Cloud Defense Logo

Products

Solutions

Company

Book A Live Demo

Rule: EC2 Instances Should Not Have a Public IP Address

This rule states that EC2 instances should not be assigned a public IP address to enhance security measures.

RuleEC2 instances should not have a public IP address
FrameworkNIST 800-171 Revision 2
Severity
High

Rule Description

This rule is designed to ensure compliance with the National Institute of Standards and Technology (NIST) 800-171 Revision 2 security standard. According to this standard, EC2 instances should not have a public IP address assigned to them. Having a public IP address increases the attack surface and potential exposure to unauthorized access and security threats.

Remediation

To remediate this issue and comply with NIST 800-171 Revision 2, follow the step-by-step guide below:

Step 1: Identify instances with public IP addresses

  1. 1.
    Log in to the AWS Management Console.
  2. 2.
    Navigate to the EC2 dashboard.

Step 2: Remove public IP addresses

  1. 1.
    Select the instance that has a public IP address.
  2. 2.
    Click on the "Actions" button and select "Networking" then "Manage IP addresses".
  3. 3.
    Click on "Release IP address" to remove the public IP address from the instance.
  4. 4.
    Repeat this process for all instances with assigned public IP addresses.

Troubleshooting

Issue: Unable to release the public IP address

  • Check if the instance is using an Elastic IP address. If so, you need to disassociate the Elastic IP before releasing the public IP. Follow the instructions below to disassociate the Elastic IP:

    1. 1.
      Navigate to the EC2 dashboard in the AWS Management Console.
    2. 2.
      Go to "Elastic IPs" under the "Network & Security" section.
    3. 3.
      Select the Elastic IP associated with the instance.
    4. 4.
      Click on the "Actions" button and select "Disassociate IP address".
    5. 5.
      After disassociating the Elastic IP, try releasing the public IP address again.
  • If the above steps don't resolve the issue, ensure that the instance is not part of an EC2 Auto Scaling group or Elastic Load Balancer. These can prevent the release of public IP addresses. Remove the instance from such groups or load balancers before attempting to release the IP.

Issue: Required public accessibility

  • If your specific use case requires public accessibility for an instance, you can use a NAT Gateway or a bastion host to allow specific secure access from the internet while adhering to security standards. Consult with your security team to ensure that the necessary controls and security measures are implemented.

Code Sample (if applicable)

No code sample is available for this rule as it requires manual configuration and management through the AWS Management Console.

It's important to periodically review your EC2 instances and ensure that they do not have public IP addresses assigned to them to maintain compliance with NIST 800-171 Revision 2 security standards.

Is your System Free of Underlying Vulnerabilities?
Find Out Now