Compliancemanzill.com
CIS Amazon Web Services Foundations Benchmark v1.2.0

CIS Amazon Web Services Foundations Benchmark v1.2.0/Identity and Access Management/19 of 49

1.19Ensure IAM instance roles are used for AWS resource access from instances

Control family: Identity and Access Management

Control description

AWS access from within AWS instances can be done by either encoding AWS keys into AWS API calls or by assigning the instance to a role which has an appropriate permissions policy for the required access. "AWS Access" means accessing the APIs of AWS in order to access AWS resources or manage AWS account resources.

How to implement

ResponsibilityCustomerYou configure and operate this in your own cloud accounts.

A program on an EC2 instance that needs to call AWS should get temporary credentials from a role attached to the instance, not from an access key stored on the disk. Role credentials rotate by themselves and can't be copied off for long-term use, while a stored key lasts until someone deletes it.

Before you start

The same on every cloud, before the steps in the tabs.

  • List the workloads on EC2 that call AWS and the access keys they use today.
  • Set the rule that new instances get an IAM role, never stored keys, and add it to build reviews.

Evidence

  • The inventory of instance workloads and the role each one uses

On AWS the tasks create a role for the instance, attach it, and then remove the stored access key the program used before.

Task 1Create a role the instance can use

  1. Sign in to the AWS Management Console at console.aws.amazon.com and open IAM > Roles.
  2. Choose Create role, select AWS service as the trusted entity and EC2 as the use case, then choose Next.
  3. Select only the policies the program needs (for example read access to one S3 bucket) and choose Next.
  4. Name the role after the application, such as orders-app-instance, and choose Create role.
  5. Check it: the role's Trust relationships tab names ec2.amazonaws.com.

Task 2Attach the role to the instance

  1. Open EC2 > Instances and select the instance.
  2. Choose Actions > Security > Modify IAM role.
  3. Choose the new role and select Update IAM role.
  4. Check it: the instance's Security tab shows the role, and the program keeps working once it picks up the role credentials.

Task 3Remove the access key the program used before

  1. Find the IAM user whose key was stored on the instance and open its Security credentials tab in IAM.
  2. Confirm the key's Last used date has stopped moving since the role was attached.
  3. Choose Actions > Deactivate, wait to be sure nothing breaks, then Actions > Delete.
  4. Delete the key from the instance's files or environment settings.
  5. Check it: a search of the instance turns up no AWS access key.

Evidence

  • EC2 > Instances, showing an IAM role on each instance that calls AWS
  • The credential report, showing the old application keys deleted

Console steps as of 5 November 2026. Not every step has been confirmed in a live console yet, and menus and labels can move between releases, so look for the nearest match if one has changed.