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
feat: add --enable-host-access flag and fix CONNECT to port 80
This PR addresses issue #189 by:
1. Making host.docker.internal opt-in via --enable-host-access flag
- By default, containers cannot resolve host.docker.internal
- When enabled, adds extra_hosts to both Squid and agent containers
- Shows security warning when combined with host.docker.internal domain
2. Allowing CONNECT method to Safe_ports (80 and 443)
- Changes `http_access deny CONNECT !SSL_ports` to `!Safe_ports`
- Required because Node.js fetch uses CONNECT for HTTP through proxy
- Domain ACLs remain the primary security control
Security considerations:
- Host access is opt-in to prevent accidental exposure of host services
- Warning displayed when host.docker.internal is in allowed domains
- Safe_ports change has minimal security impact as domain filtering is primary control
Closes#189
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
--env-all Pass all host environment variables to container
22
+
-v, --mount <path:path> Volume mount (host_path:container_path[:ro|rw])
23
+
--tty Allocate a pseudo-TTY for interactive tools
14
24
-V, --version Output the version number
15
25
-h, --help Display help for command
16
26
@@ -254,6 +264,48 @@ sudo awf \
254
264
- Block known bad domains while allowing a curated list
255
265
- Prevent access to internal services from AI agents
256
266
267
+
## Host Access (MCP Gateways)
268
+
269
+
When running MCP gateways or other services on your host machine that need to be accessible from inside the firewall, use the `--enable-host-access` flag.
270
+
271
+
### Enabling Host Access
272
+
273
+
```bash
274
+
# Enable access to services running on the host via host.docker.internal
275
+
sudo awf \
276
+
--enable-host-access \
277
+
--allow-domains host.docker.internal \
278
+
-- curl http://host.docker.internal:8080
279
+
```
280
+
281
+
### Security Considerations
282
+
283
+
> ⚠️ **Security Warning**: When `--enable-host-access` is combined with `host.docker.internal` in `--allow-domains`, containers can access **ANY service** running on the host machine, including:
284
+
> - Local databases (PostgreSQL, MySQL, Redis)
285
+
> - Development servers
286
+
> - Other sensitive services
287
+
>
288
+
> Only enable this for trusted workloads like MCP gateways.
289
+
290
+
**Why opt-in?** By default, `host.docker.internal` hostname resolution is disabled to prevent containers from accessing host services. This is a defense-in-depth measure against malicious code attempting to access local resources.
The firewall allows the HTTP CONNECT method on both ports 80 and 443. This is required because some HTTP clients (e.g., Node.js fetch) use the CONNECT method even for HTTP connections when going through a proxy. Domain ACLs remain the primary security control.
0 commit comments