Repository navigation
Conversation
The agent container could fail to read deployment files when an application's own containers restrict permissions on their mounted directories, since the agent dropped all Linux capabilities and had no way to bypass directory access checks owned by another user. Add the DAC_READ_SEARCH capability back to the agent container so it can inspect deployment paths regardless of directory permissions set by application containers, and update e2e coverage and the generated compose snippet to match.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| - ALL | ||
| cap_add: | ||
| # Inspect deployment paths even when application containers restrict directory permissions. | ||
| - DAC_READ_SEARCH |
Member
There was a problem hiding this comment.
I don't really like the idea that the agent can bypass all filesystem permissions. It looks dangerous (although we already have docker daemon access). The symlink volume escape thing is really annoying. It can only happen if one container creates a symlink inside a volume first, and then is re-created using the symlink as volume. I found no real solution yet, but maybe this is just something to document rather than to enable by default?
This branch has not been deployed
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.
Type of change
Description
When an application's compose file bind-mounts a directory that is owned by a non-root user with restrictive permissions (e.g.
0700), the agent container could no longer traverse into it to inspect mounts during deployment, causing redeploys to fail.The agent containers (both the production
docker-compose.ymland the one generated by the frontend's agent setup dialog) drop all Linux capabilities for security. This fix re-adds theDAC_READ_SEARCHcapability, which allows the agent to read and search restricted deployment directories without granting any write or execute privileges, while still preserving existing symlink checks. The e2e agent compose file and setup dialog test were updated accordingly, and a regression test was added that redeploys an application through a bind mount restricted to0700owned by a non-root UID.Additional context
Fixes #444.
Existing installations need to update their agent Compose configuration and recreate the agent container to pick up the new capability.
Validated locally with backend Docker tests (race detection), the full e2e suite (225 tests), frontend build, typecheck, lint, and formatting.