Repository navigation
feat(kyverno): migrate restrict-arc-openbao-certificate to ValidatingPolicy - #5124
Conversation
…Policy Fixes #5123 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai review |
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 52 minutes. View limit details
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 |
Fold the issuer scope into the validation so out-of-scope certificates get a current pass instead of no result, matching the platform's report convention. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…transport proof The proof now fetches the ValidatingPolicy, compares its live spec with the source exactly (the kind adds no defaults) and reads readiness from status.conditionStatus. Its negative cases become the ValidatingPolicy equivalents: admission or background disabled, Audit instead of Deny, an added match condition, fail-open, an unknown field and a not-ready status. The listener policy's checks are unchanged. Fixes #5126 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
devantler
left a comment
There was a problem hiding this comment.
🤖 Generated by the Agentic Engineer
Self-review (fallback — CodeRabbit, Codex and Cursor Bugbot unavailable)
Reviewed commit: e845f9514aad91c4c558a400f89750481810db13
- CodeRabbit: rate limited — its 11:31Z reply on this PR was a rate-limit notice, and the 11:43Z rate-limit reply on this repository (lane-health read 12:07Z) names a reset near 12:25Z; no review artifact exists at this head.
- Codex: usage limit since 2026-10-19 22:44Z (lane-health read 12:07Z today); no Codex artifact on this PR.
- Cursor Bugbot: usage limit since 2026-10-19 22:18Z (lane-health read 12:07Z today); no Bugbot check-run on this PR.
Scope read: the whole diff against main, plus every caller of the transport proof (its workflow, the CI entry and the staging Go test).
Correctness: the restriction is unchanged — a Certificate or CertificateRequest naming the arc-openbao-ca ClusterIssuer is denied outside openbao; an unset issuerRef.kind still means a namespaced Issuer and is not restricted; Deny matches the old Enforce. The new fixtures cover both same-name namespaced cases. The proof now reads the ValidatingPolicy by its full resource name, requires the live spec to equal the source spec exactly and status.conditionStatus.ready == true, and keeps the churn check. Read-only check on production: the four ValidatingPolicies already deployed carry no server-added spec keys and all report conditionStatus.ready: true, so the exact-equality check holds. The removed proof cases test fields that a ValidatingPolicy does not have; the new negative cases (admission or background off, Audit, a matchCondition exclusion, failurePolicy: Ignore, an unknown field, not ready) cover its equivalents. The proof runs with the production admin kubeconfig, so reading the new kind needs no RBAC change.
Security: the issuance boundary is preserved exactly; no trust, execution or egress boundary changes.
Verdict: no P0/P1 findings
Readiness — head
|
Why
The next Kyverno release removes the older policy kind. The rule that stops any namespace other than OpenBao's from getting a certificate from the authority OpenBao's own certificate comes from still uses that kind, so on upgrade that impersonation path would silently open.
What
The same rule is rewritten in the newer policy kind and keeps blocking, with the same scope. The production check that proves this rule is deployed, blocking and unchanged now reads it in its new form, with the same failure cases. Its test also covers same-named authorities that are local to one namespace, which stay out of scope.
Fixes #5123
👉 After merge/promotion: also close the proof-update issue linked from #5123, which this change delivers.