You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0dd28fc
Browse filesBrowse the repository at this point in the historyBrowse files
fix(apply): mask the node's side of the dry-run diff
The dry-run diff the node returns prints the config it runs next to the
one being applied. talm masked it by the secret values of the rendered
config only, so when the two carried different secrets, as after a CA
rotation or with a regenerated secrets.yaml, the node's CA keys, tokens
and encryption secrets printed on the removed side in the clear, on
every contract.
On a dry run, the only apply whose response carries that diff, the
apply paths now read the node's config before applying, as the drift
preview already does, and mask its secret values too. A node on a
maintenance connection has no config to read. A read or decode failure
leaves that side unmasked with a warning but never fails the apply.
A test runs a real Talos config diff between two configs with
different secrets through the print path, on v1.13 and v1.14, and
requires every field Talos redacts on either side to be masked.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <[email protected]>
Expected: in the `Config diff:` block, a user secret renders as `value: ***` and a bootstrap `*.key` / `token` / encryption-secret renders as `key: ***` (etc.) by default. `--show-secrets-in-drift` prints the block verbatim (the same flag that governs the structured drift preview governs this surface too). A leak here is a security-class bug: `talm` prints the server-computed diff verbatim, so an unredacted `ModeDetails` would expose CA private keys and user secrets in CI logs.
859
859
860
-
Regression anchor: the `Config diff:` shows secrets as context lines too (an unchanged `key:` adjacent to a change hunk), not only on `+`/`-` lines — value-based masking covers both. Public material adjacent to a secret slice (an `acceptedCAs[].crt`) is redacted alongside its key by design (the slice is masked whole); `--show-secrets-in-drift` restores it.
860
+
Both sides, on a project pinned at `talosVersion: "v1.14"`: keep a copy of `secrets.yaml`, regenerate it so the rendered secrets differ from the ones the node runs, and run `talm apply --dry-run -f nodes/node0.yaml 2>&1`. Expected: none of the `-` lines (the node's current keys) and none of the `+` lines (the regenerated ones) shows key material. The CA and service-account keys are multi-line PEM there, so every line between `-----BEGIN` and `-----END` in the `issuingCA.key` and `issuer.privateKey` blocks reads `***`, while the armor lines stay. If talm cannot read the node's config (a COSI timeout, an RPC error), the dry run prints `warning: the node's side of the dry-run diff is not masked` and the apply itself is unaffected. Restore the original `secrets.yaml` before applying anything.
861
+
862
+
Regression anchor: the `Config diff:` shows secrets as context lines too (an unchanged `key:` adjacent to a change hunk), not only on `+`/`-` lines — value-based masking covers both. `TestModeDetails_PrintedDiffMasksSecretsOnBothSides` runs a real Talos config diff between two configs with different secrets through the print path, on v1.13 and v1.14. Public material adjacent to a secret slice (an `acceptedCAs[].crt`) is redacted alongside its key by design (the slice is masked whole); `--show-secrets-in-drift` restores it.
861
863
862
864
### C6. Drift preview shows secrets with explicit opt-in
0 commit comments