Skip to content

Reviewed privileged-RBAC exclusions leave 12 stale warnings in cluster policy reports #3900

Closed

Description

@devantler

🤖 Generated by the Agentic Engineer

Evidence

Read-only against prod on 2026-09-19: of 281 ClusterPolicyReports, 12 hold a warn result that is 129 hours old, all from audit-privileged-rbac / privileged-rules. The same rule's other 229 results are pass and less than an hour old, so the background scan is running and rewriting results for this rule. Only these 12 are frozen.

The 12 subjects are exactly ClusterRoles that #3791 later moved into the policy's reviewed exclude list (for example cluster-admin, admin, edit, longhorn-role, the Crossplane and KRO roles). As docs/policy-reports.md already explains, an exclude produces no replacement result, so each audit-era warning stays in its report indefinitely.

Who this affects

Anyone reading the Policy Reporter dashboard. It shows 12 privileged-RBAC warnings for roles the platform has already reviewed and accepted, so the count stays wrong, and a real new warning is harder to spot next to it.

Why the report-pruning work does not cover it

The prune-stale-policy-reports DeletingPolicy (platform#3899, part of #2573) matches namespaced policyreports only, and its delete grant is scoped the same way. Cluster-scoped reports are out of scope by design.

Expected behaviour

A reviewed exclusion shows as a current skip, or its report no longer lists a result for that rule, and nothing reports stale failures for roles that were deliberately accepted.

Options

  1. Root cause (preferred): express the exact-identity exclusions as a false preconditions entry rather than exclude, which is the shape docs/policy-reports.md already recommends. The result becomes a current skip. The exact-identity matching in scripts/tests/test-audit-privileged-rbac.sh must keep its guarantees (name and kind for ClusterRoles, namespace and name for Roles).
  2. Extend the prune policy and its grant to clusterpolicyreports. This is broader, and it only clears the current symptom while the exclude keeps producing new stale results.

Acceptance criteria

  • Prod shows 0 audit-privileged-rbac results older than 6h in ClusterPolicyReports, after one background scan.
  • The existing privileged-RBAC tests pass, and a new test proves an excluded role yields skip rather than no result.
  • Non-excluded privileged roles still produce warn/fail.

Size

Small to medium: one policy's exclusion shape plus its test.

Activity

  1. added theissue type on Sep 19, 2026
  2. moved this to 📥 Backlog in 🌊 Project Boardon Sep 19, 2026
  3. devantler commented on Sep 19, 2026

    @devantler
    ContributorAuthor

    🤖 Generated by the Agentic Engineer

    Scope addition: the same policy's two reviewed Role exclusions (longhorn-system/longhorn and velero/velero-server) leave one 129h-old warn each in their namespaced PolicyReports. platform#3899 will not prune them: after review, it only deletes a report that also holds a result from the last two hours, so a report Kyverno no longer re-checks keeps its failures. These Roles match no other rule, so nothing refreshes their reports. Moving the exclusions to preconditions fixes all 14 entries (12 cluster, 2 namespaced) at the source.

  4. added a commit that references this issue on Sep 19, 2026
  5. moved this from 📥 Backlog to 👀 In Review in 🌊 Project Boardon Sep 19, 2026
  6. moved this from 👀 In Review to ✅ Done in 🌊 Project Boardon Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions