You are not logged in.
Hi everyone,
I'm working on isolating an AI agent inside a Docker container while allowing it to access only approved external domains.
I'm considering two approaches:
- An internal Docker bridge with dedicated firewall rules and an HTTP proxy.
- Using `--network=none` with a bind-mounted Unix socket, Socat and Squid to provide controlled proxy access through the container's loopback interface.
My objective is to achieve strong network isolation while keeping modifications to the host system and its existing firewall configuration to a minimum.
Has anyone implemented the second approach? Are there any disadvantages from a security, reliability or maintenance perspective?
Is there a simpler or more secure approach you would recommend?
Thanks in advance.
Last edited by Santo C01 (2026-11-29 07:17:14)
Offline
I haven't run the socket version myself, but --network=none plus a bind-mounted socket is a decent idea since there is no network stack to leak from. Main downside is more moving parts to maintain, and the proxy then becomes the one thing you have to trust, so allowlist the domains there and log denied requests.
Offline
I agree with AzharAbbasPK that the socket approach is sound in principle, since --network=none removes the usual leak paths. The main risk I would watch is the proxy itself. If Squid or socat is misconfigured, the allowlist is the only thing standing between the agent and the open internet, so I would test it with a few blocked domains before trusting it. Also make sure the socket permissions are tight, so only that container user can reach it. The internal bridge is simpler to reason about, but it does touch the host firewall more, so the socket route fits your goal of minimal host changes.
Offline