getsops / getsops/sops

How to encrypt a file locally with an assumed KMS role and decrypt it AWS without any role

Open
#555 7 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/keyservice keyservice/awskms
Dominant language
Go
Stars
23.1k
Forks
1.1k
Avg merge
1d 11h
Merged PRs (30d)
9

Description

Problem description:

I am going to use Sops in Aws EKS. The current workflow presume that the developer will encrypt a secret assuming a special role. Later, such encrypted file, is used in AWS and needs to be decrypted without such role ( The AWS node has the proper access to do it )
Follow my .sops.yaml file

 creation_rules:
   - key_groups:
     - kms:
       - arn: "arn:aws:kms:us-east-1::XXXXXXXXXXXXX:key/kms_key_id"
         role: "arn:aws:iam::XXXXXXXXXXXXX:role/EncryptionRole"
     - kms:
       - arn: "arn:aws:kms:us-east-1:XXXXXXXXXXXXX:key/kms_key_id"

With the above config the encryption process will fail because the user cannot use the 2 key directly, even though is the same.
My current workaround is to comment the last 2 lines from the .sops.yaml, encrypt the file, and remove the "role:" line from the encrypted file.
In this way I can decrypt the key in AWS.

Ideas

Have the possibility to specify which key to use to decrypt
Rewrite the encrypted the file with the specified arn independently from the one used for encryption
Other ideas are welcome.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the .sops.yaml creation_rules shown in the issue and trace how the encryption role and KMS ARNs are handled during encryption and decryption. Reproduce the configuration with an assumed encryption role and an AWS node role; done should mean the file can be encrypted locally and decrypted in AWS without requiring the encryption role.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go
Domain
cloud, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.