Failure to Grant Permissions to Create & Manage Access Keys on AWS console

0

I wanted to allow a general user to create and manage access key on AWS console. To grant those permissions to that user, I created 2 IAM policies below referring to https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html .

{ "Version": "2012-10-17", "Statement": [ { "Sid": "CreateOwnAccessKeys", "Effect": "Allow", "Action": [ "iam:CreateAccessKey", "iam:GetUser", "iam:ListAccessKeys" ], "Resource": "arn:aws:iam::*:user/${aws:username}" } ] }

{ "Version": "2012-10-17", "Statement": [ { "Sid": "ManageOwnAccessKeys", "Effect": "Allow", "Action": [ "iam:CreateAccessKey", "iam:DeleteAccessKey", "iam:GetAccessKeyLastUsed", "iam:GetUser", "iam:ListAccessKeys", "iam:UpdateAccessKey" ], "Resource": "arn:aws:iam::*:user/${aws:username}" } ] }

With the 2 IAM policies, still, that user could not create and manage access key on AWS console and found error messages as follows.

User: arn:aws:iam::711268734740:user/testuser is not authorized to perform: iam:ListAccessKeys on resource: user testuser with an explicit deny in an identity-based policy

How do I grant permissions to that user to create and manage own access keys?

질문됨 일 년 전420회 조회
1개 답변
0
수락된 답변

Explicitly created deny statements take precedence over any allow rules for same action. Are you creating a statement such as "Action: iam:*, Effect: Deny" other than the two policies? The error message indicates that there is an explicit deny rule for "iam:ListAccessKeys".

imiky
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠