Docker image for aws-encryption-sdk-cli
- Create
.env
file to the project folder - Create a symmetric KMS key in AWS console
- Copy the key arn into
.env
asKEY_ARN
- Copy the key arn into
- Create an IAM user with programmatic access
- Copy access key id and secret access key to
.env
asAWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
- Copy access key id and secret access key to
- Create a new IAM policy:
- Required KSM create actions:
Decrypt
,Encrypt
andGenerateDataKey
- From the
Resources
tab, selectSpecific
and add the created KMS key's arn there
- Required KSM create actions:
- Attach the created policy to the created user
- Build the image:
./build.sh
- Encrypt:
cat input_path | ./encrypt.sh > output_path
cat secret.txt | ./encrypt.sh > secret.txt.encrypted
- Decrypt:
cat input_path | ./decrypt.sh > output_path
cat secret.txt.encrypted | ./decrypt.sh > secret.txt
-e = path to .env file (default project/.env)