Skip to content

fix: close compose security scan bypasses for bare ports and security_opt#733

Merged
Lightheartdevs merged 2 commits intoLight-Heart-Labs:mainfrom
yasinBursali:fix/compose-security-scan-bypasses
Apr 3, 2026
Merged

fix: close compose security scan bypasses for bare ports and security_opt#733
Lightheartdevs merged 2 commits intoLight-Heart-Labs:mainfrom
yasinBursali:fix/compose-security-scan-bypasses

Conversation

@yasinBursali
Copy link
Copy Markdown
Contributor

What

  • Reject bare port numbers (e.g. 8080) that Docker binds to 0.0.0.0
  • Catch security_opt entries using = separator (e.g. seccomp=unconfined)

Why

  • Bare ports without : skipped the entire port binding check, allowing LAN exposure
  • security_opt check only matched : form — = separator bypassed the filter entirely

How

  • Add else clause rejecting ports without colon prefix
  • Normalize = to : before comparing against blocklist

Testing

  • 2 new tests: test_scan_rejects_bare_port_no_colon, test_scan_rejects_security_opt_equals_separator
  • Fixed pre-existing missing import yaml in test file
  • All 60 tests pass ✅

Platform Impact

All platforms (server-side Python)

🤖 Generated with Claude Code

yasinBursali and others added 2 commits April 3, 2026 02:42
…_opt

Reject bare port numbers that would bind to 0.0.0.0. Normalize security_opt
separators so both ':' and '=' forms are caught.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add tests verifying that bare ports without colon prefix and
security_opt entries using '=' separator are correctly rejected
by the compose security scanner.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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