Skip to content

fix(rules): read securityOpt entries and capabilities the way Docker does - #91

Merged
nozaq merged 1 commit into
mainfrom
claude/fix-securityopt-capabilities-flj0nr
Aug 1, 2026
Merged

fix(rules): read securityOpt entries and capabilities the way Docker does#91
nozaq merged 1 commit into
mainfrom
claude/fix-securityopt-capabilities-flj0nr

Conversation

@nozaq

@nozaq nozaq commented Aug 1, 2026

Copy link
Copy Markdown
Member

Move the reading of a "securityOpt" entry and of a capability name into
dockerargs, so the rules share one answer to how Docker splits and matches
them.

securityOpt entries were split on "=" only, and only against a fixed set of
literal spellings, which both missed and misreported configurations:

  • "seccomp:unconfined" went unreported. Docker falls back to ":" as the
    separator in an entry holding no "=".
  • "no-new-privileges=1" was read as unset. The value is a boolean, which
    Docker reads with strconv.ParseBool.
  • "seccomp=builtin" was reported as overriding the default profile. Docker
    passes the name straight through and the daemon loads the same profile it
    would with no seccomp option at all, so it is the default, not an
    override. The match is exact, so "seccomp=BUILTIN" still names a file.

Capability names now go through one normalization — upper-cased, "CAP_"
prefixed, with "ALL" standing on its own — which also reaches the "capAdd"
property, where "all" previously went unreported.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01JMeKPpNA7DkazGxjXRrk3q

…does

Move the reading of a "securityOpt" entry and of a capability name into
dockerargs, so the rules share one answer to how Docker splits and matches
them.

securityOpt entries were split on "=" only, and only against a fixed set of
literal spellings, which both missed and misreported configurations:

  - "seccomp:unconfined" went unreported. Docker falls back to ":" as the
    separator in an entry holding no "=".
  - "no-new-privileges=1" was read as unset. The value is a boolean, which
    Docker reads with strconv.ParseBool.
  - "seccomp=builtin" was reported as overriding the default profile. Docker
    passes the name straight through and the daemon loads the same profile it
    would with no seccomp option at all, so it is the default, not an
    override. The match is exact, so "seccomp=BUILTIN" still names a file.

Capability names now go through one normalization — upper-cased, "CAP_"
prefixed, with "ALL" standing on its own — which also reaches the "capAdd"
property, where "all" previously went unreported.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JMeKPpNA7DkazGxjXRrk3q
@nozaq
nozaq merged commit 7168819 into main Aug 1, 2026
12 checks passed
@nozaq
nozaq deleted the claude/fix-securityopt-capabilities-flj0nr branch August 1, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants