AWS Cloud Certify · Practice exams

AWS KMS for the Security Specialty Exam: Key Policies, Rotation, Deletion and Imported Key Material

AWS KMS is one of the most tested services in the Data Protection domain. The facts below come from the AWS KMS developer guide and focus on what exam questions tend to hinge on: who can use a key, what rotation really changes, and what is reversible.

At a glance

AWS KMS key rotation at a glance
TypeApplies toNotes
Automatic rotationSymmetric encryption keys with key material generated by KMS (AWS_KMS origin)Every 365 days by default, configurable. The key ID does not change.
On-demand rotationSymmetric encryption keys with AWS_KMS origin and with imported (EXTERNAL) key materialWorks whether or not automatic rotation is enabled.
Manual rotationAsymmetric keys, HMAC keys and keys in custom key storesCreate a new key and switch the alias or application.
AWS managed keysKeys AWS manages for youRotated automatically every year; you cannot enable or disable it.

Source: docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html

Key points (16)

KMS · The key policy grants no automatic access

Unlike other resource policies, a KMS key policy does NOT automatically grant permissions to the account. Without the statement that allows the account's root principal, IAM policies that allow use of the key are ineffective (IAM policies that deny still work).

Official source: docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html

KMS · Unmanageable key

If a key policy gives access to only one user and you delete that user, the key becomes unmanageable and you must contact AWS Support. That is why the default policy includes the account's root principal (arn:aws:iam::ID:root).

Official source: docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html

KMS · Key administrators vs key users

Key administrators manage the key but CANNOT use it in cryptographic operations. Careful: they can change the key policy and create grants, so they can give themselves usage permissions. kms:Delete* does not allow ScheduleKeyDeletion.

Official source: docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html

KMS · Grants for AWS services

Key users get CreateGrant, ListGrants and RevokeGrant only when the request comes from an integrated AWS service (condition kms:GrantIsForAWSResource). You can limit it to specific services with kms:ViaService.

Official source: docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html

KMS · Automatic rotation

Automatic rotation only applies to symmetric encryption keys with key material generated by KMS (AWS_KMS origin). By default it rotates every 365 days and the period is configurable. The key ID does not change and KMS keeps the old material to decrypt.

Official source: docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html

KMS · Rotating does not re-encrypt data

Rotation only changes the current key material: it does not rotate data keys or re-encrypt data already protected, and it does not mitigate a compromised data key. Applications and services keep working without changes.

Official source: docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html

KMS · Manual vs automatic rotation

Asymmetric keys, HMAC keys and keys in custom key stores support neither automatic nor on-demand rotation: rotate them manually by creating a new key (and switching the alias). On-demand rotation does work with imported key material (EXTERNAL).

Official source: docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html

KMS · AWS managed keys

KMS automatically rotates AWS managed keys every year (about 365 days) and you cannot enable or disable that rotation. For AWS owned keys, the owning service decides. KMS records the RotateKey event in CloudTrail.

Official source: docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html

KMS · Multi-Region keys and rotation

In multi-Region keys, rotation is a shared property: you enable it and trigger it only on the primary key, and KMS copies the new material to the replicas before using it to encrypt.

Official source: docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html

KMS · Key deletion

Deleting a KMS key requires a waiting period of 7 to 30 days (30 by default) and is irreversible once it ends. While 'Pending deletion', the key cannot be used for cryptographic operations. If in doubt, disable it: it can be re-enabled.

Official source: docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html

KMS · Alarm on use during deletion

During the waiting period you can cancel the deletion and create a CloudWatch alarm that warns you if someone or something tries to use the key. It is logged in CloudTrail when scheduled and when deleted. Only customer managed keys can be deleted.

Official source: docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html

KMS · Deleting an asymmetric encryption key

With an asymmetric ENCRYPT_DECRYPT key, anyone holding the public key can keep encrypting outside KMS without notice, and that data cannot be decrypted after deletion. Alarms cannot detect use of the public key. Consider disabling it.

Official source: docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html

KMS · Imported key material (BYOK)

With imported key material you remain responsible for the material, but KMS uses a copy. It cannot be imported into custom key stores. It is useful to prove the entropy source or to set an expiration and be able to delete it manually.

Official source: docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html

KMS · Deleting imported material vs deleting the key

Deleting imported key material is temporary and reversible: you import it again. Deleting the KMS key (after 7-30 days) is irreversible. With expired or deleted imported material, the key is unusable until you reimport it.

Official source: docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html

KMS · Symmetric ciphertext can't be recreated

A symmetric ciphertext is cryptographically bound to its KMS key: even if you recreate a key with the same material, it cannot decrypt it. With asymmetric or HMAC keys you can recreate an equivalent one (with a different key ID).

Official source: docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html

KMS · Alarm for imported material expiration

Create a CloudWatch alarm that warns you when imported material is about to expire: when any material expires or is deleted, the KMS key stops working. You can also reimport it or import new material for on-demand rotation.

Official source: docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html

Where this fits in the exam

Practice this topic

Answer practice questions, then review your mistakes with spaced repetition.

Start a test

More study topics