Publicly accessible EC2 with High or Critical vulnerability associated with Role that can become Admin

Description

A publicly-accessible EC2 instance with critical or high vulns can assume a role that can become admin.

Remediation

  1. Review and apply security patches for the high and critical severity vulnerabilities. If no patch is available, apply compensating controls such as disabling or removing the vulnerable component.
  2. Assess whether this instance needs to be accessible from the internet. If not, restrict access to the instance by updating the security group or network ACL to only allow access from trusted sources.
  3. Review the IAM role associated with the instance profile and remove unnecessary privilege-escalation permissions. Apply the principle of least privilege, and use permission boundaries where appropriate to limit administrative access.