ExitAmazon VPC: security group rules1 / 9
Explanation

Describe the connection you want to allow

How stateful security group rules allow data-source connections using source IP ranges, security group references, ports, and protocols. · associate

A security group controls traffic for associated network interfaces, including those used by EC2 instances and RDS databases. Its rules allow traffic; they do not explicitly deny it. For a new connection, the client's outbound rules and the data source's inbound rules must both allow the traffic.

A rule specifies a protocol, such as TCP, and, for TCP or UDP, a destination port or port range. An inbound rule also specifies the allowed source; an outbound rule specifies the allowed destination. For PostgreSQL listening on port 5432, allow TCP 5432, not UDP 5432 or every port.

An IP allowlist uses CIDR notation. If the source address seen by the database is 10.0.1.25, use 10.0.1.25/32 to allow that one IPv4 address. 10.0.1.0/24 allows the whole range, while 0.0.0.0/0 allows any IPv4 source. Choose the narrowest range that covers the intended clients.

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.