Compare commits

...

55 Commits

Author SHA1 Message Date
LeeW 9663fefd6d fmting 1 year ago
LeeW 3e9c231e39 move to branch ADP-216_sops_automation 1 year ago
LeeW def05b9af3 move to branch ADP-216_sops_automation 1 year ago
LeeW d5773f512a archive more keys 1 year ago
LeeW 33144d99de register dir for archived keys 1 year ago
LeeW e2a8eb1a05 clarifies README 1 year ago
Lee Watson cbc57acf1d updates from code review 1 year ago
LeeW e953b1e047 adds roles, iter x/n 1 year ago
LeeW 8748069d1d refactor name 1 year ago
LeeW fd89ab65fd adds roles, iter x/n 1 year ago
LeeW 5f2d02f600 adds roles, iter x/n 1 year ago
LeeW 959b7d71ff adds roles, iter x/n 1 year ago
LeeW 50d0a7e86e create sops config if not exist 1 year ago
LeeW 875c01e27f fix example script 1 year ago
Michael Haehnel a23cb6681b
ADP-179: Adds folder for archived keys 1 year ago
LeeW 8b0e2c1129 fixes markdown formatting in README 1 year ago
LeeW 293ed87f0c refactor: args 1 year ago
LeeW 233173e9ac refactor: args 1 year ago
LeeW cd2634e845 refactor: args, secrets files 1 year ago
LeeW d8bc39c9d8 refactor: args, secrets files 1 year ago
LeeW 002982c4ac refactor: args 1 year ago
LeeW c8c0187a18 phase3: refactor 1 year ago
LeeW e4f66eac3d phase3: refactor 1 year ago
LeeW e45c4082b6 phase3: cleanup 1 year ago
LeeW fa5739c24f phase2: update script, make useful for general case 1 year ago
LeeW d120c13544 phase2: update script, make useful for general case 1 year ago
LeeW 701dce3124 phase1: update script, shift around dir responsibility 1 year ago
LeeW bc1bc225e5 phase1: update script, shift around dir responsibility 1 year ago
LeeW d76e993582 phase1: update script, shift around dir responsibility 1 year ago
LeeW 67bf466ee7 phase1: update script, shift around dir responsibility 1 year ago
LeeW 0da6e2f13d phase1: update script, shift around dir responsibility 1 year ago
LeeW 22ddfc1b5e phase1: update script, shift around dir responsibility 1 year ago
LeeW c49d549ad6 phase1: update script, reduce noise on tty 1 year ago
LeeW 21c30a37e3 phase1: update script 1 year ago
LeeW c8c8e54b50 phase1: reorg dir structure 1 year ago
LeeW c877192807 phase1: update script 1 year ago
LeeW 651b701896 phase1: update script 1 year ago
LeeW 36b01996cb phase1: reorg dir structure 1 year ago
LeeW 000e9a860d updates comment 1 year ago
LeeW 8aadf67422 document source 1 year ago
LeeW 3a20bf3163 rename mock file 1 year ago
LeeW 55cc7d1ead automatically created sops config 1 year ago
LeeW 5b93a0e5f3 automates creation+verification of sops config 1 year ago
LeeW fd2bbeb5ff automates creation+verification of sops config 1 year ago
LeeW f3138ffcc5 automates creation+verification of sops config 1 year ago
LeeW 0bf2edd57c automates creation+verification of sops config 1 year ago
LeeW 20c2a79808 automates creation+verification of sops config 1 year ago
LeeW a63b96fe2e automates listing of keyfiles 1 year ago
LeeW ffca5846f4 automates listing of keyfiles 1 year ago
LeeW a1fc113743 automates listing of keyfiles 1 year ago
LeeW f6380e7668 automates listing of keyfiles 1 year ago
LeeW b7bcc8dd2c automates listing of keyfiles 1 year ago
LeeW f1e529f1ed automates listing of keyfiles 1 year ago
LeeW 3efade8643 automates listing of keyfiles 1 year ago
LeeW aae050c850 updates instructions for sops 1 year ago

@ -1,4 +1,11 @@
## howto create a gpg key
# GPG Key Repo
Purpose: Manage gpg keys for:
* SOPS
# Key Management
## howto create and add a gpg key
- please follow instruction on following link: https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key
- add ONLY the _PUBLIC_ part of your gpg key!!!
- checkin via MergeRequest/PullRequest
@ -8,3 +15,55 @@ gpg --import /path/to/keys/*.gpg.pub
### list imported gpg keys
gpg --list-keys --keyid-format=long
# EOL: Archive Expired Keys
To mark a key as expired, move it to the `archive/` dir as follows:
```bash
mv ${keyname} "archive/${keyname}_$(date '+%Y-%m-%d').archive"
```
# Configure SOPS
SOPS is used for encrypting secrets, e.g. credentials for various systems
## Install
https://github.com/getsops/sops
Note:
* MacOS: If desired, one can also use brew to install sops: `brew install sops`; although this is not officially maintained, [the formula is essentially the same as the official installation instructions](https://github.com/Homebrew/homebrew-core/blob/4496ce5131bc09e7065fa0aa8fb96366a3df6477/Formula/s/sops.rb)
## Usage
Decrypt and Display Secrets in Terminal:
```bash
GPG_TTY=$(tty) sops secrets.yaml
```
Note: The `GPG_TTY` is necessary to have the password prompt appear. src: https://www.varokas.com/secrets-in-code-with-mozilla-sops/
Note: `secrets.yaml` is just an example; the file can have any name
## Example
The steps in the following example can be run locally in order to:
* create a sample secrets file
* encrypt the file
* decrypt the file
If these steps work, sops configured correctly - on your machine ;-)
```bash
#!/usr/bin/env bash
set -ueo pipefail
# demo: create a file with a mock secret, src: https://bash-org-archive.com/?244321
yq -n '.demo.credentials.secret = "hunter2"' > secrets.yaml
# encrypt
sops -e -i secrets.yaml
# decript, print to console
sops -d secrets.yaml
```
Loading…
Cancel
Save