๐ก๏ธ AWS EC2 Security Group allows public IPv6 (::/0) access to admin ports๐ข
- Contextual name: ๐ก๏ธ Security Group allows public IPv6 (::/0) access to admin ports๐ข
- ID:
/ce/ca/aws/ec2/security-group-allows-public-ipv6-to-admin-ports - Tags:
- ๐ข Policy with categories
- ๐ข Policy with type
- ๐ข Production policy
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
SECURITY
Logicโ
- ๐ง prod.logic.yaml๐ข
Similar Policiesโ
- Internal:
dec-x-bcae85fb
Similar Internal Rulesโ
| Rule | Policies | Flags |
|---|---|---|
| โ๏ธ dec-x-bcae85fb | 2 |
Descriptionโ
Descriptionโ
Security groups provide stateful filtering of ingress and egress network traffic to AWS resources. It is recommended that no security group allows unrestricted ingress access to remote server administration ports, such as SSH to port
22and RDP to port3389.Rationaleโ
Public access to remote server administration ports, such as 22 and 3389, increases resource attack surface and unnecessarily raises the risk of resource compromise.
Impactโ
When updating an existing environment, ensure that administrators have access to remote server administration ports through another mechanism before removing access by deleting the ::/0 inbound rule.
Auditโ
Perform the following to determine if the account is configured as prescribed:
- Login to the AWS Management Console at https://console.aws.amazon.com/vpc/home.
- In the left pane, click
Security Groups.- For each security group, perform the following:
- Select the security group.
- Click the
Inbound Rulestab.- Ensure no rule exists that has a port range that includes port
22,3389, or other remote server administration ports for your environment and has aSourceof::/0.... see more
Remediationโ
Remediationโ
From AWS CLIโ
Inline JSON exampleโ
aws ec2 revoke-security-group-ingress \
--group-id {{sg-id}} \
--ip-permissions '[{"IpProtocol": "{{tcp}}","FromPort": {{22}},"ToPort": {{22}},"Ipv6Ranges": [{ "CidrIpv6": "::/0" }]}]'Using a fileโ
Extract the existing rule to a file:
aws ec2 describe-security-groups \
--group-id {{sg-id}} \
--query "SecurityGroups[0].IpPermissions[?Ipv6Ranges[?CidrIpv6=='::/0']]" \
--output json > {{revoke-rule}}.jsonRevoke it by referencing the file:
aws ec2 revoke-security-group-ingress \
--group-id {{sg-id}} \
--ip-permissions file://{{revoke-rule}}.jsonNote: You must revoke the entire rule as it was originally defined โ that is, exact protocol, full port range, and CIDR block โ and if needed, recreate any safe sub-rules after that.
From Consoleโ
Perform the following to implement the prescribed state:
- Login to the AWS Management Console at https://console.aws.amazon.com/vpc/home.
- In the left pane, click
Security Groups.... see more