security(ci): assert the DR identity against parsed allow-list entries - #2997
Conversation
validateVerifyAllowList decided whether the DR rebuild identity is allowed by scanning the cluster config as raw text, so any line containing the subject regex satisfied it. Four inert or over-broad shapes were accepted: the identity in a comment, the whole verify block at a path KSail discards, a wider regex merely containing the identity, and the right subject under the wrong issuer. Parse spec.workload.flux.verify.matchOIDCIdentity and require an entry whose issuer and subject both equal the pinned values exactly. This is the config half of the parse-don't-scan correction validateCDWiring already documents for workflows. Refs #2945
Self-review found the discarded-path test would also pass if the synthetic config were merely malformed, which would prove nothing about the path being ignored. Assert the zero-entries branch specifically; ablating the assertion onto the other branch fails, so it is live. Also record that decoding reads the first YAML document only, and that a block in a later document fails this gate rather than satisfying it.
✅
|
@coderabbitai review |
|
✅ Action performedReview finished.
|
📝 WalkthroughWalkthroughThe DR signing validator now parses the first YAML document and reads Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Readiness — self-promotingProgrammatically tested. RED first: all four bypasses reproduced against the scanning version, CI green at Reviewed: Tried and evaluated as a user — ran the real CLI, not just The failure names the exact entry to add, so a developer who trips it can fix it from the log without Scope note. Only the config-side check changed. The |

Why
The check that guarantees a disaster-recovery rebuild can publish something production will accept
could be satisfied by text that has no effect on the cluster — including a comment. That matters
because a rejected artifact during a DR rebuild is the one failure nobody can fix by hand, and it
would only be discovered mid-incident. The gate was reporting "passed" on four different
configurations that would all leave a DR rebuild unverifiable.
What
The gate now reads the allow-list as configuration instead of as text, and requires the DR rebuild's
signer identity to be present exactly — both halves of it. A commented-out identity, an allow-list
placed where KSail ignores it, a wider pattern that merely contains the right one, and the right
identity issued by someone else are all now failures rather than passes. No behaviour outside this
one check changes, and the real production config passes unmodified.
Fixes #2945