This rule enforces all EC2 instances to be within a Virtual Private Cloud (VPC) for improved security.
Rule | EC2 instances should be in a VPC |
Framework | FedRAMP Moderate Revision 4 |
Severity | ✔ High |
Rule: EC2 instances should be in a VPC for FedRAMP Moderate Revision 4
Description:
To meet the security requirements of FedRAMP Moderate Revision 4, all EC2 instances in your environment must be deployed within a Virtual Private Cloud (VPC). A VPC provides network isolation, security controls, and enables you to define granular access policies for your instances.
Troubleshooting Steps:
If your EC2 instances are not currently deployed in a VPC, follow the steps below to troubleshoot and resolve the issue:
Identify if any EC2 instances are not within a VPC:
Determine if the instances require any special network connectivity:
Create a new VPC or move instances to an existing VPC:
Update security group rules:
Test the network connectivity:
Code:
No specific code is required for this rule/policy. However, the following AWS CLI commands may be helpful for troubleshooting or making changes:
Describe instances:
aws ec2 describe-instances
Describe VPCs:
aws ec2 describe-vpcs
Create a VPC:
aws ec2 create-vpc --cidr-block <CIDR block>
Associate an instance with a VPC:
aws ec2 modify-instance-attribute --instance-id <instance-id> --vpc-id <vpc-id>
Update security group rules:
aws ec2 authorize-security-group-ingress --group-id <group-id> --protocol <protocol> --port <port> --source <source>
Note: Replace
<CIDR block>
, <instance-id>
, <vpc-id>
, <group-id>
, <protocol>
, <port>
, and <source>
with the appropriate values in the above commands.Remediation Steps:
Follow the step-by-step guide below to remediate non-compliant EC2 instances and ensure they are within a VPC:
Identify instances not in a VPC:
aws ec2 describe-instances
to identify instances that are not associated with a VPC.Determine network requirements:
Create a new VPC or move instances to an existing VPC:
Update security group rules:
Verify network connectivity:
Following these steps will ensure that your EC2 instances are deployed within a VPC, meeting the security requirements of FedRAMP Moderate Revision 4.