learning-it by example

Back to the video

Zero Egress? Test a Docker Internal Network

A customer says no data may leave. Here is a test that shows whether a closed container can reach the internet.

Video #311 ยท Forward deployed engineer interviews

Steps in the video

  1. 0:00 A customer says no data may leave: a test that shows if it can
  2. 0:34 The idea
  3. 1:06 Setup
  4. 1:36 Two networks, three services
  5. 1:59 The probe
  6. 3:03 What it proves
  7. 3:25 What this does not show
  8. 3:59 Mistakes to avoid
  9. 4:24 My take and next steps
  10. 4:48 Recap

Files

  • compose.yaml (19 lines)
  • probe.py (19 lines)

Download the code (zip)

Tested with

Python 3.12.15

What this does not show

One run on one laptop with Docker 27.5.1: a container only on an internal network could not open a connection to one public address. The probe prints, it does not fail a build. A second network, host rules, a proxy, a mounted socket and name lookups were not tested. The image is not pinned by digest.

Sources

Learning IT by Example.