serverless-kms-secrets | ️ Serverless plugin to encrypt variables | Serverless library
kandi X-RAY | serverless-kms-secrets Summary
kandi X-RAY | serverless-kms-secrets Summary
This plugins does the following:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of serverless-kms-secrets
serverless-kms-secrets Key Features
serverless-kms-secrets Examples and Code Snippets
Community Discussions
Trending Discussions on serverless-kms-secrets
QUESTION
I’m using serverless-kms-secrets on serverless frameword to set some ENV variables I want to consume using Ruby.
I can confirm that the plugin works perfectly, it generated the file with the encrypted variable and I can see the encrypted variable in my environment on AWS lambda. The problem is that I can’t decrypt it in Ruby. The code that decrypts it (correctly) in the plugin is here, I understand it gets the string saved in the file and encodes it using Base64, so no big deal. In Ruby:
...ANSWER
Answered 2019-Mar-21 at 08:15It looks like the ciphertext_blob
argument in Aws::KMS::Client#decrypt
expects a binary string that includes the encrypted Ciphertext that you want to decrypt.
In your example, you are passing in an unencrypted Base64 encoded string into decrypt
. Instead, you need to to pass in an encrypted binary string.
To get an encrypted string we can call Aws::KMS::Client#encrypt
with your keyId (also know as your ARN) and the string you want to encrypt in plaintext.
In the response from that call we get back a ciphertext_blob
which is the encrypted binary string that we need to use in order to decode.
Sometimes you might see that binary data "unpacked", which you can demonstrate doing ciphertext_blob.unpack('H*')
. If you have unpacked data and want to decrypt it, you will need to pack it: encrypted_upacked_blob.pack('H*')
.
Here's a full example of a round trip encoding and decoding of a plaintext string:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install serverless-kms-secrets
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page