Dockerfile: put some XDG dirs under /tmp #16304
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Opening this up for consideration/feedback, not sure if this is the best approach yet 🙂
Background context:
sigstore-python
currently usesplatformdirs
to place it somewhere sensible under the user's local data/cache dirsuid=nobody
with$HOME=/nonexistent
, meaning that the XDG dirs don't exist.gracefully addresseshacks around the above by creating two new directories under/tmp
and using them as Warehouse's XDG dirs.From a functionality/correctness perspective, this should have no impact on Warehouse: nothing else appears to use the XDG dirs and, if anything in the future does, it should be redirected to these new ones.
From a security perspective: this puts the XDG dirs in a "global" temporary directory within the container. However (AFAICT), Warehouse intentionally runs as
nobody
with a rootless configuration to mitigate this kind of minor risk.CC @di