test(openbao): guard Retain on the platform PKI and transit CRs #756
Loading…
Reference in a new issue
No description provided.
Delete branch "test/openbao-platform-retain-guard"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds
tests/openbao-platform-crs.sh, guarding the ten CRs that #750 moved out of Crossplane.This has to land before platform-seanfarm empties the composition, so the invariant is never left unguarded for a window.
Why now
platform-seanfarm
tests/check-binjovi-forgejo-key.shasserts that exactly onebinjovi-forgejo-jwtkey exists, of typeecdsa-p256. It reads the composition. Once the composition is emptied that guard reads an empty file and fails -- which it correctly did when I made that change, and which is how this gap surfaced.The obvious move is to delete the stale guard. That would silently drop a real invariant, so it is being ported here instead, to where the manifest now lives.
tests/binjovi.shalready checks the policy side inexecution-platform.yaml(transit/sign/binjovi-forgejo-jwt,transit/keys/binjovi-forgejo-jwt). Nothing in this repo checked the key declaration. That was the gap.Widened to the property that actually protects the keys
While porting it, the guard covers
deletionPolicy, which matters more than the key names.The transit backend holds
cosign,cosign-ecandbinjovi-forgejo-jwt. Unmounting it destroys every key in it, every existing signature stops verifying, and the material does not come back.spec.deletionPolicy: Retainis the only thing preventing that, and it is load bearing, not decorative --libseanfarm-operatorv0.4.13 (pinned by the deployedopenbao-operatorv0.12.32)reconcile/harness.go:401:with the
UnmountSecretscall inside that block (openbaotransitbackend_impl.go:152).The CRD default is
Delete. So an omitted line silently selects destruction. It renders green, dry-runs green, and only shows up when a CR is deleted -- which is exactly what the retirement is about to do.What it checks
kustomization.yaml-- an unlisted file is invisible to Flux while looking present in reviewopenbao.sean.farmCRs setdeletionPolicy: Retainexplicitly (theOpenBaoConnectionis skipped by API group, not by name, since it has no such field)deletionAllowed, which gates per-key destruction ahead of the unmountRed-green
Each check was verified against a mutation that should trip it:
Retainfrom the transit backenddeletionPolicy <unset>)Deletebinjovi-forgejo-jwttoed25519deletionAllowed: trueoncosign-ecTree restored after each;
git statusclean.Tests
tests/check.shexits 0 with the guard registered.https://claude.ai/code/session_01GfkEuwuvGSqGyXVuxwT7PA