Concepts
- Private network: a named Docker network. Apps you add as members can reach each other.
- Default deny: a private network flag. Members are isolated from each other until a rule allows a pair.
- Allow rule: lets two apps reach each other across network boundaries. Rules work in both directions at the network level.
How it is enforced
- Same node: the control plane creates one Docker network per private network and per rule, and attaches the apps’ containers to it through the Docker Engine API. It re-applies every reconcile pass, so redeployed containers are attached again and removed rules are detached.
- Across nodes: apps on other nodes are found through mesh DNS. Members of a default-deny network with no rule naming them are left out of mesh DNS, so their names stop resolving. This gates name resolution, it is not a packet filter.
- Limits: rules are app level, not per port. Direct IP access across the mesh is not filtered.
Names members resolve
On a shared private network or allow rule, each member’s containers answer to:- the app name, for example
kafka. For a stack with several services it resolves to any of them. - for a stack service, the service name, for example
kafka-1.
db- (managed databases) and localhost are always withheld. Withheld names show as withheld in member_names; rename the app or service to get one back.
private-networks list and GET /api/v1/private-networks (member_names) show the names. A running attachment that lacks them is reconnected once. Members of a default-deny network resolve each other only through allow rules. Aliases are set on the control plane’s own Docker only: containers on other nodes join without them. One-off and scheduled job containers can look names up but do not answer to them.
The map
Green lines are allowed, red dashed lines are blocked, and amber lines mean the policy and what runs on Docker disagree. Blocked paths between apps of the same project show a Allow button that creates the rule. Amber paths show Re-apply.CLI
API
Changes need root. Reads need the read ability.