Enabling public network access to cloud resources can affect an organization’s ability to protect its data or internal operations from data theft
Depending on the component, inbound access from the Internet can be enabled via:
- a boolean value that explicitly allows access to the public network.
- the assignment of a public IP address.
- database firewall rules that allow public IP ranges.
Deciding to allow public access may happen for various reasons such as for quick maintenance, time saving, or by accident.
This decision increases the likelihood of attacks on the organization, such as:
- data breaches.
- intrusions into the infrastructure to permanently steal from it.
- and various malicious traffic, such as DDoS attacks.
Ask Yourself Whether
This cloud resource:
- should be publicly accessible to any Internet user.
- requires inbound traffic from the Internet to function properly.
There is a risk if you answered no to any of those questions.
Recommended Secure Coding Practices
Avoid publishing cloud services on the Internet unless they are intended to be publicly accessible, such as customer portals or e-commerce
Use private networks (and associated private IP addresses) and VPC peering or other secure communication tunnels to communicate with other cloud
The goal is to prevent the component from intercepting traffic coming in via the public IP address. If the cloud resource does not support the
absence of a public IP address, assign a public IP address to it, but do not create listeners for the public IP address.
Sensitive Code Example
DMS and EC2 instances have a public IP address assigned to them:
PubliclyAccessible: true # sensitive, by default it's also set to true
- AssociatePublicIpAddress: true # sensitive, by default it's also set to true
DMS and EC2 instances doesn’t have a public IP address:
- AssociatePublicIpAddress: false