feat(run): seccomp loopback egress guard (Linux)#232
Merged
Conversation
Cross-platform run-audit channel: firma-core RunAuditEvent/RunAuditMessage, sidecar out-of-band ingest listener, and CLI wiring that binds the control socket when firma run provisions one. Also migrate two Windows-only allow(unsafe_code)/expect_used lints to expect(...) with reasons.
Add the seccomp connect-notify egress guard and wire it into the bwrap runtime: in-sandbox installer/runner (__egress-guarded-run), host-side supervisor, routing env overrides, and the bwrap entrypoint. Add loopback and raw TCP e2e coverage with a local TCP proxy and audit snapshots.
This was referenced Jul 6, 2026
Closed
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Add deterministic coverage for gaps in the seccomp loopback guard: - classify/is_loopback edges: IPv4-mapped non-loopback allowed, unspecified addresses allowed, DNS port allowed, empty allow-list blocks all loopback, external IP on unsanctioned port allowed. - parse_sockaddr boundaries: exact AF_INET/AF_INET6 length cutoffs, empty buffer, big-endian port, IPv4-mapped-loopback parses as V6 and blocks. - classify_notification: IPv6 loopback block, AF_UNIX allow, sanctioned DNS port allow. - BPF arch/nr jump routing. - SCM_RIGHTS fd transfer roundtrip and the no-fd error path. - start() binds the control socket and Drop tears it down.
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.
What
Linux
bwrapseccompuser-notifyfilter that traps the agent'sconnect(2)and blocks direct connections to any loopback address (127.0.0.0/8,::1, IPv4-mapped) except the proxy bridge and DNS stub ports, returningEACCES. Catches direct sockets that bypassHTTP_PROXY.Each block is reported to the Sidecar over the audit channel (PR #231) and recorded as a signed
DENY/network.loopback/loopback blockedevent, visible infirma monitor. Deny path is race-free; allow path usesSECCOMP_USER_NOTIF_FLAG_CONTINUE. Fails open with a warning if user-notify is unavailable — the private netns already isolates the agent, so the guard is defense-in-depth plus a direct-socket audit trail.Stack
Based on #231 (audit channel). Part of the fir-383 split replacing #216.