Fix .sops.yaml to scope encryption to secret payload fields only
This commit is contained in:
+9
-5
@@ -87,11 +87,15 @@ and it must happen before this file is ever `git add`ed:
|
||||
sops --encrypt --in-place apps/cert-manager/cloudflare-api-token.sops.yaml
|
||||
```
|
||||
|
||||
`sops` reads `.sops.yaml`, sees the filename ends in `.sops.yaml`, and
|
||||
encrypts every value under `stringData` for your age public key. Open the
|
||||
file afterward — the keys (`api-token`) stay readable, the values are now
|
||||
unintelligible ciphertext with `sops` metadata appended. That's what's safe
|
||||
to commit.
|
||||
`sops` reads `.sops.yaml`, sees the filename ends in `.sops.yaml`, and —
|
||||
because of that file's `encrypted_regex: ^(data|stringData)$` — encrypts
|
||||
only the values under `stringData`, for your age public key. `apiVersion`,
|
||||
`kind`, and everything under `metadata` (name, namespace) stay in plain
|
||||
text on purpose: Kubernetes object names have to be plain DNS-safe
|
||||
strings, and encrypting them would produce a `SopsSecret` that fails to
|
||||
apply at all. Open the file afterward — `stringData`'s values are now
|
||||
unintelligible ciphertext with `sops` metadata appended; everything else is
|
||||
still readable. That's what's safe to commit.
|
||||
|
||||
Once pushed and synced, the operator finds this `SopsSecret`, decrypts it
|
||||
using the private key mounted from step 2, and creates an ordinary
|
||||
|
||||
Reference in New Issue
Block a user