服务 · Security, Identity, and Compliance · 基于 CLF-C02
AWS Key Management Service (AWS KMS)
Who may use a key, which key type, how keys rotate and delete, and where KMS limits you.
本课尚未翻译,暂以英文显示。
你在云从业者中已学过
- KMS creates and controls encryption keys, and logs every use in CloudTrail.
- Keys can be customer managed, AWS managed or AWS owned.
- KMS keys encrypt data keys, not the data itself.
Control who can use the key
- Key policy, with IAM
A service uses the key for one resource
- Grant, created by the service
Same key in two Regions
- Multi-Region key
Sign, or encrypt outside AWS
- Asymmetric key
Rotate every year with no work
- Automatic rotation
| Need | Choose |
|---|---|
| Control who can use the key | Key policy, with IAM |
| A service uses the key for one resource | Grant, created by the service |
| Same key in two Regions | Multi-Region key |
| Sign, or encrypt outside AWS | Asymmetric key |
| Rotate every year with no work | Automatic rotation |
AWS managed key
- Automatic every year, not configurable
Customer managed key
- Optional, yearly by default, or on demand
Imported key material
- Not automatic. On demand, or switch to a new key
Asymmetric key
- Manual: new key and alias
| Key type | Rotation |
|---|---|
| AWS managed key | Automatic every year, not configurable |
| Customer managed key | Optional, yearly by default, or on demand |
| Imported key material | Not automatic. On demand, or switch to a new key |
| Asymmetric key | Manual: new key and alias |
是什么
Every KMS key has one key policy, and it is the main control. IAM policies work for a key only if the key policy allows it, usually by trusting the account. A grant is a temporary permission that a service such as EBS or RDS uses for you. For cross-account use, the key policy must allow the other account, and the other account’s IAM policy must allow its own users.
是什么
Symmetric keys are the default, and the key never leaves KMS. Asymmetric keys have a public part you can export, for signing or for encryption outside AWS. Multi-Region keys have the same key ID and key material in several Regions. Use them for encrypting in one Region and decrypting in another, as in DynamoDB global tables.
是什么
Automatic rotation is optional for customer managed keys and runs every year by default. You can set a custom period, or rotate on demand. KMS keeps old key material, so old data still decrypts. Keys with imported key material do not rotate automatically, and neither do asymmetric keys. AWS managed keys always rotate every year. To delete a key, you schedule deletion with a waiting period of 7 to 30 days. The key cannot be used during the wait.
Each account has a request quota per Region for KMS API calls. Busy workloads can hit throttling. Fewer calls come from S3 Bucket Keys and from caching data keys.
要记住
- The key policy is required. IAM works only if the key policy allows it.
- Cross-account: both the key policy and the other account’s IAM policy must allow.
- Multi-Region keys: the same key in several Regions.
- Rotation: yearly by default, custom period or on demand. Imported material: no automatic rotation.
要记住
- Deletion waits 7 to 30 days. Disable a key to stop use without deleting.
- Reduce KMS calls with S3 Bucket Keys and data key caching.
考试中
- “Let another account decrypt data with our key” points to a key policy that allows the other account.
- “Encrypt in one Region and decrypt in another with the same key” points to a multi-Region key.
- “Rotate keys every year with no effort” points to automatic key rotation.
- “Throttling from KMS under heavy S3 load” points to S3 Bucket Keys.
别和这些弄混
AWS CloudHSMDedicated HSMs for compliance, or KMS keys backed by your own HSM cluster.
AWS Secrets ManagerRotate and share secrets across accounts and Regions, and choose it or Parameter Store.
AWS Certificate Manager (ACM)Which certificate, how to validate it, where it can attach, and the Region rule for CloudFront.