11. The rules at the doors¶
The board of network rules.

On a board next to Linh's workshop hang the rules of each door. By default Neri's house lets its own people go out and lets nobody in. A visitor who crosses the bridge reaches the door and stops there.
LUMO reads Neri's needs again: the service answers on one port, and Neri wants to log in to look after it. So LUMO adds exactly two rules: let in the web traffic of the service, and let in remote login, but only from Neri's own address. Nothing else.

"Why not open everything? It would be simpler," Neri asks. LUMO shields the flame from the wind. "Every open door is a door someone else can use. We open what the service needs, and we write down why."

Important
Where the picture stops. Security groups are not physical fences or guards. They are rules applied to each
port by the virtual network. A rule that is too broad (for example SSH open to 0.0.0.0/0) can expose a service to
the whole Internet.
What it is in OpenStack¶
- A security group is a named set of rules applied to the ports of instances. Each port can have several groups.
- Each rule allows traffic: a direction (ingress or egress), a protocol, a port range, and a remote source (an IP range or another security group). Anything not allowed is dropped.
- They are stateful: if an incoming connection is allowed, its replies go out without an extra rule, and the other way round.
- The
defaultgroup of a project allows all outgoing traffic and incoming traffic only from members of the same group.
From the village to OpenStack¶
flowchart LR
V["Visitor on the Internet"] -->|"TCP 443"| SG
A["Neri's address 198.51.100.7"] -->|"TCP 22"| SG
X["Anyone else"] -->|"TCP 22"| SG
subgraph SG["Security group of the port"]
R1["allow ingress TCP 443 from 0.0.0.0/0"]
R2["allow ingress TCP 22 from 198.51.100.7/32"]
end
SG -->|"allowed"| P["Port of Neri's instance"]
SG -.->|"dropped: no rule"| D["✕"]
See it for real¶
openstack security group list
openstack security group rule list <SG>
openstack security group rule create --protocol tcp --dst-port 443 --remote-ip 0.0.0.0/0 <SG>
On a real host. Who applies the rules depends on the driver. With Kolla-Ansible 2026.1 and ML2/OVS, the Open
vSwitch agent on the compute writes them as iptables chains named after the port id (neutron-openvswi-i<id> for
incoming traffic, -o<id> for outgoing); each instance port has a Linux bridge qbr… between the instance and
br-int. With ML2/OVN, the rules are OVN access lists turned into flows. Read-only, on the compute:
sudo docker exec -u root neutron_openvswitch_agent iptables-save | grep <first 10 characters of the port id>. To go
further: Security group rules not applied, section "Where
the rules are enforced".
The lantern: the beam narrows onto the openings that are actually needed.
Next: the network is under control. LUMO turns to where the data lives. 12. The attached disk and the object archive →
To remember
Lumo: if you keep only 3 things from this page, keep these.
- A security group is a set of rules applied to ports; anything not allowed is dropped.
- Rules are stateful: replies to an allowed connection go back without an extra rule.
- Open only what the service needs, from the narrowest source possible.
What would you do?
Lumo: a situation you could meet on a real platform, and three ways to react. Pick the one you would choose: I will tell you what this page says about it. Nothing is recorded.
Check yourself
Lumo: 2 quick questions to check the main ideas of this page. Choose an answer to see the explanation and the section that gives the evidence. Your score counts your first choices and stays in this browser only.