Where do I find access key in AWS console? - amazon-web-services

I'm using an Access Key and Secret Key to access S3 from an app. It works. But I can't find the credentials in the console. Where might they be? They're not listed under IAM users.

The IAM Access Key and Secret Key are located (i.e. the option to create them) in IAM user's Summary in Security Credentials tab.
Edit: based on #jarmod comment.

Related

secret manager - hide secret in AWS console

I am creating a new secret in AWS secret manager from the AWS console
I used default encryption key to encrypt it.
When I retrieve the secret from console I see it as plain text.
Can the secret be encrypted (not see it as plain text) and saved in AWS console
By default access to AWS secret manager is private and not allow to any IAM users or roles. The fact that you or someone else can view them, means they have been explicitly allowed to access the secrets.
Thus, if you have any users who should not see the secrets, deny them secretsmanager:GetSecretValue permissions or any actions that you don't want them to be able to perform.

how to generate Access key & secret key for AWS roles

I want to manage the my AWS environment using PowerShell. We are getting access through IAM roles. I am facing trouble to generate the Access key & secret key for my IAM role. Can someone guide me how can i generate these keys.
An IAM Role can only be used by an IAM User. This is because the User needs to authenticate to AWS to prove that they are that user. This will then provide IAM User credentials.
If you then wish to use a role, you can use the User credentials to call Use-STSRole, which will assume the role and return a set of credentials associated with the Role. (Note: The credentials will expire after a period of time, typically one hour.)
For more details, see: Switching to an IAM Role (Tools for Windows PowerShell)
You do not generate IAM Access Key / Secret Key for roles. AWS generates these for you and makes them available in the instance's metadata.
The AWS Tools for Windows PowerShell will automatically extract the access key / secret key from the instance's metadata if you have installed PowerShell and the AWS Tools correctly.
This link will provide more information about PowerShell and IAM Roles:
IAM Roles for EC2
[Update after new comment]
If your goal is to generate IAM access keys for a new user, login to the AWS console, go to IAM, go to users, Add User, click "Programmatic access", then Set permissions for the user and finish by creating the user. On the next screen will be the access keys. You need to download (or copy) the Secret access key as it will NOT be shown again.
For an existing user, click on the user, click on the "Security credentials" tab, then click the "Create access key" button. Copy or download the keys. Note: You cannot access previously created access keys. If you have lost the secret access key, then you have to generate new ones.
Managing Access Keys for Your AWS Account
According to AWS Doc there is a way through API:
TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \
&& curl -H "X-aws-ec2-metadata-token: $TOKEN" –v http://169.254.169.254/latest/meta-data/iam/security-credentials/*role_name*
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html

how to get AWS access key ID & secret access key from .pem file

I have the .PEM file for my AWS account. How to get AWS access key ID & secret access key to login to AWS CLI?
I am trying to configure my AWS CLI in windows using the command aws configure in command line. Its asking me parameters like
Access Key ID:
Secret Access Key:
I am not sure how to get these !! I only have .PEM file
I also don't have access to create one under the tab My Security Credentials->Users->Security Credentials
the .pem file allows you to connect to an ec2 instance that you have created.
the AWS access key id and AWS secret access key are information about your account and not linked to a specific instance. They are available when you create the account and after are not revealed to you
You can read this blog post from amazon to get more information why and how to get a new one. I'd always recommend to create a dedicated user to be used for the CLI even if you're the only one working on the account.
You need to contact your company's IT administrator, or whomever created the instance for you. They should be able to access your credentials and send it over to you. I had the same issue because I thought my .pem file was the correct credentials, but it was not. Once you obtain the access key ID and secret access key, you can then enter it in the following fields (it may have a slightly different terminology for these prompts, but you should get the idea):
access key ID:
secret access key:
region code: # This could be found on your management console (e.g. us-virginia-1)
Clarification: The .pem file contains the RSA private key, this is NOT what you need for configuring your AWS-CLI, the correct credentials will instead be referred to as 'access key ID' and 'secret access key', respectively.

What is aws_access_key_id and aws_secret_access_key in AWS?

I've signed up for a new AWS account and generated a new keypair. I've got the PEM file.
I start a new instance and log into it. I'm trying to do an 'aws configure' but its asking for aws_access_key_id and aws_secret_access_key. What are these? I've just got this PEM file.
AWS Security Credentials
When you interact with AWS, you use AWS security credentials to verify who you are and whether you have permission to access the resources that you are requesting. In other words, security credentials are used to authenticate and authorize calls that you make to AWS.
Types of Security Credentials
Access keys (access key ID and secret access key)
Access keys consist of an access key ID (like AKIAIOSFODNN7EXAMPLE) and a secret access key (like wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY). You use access keys to sign programmatic requests that you make to AWS whether you're using the AWS SDK, REST, or Query APIs.... Access keys are also used with command line interfaces (CLIs).
Finally, under How Do I Get Security Credentials?
Access keys (access key ID and secret access key)
... You can create new access keys for the account by going to the Security Credentials page. In the Access Keys section, click Create New Access Key.

Log in to AWS using Access Key ID and Secret Access Key ID

In AWS, how do I use my Access Key ID and Secret Access Key?
I can't use them in IAM users sign-in link.
Access Key ID and Secret Access Key are for API/CLI/SDK access. For IAM sign-in (dashboard) you need the username and password. When a new IAM user is added, the user gets username, password, access key and secret key, and the IAM URL from the IAM admin.
To complement helloV's answer : you can also use the access key and secret key to generate a signed URL to the console. This signed URL will allow to access the console, without being prompted for username and password.
Many AWS customers are using this technique to provide single-sign on for Federated users.
More details are available at : http://docs.aws.amazon.com/STS/latest/UsingSTS/STSMgmtConsole-manualURL.html
Just to add, for anyone who might need it, if your intent is to use the AWS CLI, running aws configure will prompt you for both.