lacework-global-116
Rotate access keys every 45 days or less
Description
Access keys consist of an access key ID and secret access key, used to sign programmatic requests that you make to AWS. AWS users need their own access keys to make programmatic calls to AWS from the AWS Command Line Interface (AWS CLI), Tools for Windows PowerShell, the AWS SDKs, or direct HTTP calls using the APIs for individual AWS services. Best practices recommend that all access keys be regularly rotated.
Remediation
Perform the following to rotate access keys:
- Log in to the AWS Management Console.
- Click Services.
- Click Identity and Access Management (IAM).
- Click Users.
- Select a user.
- Click Security Credentials.
- As an Administrator, click Make Inactive for keys not rotated in 45 days.
- As an IAM User, click Make Inactive or Delete for keys not rotated or used in 45 days.
- Click Create Access Key.
- Update programmatic call with new Access Key credentials.
Using the AWS CLI:
Create a second access key:
aws iam create-access-key
Update all applications and tools to use the new access key.
Check if the first access key is still in use:
aws iam get-access-key-last-used
If the first access key is no longer in use, change the state of the first access key to Inactive:
aws iam update-access-key
Use the new access key to confirm that applications are working.
Allow all applications and tools time to update, then delete the first access key:
aws iam delete-access-key