Cloud concept · Updated

Credential Rotation - Credential rotation is the controlled replacement of authentication secrets, followed by retirement of the old credentials, to limit their useful lifetime.

In short

Passwords, access keys, tokens, and application secrets can be exposed through compromised systems, accidental disclosure, or excessive distribution. Rotation limits how long a persistent credential remains usable, but it must coordinate changes across the identity system, secret storage, and consuming applications to avoid outages.

Cloud Concepts Hub →

6 key aspects of Credential Rotation

Effective rotation combines secure replacement, coordinated consumer updates, verification, and timely retirement while favoring temporary credentials wherever possible.

01
Complete lifecycle replacement

Generate a replacement, apply it to the authenticating system, update consumers, verify access, and retire the old credential. Updating only the stored secret leaves the rotation incomplete.

02
Preference for temporary credentials

Use roles, federation, and short-lived credentials where supported to reduce dependence on persistent secrets. Ensure applications use credential providers that refresh temporary credentials before they expire.

03
Coordinated application cutover

Account for secret caching, connection pools, deployment timing, and whether the target supports overlapping credentials. Keep any overlap bounded and verify adoption before retiring the old value.

04
Risk-based timing and emergency response

Set rotation schedules according to risk and applicable requirements. Immediately contain suspected credential compromise, including reviewing sessions and previously issued tokens where relevant.

05
Protected storage and limited access

Store credentials centrally with encryption and narrowly scoped retrieval permissions. Give rotation automation only the permissions it needs, and prevent secret values from entering logs.

06
Verification and operational visibility

Test the replacement against the target before completing the cutover. Monitor rotation failures, stale credentials, and unexpected use of retired identities or keys.

Cloud services for Credential Rotation

IAM roles and AWS STS reduce reliance on persistent AWS credentials by providing temporary access. For secrets that must persist, Secrets Manager stores values and coordinates supported rotation workflows, with Lambda implementing target-specific updates when required. Systems Manager Parameter Store can hold encrypted secrets, but storage and parameter notifications alone do not rotate credentials in the target system.

IAM permissions control which applications retrieve secrets and which automation can change them. Applications must refresh credentials and tolerate controlled cutovers. CloudTrail supplies an audit trail of supported management and access operations, while operational monitoring should detect failed rotations and authentication errors.

AWS Secrets ManagerAWS Secrets Manager

Stores secrets and supports automatic rotation through managed rotation for supported integrations or Lambda-based rotation workflows. Successful rotation must update the target system as well as the stored secret, and consumers must retrieve the current value.

AWS Systems ManagerAWS Systems Manager

Parameter Store provides centralized configuration and secret storage, including encrypted SecureString parameters. Parameter policies can support expiration and change notifications, but rotating a target credential requires separate automation or integration.

AWS LambdaAWS Lambda

Runs rotation logic for supported Secrets Manager workflows and custom credential-management automation. Functions need access to the target system and narrowly scoped permissions to generate, apply, test, and store replacement credentials.

AWS CloudTrailAWS CloudTrail

Records supported AWS API activity, including credential-management and secret-access operations, to support investigation and audit. Its records can help establish who changed credentials, when changes occurred, and whether unexpected access followed.

Credential Rotation exam questions

Real practice exam questions on Credential Rotation, with the correct answer and its explanation. Answer them with every option in the exam simulator.

CLF-C02

An application retrieves a third-party payment API token from AWS Secrets Manager. During a security review, a team replaces the stored token with a randomly generated string. The application successfully retrieves the new value, but the payment provider rejects its requests. The original token still works with the provider. What should the team do to complete the credential replacement?

Show answerCORRECT ANSWER

Obtain a replacement token from the payment provider, store it in Secrets Manager, verify that the application uses it successfully, and revoke the original token with the provider.

Complete rotation requires a replacement credential that the authenticating system accepts, delivery to the application, verification, and invalidation of the old credential. Updating secret storage alone does not accomplish this.

MLA-C02 (beta)

A company uses a third-party evaluation platform to invoke foundation models in Amazon Bedrock. The platform supports Bedrock bearer-token authentication but cannot sign requests with AWS Signature Version 4. It imports credentials from the company's secure integration once every 24 hours and cannot refresh them between imports. Evaluation requests run continuously.

Security policy requires replacing the platform's credential at each daily import and invalidating its predecessor after successful authentication with the replacement. The integration can provision credentials and update the platform without interrupting requests.

Which credential choice and replacement procedure meet these requirements?

Show answerCORRECT ANSWER

Create a long-term Amazon Bedrock API key with sufficient validity to cover the next import. Securely import it, verify successful model invocation with it, and then revoke the previous API key.

A long-term Bedrock API key supports bearer-token authentication and can remain valid throughout the 24-hour import interval. Keeping the previous key valid until the replacement is verified preserves availability. Revoking the previous key then completes rotation.

SAP-C03

A company is standardizing AWS CloudFormation templates for new Amazon RDS for PostgreSQL DB instances across its application accounts. Each database must have a unique, automatically generated master password that rotates every 7 days. The selected RDS configuration supports service-managed master credentials.

Security policy prohibits the deployment pipeline and the CloudFormation execution role from retrieving plaintext passwords. Passwords must not be supplied as stack parameters or resolved into resource properties by CloudFormation. Applications already support retrieving database credentials at runtime from a secret ARN. The templates must expose this ARN to the application configuration.

Which solution meets these requirements with the LEAST operational overhead?

Show answerCORRECT ANSWER

Set ManageMasterUserPassword to true on the AWS::RDS::DBInstance resource and omit MasterUserPassword. Use Fn::GetAtt with MasterUserSecret.SecretArn to supply the RDS-managed secret ARN to applications. Use the default RDS-managed rotation schedule.

RDS generates and manages the master password in Secrets Manager and rotates it every 7 days by default. CloudFormation does not need to retrieve or resolve the plaintext password. The MasterUserSecret.SecretArn attribute provides the nonsecret identifier that applications can use for authorized runtime retrieval, without custom password-generation or rotation automation.

Practice Credential Rotation in a full exam

Questions on Credential Rotation in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Credential Rotation

3 min read

Credential rotation replaces an authentication secret and retires its predecessor. A complete rotation changes the credential at the system that validates it, securely distributes the replacement to authorized consumers, verifies successful authentication, and invalidates the old value. Merely generating a new password or updating a secret in storage does not complete rotation if the target system still accepts the old credential.

In cloud environments, first distinguish long-lived credentials from temporary credentials. Long-lived credentials include IAM user access keys, database passwords, and many third-party API secrets. These require explicit lifecycle management. Temporary credentials have an expiration time and are obtained again when needed. For workloads accessing AWS, prefer IAM roles and temporary credentials over embedded IAM user access keys. Supported SDK credential providers can obtain and refresh role credentials without application code handling persistent secrets.

For an unavoidable IAM user access key, a practical rotation sequence is to create a second key, update authorized consumers, verify that requests use the replacement, deactivate the old key, and eventually delete it. An IAM user can have at most two access keys, including inactive keys, so available key slots affect the procedure. Access keys do not automatically expire because of an IAM password policy. Password policies govern IAM user console passwords, including configurable complexity, reuse prevention, and expiration settings; they do not rotate API credentials.

Database password rotation requires coordination between the database and its clients. For example, a rotation workflow can generate a new password, apply it to the database account, test access, and promote the new secret version for application retrieval. AWS Secrets Manager supports automatic rotation through managed integrations or Lambda-based workflows, depending on the secret and target service. Applications must refresh cached secrets appropriately and recover from authentication failures; otherwise, successful rotation can still interrupt connection establishment.

Secret storage and secret rotation are separate capabilities. A central store protects values, controls retrieval, and reduces hard-coded credentials in source repositories and deployment files. AWS Systems Manager Parameter Store can store encrypted SecureString parameters, but parameter expiration notifications or policies do not themselves change credentials in a database or external system. Rotation requires an integration or workflow that updates both the target and its stored value.

Choose rotation timing according to exposure risk, credential capabilities, compliance requirements, and operational constraints. Scheduled rotation can reduce the lifetime of an undiscovered leaked secret, but suspected compromise requires immediate containment rather than waiting for the next schedule. Replace or revoke affected credentials, investigate their use, and address the original exposure. Replacing a password or access key does not necessarily terminate sessions or invalidate temporary credentials already issued; those may need separate controls.

Availability and security can conflict during cutover. Brief overlap between old and new credentials can support a safe rollout when the target accepts both, but it also extends the old credential's usability. Single-password accounts may require carefully timed updates, retries, or an alternating-account strategy. Test failures, partial deployment, stale caches, and recovery procedures before production use. Restrict the rotation workflow's permissions, avoid logging secret values, and alert on failed or overdue rotations.

Finally, credential rotation is not the same as encryption-key rotation. Rotating an AWS KMS key's backing key material does not change database passwords, replace IAM access keys, or automatically re-encrypt existing data. Rotation also does not replace least privilege, multifactor authentication, secure storage, or incident response. For human passwords, arbitrary frequent changes are not a substitute for strong passwords and MFA; use applicable policy requirements and evidence of compromise to guide changes.

Learn Credential Rotation in lessons

10 short lessons on Credential Rotation in 8 certification courses.

and 4 more lessons

Open the lessons