Ensure rotation for customer-created symmetric CMKs is enabled
Description
AWS Key Management Service (KMS) allows customers to rotate the backing key, which is key material stored within the KMS that is tied to the key ID of the customer-created customer master key (CMK). The backing key is used to perform cryptographic operations such as encryption and decryption. Automated key rotation currently retains all prior backing keys so that decryption of encrypted data can occur transparently. It is recommended that CMK key rotation be enabled for symmetric keys. Key rotation cannot be enabled for any asymmetric CMK.
Rationale
Rotating encryption keys helps reduce the potential impact of a compromised key, as data encrypted with a new key cannot be accessed with a previous key that may have been exposed. Keys should be rotated every year or upon an event that could result in the compromise of that key.
Impact
Creation, management, and storage of CMKs may require additional time from an administrator.
Audit Procedure
Using AWS Console
- Sign in to the AWS Management Console and open the KMS console at: https://console.aws.amazon.com/kms.
- In the left navigation pane, click
Customer-managed keys. - Select a customer-managed CMK where
Key spec = SYMMETRIC_DEFAULT. - Select the
Key rotationtab. - Ensure the
Automatically rotate this KMS key every yearbox is checked. - Repeat steps 3-5 for all customer-managed CMKs where
Key spec = SYMMETRIC_DEFAULT.
Using AWS CLI
- Run the following command to get a list of all keys and their associated
KeyIds:
aws kms list-keys
- For each key, note the KeyId and run the following command:
aws kms describe-key --key-id <key-id>
- If the response contains
"KeySpec = SYMMETRIC_DEFAULT", run the following command:
aws kms get-key-rotation-status --key-id <kms-key-id>
- Ensure
KeyRotationEnabledis set totrue. - Repeat steps 2-4 for all remaining CMKs.
- Alternatively, the following command can be used to check all keys more comprehensively:
KEY_IDS=$(aws kms list-keys --query "Keys[].KeyId" --output text)
for KEY_ID in $KEY_IDS; do
aws kms get-key-rotation-status --key-id "$KEY_ID" --query "{KeyId:KeyId,RotationEnabled:KeyRotationEnabled}" --output table
done
Expected Result
All customer-managed symmetric CMKs (KeySpec = SYMMETRIC_DEFAULT) have KeyRotationEnabled set to true.
Remediation
Using AWS Console
- Sign in to the AWS Management Console and open the KMS console at: https://console.aws.amazon.com/kms.
- In the left navigation pane, click
Customer-managed keys. - Select a key with
Key spec = SYMMETRIC_DEFAULTthat does not have automatic rotation enabled. - Select the
Key rotationtab. - Check the
Automatically rotate this KMS key every yearbox. - Click
Save. - Repeat steps 3-6 for all customer-managed CMKs that do not have automatic rotation enabled.
Using AWS CLI
- Run the following command to enable key rotation:
aws kms enable-key-rotation --key-id <kms-key-id>
Default Value
By default, automatic key rotation is disabled for customer-managed symmetric CMKs. Key rotation must be explicitly enabled after key creation.
References
- https://aws.amazon.com/kms/pricing/
- https://csrc.nist.gov/publications/detail/sp/800-57-part-1/rev-5/final
- CCE-78920-6
CIS Controls
| Controls Version | Control | IG 1 | IG 2 | IG 3 |
|---|---|---|---|---|
| v8 | 3.11 Encrypt Sensitive Data at Rest - Encrypt sensitive data at rest on servers, applications, and databases containing sensitive data. | x | x | |
| v7 | 14.8 Encrypt Sensitive Information at Rest - Encrypt all sensitive information at rest using a tool that requires a secondary authentication mechanism not integrated into the operating system. | x |
MITRE ATT&CK Mappings
| Techniques / Sub-techniques | Tactics | Mitigations |
|---|---|---|
| T1530 | TA0009 | M1041 |
Profile
Level 2 | Automated