Critical

IAM user can execute a Privilege Escalation by using inline AssumeRole

Security & Compliance
Description

When an IAM user is granted permission to assume a specific IAM role, it can use the AssumeRole API to obtain temporary security credentials with elevated privileges. However, if the IAM user has the iam:PassRole permission, it can also create a new role with elevated privileges and assume that role instead, thereby bypassing any restrictions on the original role. This is a type of privilege escalation attack. An IAM user with the ability to execute a privilege escalation by using inline AssumeRole can be a serious security risk, as it can potentially grant unauthorized access to sensitive resources or perform malicious actions within the account.‍

Remediation

When an IAM user has the ability to use the AssumeRole API action with an IAM role that has elevated permissions, they can escalate their privileges and gain access to resources that they shouldn't have. The following steps can help remediate this issue:

  1. Review the IAM policy attached to the user that grants the AssumeRole action.
  2. Ensure that the policy grants the sts:AssumeRole action only to trusted roles.
  3. Check the permissions granted to the roles that can be assumed by the IAM user. Make sure that they only have the minimum necessary permissions required to perform their intended functions.
  4. If necessary, remove the AssumeRole permission from the IAM user's policy, or restrict it to a subset of roles that the user is authorized to assume.
  5. Use AWS CloudTrail to monitor the usage of AssumeRole and identify any suspicious activity.

By following these steps, you can limit the ability of an IAM user to perform a privilege escalation attack by using the AssumeRole API action.

Enforced Resources
Note: Remediation steps provided by Lightlytics are meant to be suggestions and guidelines only. It is crucial to thoroughly verify and test any remediation steps before applying them to production environments. Each organization's infrastructure and security needs may differ, and blindly applying suggested remediation steps without proper testing could potentially cause unforeseen issues or vulnerabilities. Therefore, it is strongly recommended that you validate and customize any remediation steps to meet your organization's specific requirements and ensure that they align with your security policies and best practices.

Step into the Future of SecOps