From 6eb4b59d9771e7988d87acc3c2ec21d0a3ac2622 Mon Sep 17 00:00:00 2001 From: Matt Mabrey Date: Tue, 29 Sep 2026 18:52:28 -0700 Subject: [PATCH] Fix EAI_AGAIN: work around Docker's internal-network DNS bug with a static IP - egress-proxy gets a fixed IP (172.28.5.10) on a new 172.28.5.0/24 subnet for the 'egress' network. - sde-meeting-toolkit gets a static extra_hosts entry for 'egress-proxy' instead of relying on Docker's embedded DNS, which breaks for internal-network names on a container that's also on a normal network (confirmed via a real smoke test run - EAI_AGAIN). - Update CHANGELOG with the root cause and the subnet-collision caveat. --- CHANGELOG.md | 5 +++++ docker-compose.yml | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96f9826..e9386c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project are logged here, newest first. This file starts from the point the toolkit was handed off and set up in this repo. +## 2026-09-29 (4) + +- Fixed (found via real smoke test on the user's own Docker): `sde-meeting-toolkit` couldn't resolve `egress-proxy` at all (`getaddrinfo EAI_AGAIN egress-proxy`) once `egress` was marked `internal: true`. Root cause is a known Docker bug: a container on both a normal network (`proxy`) and an `internal: true` network (`egress`) can lose embedded DNS resolution for names on the internal side. Fixed by giving `egress-proxy` a fixed IP (`172.28.5.10` on a new `172.28.5.0/24` subnet) and adding a static `extra_hosts` entry on `sde-meeting-toolkit` instead of relying on DNS for that one name. +- Note: `172.28.5.0/24` is an arbitrary private subnet choice. If it collides with another Docker network already on a host, change it (and the matching `ipv4_address`/`extra_hosts` entries) to an unused one - Docker's error message names the conflict if this happens. + ## 2026-09-29 (3) - Added: outbound network restriction. `sde-meeting-toolkit` no longer has any direct route to the internet. Its one outbound call (the AI draft button, to `api.anthropic.com`) is routed through a new `egress-proxy` container (`egress-proxy/`, tinyproxy) that only allows that one destination and refuses everything else, even from inside a compromised app container. diff --git a/docker-compose.yml b/docker-compose.yml index ce7a7b4..1883961 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,6 +45,14 @@ services: networks: - proxy - egress + # A container attached to both a normal network ("proxy") and an + # internal: true network ("egress") can hit a real Docker bug where + # embedded DNS stops resolving names on the internal side (EAI_AGAIN), + # confirmed while testing this. Sidestep it with a static hosts entry + # instead of relying on DNS for this one name - egress-proxy's fixed + # IP is set below via ipv4_address. + extra_hosts: + - "egress-proxy:172.28.5.10" depends_on: - egress-proxy # Hardening for a container that's reachable from the public internet @@ -61,8 +69,12 @@ services: container_name: sde-meeting-toolkit-egress-proxy restart: unless-stopped networks: - - egress - - default + egress: + # Fixed IP so sde-meeting-toolkit can reach this by static hosts + # entry (extra_hosts above) instead of DNS, working around the + # internal-network DNS bug. Must match that entry if ever changed. + ipv4_address: 172.28.5.10 + default: {} cap_drop: - ALL security_opt: @@ -80,3 +92,6 @@ networks: # out except through egress-proxy, which also sits on "default" and IS # meant to have one. internal: true + ipam: + config: + - subnet: 172.28.5.0/24