feat(audit): network.loopback DENY audit channel#231
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.
This was referenced Jul 6, 2026
Closed
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
veeso
approved these changes
Jul 7, 2026
luca-iachini
added a commit
that referenced
this pull request
Jul 7, 2026
## What Linux `bwrap` seccomp `user-notify` filter that traps the agent's `connect(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, returning `EACCES`. Catches direct sockets that bypass `HTTP_PROXY`. Each block is reported to the Sidecar over the audit channel (PR #231) and recorded as a signed `DENY` / `network.loopback` / `loopback blocked` event, visible in `firma monitor`. Deny path is race-free; allow path uses `SECCOMP_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.
luca-iachini
added a commit
that referenced
this pull request
Jul 8, 2026
## What Documents the loopback egress enforcement model across backends: - `docs-site/src/content/docs/concepts/sandbox.md` — new **Loopback blocking** section (Linux seccomp guard, macOS sandbox-exec port-scope, proxy-only backends), updated network-boundary / proxy-bridge prose, and structural/invariant tables. - `crates/firma-run/src/backend/windows_wsl2.rs` — comment documenting the WSL2/Windows gap: the seccomp guard is Linux-host-only and not wired across the Windows->guest boundary; WSL2 stays proxy-only. `llms.txt` audit-channel + `network.loopback` action-class registry entries land in the branches that own them (#231 base; #232 linux; #233 macOS). ## Stack Based on #231 (audit channel, for the `network.loopback` model). Part of the fir-383 split replacing #216.
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
Adds the firma run audit channel: an out-of-band control socket (
FIRMA_RUN_AUDIT_SOCK) carrying newline-delimitedfirma_core::RunAuditMessage. The Sidecar owns the mapping from eachRunAuditEventvariant to(action_class, decision, deny_reason, resource)and signs the result.RunAuditEvent::LoopbackBlockedis the first variant, mapping to the audit-onlynetwork.loopbackaction class (not inActionClassRegistry::v0_1, never Cedar-evaluated). The channel is reusable by future out-of-band producers rather than adding new sockets.Why
Foundation for the loopback egress guard (Linux) and future out-of-band enforcement facts to reach signed audit without touching the request pipeline.
Stack
Base of the fir-383 split. Replaces #216.