All technological notes.
AWS KMS (Key Management Service)IAM for authorizationKMS Key usage using CloudTrailSeamlessly integrated into most AWS services (EBS, S3, RDS, SSM…)
KMS Key Encryption also available through API calls (SDK, CLI)KMS Keys
KMS Customer Master KeySymmetric (AES-256 keys)
Symmetric CMKs(Customer Master Key)KMS API to useAsymmetric (RSA & ECC key pairs)
Encrypt/Decrypt, or Sign/Verify operationsPrivate Key unencryptedTypes of KMS Keys:
SSE-S3, SSE-SQS, SSE-DDB (default key)aws/service-nameaws/rds or aws/ebspay for API call to KMS ($0.03 / 10000 calls)
Sample:
KMS Keys in AWS KMS before you are able to use the encryption features for EBS, S3, RDS …
AWS Managed Service keys in KMS, therefore we don’t need to create our own KMS keys.Automatic Key rotation:
Sample:
技术方法
所有权
| Types | Description | Rotation |
|---|---|---|
| AWS Owned Keys | SSE, default, free |
|
| AWS Managed Keys | aws/service-name, free | 1Y |
| Customer managed Keys | create, 1$/month | 1Y, if enable |
| Customer managed Keys | import, 1$/month | manual, alias |

Difference:
Default KMS Key Policy:
root user = entire AWS account (every users)Custom KMS Key Policy:
users, roles that can access the KMS keyCMK in
your account

Identical KMS keys in different AWS Regions that can be used interchangeably
DynamoDB Encryption Client
Global Tables, the client-side encrypted data is replicated to other regionsmulti-region key, replicated in the same region as the DynamoDB Global table, then clients in these regions can use lowlatency API calls to KMS in their region to decrypt the data client-sideclient-side encryption we can protect specific fields and guarantee only decryption if the client has access to an API key
AWS Encryption SDK
Aurora tableAurora Global Tables, the client-side encrypted data is replicated to other regionsmulti-region key, replicated in the same region as the Global Aurora DB, then clients in these regions can use low-latency API calls to KMS in their region to decrypt the data client-sideclient-side encryption we can protect specific fields and guarantee only decryption if the client has access to an API key, we can protect specific fields even from database admins
SSE-S3
SSE-S3 are replicated by defaultSSE-C
SSE-C (customer provided key) are never replicatedSSE-KMS
For objects encrypted with SSE-KMS, you need to enable the option
KMS Key to encrypt the objects within the target bucketKMS Key Policy for the target keyIAM Role with kms:Decrypt for the source KMS Key and kms:Encrypt for the target KMS KeyService Quotas increasemulti-region AWS KMS Keys
multi-region AWS KMS Keys, but they are currently treated as independent keys by Amazon S3. 可以用 multi, 但实际上视作独立
Sample:
SSE-KMS. You have been tasked to replicate the objects to a target bucket in the same AWS region but with a different KMS Key. You have configured the S3 replication, the target bucket, and the target KMS key and it is still not working. What is missing to make the S3 replication work?
kms:Decrypt and Target KMS Key kms:Encrypt to be used by S3 Replication service.AMI in Source Account is encrypted with KMS Key from Source AccountKMS Keys used to encrypted the snapshot the AMI references with the target account / IAM RoleDescribeKey, ReEncrypted, CreateGrant, DecryptKMS key in its own account to re-encrypt the volumes
KMS CMK. You want to share this AMI with another AWS account. You have shared the AMI with the desired AWS account, but the other AWS account still can’t use it. How would you solve this problem?









