More Info:
No security group should allow unrestricted inbound access using Internet Control Message Protocol (ICMP).Risk Level
MediumAddress
SecurityCompliance Standards
- APRA CPS 234 (Australia)
- AWS Startup Security Baseline
- AWS Well Architected Framework
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS Critical Security Controls v8
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- DPDPA
- Digital Operational Resilience Act (EU)
- FedRAMP
- GDPR
- HITRUST CSF
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIS2 Directive
- NIST CSF
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- PCI
- Reserve Bank of India (RBI) Cyber Security Framework
- Reserve Bank of India (RBI) Master Direction – Information Technology Framework
- SOC2
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate the “Unrestricted ICMP Access Should Not Be Allowed” misconfiguration in AWS using the AWS console, you can follow the below steps:
- Log in to the AWS Management Console and navigate to the EC2 Dashboard.
- Click on the “Security Groups” option from the left-hand menu.
- Select the security group that has unrestricted ICMP access.
- Click on the “Inbound Rules” tab.
- Locate the rule that allows all ICMP traffic (Protocol: ICMP, Port Range: All).
- Click on the “Edit” button for that rule.
- Change the “Source” field to a specific IP range or security group that requires access to ICMP traffic. If you want to allow ICMP traffic from any IP address, you can select “My IP” option.
- Click on the “Save” button to apply the changes.
Using CLI
Using CLI
To remediate the unrestricted ICMP access issue in AWS using AWS CLI, follow these steps:Replace This should return the details of the security group, which should no longer have the ICMP access rule.
- Open the AWS CLI or AWS Management Console.
- Identify the security group that has unrestricted ICMP access. You can use the following command to list all the security groups in your AWS account:
- Once you have identified the security group, use the following command to revoke the ICMP access rule:
<security-group-id> with the ID of the security group that has unrestricted ICMP access.- Verify that the ICMP access rule has been revoked by running the following command:
- Repeat the above steps for all the security groups that have unrestricted ICMP access.
Using Python
Using Python
To remediate the misconfiguration of unrestricted ICMP access in AWS using Python, you can follow these steps:Note: Replace the security_group_ids with the actual security group IDs that allow unrestricted ICMP access.
- Identify the security group(s) that allow unrestricted ICMP access.
- Use the AWS SDK for Python (Boto3) to modify the security group(s) and remove the rule that allows unrestricted ICMP access.
Using Terraform
Using Terraform
aws_vpc_security_group_ingress_rule resources that model icmp from 0.0.0.0/0 and icmpv6 from ::/0 is a destructive change for those rules only: Terraform will delete the offending ingress rules but will not replace the security group itself.To verify, run terraform plan and confirm it shows - (destroy) for the unrestricted aws_vpc_security_group_ingress_rule resources and no remaining ingress rule with ip_protocol = "icmp"/"icmpv6" and cidr_ipv4 = "0.0.0.0/0" or cidr_ipv6 = "::/0".
