Access Key ID for non-root IAM user

0

Hi Team - Can you let me know if the AWS mgmt and child account's root user or admin user can pull the access key ID for all the non-root IAM user ?

2개 답변
2
수락된 답변

An AWS account root user does have all the permissions for accessing any resources within that account unless not denied explicitly. Resources, which support resource based policy such as S3 bucket, can be denied access to root user by setting up explicit deny in bucket policy within that account.

Root user can view non-root IAM user access keys as well. This is why it's always best practice to delete root user secret/access keys to avoid unintended access to broader set of resources.

Child account's root user's permissions can be limited by Service Control Policy(SCP), through SCP, you can dictate what are those actions which child account's root user can do or can not do.

Hope this helps.

Comment here if you have additional questions, happy to help.

Abhishek

profile pictureAWS
전문가
답변함 8달 전
profile pictureAWS
전문가
검토됨 8달 전
  • Thanks. Do you have sample command to pull the list of access key ID from management account. so i dont need to log-on to each individual account and run the command,

  • AWS Organizations allows managing multiple accounts but it doesn't give root users automatic access to child accounts. With that said, you have two options, if this is going to be recurring task, then setup cross account IAM role, where from management account, you can access child account resources or you need to go to each account and generate the list.

    How I'd do it, if I'd have access to each account, set up CLI and iteratively run the following CLI command for each CLI profile:

    aws iam list-users --output text | awk '{print $NF}' aws iam list-access-keys --user <for_each_user_retrieved from above command> --output text

    This can be easily scripted and run for each CLI profile. Hope you find this helpful.

  • Does this help, or are you looking for something else?

  • Sorry for late reply. I have not checked the command but looks promising solution. hope i can post my comment here or ask new question on same topic, if require

  • Yes absolutely.

0

Hi,

you can use the iam:ListAccessKeys API to list all access key ids for a user, check here for more information. So, by iterating over all users, you could list all access key ids in an account.

profile pictureAWS
전문가
답변함 8달 전

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

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

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

관련 콘텐츠