You are not logged in.

#1 2026-11-29 07:16:45

Santo C01
Member
Registered: 2026-03-02
Posts: 31

Docker network isolation using Unix sockets

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

#2 Yesterday 22:05:44

AzharAbbasPK
Member
Registered: 2026-11-28
Posts: 6

Re: Docker network isolation using Unix sockets

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

#3 Today 06:35:50

NorrisFByrd
Member
Registered: 2026-11-29
Posts: 5

Re: Docker network isolation using Unix sockets

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

Board footer

Powered by FluxBB