Check ID:
Provider: AWS
Service:
Severity: HIGH
Categories:
Resource type:
ec2_instance_internet_facing_with_instance_profileProvider: AWS
Service:
ec2Severity: HIGH
Categories:
internet-exposed, identity-accessResource type:
AwsEc2InstanceWhat this check verifies
EC2 instances with a public IP address and an attached instance profile (IAM role) are identified. Instances lacking public exposure or without an instance profile are excluded.Risk
Publicly reachable instances with IAM role credentials expand the blast radius. Remote exploits or misconfigurations can steal credentials via the instance metadata service, enabling unauthorized API calls, data exfiltration, and lateral movement, impacting confidentiality, integrity, and availability.Recommendation
Avoid direct Internet exposure. Place workloads behind an Application Load Balancer and protect HTTP apps with WAF. Remove public IPs or restrict ingress to trusted sources. Apply least privilege to instance profiles and enforce IMDSv2. Use bastion hosts or Session Manager for admin access.Remediation
- CLI
- Terraform
- Native IaC
- Dashboard steps
aws ec2 disassociate-iam-instance-profile —association-id <ASSOCIATION_ID>
References
- https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html
- https://aws.amazon.com/blogs/aws/aws-web-application-firewall-waf-for-application-load-balancers/
- https://support.icompaas.com/support/solutions/articles/62000127121-ensure-instance-profile-is-attached-for-internet-facing-ec2-instances
Where this check fires
This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable byCheck ID = ec2_instance_internet_facing_with_instance_profile. 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