Check ID: ec2_securitygroup_not_used
Provider: AWS
Service: ec2
Severity: LOW
Categories: trust-boundaries
Resource type: AwsEc2SecurityGroup

What this check verifies

EC2 security groups, except default, are assessed for unused status: zero attached network interfaces, no AWS Lambda associations, and no references from other security groups.

Risk

Orphaned security groups may later be attached with overly permissive rules without review, enabling unintended inbound or lateral access that compromises confidentiality and integrity. They also create configuration drift, increasing the chance of misapplied access controls.

Recommendation

Apply least privilege and strong lifecycle management: delete or quarantine unused security groups, enforce ownership tags and retention policies, review regularly, and manage changes via IaC with approvals. Restrict who can attach groups and use guardrails to prevent reuse of stale or permissive groups.

Remediation

aws ec2 delete-security-group —group-id <SECURITY_GROUP_ID>

References

Where this check fires

This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable by Check ID = ec2_securitygroup_not_used. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to AWS checks