- Home
- »
- AWS Documentation
- »
- IAM
- »
- Ensure an IAM role has been created to manage incidents with AWS Support
An IAM role has not been created to manage incidents with AWS Support
Description
Access to AWS services from within EC2 instances is achieved through two primary methods: embedding AWS keys directly within API requests or associating the EC2 instance with an IAM role that is granted the necessary permissions via an attached policy. This AWS access enables communication with AWS service APIs, allowing for the management and utilization of AWS resources.
IAM roles provide a more secure alternative to managing long-lived credentials, reducing the risks associated with credential sharing and rotation. If static credentials are compromised, they can be exploited outside the AWS environment, potentially granting unauthorized access. Conversely, exploiting role-based permissions requires an attacker to gain persistent access to a specific EC2 instance, limiting the scope of potential damage to that instance’s permissions.
The use of embedded credentials, particularly within compiled applications or systems that are difficult to update, increases the risk of improper credential rotation. This is due to the potential disruptions that updating these credentials may cause to service operations. Over time, credentials that are not rotated become increasingly vulnerable to exposure, especially as they may be known to a wider pool of individuals, including former employees, who may no longer have legitimate access to the system.
Fix -Runtime
Procedure
Use the Amazon unified command line interface to create an IAM role for managing incidents with AWS.
Create a trust relationship policy document that allows \<iam_user> to manage AWS incidents. Save this document locally as /tmp/TrustPolicy.json:.
{
Version: 2012-10-17,
Statement: [
{
Effect: Allow,
Principal: {
AWS: "IAM_USER"
},
Action: sts:AssumeRole
}
]
}
Create the IAM role using the above trust policy:
aws iam create-role --role-name <aws_support_iam_role>
--assume-role- policy-document file:///tmp/TrustPolicy.json
Attach 'AWSSupportAccess' managed policy to the created IAM role:
aws iam attach-role-policy
--policy-arn <iam_policy_arn> --role-name <aws_support_iam_role>