AWS - KMS (Key Management Service)

  KMS   It is used for the encryption and decryption of data in the AWS environment Types Symmetric If the same key is used to encrypt or de...


  It is used for the encryption and decryption of data in the AWS environment



If the same key is used to encrypt or decrypt the data.


If a different key(public key) is used for encryption and a different key(private key) is used for decryption.

AWS Master keys

These are master keys that are managed by AWS for its service's encryption like SNS, EBS.

Customer master key(<4kb)

These master keys are created by a user for encryption and decryption.

Steps to Create Customer KMS

1. Create a user who owns the cmk(customer master key) ( Note down Access key and secret key)

2. Crate a user who uses this cmk

3. Create a KMS key using KMS service in AWS 

    Create Symmetric key

    Provide ownership to a user

    Provide user name who uses this key

4. Create an EC2 instance and configure user which will have the ownership/usage of KMS keys.

5. Connect to EC2 instance and configure Accesskey and Secret key.

6. Run following commands

  • echo "Hello AWS!!" > secret.txt
  • aws kms encrypt --key-id YOURKEYIDHERE --plaintext fileb://secret.txt --output text --query CiphertextBlob | base64 --decode > encryptedsecret.txt

  • aws kms decrypt --ciphertext-blob fileb://encryptedsecret.txt --output text --query Plaintext | base64 --decode > decryptedsecret.txt

  • aws kms re-encrypt --destination-key-id YOURKEYIDHERE --ciphertext-blob fileb://encryptedsecret.txt | base64 > newencryption.txt 

  • aws kms enable-key-rotation --key-id YOURKEYIDHERE

  • aws kms get-key-rotation-status --key-id YOURKEYIDHERE

  • aws kms generate-data-key --key-id YOURKEYIDHERE --key-spec AES_256



Ansible,6,AWS,1,Azure DevOps,1,Containerization with docker,2,DevOps,2,Docker Quiz,1,Docker Swarm,1,DockerCompose,1,ELK,2,git,2,Jira,1,Kubernetes,1,Kubernetes Quiz,5,SAST DAST Security Testing,1,SDLC Quiz,3,SonarQube,3,Splunk,2,vagrant kubernetes,1,YAML Basics,1,
DevOpsWorld: AWS - KMS (Key Management Service)
AWS - KMS (Key Management Service)
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content