概念
Access keys, passwords and secrets
The credentials that prove who you are, how to keep them safe, and where applications should store their secrets.
このレッスンはまだ翻訳されていないため、英語で表示しています。
Password
- Used for
- Signing in to the AWS Management Console
- How long it lasts
- Until it is changed or expires
- Good practice
- A strong password policy, plus MFA
Access keys
- Used for
- The AWS CLI, SDKs and direct API calls
- How long it lasts
- Until they are deleted
- Good practice
- Avoid them if you can. Otherwise rotate them and keep them out of code.
Temporary credentials
- Used for
- Roles, IAM Identity Center and federation
- How long it lasts
- One short session, then they expire
- Good practice
- The recommended choice for people and applications
| Credential | Used for | How long it lasts | Good practice |
|---|---|---|---|
| Password | Signing in to the AWS Management Console | Until it is changed or expires | A strong password policy, plus MFA |
| Access keys | The AWS CLI, SDKs and direct API calls | Until they are deleted | Avoid them if you can. Otherwise rotate them and keep them out of code. |
| Temporary credentials | Roles, IAM Identity Center and federation | One short session, then they expire | The recommended choice for people and applications |
1 / 2
Password
- Used for
- Signing in to the AWS Management Console
- How long it lasts
- Until it is changed or expires
- Good practice
- A strong password policy, plus MFA
Access keys
- Used for
- The AWS CLI, SDKs and direct API calls
- How long it lasts
- Until they are deleted
- Good practice
- Avoid them if you can. Otherwise rotate them and keep them out of code.
| Credential | Used for | How long it lasts | Good practice |
|---|---|---|---|
| Password | Signing in to the AWS Management Console | Until it is changed or expires | A strong password policy, plus MFA |
| Access keys | The AWS CLI, SDKs and direct API calls | Until they are deleted | Avoid them if you can. Otherwise rotate them and keep them out of code. |
2 / 2
Temporary credentials
- Used for
- Roles, IAM Identity Center and federation
- How long it lasts
- One short session, then they expire
- Good practice
- The recommended choice for people and applications
| Credential | Used for | How long it lasts | Good practice |
|---|---|---|---|
| Temporary credentials | Roles, IAM Identity Center and federation | One short session, then they expire | The recommended choice for people and applications |
- Best for
- Database passwords, API keys and tokens
- Automatic rotation
- Yes, on a schedule
- Cost
- Charged per secret and per request
Systems ManagerParameter Store
- Best for
- Settings such as URLs and IDs, and simple encrypted values
- Automatic rotation
- No
- Cost
- Standard parameters at no extra charge
Written into the code
- Best for
- Nothing. Anyone who can read the code can read the secret.
- Automatic rotation
- Only by changing and redeploying the code
- Cost
- Free, but the risk is high
| Where | Best for | Automatic rotation | Cost |
|---|---|---|---|
| Database passwords, API keys and tokens | Yes, on a schedule | Charged per secret and per request | |
| Settings such as URLs and IDs, and simple encrypted values | No | Standard parameters at no extra charge | |
| Written into the code | Nothing. Anyone who can read the code can read the secret. | Only by changing and redeploying the code | Free, but the risk is high |
1 / 2
- Best for
- Database passwords, API keys and tokens
- Automatic rotation
- Yes, on a schedule
- Cost
- Charged per secret and per request
Systems ManagerParameter Store
- Best for
- Settings such as URLs and IDs, and simple encrypted values
- Automatic rotation
- No
- Cost
- Standard parameters at no extra charge
| Where | Best for | Automatic rotation | Cost |
|---|---|---|---|
| Database passwords, API keys and tokens | Yes, on a schedule | Charged per secret and per request | |
| Settings such as URLs and IDs, and simple encrypted values | No | Standard parameters at no extra charge |
2 / 2
Written into the code
- Best for
- Nothing. Anyone who can read the code can read the secret.
- Automatic rotation
- Only by changing and redeploying the code
- Cost
- Free, but the risk is high
| Where | Best for | Automatic rotation | Cost |
|---|---|---|---|
| Written into the code | Nothing. Anyone who can read the code can read the secret. | Only by changing and redeploying the code | Free, but the risk is high |
概要
A person uses a password to sign in to the AWS Management Console. A program uses access keys to call AWS through the AWS Command Line Interface (AWS CLI), an SDK or the API. An access key has two parts, an access key ID and a secret access key, and they are used together. The passwords and access keys of IAM users are long-term: they keep working until someone changes or deletes them, or until a password expires.
概要
Long-term credentials can leak, so AWS recommends temporary credentials: roles for applications, and IAM Identity Center for people. If an IAM user must have access keys, rotate them, never share them and never put them in code. The root user should have no access keys at all. A password policy sets rules for IAM user passwords, such as minimum length, required character types, expiry and no reuse. It does not apply to the root user.
概要
Applications also have secrets of their own, such as database passwords and API keys. Store them in AWS Secrets Manager, which can rotate them automatically. AWS Systems Manager Parameter Store is a low-cost place for settings and simple encrypted values.
覚えること
- Console = password. AWS CLI, SDKs and API = access keys.
- The secret access key is shown only once, when the key is created.
- Prefer temporary credentials from roles and IAM Identity Center.
- Never put access keys or passwords in code or in a code repository.
- A password policy applies to IAM users, not to the root user.
覚えること
- Database passwords, API keys and other secrets belong in Secrets Manager, which can also rotate them.
試験では
- “Require a minimum password length and complexity for IAM users” points to an IAM password policy.
- “Store database credentials and rotate them automatically” points to AWS Secrets Manager. “Store configuration values at no extra cost” points to Systems Manager Parameter Store.
混同しやすいもの
AWS Secrets ManagerKeeps secrets such as database passwords and API keys out of your code, and rotates them automatically.
AWS Systems ManagerOne place to operate your servers: patch them, run commands, connect securely and store settings.
- Authentication methodsThe ways people and applications prove who they are to AWS: passwords, MFA, single sign-on and roles.