Compare commits
59 Commits
master
...
ADP-179_do
| Author | SHA1 | Date |
|---|---|---|
|
|
c3cb659d20 | 10 months ago |
|
|
d35751093d | 10 months ago |
|
|
36a3a88432 | 10 months ago |
|
|
5526ba1c22 | 10 months ago |
|
|
bc065ba5fc | 10 months ago |
|
|
69e75e7f88 | 10 months ago |
|
|
def05b9af3 | 10 months ago |
|
|
d5773f512a | 10 months ago |
|
|
33144d99de | 10 months ago |
|
|
e2a8eb1a05 | 10 months ago |
|
|
cbc57acf1d | 10 months ago |
|
|
e953b1e047 | 11 months ago |
|
|
8748069d1d | 11 months ago |
|
|
fd89ab65fd | 11 months ago |
|
|
5f2d02f600 | 11 months ago |
|
|
959b7d71ff | 11 months ago |
|
|
50d0a7e86e | 11 months ago |
|
|
875c01e27f | 11 months ago |
|
|
a23cb6681b | 11 months ago |
|
|
8b0e2c1129 | 11 months ago |
|
|
293ed87f0c | 11 months ago |
|
|
233173e9ac | 11 months ago |
|
|
cd2634e845 | 11 months ago |
|
|
d8bc39c9d8 | 11 months ago |
|
|
002982c4ac | 11 months ago |
|
|
c8c0187a18 | 11 months ago |
|
|
e4f66eac3d | 11 months ago |
|
|
e45c4082b6 | 11 months ago |
|
|
fa5739c24f | 11 months ago |
|
|
d120c13544 | 11 months ago |
|
|
701dce3124 | 11 months ago |
|
|
bc1bc225e5 | 11 months ago |
|
|
d76e993582 | 11 months ago |
|
|
67bf466ee7 | 11 months ago |
|
|
0da6e2f13d | 11 months ago |
|
|
22ddfc1b5e | 11 months ago |
|
|
c49d549ad6 | 11 months ago |
|
|
21c30a37e3 | 11 months ago |
|
|
c8c8e54b50 | 11 months ago |
|
|
c877192807 | 11 months ago |
|
|
651b701896 | 11 months ago |
|
|
36b01996cb | 11 months ago |
|
|
000e9a860d | 11 months ago |
|
|
8aadf67422 | 11 months ago |
|
|
3a20bf3163 | 11 months ago |
|
|
55cc7d1ead | 11 months ago |
|
|
5b93a0e5f3 | 11 months ago |
|
|
fd2bbeb5ff | 11 months ago |
|
|
f3138ffcc5 | 11 months ago |
|
|
0bf2edd57c | 11 months ago |
|
|
20c2a79808 | 11 months ago |
|
|
a63b96fe2e | 11 months ago |
|
|
ffca5846f4 | 11 months ago |
|
|
a1fc113743 | 11 months ago |
|
|
f6380e7668 | 11 months ago |
|
|
b7bcc8dd2c | 11 months ago |
|
|
f1e529f1ed | 11 months ago |
|
|
3efade8643 | 11 months ago |
|
|
aae050c850 | 11 months ago |
@ -1,10 +1,66 @@
|
|||||||
## 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
|
- 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!!!
|
- add ONLY the _PUBLIC_ part of your gpg key!!!
|
||||||
- checkin via MergeRequest/PullRequest
|
- checkin via MergeRequest/PullRequest
|
||||||
|
|
||||||
### import gpg keys
|
### import gpg keys
|
||||||
|
```shell
|
||||||
gpg --import /path/to/keys/*.gpg.pub
|
gpg --import /path/to/keys/*.gpg.pub
|
||||||
|
```
|
||||||
|
|
||||||
### list imported gpg keys
|
### list imported gpg keys
|
||||||
gpg --list-keys --keyid-format=long
|
```shell
|
||||||
|
gpg --list-keys --keyid-format=long
|
||||||
|
```
|
||||||
|
|
||||||
|
# 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 is 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
|
||||||
|
# PREREQUISITE: valid sops config, i.e. .sops.yaml
|
||||||
|
yq -n '.demo.credentials.secret = "hunter2"' > secrets.yaml
|
||||||
|
# encrypt
|
||||||
|
sops -e -i secrets.yaml
|
||||||
|
|
||||||
|
# decript, print to console
|
||||||
|
sops -d secrets.yaml
|
||||||
|
```
|
||||||
Loading…
Reference in New Issue