This rule states that IAM user access keys should be rotated at least every 90 days.
Rule | IAM user access keys should be rotated at least every 90 days |
Framework | General Data Protection Regulation (GDPR) |
Severity | ✔ Low |
Rule Description
IAM user access keys should be rotated at least every 90 days to comply with the General Data Protection Regulation (GDPR). This rule ensures that access keys used by IAM users to access AWS services are regularly refreshed, reducing the risk of unauthorized access and potential data breaches.
Access keys are long-term credentials associated with an IAM user that allow programmatic access to AWS services. Rotating these keys periodically improves the security posture of AWS accounts and aligns with GDPR requirements.
Troubleshooting Steps
If an IAM user's access keys are not rotated within the specified time period, the following troubleshooting steps can be taken:
Necessary Code
To enforce access key rotation for IAM users every 90 days, you can use an IAM policy with the following code snippet:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "RotateAccessKeys",
"Effect": "Deny",
"Action": [
"iam:CreateAccessKey"
],
"Resource": [
"arn:aws:iam::123456789012:user/*"
],
"Condition": {
"NumericLessThanEquals": {
"aws:TimeSinceLastAccessKeyRotated": "7776000"
}
}
}
]
}
This IAM policy denies the creation of new access keys for IAM users whose existing access keys have not been rotated within the last 90 days (7776000 seconds).
Step-by-Step Guide for Remediation
Follow these steps to remediate the access key rotation violation: