ladderlore
  • Type a service name, like S3 or IAM.

Concept

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
The three kinds of credentials.

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.

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
The three kinds of credentials.
  • Secrets Manager

    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 an application should keep its secrets.

1 / 2

  • Secrets Manager

    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

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 an application should keep its secrets.

What it is

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.

What it is

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.

What it is

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.

Remember

  • 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.

Remember

  • Database passwords, API keys and other secrets belong in Secrets Manager, which can also rotate them.

On the exam

  • “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.