Learn about the importance of rotating IAM user access keys every 90 days.
Rule | IAM user access keys should be rotated at least every 90 days |
Framework | NIST Cybersecurity Framework (CSF) v1.1 |
Severity | ✔ Low |
IAM User Access Key Rotation Policy
Description
In accordance with the NIST Cybersecurity Framework (CSF) v1, it is essential to rotate IAM user access keys at least every 90 days. Access keys are used to authenticate and authorize requests made to Amazon Web Services (AWS) APIs. Regular rotation of these keys helps mitigate the risk of unauthorized access and potential security breaches.
Troubleshooting Steps
If you encounter issues during IAM user access key rotation, follow these troubleshooting steps:
Verify IAM User Credentials: Ensure that you have the necessary permissions and credentials to perform access key rotation. Check if you are part of a group with
IAMUserChangePassword
and IAMUserAccessKeyRotate
permissions.Check Access Key Status: Validate the status of the access key you are attempting to rotate. Navigate to the AWS Management Console, access the IAM service, and go to the "Users" section. Select the relevant IAM user and check if the access key is active or inactive.
Validate IAM User Policy: Confirm that the IAM user's policies do not explicitly disable key rotation. Review the attached IAM policy document to verify that it does not contain
iam:UpdateAccessKey
or other relevant statements that may prevent key rotation.Rotate Access Key Using AWS CLI: If the access key is active and there are no policy restrictions, rotate the key using AWS Command Line Interface (CLI) commands. Proceed to the remediation steps below for a step-by-step guide on key rotation using CLI.
Necessary Codes
There are no specific codes required for this rule. However, you may need to utilize AWS CLI commands for access key rotation, as mentioned in the remediation steps below.
Remediation Steps
Using AWS Management Console
Sign in to the AWS Management Console using appropriate IAM user credentials.
Open the IAM service dashboard.
Navigate to the "Users" section.
Select the IAM user for which access key rotation is required.
In the "Security credentials" tab, locate the access key to be rotated.
Click on the "Rotate now" button next to the access key.
Take note of the new access key and secret access key generated.
Update any applications or environments that use the old access key with the newly generated one.
Using AWS CLI
Install and configure AWS CLI on your local machine if not already done.
Open a terminal or command prompt.
Run the following AWS CLI command to rotate the access key:
aws iam update-access-key --access-key-id <EXISTING_ACCESS_KEY_ID> --status Inactive --user-name <YOUR_USERNAME>
Replace
<EXISTING_ACCESS_KEY_ID>
with the access key ID you want to rotate, and <YOUR_USERNAME>
with your IAM username.The command will set the existing access key status to inactive.
Run the following command to create a new access key:
aws iam create-access-key --user-name <YOUR_USERNAME>
Replace
<YOUR_USERNAME>
with your IAM username.Note down the new access key ID and secret access key generated by the command.
Update any applications or environments that use the old access key with the newly generated one.
Disable or remove the old access key if no longer needed:
aws iam delete-access-key --access-key-id <EXISTING_ACCESS_KEY_ID> --user-name <YOUR_USERNAME>
Replace
<EXISTING_ACCESS_KEY_ID>
with the access key ID you want to disable or remove, and <YOUR_USERNAME>
with your IAM username.Conclusion
Rotating IAM user access keys every 90 days is crucial for maintaining the security of your AWS resources. By following the provided troubleshooting steps and remediation guidelines, you can ensure compliance with the NIST Cybersecurity Framework and mitigate potential security risks.