Open hoangquochung1110 opened 3 months ago
ACTION_NAMES="geo-places:*"
aws iam simulate-principal-policy \
--policy-source-arn ${ARN} \
--action-names ${ACTION_NAMES} \
--policy-input-list '[]'
2.List all policies attached to the user
aws iam list-attached-user-policies --user-name username
Retrieve group which $USER_NAME assigned to
GROUP=$(aws iam list-groups-for-user --user-name $USER_NAME | jq -r '.Groups[].GroupName')
echo $GROUP
View inline policies
POLICY=$(aws iam list-group-policies --group-name $GROUP | jq '.PolicyNames[]')
aws iam get-group-policy --group-name $GROUP --policy-name $POLICY
View managed policies
aws iam list-attached-group-policies --group-name $GROUP | jq -r '.AttachedPolicies[].PolicyArn'
aws iam get-policy --policy-arn $POLICY_ARN
Set username
Retrieve ARN of the IAM user