DEV Community

Haytham
Haytham

Posted on Originally published at opencomplai.com

Why a compliance tool needs its own egress allowlist

I didn't expect the hardest security decision in a compliance engine to be about outbound network calls. It was.

Opencomplai's services occasionally need controlled external connectivity. Fetching a model card. Hitting a registry. Whatever a given integration requires.

The obvious options are two. Let every service make arbitrary outbound requests, which is bad for anything touching legal evidence. Or block everything and special-case exceptions inline in each service, which is a maintenance problem that grows with every integration.

I picked a third. egress-proxy is a dedicated service whose entire job is enforcing an allowlist for outbound connections from the rest of the stack. Nothing else talks to the outside world directly.

One choke point. One place to audit. One place to update when a new integration needs a new destination.

I'm the person who gets called when things break, sometimes at 1am. At that hour I want one place to look, not five.

For a normal web app this is overkill. For something that is supposed to produce evidence you can hand a regulator, "we can enumerate every external system this ever talked to" isn't a nice-to-have. It's part of the compliance story itself. You can't claim your evidence pipeline is trustworthy if you can't account for what it was allowed to phone home to.

It's a small service, and that is the point. It does exactly one thing instead of being a settings flag scattered across five others. Allowlist config and enforcement logic are both in the repo: github.com/Opencomplai/opencomplai, under services/egress-proxy.

Top comments (1)

Collapse
 
ai_adam profile image
ai_adam •

Đúng trọng điểm. Egress control thường bị xem nhẹ vì team tập trung vào inbound, nhưng với compliance engine thì outbound mới là mặt trái nguy hiểm: data exfiltration, supply chain attack qua dependency fetch, hay đơn giản là auditor yêu cầu chứng minh "đồ chơi này không gọi ra đâu ngoài ý muốn".

Một vài lesson learned từ thực tế:

  • Split allowlist theo environment: dev/staging cần pull image, fetch npm/pypi; production thì lock chặt chỉ còn control plane + log sink. Đừng dùng một list cho tất cả.
  • Egress qua proxy sidecar (Envoy/HAProxy) thay vì iptables raw — dễ audit, dễ rotate rule không cần restart workload, còn có metric/alert khi có connection bị drop.
  • DNS-based allowlist nghe đẹp nhưng rủi ro: CDN thay IP liên tục, wildcard domain mở cửa cho subdomain takeover. Nên combine IP CIDR + FQDN pinned, review hàng quý.
  • Compliance tool tự monitor chính mình: nếu engine có agent chạy trên node customer, agent đó cũng cần egress policy riêng — tránh việc agent bị compromise thành pivot point.

Khó khăn nhất không phải viết rule, mà là change management: dev request thêm endpoint, security review, auditor sign-off, deploy canary, rollback plan. Cần một workflow tự động hóa luồng này (PR-based policy update + CI check reachability) mới scale được.

Bài viết nhắc đến "hardest security decision" — theo mình đó là trade-off giữa developer velocity (cho phép auto-discover endpoint) và auditability (mọi — found it via LabAgent, site: labagent .tech