Restrict outbound network to api.anthropic.com only
- New egress-proxy/ container (tinyproxy) that only allows CONNECT to api.anthropic.com, refuses everything else. - docker-compose.yml: sde-meeting-toolkit is no longer on 'default' at all. Its only networks are 'proxy' (NPM, inbound) and a new private 'egress' network shared only with egress-proxy. egress-proxy is the only container with a real internet route. - server.js: route the one outbound Anthropic call through EGRESS_PROXY_URL when set, using undici's own fetch + ProxyAgent together (mixing them with Node's global fetch throws a version mismatch error - caught this locally before it hit a real deploy). - Add undici as a real dependency (package.json, package-lock.json), npm ci step in Dockerfile. - Add smoke-test-egress.sh + Step 9b in DOCKER_TESTING.md to verify this whole chain with real Docker. - Update CHANGELOG.
This commit is contained in:
@@ -2,6 +2,14 @@
|
||||
|
||||
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 (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.
|
||||
- Added: one real npm dependency, `undici` (`package.json`, `package-lock.json`), and an `npm ci` step in `Dockerfile`. Used only to route the Anthropic call through `egress-proxy` via `EGRESS_PROXY_URL`. Local, non-Docker runs are unaffected; the app calls Anthropic directly when this isn't set, same as before.
|
||||
- Fixed (caught before deploy): Node's global `fetch()` and an externally-installed `undici`'s `ProxyAgent` don't mix — throws `invalid onRequestStart method`, since Node's internal `undici` and the npm package aren't guaranteed to match versions. `server.js` now uses `undici`'s own `fetch` together with its own `ProxyAgent` for the proxied call, avoiding the mismatch. Confirmed via a local CONNECT-tunnel test.
|
||||
- Added: `smoke-test-egress.sh`, a script that builds the full stack and checks the app container can't reach anything but Anthropic's API, `egress-proxy` correctly refuses an unrelated domain, and the AI draft button still works end to end. Documented as Step 9b in `DOCKER_TESTING.md`.
|
||||
- Network layout note: `sde-meeting-toolkit` is on `proxy` (NPM, inbound) and a new private `egress` network (to `egress-proxy` only). `egress-proxy` is on `egress` and `default` (its own internet route). Neither container is on both `proxy` and `default`.
|
||||
|
||||
## 2026-09-29 (2)
|
||||
|
||||
- Added: shared login turned on now that the toolkit is reachable at `MVP.controls.dev`. Username `PrimeMVP`, password generated and set in `.env`/Portainer (not committed; `.env` is gitignored). This is a stopgap ahead of real per-user `APP_USERS` accounts.
|
||||
|
||||
Reference in New Issue
Block a user