This rule focuses on restricting access on common ports from 0.0.0.0/0 in VPC security groups.
Rule | VPC security groups should restrict ingress access on ports 20, 21, 22, 3306, 3389, 4333 from 0.0.0.0/0 |
Framework | FedRAMP Low Revision 4 |
Severity | ✔ High |
Rule Description
This rule enforces the restriction of ingress access on specific ports (20, 21, 22, 3306, 3389, and 4333) from the IP range 0.0.0.0/0 (any IP address) within a Virtual Private Cloud (VPC) environment. The purpose is to enhance the security posture of the VPC by limiting access to these ports to only authorized entities. This rule specifically applies to the FedRAMP Low environment, Revision 4.
Troubleshooting Steps
If there are any connectivity issues related to the ingress access on the specified ports, you should follow these troubleshooting steps:
Necessary Codes
To implement this rule, you need to modify the inbound rules of the relevant security groups in your VPC. Here is an example code snippet:
aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port 20 --cidr 0.0.0.0/0 aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port 21 --cidr 0.0.0.0/0 aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port 22 --cidr 0.0.0.0/0 aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port 3306 --cidr 0.0.0.0/0 aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port 3389 --cidr 0.0.0.0/0 aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port 4333 --cidr 0.0.0.0/0
Replace
<security-group-id>
with the actual ID of the security group to which you want to apply these rules.Step-by-Step Guide for Remediation
Follow these step-by-step instructions to ensure that the ingress access on ports 20, 21, 22, 3306, 3389, and 4333 is properly restricted within your VPC:
Identify the security group(s) associated with the instance(s) that require the rule modification.
Access the AWS Management Console or use the AWS CLI (Command Line Interface) to log in to your AWS account.
Open the Amazon VPC service.
Select "Security Groups" from the left-hand menu.
Locate the security group(s) associated with the affected instance(s).
Select the appropriate security group to view its details.
In the "Inbound rules" section, check if any existing rules allow access on ports 20, 21, 22, 3306, 3389, and 4333 from 0.0.0.0/0.
If such rules exist, select them and click on the "Delete" or "Remove" button to remove them.
Once the old rules are removed, click on the "Add Rule" button or similar to create new inbound rules.
Add inbound rules for each required port (20, 21, 22, 3306, 3389, and 4333), specifying the following parameters:
Repeat step 10 for each required port.
After adding all the necessary rules, click on the "Save" or "Apply" button to apply the changes.
Verify that the new inbound rules are appropriately configured and restricting access as intended.
By following these steps, you will successfully restrict ingress access on ports 20, 21, 22, 3306, 3389, and 4333 from 0.0.0.0/0 within your VPC for the specified FedRAMP Low Revision.