Use IAM roles (i.e., instance profiles) instead of IAM access keys to appropriately grant access permissions to any application that perform AWS API requests running on your Amazon EC2 instances. With IAM roles you can avoid sharing long-term credentials and protect your EC2 instances against unauthorized access.
This rule can help you with the following compliance standards:
- CISAWSF
- APRA
- MAS
- NIST4
For further details on compliance standards supported by Conformity, see here.
This rule can help you work with the AWS Well-Architected Framework.
This rule resolution is part of the Conformity Security & Compliance tool for AWS.
Using IAM roles over IAM access keys to sign AWS API requests has multiple benefits. For example, once enabled and configured, you or your administrators don't have to manage credentials anymore as the credentials provided by the IAM roles are temporary and rotated automatically behind the scenes. You can use a single role for multiple Amazon EC2 instances within your stack, manage its access policies in one place, and allow policies to propagate automatically to all instances. You can also restrict which role a IAM user can assign to an EC2 instance during the launch process in order to stop the user from trying to gain elevated access (i.e., overly permissive privileges).
Audit
To determine if your Amazon EC2 instances are using IAM roles to sign AWS API requests, perform the following operations:
Remediation / Resolution
To attach IAM roles to your existing Amazon EC2 instances, you must configure your EC2 instances with instance profiles. To implement secure, role-based access for your Amazon EC2 instances, perform the following operations:
References
- AWS Documentation
- Amazon EC2 FAQs
- Using IAM Roles
- Using an IAM Role to Grant Permissions to Applications Running on Amazon EC2 Instances
- Using Instance Profiles
- AWS managed policies for Amazon Elastic Compute Cloud
- Temporary Security Credentials
- Permissions for the IAM Role Assigned to AWS Config
- Elastic IP Addresses
- AWS Command Line Interface (CLI) Documentation
- describe-instances
- associate-iam-instance-profile
- create-role
- attach-role-policy
- create-instance-profile
- add-role-to-instance-profile
- CloudFormation Documentation
- Amazon Elastic Compute Cloud resource type reference
- Terraform Documentation
- AWS Provider