This rule states that IAM user access keys should be rotated every 90 days to enhance security.
Rule | IAM user access keys should be rotated at least every 90 days |
Framework | FedRAMP Low Revision 4 |
Severity | ✔ Low |
Rule Description:
The rule requires that IAM user access keys be rotated at least every 90 days to comply with the FedRAMP Low Revision 4 security requirements. Access keys are used by IAM users to authenticate and access AWS services. Rotating access keys regularly minimizes the risk of unauthorized access and potential security breaches.
Troubleshooting Steps:
If access keys are not rotated within the specified timeframe, the following troubleshooting steps can be followed:
Necessary Code:
The following is an example of code that can be used to rotate IAM user access keys:
# Getting a list of IAM users aws iam list-users # Rotating an IAM user's access key aws iam create-access-key --user-name <IAM_USER_NAME> # Make note of the new AccessKeyId and SecretAccessKey values # Disabling an IAM user's old access key aws iam update-access-key --access-key-id <OLD_ACCESS_KEY_ID> --status Inactive --user-name <IAM_USER_NAME>
Step-by-Step Guide for Remediation:
Identify the IAM users: Use the AWS CLI command
aws iam list-users
to retrieve a list of IAM users within your AWS account.Determine access key age: Review the creation date of each access key for the IAM users identified in step 1. Calculate the duration since the access keys were last rotated.
Rotate access keys: For each IAM user whose access keys have exceeded the 90-day rotation period, generate new access keys using the AWS CLI command
aws iam create-access-key --user-name <IAM_USER_NAME>
. Make note of the new AccessKeyId and SecretAccessKey values.Disable old access keys: To prevent the use of old access keys, disable them using the AWS CLI command
aws iam update-access-key --access-key-id <OLD_ACCESS_KEY_ID> --status Inactive --user-name <IAM_USER_NAME>
. Replace <OLD_ACCESS_KEY_ID>
with the ID of the old access key and <IAM_USER_NAME>
with the IAM user's name.Test new access keys: Ensure that the new access keys are properly configured and provide the necessary permissions by attempting to access the required AWS resources or services using the new access keys. If there are any issues, verify the IAM user's permissions and troubleshoot accordingly.
Repeat steps 3-5 for any other IAM users identified in step 2.
By following these steps, you can ensure that IAM user access keys are rotated within the required timeframe, meeting the FedRAMP Low Revision 4 security requirement.