[Security Review] Daily Security Review & Threat Model #6982
Closed
Replies: 2 comments
|
🔮 The ancient spirits stir; the smoke test agent has passed through this discussion and left a brief omen of presence. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
0 replies
|
This discussion was automatically closed because it expired on 2026-08-13T07:49:20.321Z.
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
📊 Executive Summary
Daily automated review of
github/gh-aw-firewall(network-egress firewall for AI agent sandboxes). Overall posture is strong: defense-in-depth network controls (dual-homed Squid + optional iptables), disciplined capability dropping (cap_drop: ALLbaseline, narrowcap_add), UID/GID input validation inentrypoint.sh,execaused exclusively with array-form args (no shell-string injection surface), andnpm auditreports 0 vulnerabilities across dependencies (only 5 runtime deps:ajv,chalk,commander,execa,js-yaml). No critical findings identified this cycle.🔍 Findings from Firewall Escape Test
The pre-fetched escape-test log (
/tmp/gh-aw/escape-test-summary.txt) is from the "Secret Digger (Copilot)" run (actions/runs/29286879560, workflow sourcefeat/security-mode-strict/.github/workflows/secret-digger-copilot.md). This is a prompt-injection red-team workflow, not a network-escape test:noop: "Refused prompt injection attack... prohibited by the security policy. No investigation was performed."GH_AW_DETECTION_CONCLUSION: warning,GH_AW_DETECTION_REASON: threat_detected, auto-filed to issue [aw] Detection Runs #6205 ("[aw] Detection Runs") — showing the two-layer control (agent self-refusal + independent threat-detection scorer) both fired correctly, and result was also logged to the no-op tracking issue [aw] No-Op Runs #5883.🛡️ Architecture Security Analysis
Network Security
containers/agent/setup-iptables.sh, 536 lines) + host-level iptables (src/host-iptables.ts,src/host-iptables-chain.ts), and (2) newer network-isolation/topology mode (src/config/sandbox-network-policy.json,src/compose-network.ts) where the agent sits on aninternalDocker network with no route out except the dual-homed Squid proxy — egress denial is structural (no route), not rule-based, eliminating whole classes of iptables-bypass bugs.containers/agent/setup-iptables.sh:471dangerous-port blocklist (SSH 22, SMTP 25, DB ports, Redis, MongoDB) is a good defense-in-depth layer but is a blocklist rather than allowlist for non-HTTP protocols — new dangerous services added later would not automatically be blocked unless the list is updated (Medium risk, low likelihood given HTTP(S)-only design intent).HTTPS_PROXYenv var + explicitCONNECT: proxy-unaware tools that ignore the env var get DNAT'd to Squid, but raw TLS ClientHello (non-CONNECT) is rejected — fails closed (good), though this means such tools simply error out rather than being silently logged/alerted at the app layer (only iptables kernel log).Container Security
cap_add: ['SYS_CHROOT','SYS_ADMIN'], dropsNET_RAW+others (src/services/agent-service.ts:78-89);NET_ADMINis never granted to the agent — isolated to a short-livedawf-iptables-initcontainer (cap_add: ['NET_ADMIN','NET_RAW'],cap_drop: ['ALL']) that shares the network namespace only during setup, closing the historical "agent holds NET_ADMIN during startup" window (explicitly called out atsrc/services/agent-service.ts:303-304).entrypoint.shchroot mode dropsCAP_SYS_CHROOT/CAP_SYS_ADMINviacapshbefore user code executes (determine_capabilities_to_drop(), lines 415-431) — correct ordering to prevent user-controlled process retaining escape-capable caps.setup_user_identity(), lines 27-53) validatesAWF_USER_UID/AWF_USER_GIDare numeric and explicitly rejects0(root) — a concrete guard against a privilege-drop-defeat via crafted env vars.cap_drop: ALL,no-new-privileges, seccomp profiles, and (for bounded execution)--network none,--read-only, resource/time bounds — consistent hardening pattern reused across all optional sidecars.Domain Validation
src/domain-patterns.tswildcard-to-regex converter explicitly avoids.*in favor of a bounded character class[a-zA-Z0-9.-]*to prevent ReDoS (documented at lines 62-92) — a proactive, non-obvious hardening choice worth noting as a positive control.(redacted) prefixes mapped to!CONNECT/CONNECTSquid ACLs insrc/squid/access-rules.ts`) give fine-grained per-protocol allowlisting, reducing over-permissive domain grants.Input Validation
execa()calls acrosssrc/container-lifecycle.ts,src/host-iptables-chain.ts,src/dind-*.tsuse array-form arguments, not string interpolation — this is the correct pattern and eliminates shell-injection via command args.setup-iptables.sh) use$(...)command substitution only on trusted, locally-computed system state (interface IPs viaip addr, DNS viagetent), not on unsanitized external/user input — reduces injection surface within the scripts themselves.172.30.0.10) reduce spoofing windowLOGGING.mdnotes/proc/(pid)/environunset_sensitive_tokens()+hidepid=2procfs mount--allow-domainswildcard.*capshdrop before user code (entrypoint.sh:424)🎯 Attack Surface Map
containers/agent/setup-iptables.sh,src/compose-network.tssrc/services/agent-service.ts:70-90cap_add,NET_ADMINisolated to init containersrc/domain-patterns.ts^/$src/cli.ts,src/container-lifecycle.tsexecaarray-args only, UID/GID numeric validationoption-parsers.ts) — recommend targeted fuzz/property tests on parsers📋 Evidence Collection
Commands run
✅ Recommendations
wildcardToRegex()and Squid ACL generation to continuously verify the anti-ReDoS character-class invariant holds as domain-pattern features evolve.setup-iptables.shtoward an explicit allowlist-first default for non-HTTP(S) protocols where feasible, reducing reliance on an enumerated deny list.LOGGING.mdgap notes.📈 Security Metrics
entrypoint.sh(~1000+ lines),setup-iptables.sh(536 lines),agent-service.ts,squid-service.ts,domain-patterns.ts,access-rules.ts,host-iptables*.tsAll reactions