You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,6 +171,17 @@ sudo awf \
171
171
- DNS-based data exfiltration to unauthorized DNS servers
172
172
- MCP servers accessing unexpected endpoints
173
173
174
+
### Agent Container Security (User Mode)
175
+
176
+
The agent container runs user commands as a **non-root user** (`awfuser`) for enhanced security:
177
+
178
+
-**Privilege Separation**: Privileged operations (iptables setup, DNS configuration) run as root in the entrypoint, then privileges are dropped before executing user commands
179
+
-**UID/GID Matching**: The `awfuser` UID/GID is automatically adjusted to match the host user's UID/GID, ensuring correct file ownership for mounted volumes
180
+
-**Reduced Attack Surface**: If a user command is compromised, it cannot modify system files or escape the container's security boundaries
181
+
-**Docker Access**: The `awfuser` is added to the docker group, allowing MCP servers to spawn containers while still running as non-root
182
+
183
+
**Note:** The `awf` CLI itself requires `sudo` for host-level iptables configuration (DOCKER-USER chain), but the agent processes (GitHub Copilot CLI, etc.) run without root privileges inside the container.
184
+
174
185
### DNS Server Restriction
175
186
176
187
DNS traffic is restricted to trusted servers only (default: Google DNS 8.8.8.8, 8.8.4.4). This prevents DNS-based data exfiltration attacks where an attacker encodes data in DNS queries to a malicious DNS server.
The `awfuser` UID/GID is adjusted at runtime to match the host user, ensuring correct file ownership for mounted volumes.
20
+
21
+
## Security Benefits
22
+
23
+
-**Reduced attack surface**: User commands cannot modify system files or escalate privileges
24
+
-**Correct file ownership**: Files created in mounted volumes match host user ownership
25
+
-**Works seamlessly**: Compatible with both GHCR images and local builds
26
+
27
+
## Why awf Still Needs sudo
28
+
29
+
The `awf` CLI requires sudo for host-level iptables (DOCKER-USER chain), which is separate from agent container user mode. Agent processes run as non-root, while host firewall setup requires root.
0 commit comments