Repository navigation
Chown bind-mount volumes when running as non-root user - #9593
Merged
Merged
Conversation
was only referenced in the test suites and didn't expand on the interface. Added an interface check since maybe that was the original intention of adding that wrapper. Signed-off-by: Taylor Silva <[email protected]>
Signed-off-by: Taylor Silva <[email protected]>
The rootfs of the container is left as-is in all cases, but is still namespaced. When UID/GID are `-1` in the VolumeRequest, the volumes existing owner/group are left as-is and namespaced to the containers user namespace. When UID/GID are >= 0, the volume is namespaced and chown'd to the desired UID/GID. Signed-off-by: Taylor Silva <[email protected]>
Signed-off-by: Taylor Silva <[email protected]>
Signed-off-by: Taylor Silva <[email protected]>
Signed-off-by: Taylor Silva <[email protected]>
we get different timeout errors depending on which dependency is inspecting the context Signed-off-by: Taylor Silva <[email protected]>
Signed-off-by: Taylor Silva <[email protected]>
Member
Author
|
I added an integration test under the |
Signed-off-by: Taylor Silva <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes proposed by this PR
closes #403
When a container runs as a non-root user, any input/output/cache volumes will be
chown'd to the non-root user. This means every file and directory inside the volume will be owned by the non-root user, as well as the mount point the volume is mounted at inside the container. This will allow tasks running with non-root users to easily interact with volumes made from other steps that would previously remain owned byroot. See the issue for workarounds users made. These workarounds should no longer be necessary after this change.I'm labelling this as a breaking change since this is something Concourse will do automatically that may break existing workflows IF you're running tasks as a nonroot user. We can add an opt-out toggle in the future if deemed necessary. Based on #403 though, it seems like most users would appreciate the change proposed in this PR.
For anyone that runs stuff as
rootall the time, things should continue to work as-is.This does introduce a potential footgun for any tasks that output a volume.
If the step(s) that follow this task run as
root, they'll receivesome-outputunchanged. It won't be owned by root, it'll still be owned asnonroot. If the user doesn't exist in their container then they'll see the raw UID/GID of thenonrootuser.I made this pipeline to test some basic scenarios. All jobs pass when using this PR:
Click to expand and view pipeline
Details