feat(analyzer): detect privileged container execution and escape primitives as PE5#214
Open
CharmingGroot wants to merge 1 commit into
Open
feat(analyzer): detect privileged container execution and escape primitives as PE5#214CharmingGroot wants to merge 1 commit into
CharmingGroot wants to merge 1 commit into
Conversation
…itives as PE5 PE4 detects Docker socket access; PE5 is its CLI counterpart for privileged container execution and escape primitives (docker run --privileged / -v /:/ / --cap-add=SYS_ADMIN, host namespaces --pid/net=host, --device, --security-opt unconfined, nsenter, cgroup release_agent, /proc/<pid>/ns/, unshare --map-root-user) that reach the same host takeover. Mirrors PE4's best-confidence-per-line pass with the documentation-example filter. Signed-off-by: CharmingGroot <ohyes9711@gmail.com>
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.
Summary
PE4 (#189) detects Docker socket access. This adds PE5, its CLI counterpart: privileged container execution and container-escape primitives that reach the same host takeover through
docker runflags and kernel interfaces. Verified undetected on v2.3.5 in #213.Changes
static_patterns_privilege_escalation.pygainsPE5_PATTERNS(--privileged, host root mount-v /:,--cap-add=SYS_ADMIN, host namespaces--pid/net=host,--device,--security-opt …=unconfined,nsenter, cgrouprelease_agent,/proc/<pid>/ns/,unshare --map-root-user) and a best-confidence-per-line PE5 pass that mirrors PE4, with the documentation-example filter applied. PE5 findings are HIGH.Testing
12 new tests cover each primitive (privileged, host root mount, cap-add, host namespaces, nsenter, release_agent, unshare), multi-flag dedup (one finding per line), a benign
docker runnegative, and a markdown documentation-example exclusion.make formatandmake lintpass;uv run pytest -m "not integration and not provider"reports 999 passed, 0 failed.Closes #213