01 Run list-users command (OSX/Linux/UNIX) using custom query filters to list the names of all IAM users currently available within your AWS account:
aws iam list-users
--output table
--query 'Users[*].UserName'
02 The command output should return a table with the requested IAM user identifiers:
-----------------------
| ListUsers |
+---------------------+
| cc-iam-test-admin |
| ec2-manager |
| ... |
| redshift-manager |
| iam-full-access |
+---------------------+
03 To get the name of the access policy attached to the selected IAM user, run list-user-policies command (OSX/Linux/UNIX) using the name of the IAM user that you want to examine as identifier:
aws iam list-user-policies
--user-name cc-iam-test-admin
--output table
--query 'PolicyNames'
04 The command output should return a table that contains the name of the policy (or policies) attached to the specified IAM user:
-------------------------
| ListUserPolicies |
+-----------------------+
| IAMCustomFullAccess |
+-----------------------+
05 Run get-user-policy command (OSX/Linux/UNIX) using the name of the access policy that you want to examine as identifier to describe the selected IAM policy document:
aws iam get-user-policy
--user-name cc-iam-test-admin
--policy-name IAMCustomFullAccess
--query 'PolicyDocument'
06 The command output should return the requested IAM policy document:
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"iam:CreatePolicy",
"iam:CreatePolicyVersion",
"iam:DeleteGroupPolicy",
"iam:DeletePolicy",
"iam:DeletePolicyVersion",
"iam:DeleteRolePolicy",
"iam:DeleteUserPolicy",
"iam:DetachGroupPolicy",
"iam:DetachRolePolicy",
"iam:DetachUserPolicy",
"iam:PutGroupPolicy",
"iam:PutRolePolicy",
"iam:PutUserPolicy",
"iam:UpdateAssumeRolePolicy"
],
"Resource": "*",
"Effect": "Allow"
}
]
}
07 To identify the necessary actions that allow the user to edit IAM policies by analyzing the policy document, perform the following:
- Within the policy document box, search for the following Action value with the Effect element set to Allow:
- Within the policy document box, search for the following set of Actions with an Allow effect:
- "iam:CreatePolicy"
- "iam:CreatePolicyVersion"
- "iam:DeleteGroupPolicy"
- "iam:DeletePolicy"
- "iam:DeletePolicyVersion"
- "iam:DeleteRolePolicy"
- "iam:DeleteUserPolicy"
- "iam:DetachGroupPolicy"
- "iam:DetachRolePolicy"
- "iam:DetachUserPolicy"
- "iam:PutGroupPolicy"
- "iam:PutRolePolicy"
- "iam:PutUserPolicy"
- "iam:UpdateAssumeRolePolicy"
08 If the IAM policy listed at step no. 6 has the actions outlined at step no. 8 a. and/or b., run get-user command (OSX/Linux/UNIX) to expose the Amazon Resource Name (ARN) of the selected user:
aws iam get-user
--user-name cc-iam-test-admin
--query 'User.Arn'
09 The command output should return the requested Amazon ARN:
"arn:aws:iam::123456789012:user/cc-iam-test-admin"
10 Sign into your TrendAI Vision One™ account to access Cloud Risk Management, access the rule settings and compare the user ARN returned at the previous step against each ARN listed within the rule configuration section. If the ARN found does not match any of the user ARNs listed on your TrendAI Vision One™ Cloud Risk Management Dashboard, the selected AWS IAM user is not authorized to edit IAM access policies, therefore it should be deactivated.
11 Repeat steps no. 3 - 10 to verify other Amazon IAM users for unauthorized permissions to edit IAM access policies.