Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find the owner of an AWS Access Key

I have a service which uses an AWS Access Key to push stuff to S3. I am going to sunset the service and I have the AWS Access Key and Secret. However, I can't find this key in the IAM or security credentials for the account.

Is there a way to enumerate all the access keys for an entire AWS account?

like image 251
timsabat Avatar asked Jun 04 '14 03:06

timsabat


People also ask

How do I find the owner of a AWS account?

Sign in to the AWS Management Console as a federated user with an IAM role. In the Amazon S3 console, choose a bucket name to view details about a bucket. Choose Permissions, and then choose Access Control List. At the top of the page, under Access for bucket owner, the canonical user ID for the AWS account appears.

Is the AWS access key ID a secret?

To access AWS, you will need to sign up for an AWS account. Access keys consist of an access key ID and secret access key, which are used to sign programmatic requests that you make to AWS.

What is the difference between access key and secret key in AWS?

Access Keys are used to sign the requests you send to Amazon S3. Like the Username/Password pair you use to access your AWS Management Console, Access Key Id and Secret Access Key are used for programmatic (API) access to AWS services. You can manage your Access Keys in AWS Management Console.

Which entity is associated with an access key ID and Secret access key?

An IAM user is an entity that represents a person or service. Can be assigned: An access key ID and secret access key for programmatic access to the AWS API, CLI, SDK, and other development tools.


1 Answers

If you don't have access to your account's primary access key, but you do have an access key with sufficient access to IAM, you can enumerate all the users in the account and then list the access keys for each of them. For example:

for user in $(aws iam list-users --output text | awk '{print $NF}'); do     aws iam list-access-keys --user $user --output text done 
like image 84
Jonathan Kamens Avatar answered Oct 08 '22 08:10

Jonathan Kamens