[Security Review] Daily Security Review and Threat Modeling — 2026-03-27 #1474
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-04-03T13:58:07.454Z.
|
Beta Was this translation helpful? Give feedback.
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
This review analyzed ~28,000 lines of security-critical TypeScript, bash, and C code across the AWF firewall stack. The overall security posture is strong: the architecture implements defense-in-depth with multiple independent control layers (host iptables → container iptables → Squid proxy → capability dropping → seccomp → one-shot token protection). Four actionable findings were identified: one medium severity (IPv6 filter chain gap), two low severity (ICMP tunneling not explicitly blocked; dangerous-ports list divergence), and one informational (wildcard domain over-permissiveness).
No findings from a "Firewall Escape Test Agent" workflow were available — no workflow by that name exists in this repository.
🔍 Findings from Firewall Escape Test
The
firewall-escape-testworkflow does not exist in this repository. The closest available workflows aresecurity-reviewandsecret-digger-*. No prior escape-test results were available to cross-reference.🛡️ Architecture Security Analysis
Network Security Assessment
The network security architecture implements three enforced layers:
Layer 1 — Host iptables (
src/host-iptables.ts)The host creates a dedicated
AWF-WRAPPERchain in DOCKER-USER that:ESTABLISHED,RELATEDreturn traffic224.0.0.0/4) and link-local (169.254.0.0/16) — critical for cloud metadata endpoint protectionREJECT --reject-with icmp-port-unreachableEvidence (
src/host-iptables.ts:490-530):Layer 2 — Container iptables (
containers/agent/setup-iptables.sh)Inside the agent container's network namespace:
iptables -A OUTPUT -p tcp -j DROPandiptables -A OUTPUT -p udp -j DROPLayer 3 — Squid proxy (
src/squid-config.ts)dstdomain(exact + subdomains) anddstdom_regex(wildcards)(redacted) vshttps://` vs both)DNS Exfiltration Prevention:
Container Security Assessment
Capability management (
containers/agent/entrypoint.sh:333-345,src/docker-manager.ts:1141-1164):SYS_CHROOT+SYS_ADMINat container start (needed for chroot and procfs mount)capsh --drop=cap_sys_chroot,cap_sys_adminbefore user code runsNET_ADMINis never granted to the agent — dedicated iptables-init init container handles network setupNET_RAW,MKNOD,AUDIT_WRITE,SETFCAPiptables-init init container (
src/docker-manager.ts:1262-1297):Docker commands inside the container return
exit 127.Domain Validation Assessment
Domain pattern handling (
src/domain-patterns.ts) correctly:*,*.*,.*,*.as overly broadwildcardSegments > 1 AND wildcardSegments >= totalSegments - 1*[a-zA-Z0-9.-]*instead of.*to prevent ReDoS^and$Input Validation Assessment
Port validation (
src/squid-config.ts:468-496,setup-iptables.sh:166-178):--allow-host-portssetup-iptables.sh: zeroip6tables -A OUTPUTfilter rules; IPv4 has explicit DROPsetup-iptables.sh: only-p tcpand-p udpDROP rules; ICMP unaddressedsquid-config.ts:14-33(21 ports) vssetup-iptables.sh:294-310(15 ports)*.com-style TLD wildcards pass validation, granting access to all .com domainsdomain-patterns.ts:177-183:wildcardSegments > 1fails for*.com;wildcardToRegex('*.com')→^[a-zA-Z0-9.-]*\.com$which matches any.comhostopen_by_handle_at+name_to_handle_atallowed in seccomp (Shocker attack primitives)seccomp-profile.json:lines 152,164src/squid-config.ts:40(logformat)ACTIONS_RUNTIME_TOKENandACTIONS_ID_TOKENnot in EXCLUDED_ENV_VARS or AWF_ONE_SHOT_TOKENSsrc/docker-manager.ts:467-487;containers/agent/entrypoint.sh:351-376--env-all)brace-expansionReDoS (CVSS 6.5) in dev dependency chainnpm auditoutput🎯 Attack Surface Map
--allow-domainsCLI argsrc/cli.ts,src/domain-patterns.tsvalidateDomainOrPattern()blocks*,*.*, multi-wildcard*.comallowed--env-allCLI flagsrc/docker-manager.ts:597-601--env-fileCLI flagsrc/docker-manager.ts:641-649--allow-host-portssrc/squid-config.ts:468-500,setup-iptables.sh:327-354setup-iptables.shsetup-iptables.sh:400-407/tmpmount (rw)src/docker-manager.tscontainers/agent/docker-stub.shsrc/squid-config.tssetup-iptables.sh:129-151📋 Evidence Collection
Finding T1: IPv6 Filter Chain Gap
Command:
grep "ip6tables -A OUTPUT" containers/agent/setup-iptables.shOutput: (no results) — zero filter chain rules for IPv6
IPv4 comparison:
IPv6 has only NAT rules (loopback RETURN, ::1 RETURN, DNS RETURN). When
ip6tablesis available, no filter DROP rule exists for IPv6 TCP/UDP. The default ip6tables OUTPUT policy in a Docker container is ACCEPT, so unfiltered IPv6 egress is possible if the Docker network has IPv6 enabled.Mitigating factors: Docker does not enable IPv6 by default. If ip6tables is unavailable, IPv6 is disabled via sysctl (
net.ipv6.conf.all.disable_ipv6=1) — but this is the fallback path, not the nominal path.Finding T3: Dangerous-Ports List Divergence
squid-config.ts(21 ports): 22, 23, 25, 110, 143, 445, 1433, 1521, 3306, 3389, 5432, 5984, 6379, 6984, 8086, 8088, 9200, 9300, 27017, 27018, 28017setup-iptables.sh(15 ports): 22, 23, 25, 110, 143, 445, 1433, 1521, 3306, 3389, 5432, 6379, 27017, 27018, 28017Missing from iptables: CouchDB (5984, 6984), InfluxDB (8086, 8088), Elasticsearch (9200, 9300)
These 6 ports are blocked by Squid ACL but NOT by container iptables NAT/filter rules. If Squid's domain ACL is misconfigured, these ports remain accessible at the iptables level.
Finding T4: TLD Wildcard Permissiveness
Validation logic (
domain-patterns.ts:177-183):Both are transitive dev dependencies, not part of the production runtime.
✅ Recommendations
🔴 Medium — Plan to Address
1. Add IPv6 filter DROP rules in
setup-iptables.shWhen ip6tables is available, add default-deny filter rules to match the IPv4 behavior:
File:
containers/agent/setup-iptables.shafter line 407🟡 Low — Nice to Have
2. Synchronize dangerous-ports lists
Add CouchDB (5984, 6984), InfluxDB (8086, 8088), and Elasticsearch (9200, 9300) to
DANGEROUS_PORTSinsetup-iptables.shto matchsquid-config.ts.File:
containers/agent/setup-iptables.sh:294-3103. Warn on TLD-style wildcard domains
Add a validation warning (or error) for patterns like
*.com,*.io,*.orgthat match entire TLDs. ThewildcardSegments > 1check needs to also catch single-wildcard TLD patterns:File:
src/domain-patterns.ts:1774. Add ACTIONS_RUNTIME_TOKEN to one-shot-token protection list
When running in GitHub Actions with
--env-all, add Actions-specific tokens toAWF_ONE_SHOT_TOKENSandSENSITIVE_TOKENSin the entrypoint:5. Fix npm audit vulnerabilities
Both
brace-expansionandhandlebarshave available fixes.ℹ️ Informational
6. Consider blocking ICMP at container level
The container-level iptables only blocks TCP and UDP. Adding ICMP blocking adds defense-in-depth against ICMP tunneling (low practical risk given Docker network isolation):
7. Document TLD wildcard behavior
If
*.comis intentionally allowed, document this behavior prominently so operators understand the scope.📈 Security Metrics
Beta Was this translation helpful? Give feedback.
All reactions