The default posture
What an interface with no group does, and the one rule a new group starts
with.
Writing rules
Required fields, the source that is not optional, and why there is no
update.
Attaching
Membership is a set you replace, not a list you append to.
Platform rules
Traffic that is always allowed, and the one port that is always blocked.
The default posture
Two different defaults matter here, and confusing them is the usual source of “my rules do nothing”.- An interface in no group
- A newly created group
Default deny, both directions. Every packet is dropped except the
platform’s own always-on allows. Attaching no security group is not the
permissive option — it is the closed one.
Rules
ingress | egress
required
For an
egress rule, source_cidr and source_security_group_id name the
destination. The field names do not change with the direction.tcp | udp | icmp | all
required
ipv4 | ipv6
Defaults to
ipv4. A rule matches one family only; write two rules for both.integer
Required for
tcp and udp, and rejected without them. Ignored — and
cleared — for icmp and all. The range must satisfy
0 ≤ port_min ≤ port_max ≤ 65535. For a single port, set both to it.string | uuid
required
Exactly one of the two is required. They are mutually exclusive, and
omitting both is rejected — there is no “any source” shorthand; write
0.0.0.0/0 or ::/0 explicitly. source_cidr must match the rule’s
ethertype.Naming another group as the source
Stateful
An allowed connection’s return traffic is allowed automatically. You do not write a mirrored rule in the opposite direction — an ingress rule for TCP 443 already lets the responses out.Attaching groups to an interface
name is immutable; description and
tags can be patched.
What the platform enforces regardless
A small band of rules sits above yours. You cannot override or remove them through this API.Always allowed
DHCP, IPv6 neighbor discovery, and the link-local metadata endpoint at169.254.169.254. Every instance needs these to lease its address and to reach
instance metadata at boot, so they survive a default-deny posture — otherwise a
correctly-locked-down instance could never finish booting.
Always blocked: outbound TCP 25 to the internet
Direct-to-MX SMTP from a compromised or rented instance is the fastest way for an address range to land on a spam blocklist, and the cost of that lands on everyone sharing the range. The envelope carries your address, so the block is on port 25 specifically.The submission ports 465, 587 and 2525 are not blocked. Mail handed to an
authenticated provider leaves from that provider’s addresses carrying that
provider’s reputation, so blocking those buys nothing and breaks a great deal
of software that only speaks SMTP.The port 25 drop also excludes private destinations, so your own mail server
inside the VPC stays reachable from another instance.
Quotas and access control
security_groups is a regional quota against your organization.
rules_per_security_group is a per-resource quota — it caps the rules on each
individual group, not the total across them.
A security group’s CRN is name-based, so a policy can name
crn:network:sa-saopaulo-1:my-account:security-group/web-*. Rules have no name
of their own and authorize against their parent group’s CRN and tags, so
network:CreateSecurityGroupRule is granted on a group rather than on * —
which also means a tag condition on the group governs who can add rules to it.
Next
Interfaces
What a NIC is and how it gets its security groups.
Gateways and routing
Security groups decide the last hop. Routing decides whether the packet
ever arrives.