Nova instances on Neutron networks: can the default security group be trusted to block accidental public access?
0 reputation · 19 Jan 2020, 09:57 UTC
0 reputation · 19 Jan 2020, 09:57 UTC
We run Nova compute instances attached to Neutron networks, with floating IPs allocated on demand. The goal is a defensible baseline where no instance becomes reachable from the public internet unless an operator deliberately opens a specific port.
Neutron applies security groups as stateful, allow-only filters on each VM port, and the auto-created 'default' group permits all egress plus ingress only from peers in the same group. In practice, though, exposure seems to creep in through added 0.0.0.0/0 ingress rules in templates, remote-group rules that change effective access as membership shifts, and ports where port_security_enabled has been set to false (which also drops anti-spoofing). Because groups are per-project, there appears to be no built-in way to answer 'is anything in this cloud publicly reachable?' across all projects at once.
We also understand floating IPs do not bypass security-group filtering, so the group rules are the real enforcement point. Assume a recent OpenStack release with the standard Neutron firewall driver; exact defaults may vary by operator.
35775 reputation · 19 Jan 2020, 12:33 UTC
port_security_enabled=false across all projects. Automate with a script that iterates projects (requires admin credentials).allowed_address_pairs as anti-spoofing bypass. An entry covering 0.0.0.0/0 or a large CIDR (e.g., /8, /16) effectively disables source-IP validation for that port. Flag these during the same audit.The auto-created default group is stateful and allow-only. Its initial rules permit all egress and ingress only from peers in the same group. This blocks public traffic until someone adds a permissive rule — which any project user with the member role can do. There is no built-in cross-project guardrail; Neutron evaluates rules per port, not per cloud.
Operator customizations and OpenStack release differences can alter the default group's initial rules or the default value of port_security_enabled. Some ML2 drivers or plugins (e.g., certain SR-IOV or hardware offload configurations) may ignore security-group rules for specific port types. Verify your deployment's behavior.
openstack project list -f value -c IDopenstack security group rule list --project <proj-id> \
-f value -c remote_ip_prefix | grep '^0\.0\.0\.0/0$'openstack port list --project <proj-id> \
-f value -c id -c port_security_enabled Flag any line where the second column is False.openstack port show <port-id> -f value -c allowed_address_pairs Flag entries containing 0.0.0.0/0 or CIDRs larger than /24 (adjust threshold to your policy).deny-all-baseline) with no ingress rules and the default egress rule (allow all).port_security_enabled=true on all ports via policy or CI gate.security-admin role).firewall_driver set to noop, custom ML2 mechanism drivers) can change enforcement behavior — verify in your environment.What Neutron firewall_driver and ML2 mechanism drivers are configured in your deployment? If you use a non-standard driver (e.g., OVN, SR-IOV with hardware offload, or a vendor plugin), the audit commands above may not reflect actual dataplane behavior.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.