Hands-on task
A network with no way out: --internal
ledger stores transactions, worker processes them (UPSTREAM=ledger:8080); both are in the vault network. Security requires that the vault network has no way out to the outside world. In the lab the outside world is played by the service http://198.51.100.10:9099/ on the server — right now ledger can reach it: docker exec ledger wget -qO- http://198.51.100.10:9099/.
Make vault an internal Docker network so that:
ledgeris connected only tovault, andworkeris connected to it too;workerstill reachesledger;- the outside service becomes unreachable from
ledger(don't touch the service itself).
You may reconnect the containers or recreate them with the same names and settings.
The lab has its own Docker with no internet access; the images are already loaded: izzylab/minihttp:1, alpine:3.21, busybox:1.36, nginx:1.27-alpine. izzylab/minihttp is a tiny HTTP service on port 8080: GET / answers <NAME> ok, GET /call itself goes to http://<UPSTREAM>/ and answers <NAME> -> <the neighbor's reply> (or 502), GET /env shows its settings. It is configured with the environment variables NAME, PORT, BIND (the address it listens on) and UPSTREAM.
- docker network --internal
- egress