π AWS EC2 Default Security Group does not restrict all traffic π’
- Contextual name: π Default Security Group does not restrict all traffic π’
- ID:
/ce/ca/aws/ec2/default-security-group-does-not-restrict-all-traffic
- Located in: π AWS EC2
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
SECURITY
Similar Policiesβ
- Cloud Conformity
- Internal
dec-x-ecd99f88
Similar Internal Rulesβ
Rule | Policies | Flags |
---|---|---|
βοΈ dec-x-ecd99f88 | 1 |
Logicβ
- π§ prod.logic.yaml π’
Descriptionβ
Descriptionβ
A VPC comes with a default security group whose initial settings deny all inbound traffic, allow all outbound traffic, and allow all traffic between instances assigned to the security group. If you don't specify a security group when you launch an instance, the instance is automatically assigned to this default security group. Security groups provide stateful filtering of ingress/egress network traffic to AWS resources. It is recommended that the default security group restrict all traffic.
The default VPC in every region should have its default security group updated to comply with the following:
- No inbound rules.s
- No outbound rules.
NOTE: When implementing this recommendation, VPC flow logging is invaluable in determining the least privilege port access required by systems to work properly because it can log all packet acceptances and rejections occurring under the current security groups. This dramatically reduces the primary barrier to least privilege engineering - discovering the minimum ports required by systems in the environment. Even if the VPC flow logging recommendation in this benchmark is not adopted as a permanent security measure, it should be used during any period of discovery and engineering for least privileged security groups.
... see more
Remediationβ
Remediationβ
Security Group Membersβ
Perform the following to implement the prescribed state:
- Identify AWS resources that exist within the default security group.
- Create a set of least privilege security groups for those resources.
- Place the resources in those security groups.
- Remove the resources noted in #1 from the default security group.
Security Group Stateβ
Login to the AWS Management Console at https://console.aws.amazon.com/vpc/home.
Repeat the next steps for all VPCs - including the default VPC in each AWS region:
In the left pane, click
Security Groups
.For each default security group, perform the following:
- Select the
default
security group.- Click the
Inbound Rules
tab.- Remove any inbound rules.
- Click the
Outbound Rules
tab.- Remove any Outbound rules.
Recommendedβ
IAM groups allow you to edit the
name
field. After remediating default groups rules for all VPCs in all regions, edit this field to add text similar toDO NOT USE. DO NOT ADD RULES
.