ExitAllowlisting: permitted source IP addresses1 / 9
Explanation

Start with the source the destination sees

How to build a least-privilege IP allowlist for data-source connections by identifying the source addresses the destination sees, accounting for NAT, choosing narrow CIDR ranges, and testing permitted and unpermitted sources. · associate

An IP allowlist permits connections from specified source addresses; other sources are not permitted by that rule set. For a data-source connection, identify the machine initiating the connection and the address seen where the destination enforces its rule. The database's own address is the destination, not the source to allow.

Network address translation (NAT) can change that source. A private client connecting over the internet through a public NAT gateway appears to the destination with the gateway's public egress address, not the client's private address. Confirm this using the actual route, NAT configuration, and destination-side connection or firewall records where available.

The diagram shows a simplified outbound connection path and an independent test source; routing details are omitted. Public addresses shown here are documentation examples, not addresses to deploy. The destination permits the NAT address on its database port; the next sections explain why that rule is narrow and how to verify it.

Client VPC: private client uses public NAT
Independent test network: direct public egress
Database connectionTranslated connectionUnpermitted testConnection attempts
Amazon EC2Data client: 10.0.1.25
Amazon VPCPublic NAT gateway: Elastic IP 203.0.113.10
Amazon EC2Unpermitted test client: public source 198.51.100.20
InternetPublic internet
On-premisesPublic database and firewall: allow 203.0.113.10/32 on TCP 5432

1 / 6 The private data client initiates the database connection from 10.0.1.25.

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