You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tooling.apache.org by "sbp (via GitHub)" <gi...@apache.org> on 2026/02/06 19:11:23 UTC
[I] Add a quarantined validation period after uploading and before checks are started (tooling-trusted-releases)
sbp opened a new issue, #628:
URL: https://github.com/apache/tooling-trusted-releases/issues/628
During this period, files should not be available to users other than the uploader, but functions such as downloading etc. should still work for the uploader. If the validations fail, the files are not made widely available in the system and the uploader is notified. If the validations succeed, the check tasks are started and everything proceeds as it does now.
In the validation period, all archives should be expanded. These should then be cached for the check tasks and perhaps other future tasks. We should probably keep the cache until the vote starts, and maybe beyond, or until the next version of the archive is uploaded (or the archive is deleted).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org
Re: [I] Add a quarantined validation period after uploading and before checks are started (tooling-trusted-releases)
Posted by "sbp (via GitHub)" <gi...@apache.org>.
sbp commented on issue #628:
URL: https://github.com/apache/tooling-trusted-releases/issues/628#issuecomment-3867226138
Some revisions won't introduce archives, and only `create_and_manage` can detect this. Therefore it will have to decide for itself whether to move files to `quarantined` or to `unfinished`. I thought about considering the staging directory as the `quarantined` directory, so that we wouldn't need any new directories, but then the status of the files wouldn't be clear from the filesystem alone.
We should not create a `Revision` object until the files are moved from `quarantined` to `unfinished`. Since this can only be done by a task that `create_and_manage` creates, that means that when the `create_and_manage` destination is `quarantined`, it cannot create a `Revision`. It should always set permissions, no matter what, but then it should hand over to the quarantined files validation task, which would only create the `Revision` object when the validation passes, in an atomic database transaction block that also includes moving the files from `quarantined` into `unfinished`.
Always creating a new `Revision` as late as possible has the advantage that we don't use a revision number before we're sure that the files will be kept. But it does incur the difficulty that the user would have no indication that the staging and quarantined file validation periods are ongoing. We could add a new database object for this, or we could name the paths more carefully to allow discovery from the filesystem. We could, for example, name the staging directory:
```
temporary/revising/PROJECT/VERSION/ASF_UID/PRIOR_REVISION_NUMBER/UNIXTIME/
```
And the quarantined directory similarly:
```
temporary/quarantined/PROJECT/VERSION/ASF_UID/PRIOR_REVISION_NUMBER/UNIXTIME/
```
These paths are quite verbose, but if `temporary/{revising,quarantined}/PROJECT/VERSION/ASF_UID` exists, then we know that either revising or quarantine checks are taking place. We only have to check those two deterministic locations.
(If we put the `PRIOR_REVISION_NUMBER` before the `ASF_UID` then we would have to check every existing revision number. We need `PRIOR_REVISION_NUMBER` and `UNIXTIME` to ensure that the upload is unique. We can either disallow more than one upload per second, use a random token instead of the unixtime, or use both. The `PRIOR_REVISION_NUMBER` would have to be a sentinel on first upload, e.g. `_____`. An alternative to this entire naming scheme is that the task object in the database for the quarantined file validation could be used as the signal that those checks are taking place, but since no such object exists for the revising period, that would be inconsistent.)
We can set `creating.quarantined = True` so that callers will know whether or not quarantining is happening and act accordingly, without having to perform any storage check. This could be used to set a flash message to inform the user that their files are not available yet, even to them, because they're being checked in quarantine. We would still need to perform a check for the path within the rest of the page, however, because otherwise the quarantine status wouldn't be evident in the user interface. We should probably give similar messages when any `revising` directories are found. Note that `creating.new` will also be `None` in the `creating.quarantined = True` case, so perhaps we can rely solely on that. Some callers of `create_and_manage` rely on the new revision being available, e.g. the SSH function uses it to show the path to the new revision. All such code will have to be adapted.
We would also still need to do some of the fast validation in `create_and_manage`. We could still detect symlinks there, for example, because that can be done when iterating through all of the path information which needs to be done anyway, e.g. to detect new uploaded archives.
Quarantine validation should only be for characteristics that we judge to be _dangerous_, not merely _wrong_. Empty files, for example, are wrong but very unlikely to be dangerous. A `.txt` file, on the other hand, which is an executable binary on a widely used OS is suspicious enough that the entire upload should be rejected. There is, however, an ambiguous area in between these extremes. A ZIP file which has legitimate package paths which, however, all use a leading `/` is far more likely to be a mistake than an attack. Even so, since we cannot differentiate, we should consider such cases to be dangerous. Indeed, even if the result was a mistake during the build process, the result is still actually dangerous.
When validation fails, we should permanently record the reason, and the metadata of the files that were uploaded, but we should delete the entire corresponding quarantined directory. Part of the validation process is to extract archives, which should be done in `cache`. We would keep the results of those extractions, upon successful validation, available for subsequent tasks and interface actions, but upon failure these results should also be deleted.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org
Re: [I] Add a quarantined validation period after uploading and before checks are started (tooling-trusted-releases)
Posted by "sbp (via GitHub)" <gi...@apache.org>.
sbp closed issue #628: Add a quarantined validation period after uploading and before checks are started
URL: https://github.com/apache/tooling-trusted-releases/issues/628
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org
Re: [I] Add a quarantined validation period after uploading and before checks are started (tooling-trusted-releases)
Posted by "sbp (via GitHub)" <gi...@apache.org>.
sbp commented on issue #628:
URL: https://github.com/apache/tooling-trusted-releases/issues/628#issuecomment-3877848047
**Blocking** #341.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org
Re: [I] Add a quarantined validation period after uploading and before checks are started (tooling-trusted-releases)
Posted by "sbp (via GitHub)" <gi...@apache.org>.
sbp commented on issue #628:
URL: https://github.com/apache/tooling-trusted-releases/issues/628#issuecomment-3953162186
This will close #757.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org
Re: [I] Add a quarantined validation period after uploading and before checks are started (tooling-trusted-releases)
Posted by "sbp (via GitHub)" <gi...@apache.org>.
sbp commented on issue #628:
URL: https://github.com/apache/tooling-trusted-releases/issues/628#issuecomment-3998660136
Resolved by efc597e4720aaf7bd807227634cd0fdffe357334, 731b389ae90d6d58a65afd37aec682335e10ad60, bc3f4f195d18961a7c8d1a937b7d4fe675dfe629, b96895d69940414e6b9a9eca570b0c7b3783ede8, 9003b05087b8278654e5023f9fbedee092c6bc9f, c0900cf5fdaa64204a9e2d631b77c8fbcc616baf, 3799e8e6006db477516d5bf62a7bcc9a20498492, 7340df576da4415fd1468c953e912f0e7fd14efd, 3b9ec6c5161950650b9eb784aa12b9fe6495d525, 88b3d6c47d9d2814d07b93b941e25c70c6c73e13, and a77ac42090e07c28c2caf568e88117db86b09469.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org
Re: [I] Add a quarantined validation period after uploading and before checks are started (tooling-trusted-releases)
Posted by "sbp (via GitHub)" <gi...@apache.org>.
sbp commented on issue #628:
URL: https://github.com/apache/tooling-trusted-releases/issues/628#issuecomment-3953011165
The resolution to this should include a fix to #645.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org
Re: [I] Add a quarantined validation period after uploading and before checks are started (tooling-trusted-releases)
Posted by "sbp (via GitHub)" <gi...@apache.org>.
sbp commented on issue #628:
URL: https://github.com/apache/tooling-trusted-releases/issues/628#issuecomment-3953006314
This will close #628.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org
Re: [I] Add a quarantined validation period after uploading and before checks are started (tooling-trusted-releases)
Posted by "dave2wave (via GitHub)" <gi...@apache.org>.
dave2wave commented on issue #628:
URL: https://github.com/apache/tooling-trusted-releases/issues/628#issuecomment-3862344463
#553 Is related.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org