Check file and directory access for explicit container identities - #42
Merged
Merged
Conversation
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.
A read-write mount does not guarantee access for an application identity. Add opt-in fs_readable, fs_writable and fs_executable resources to existing path groups, with explicit numeric UID/GID and expected groups.
Use an isolated Python 3 standard-library probe inside the selected container. os.access delegates to kernel access checks; real/effective/saved/filesystem IDs must agree, actual group membership must match, and effective/permitted capabilities must be zero. Missing utilities/paths, mismatches or malformed responses fail collection instead of reporting healthy access. Cache by path AND identity.
Real setfacl tests exposed that BusyBox shell test ignores the named ACL entries in our fixture. The implementation now explicitly requires python3 in the target container; it never installs anything there. No agent-side dependency, permissions modification or file creation is added. CLI/rule validation, Prometheus gauges and documentation cover ACL masks, inheritance, same-path group semantics and limitations for SELinux/AppArmor/NFSv4/SMB.
Validation: local 288-test suite (15 real-Docker cases delegated to CI), 20 workflow/example checks and strict Sphinx build. Docker integration fixtures cover named users/groups, masks, defaults, directory traversal, files, symlinks, mismatched groups and privileged probes. No release version changes.
Final verification on 80eb1fd: 289 tests collected; all 15 Docker integration tests passed separately (2 POSIX ACL, 2 OOM/PID, 11 existing integration cases). Both Python versions, image/package builds, browser and documentation checks pass. A regression test now verifies closing both the Docker SocketIO wrapper and underlying socket; the real ACL run no longer emits the observed unclosed-socket warnings.