SEC08-BP01 Implement secure key management
Secure key management covers how you generate, store, control access to, rotate, and monitor key material across its lifecycle. Treat keys as the most sensitive asset in your workload
Desired outcome:
-
You have an automated, repeatable key management mechanism that scales across your workloads.
-
Your access to key material follows least privilege, and no human operator can read key material in plaintext.
-
You monitor key usage, and you rotate key material through an automated process.
-
Your key management balances the availability, confidentiality, and integrity of key material.
Common anti-patterns:
-
Teams allow human operators to access unencrypted key material.
-
Developers write custom cryptographic algorithms instead of using vetted, standard implementations.
-
Administrators grant overly broad permissions to key material.
-
Teams store keys without audit logging, so key operations go unreviewed.
-
Teams schedule key deletion without a review process, and lose the data the key protected.
Benefits of establishing this best practice:
-
Your content is protected against unauthorized access, because access to the keys is tightly scoped and monitored.
-
You can demonstrate technical controls that align with regulatory requirements to encrypt data.
-
Automated rotation and centralized policy reduce the manual work and human error that lead to key exposure.
-
Audit logs of key operations give you an investigation trail for suspected misuse.
Level of risk exposed if this best practice is not established: High
Implementation guidance
Most encryption at scale uses envelope encryption, where a data key encrypts the data and a separate key encrypts the data key. This guards large volumes of data with a small number of tightly controlled root keys, so the security of your data depends on how well you protect those root keys. A dedicated key management system gives you secure storage, access control, rotation, and audit logging in one place.
You choose between AWS managed and customer managed keys. Managed keys, which AWS generates and rotates, remove operational burden when you do not need direct control over the key material. Customer managed keys give you control over rotation, access policy, and deletion, at the cost of more administration. Choose customer managed keys when data sensitivity, data sovereignty, or regulatory obligations require you to own the key policy and rotation schedule. Otherwise, use managed keys.
Where you store keys is an organizational decision. In a
multi-account structure, keeping keys in the same account as the
workload assigns ownership to the team that runs the workload. A
centralized key account fits when one key is shared across several
accounts, as it requires cross-account policies and concentrates
control and risk.
AWS Key Management Service (AWS KMS) provides durable,
redundant key storage backed by hardware security modules, and
many AWS services integrate with it
Key policies are the primary access control for a KMS key, alongside IAM policies and grants that let services encrypt and decrypt on your behalf. Overly broad key permissions negate the value of encryption, so review the guidance for access control to your keys and keep grants narrow.
Without monitoring, a principal under unauthorized control can decrypt data without any oversight for the access pattern change. Log key operations and review them, paying particular attention to changes in volume and destruction events.
Deleting a key destroys every ciphertext it protected. AWS KMS enforces a mandatory waiting period before deletion, defaulting to 30 days with a 7-day minimum, which gives administrators time to cancel an accidental or unauthorized deletion.
Implementation steps
-
Choose the key type for each use case: Decide between AWS managed and customer managed keys based on the control, sovereignty, and rotation requirements you established in guidance. For most services, AWS owned or AWS managed keys provide encryption at rest without managing key material or policies. When you need custom key storage, evaluate AWS CloudHSM
or the external key store. -
Map how each service integrates with AWS KMS: Review the services in your workload to understand their encryption options. See how AWS services use AWS KMS and the Encryption at Rest topic in each service guide. Confirm downstream artifacts inherit encryption, such as snapshots created from encrypted volumes.
-
Provision keys and scope access: Create keys in AWS KMS and apply key policies and IAM policies that grant least privilege. Follow the best practices for access control to your keys, and keep no human operator able to read key material in plaintext.
-
Detect overly broad key policies: Enable IAM Access Analyzer to review and alert on permissive key policies. Add custom policy checks to confirm that a policy update does not grant public access to a key.
-
Add client-side envelope encryption where needed: When your application must encrypt data before it reaches storage, use the AWS Encryption SDK with AWS KMS integration to implement envelope encryption.
-
Enable configuration monitoring for keys: Turn on AWS Security Hub CSPM to receive findings for misconfigured key policies, keys scheduled for deletion, and keys without automated rotation.
-
Set the right logging level for key activity: Log KMS operations in AWS CloudTrail and review them periodically. Because read-only KMS events are logged and can be voluminous, consider a separate trail for KMS activity and pay particular attention to key destruction events.
Resources
Related best practices:
Related documents:
Related videos: