Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target secrets support #36

Merged
merged 2 commits into from
Mar 22, 2018
Merged

Target secrets support #36

merged 2 commits into from
Mar 22, 2018

Conversation

ramaro
Copy link
Member

@ramaro ramaro commented Mar 22, 2018

Introduces a new feature of "target secrets".

Secrets are originally standalone but dealing with them at scale can become complicated, especially when one needs to add or remove recipients. The proposed solution is to organise secrets per target in their respective target directory (inside --secrets-path).

For the recipients below in the inventory for my-target:

...
target_name: my-target
kapitan:
  secrets:
    recipients:
      - name: person1@example.com
        fingerprint: DEADBEEF
      - name: person2@example.com
        fingerprint: 8BADF00D

Creating a secret for target my-target:

$ kapitan secrets --write targets/my-target/secret_sauce -t my-target -f my_data
Wrote secret targets/my-target/secret_sauce for fingerprints DEADBEEF, 8BADF00D at ./secrets/targets/my-target/secret_sauce

Let's suppose person1@example.com is no longer part of the recipients for my-target.

First we need to validate by specifying were my target secrets were written:

$ kapitan secrets  --validate-targets --secrets-path ./secrets/targets/
my-target/secret_sauce recipient mismatch

And then fix the recipient mismatch:

$ kapitan secrets  --update-targets  --secrets-path ./secrets/targets/
Wrote secret  my-target/secret_sauce for fingerprints 8BADF00D at .../secrets/targets/my-target/secret_sauce

Now that the secrets are updated, I can recompile and should see changes in whatever items are using secret targets/my-target/secret_sauce

@ramaro ramaro merged commit 21f47b4 into kapicorp:master Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants