Open elikoga opened 8 months ago
Probleme/Use-Cases:
git diff
- keine spezielle Konfigurationgit diff
- mit Konfiguration (textconv, external diff)Status quo:
Batou <= 2.3
Projekt-weite Konfiguration in ./components
(python source)
Environment-spezifische Konfiguration in ./environments/<env>/environment.cfg
(using python configparser ini format)
Environment-spezifische Secret-Konfiguration in ./environments/<env>/secrets.cfg
(using python configparser ini format, gpg encrypted)
Environment-spezifische Secret-Blobs/Dateien in ./environments/<env>/secrets-*
(gpg encrypted)
git diff
- no textconv:
git diff
- textconv:
.cfg
Dateien nicht un-ambiguous gpg sind(file $1 | grep -q "ASCII") && cat $1 || gpg --decrypt $1
als textconvÜbersicht über die aktuelle Environment Konfiguration + Secrets:
./batou secrets summary
Zeigt an, welche environments secrets haben, und wen sie als recipient habenBearbeiten von Konfiguration + Secrets:
./batou secrets edit <env> [file]
öffnet $EDITOR
mit entschlüsselten secretsenvironment.cfg
environment independent secrets:
Batou >= 2.4
Projekt-weite Konfiguration in ./components
(python source)
Environment-spezifische Konfiguration in ./environments/<env>/environment.cfg
(using python configparser ini format)
Environment-spezifische Secret-Konfiguration in ./environments/<env>/secrets.cfg.{gpg,age}
(using python configparser ini format, gpg/age encrypted)
Environment-spezifische Secret-Blobs/Dateien in ./environments/<env>/secrets-*.{gpg,age}
(gpg/age encrypted)
git diff
- no textconv:
git diff
- textconv:
[diff "gpg"]
textconv = gpg --no-tty --decrypt
[diff "age"]
textconv = age --decrypt -i <YOUR_PRIVATE_KEY_FILE>
.gitattributes
:
*.gpg diff=gpg
*.age diff=age
git diff
zeigt dann die entschlüsselten Inhalte anÜbersicht über die aktuelle Environment Konfiguration + Secrets:
./batou secrets summary
Zeigt an, welche environments secrets haben, und wen sie als recipient habenBearbeiten von Konfiguration + Secrets:
./batou secrets edit <env> [file]
öffnet $EDITOR
mit entschlüsselten secretsenvironment.cfg
environment independent secrets:
Changes/Vorschläge
git diff
- keine spezielle Konfiguration:Variante 1: Wir encrypten secrets direkt in der environment.cfg
per-field
in environment.cfg
:
[environment]
[host:foohost]
components = barcomponent
[component:barcomponent]
secret_value = -----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IHlFVGhhQSB0WndK
ZHpFTmJlMUlMaXg5ZXJyL2ZCZXN5OUNRSitQUkI2VmZBK0F0WDNvCnNTT2I3Wkcw
cmtRMW00RElxdURmSEhHOGhYWS9Ea2hQRzZlVEh2Yk03bDgKLS0tIHl4blJYK0hl
V0o2YjZaSHdQT3pJV05lUXAzWlcyYWtxL2lrUndDdVcxczQKv9MICqh5I0yEpWQC
5aZXNY5c7916Rfg9wsCvGzA1BjCBw5bUWQYX
-----END AGE ENCRYPTED FILE-----
-----BEGIN PGP MESSAGE-----
./batou secrets edit <env>
wie zuvorgit diff
zeigt sofort an, welche keys sich geändert habenenvironment.cfg
wird sehr lang, da jedes secret 7+ Zeilen brauchtvariante 2: Wir encrypten die secrets.cfg.{age|gpg}
wie in variante 1
example:
in environment.cfg
:
[environment]
[host:foohost]
components = barcomponent
secrets.cfg
(notice: no encrypted file extension since this is plaintext)
[component:barcomponent]
secret_value = -----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IHlFVGhhQSB0WndK
ZHpFTmJlMUlMaXg5ZXJyL2ZCZXN5OUNRSitQUkI2VmZBK0F0WDNvCnNTT2I3Wkcw
cmtRMW00RElxdURmSEhHOGhYWS9Ea2hQRzZlVEh2Yk03bDgKLS0tIHl4blJYK0hl
V0o2YjZaSHdQT3pJV05lUXAzWlcyYWtxL2lrUndDdVcxczQKv9MICqh5I0yEpWQC
5aZXNY5c7916Rfg9wsCvGzA1BjCBw5bUWQYX
-----END AGE ENCRYPTED FILE-----
./batou secrets edit <env>
wie zuvorgit diff
zeigt sofort an, welche keys sich geändert habengit diff
- mit Konfiguration (textconv, external diff):./batou secrets diff <file1> <file2>
hinzufügen
external diff
in git verwendet werden
git diff
zeigt dann die entschlüsselten Inhalte angit diff
zeigt alle secrets Änderungen an./batou secrets decrypt-to-stdout <file>
hinzufügen
textconv
in git verwendet werden
git diff
zeigt dann die entschlüsselten Inhalte angit diff
zeigt alle secrets Änderungen anBefehl ./batou show-environment <env>
hinzufügen
sowas wie:
$ ./batou show-environment dev
[environment] # all values from environment.cfg
connect_method = local
[host:foohost]
service_user = foouser # from environment.cfg
components = barcomponent # from environment.cfg
data-foo = <REDACTED> # from secrets.cfg
[component:barcomponent]
normal_value = 42 # from environment.cfg
secret_value = <REDACTED> # from secrets.cfg
--show-secrets
werden die secrets nicht redacted./batou secrets edit
: --watch
flag
./batou secrets merge-driver <ancestor> <current> <other> <marker-size> <merged>
project
wird eingeführt./batou secrets edit project
öffnet $EDITOR
mit entschlüsselten secretsproject
geerbt./
oder ./environments/
project.cfg
secrets.cfg.{age|gpg}
./environments/<env>/
./batou secrets edit <env> [file]
-> ./batou secrets edit [env] [file]
(optional)
env
nicht angegeben ist, wird project.cfg
verwendetenv
angegeben ist, wird secrets.cfg
verwendet
Related issues are
2 the format should make this 'easy'
42
49 outlines some related thoughts, but I don't think it's applicable immediately
281 describes per-field description