You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
communication-keys/README.md

39 lines
935 B
Markdown

## howto create 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
### import gpg keys
gpg --import /path/to/keys/*.gpg.pub
### list imported gpg keys
gpg --list-keys --keyid-format=long
# Configure SOPS
```bash
GPG_TTY=$(tty) sops secrets.yaml
```
Note: GPG_TTY src: https://www.varokas.com/secrets-in-code-with-mozilla-sops/
## Example
```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
```
# Archive Expired Keys
```bash
mkdir archive
mv ${keyname} "archive/${keyname}_$(date '+%Y-%m-%d').archive"
```