More Info:

IAM Roles/Instance profiles should be used instead of IAM Access Keys to appropriately grant access permissions to any application that perform AWS API requests running on your EC2 instances.

Risk Level

Medium

Address

Security

Compliance Standards

SOC2, NIST

Triage and Remediation

Remediation

To remediate the misconfiguration “EC2 IAM Roles Should Be Used” for AWS using the AWS console, please follow the below steps:

  1. Login to your AWS Management Console.
  2. Navigate to the EC2 dashboard.
  3. Select the EC2 instance for which you want to remediate the misconfiguration.
  4. Click on the “Actions” dropdown menu and select “Instance Settings” and then click on “Attach/Replace IAM Role”.
  5. In the “Attach/Replace IAM Role” window, select the IAM role that you want to attach to the EC2 instance.
  6. Click on the “Apply” button to attach the selected IAM role to the EC2 instance.

By following the above steps, you have successfully remediated the misconfiguration “EC2 IAM Roles Should Be Used” for AWS. Now the EC2 instance is associated with an IAM role, which provides temporary security credentials to applications that run on the instance. This helps to improve the security of your AWS infrastructure by reducing the risk of unauthorized access to resources.

Additional Reading: