AWS Key Management Services (KMS)
Last updated
Last updated
When data is moved into the cloud, it is best to secure it at both the stages - when data is in transit and when the data is at rest and one of the services from AWS that can be foundational into dealing with keys for encryption is KMS or Key Management Service, mainly used to provide, store and manage encryption keys for data at rest.
Note that KMS also allows auditing of who used the KMS keys with the help of . It is also possible to exercise access control to KMS keys by creating usage policies.
KMS allows centralized key management that has compatibility to a variety of other AWS services.
AWS KMS facilitates the creation of both Symmetric key and Asymmetric keys (like for EC2 access over ssh)
KMS keys can be of two types:
Customer Master Keys (CMKs) - It can be customer managed (uploaded by the customer or generated by KMS for the customer) or AWS-managed (generated in KMS by AWS whenever required). It can act as one of the input in generating unique data keys as well as used to encrypt and decrypt the generated data keys, i.e. CMKs can act as Key encryption keys and this process is known as Envelope Encryption
Data Encryption Keys - It is also known as data keys, which is used to encrypt and decrypt the data. Note that master key never leaves the KMS and DEK generated each time is unique, for better security.
Using the keys in KMS, AWS encrypts and decrypts the data in S3 or s3 glacier or EBS or EFS or FSx or RedShift or RDS or Amazon EMR and even CloudTrail. This process is called Server-Side Encryption. Different flavours of SSE are as follows:
Server Side Encryption using AWS Managed Keys (SSE-KMS) - Data Encryption key (DEK) is used, which itself is encrypted using Customer Master Key.
Server Side Encryption using Customer Provided Encryption key (SSE-C) - The customer generated key is uploaded into KMS is used for encryption data directly, unlike in previous case, where DEK (data encryption key) is generated using Customer Master key
There is something called Client-Side Encryption, where the client only supplies 256-bit key and key encrypting key and encrypt the data and encrypted blob is directly uploaded as it is (encrypted) in s3.
Please note that it is essential for KMS Administrative tasks such as
Control access to IAM users and role that can administer and may or may not use the key
Rotate the keys
Disable keys and Re-enable keys when required
Audit the usage of keys
AWS Console for KMS keys shows the following options:
<-will be added later->
<-will be added later->