This rule ensures VPC security groups restrict ingress access on specific common ports to enhance network security.
Rule | VPC security groups should restrict ingress access on ports 20, 21, 22, 3306, 3389, 4333 from 0.0.0.0/0 |
Framework | CISA-cyber-essentials |
Severity | ✔ High |
Rule Description:
The VPC security groups should restrict ingress access on specific ports from the IP range 0.0.0.0/0 for CISA Cyber Essentials compliance. This rule aims to ensure that only necessary and authorized traffic is allowed into the VPC.
Troubleshooting Steps:
Necessary Code:
If existing rules in the security group need modification or new rules need to be added, the code examples below can be used as a reference.
# Example: Restrict ingress access on port 20 (FTP) from 0.0.0.0/0 aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol tcp --port 20 --cidr 0.0.0.0/0 # Example: Restrict ingress access on port 21 (FTP) from 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 # Example: Restrict ingress access on port 22 (SSH) from 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 # Example: Restrict ingress access on port 3306 (MySQL) from 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 # Example: Restrict ingress access on port 3389 (RDP) from 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 # Example: Restrict ingress access on port 4333 from 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
Remediation Steps:
Follow the step-by-step guide below to remediate the issue:
Note: It is recommended to perform these changes during a maintenance window or with proper precautionary measures to avoid any unintended disruption to your services.