Check ID: ec2_ami_public
Provider: AWS
Service: ec2
Severity: CRITICAL
Categories: internet-exposed
Resource type: Other

What this check verifies

EC2 AMIs owned by the account are evaluated for public visibility via their launch permissions. Images shared with all accounts (Group=all) are treated as publicly accessible.

Risk

Public AMIs expose image contents to any AWS account, undermining confidentiality and integrity:
  • Leakage of embedded secrets, configs, or data from referenced snapshots
  • Adversaries can fingerprint your stack, aiding targeted exploits or repackaging for supply chain abuse

Recommendation

Keep AMIs private and enforce least privilege launch permissions. Share only with specific accounts and review access routinely. Enable block public access for AMIs, sanitize images to remove secrets, encrypt backing snapshots, and apply lifecycle governance to retire outdated images.

Remediation

aws ec2 modify-image-attribute --image-id <EC2_AMI_ID> --launch-permission "Remove=[{Group=all}]"

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_ami_public. 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