Skip to content

bug(ci): the Kubescape scan log reports "All controls passed" while the same run raises Code Scanning alertsΒ #2846

Closed

Description

@devantler

πŸ€– Generated by the Agentic Engineer

Part of #2451. Follows #2829, which added the Kubescape SARIF β†’ Code Scanning upload.

Evidence

Measured locally against main (ksail 7.x, k8s source dir, repo exceptions applied), running
exactly what CI runs:

ksail workload scan --framework nsa --exceptions <generated> --compliance-threshold 95 \
  --format sarif -o kubescape.sarif
  • Console output: All controls passed. No issues found β€” exit 0.
  • SARIF written by the same run: 4 findings on real, un-excepted manifests:
    • C-0034 (warning) Γ—3 β€” bases/infrastructure/vault-backup/{job,cron-job}.yaml, bases/infrastructure/vault-config/job.yaml
    • C-0017 (note) Γ—1 β€” bases/apps/umami/cron-job.yaml

I confirmed none of these are suppressed: no policy in the generated exceptions file
(21 policies) covers C-0034 or C-0017.

The printer is showing a filtered view, not an empty one. Re-running the same scan with
--exceptions removed produced 70 SARIF findings while the console table listed one
control (C-0013, 2 resources). So the console summary surfaces only a subset; the SARIF
carries the full set.

Problem

Since #2829, those SARIF findings become Code Scanning alerts β€” so the two surfaces now
disagree in a way they did not before:

  • The CI log, which is what a developer reads on a PR, says All controls passed. No issues found.
  • The Security tab shows alerts for the same run.

Anyone trusting the log concludes there is nothing to fix. Findings that do not move the
compliance score enough to breach the floor are invisible in CI entirely, which is precisely the
class #2829 was added to make visible. The gate is working correctly; the reporting around it is
what misleads.

Smallest useful change

After the scan step, derive a one-line summary from the SARIF the run just produced and print it
to the log and the job summary β€” count and per-control breakdown, plus a pointer to the Security
tab. No change to the gate, the threshold, or the upload.

Acceptance criteria

  • A run producing N SARIF findings prints a summary naming N and the control IDs, even when the
    compliance gate passes and the Kubescape table prints All controls passed.
  • A run producing zero findings says so explicitly.
  • The compliance-threshold gate's pass/fail behaviour is unchanged.
  • No change to what is uploaded to Code Scanning.

Size

S β€” one step in the validate job, reading a file the run already writes.

Note on scope

The filtered console table comes from Kubescape's own printer, which ksail forwards. This issue is
deliberately scoped to the platform's CI reporting rather than proposing an upstream printer
change β€” the summary we need is cheap to derive on our side and does not depend on upstream.

Activity

  1. added theissue type on Jul 28, 2026
  2. moved this to πŸƒπŸ»β€β™‚οΈ In Progress in 🌊 Project Boardon Jul 28, 2026
  3. coderabbitai commented on Jul 28, 2026

    @coderabbitai
    Contributor
    πŸ”— Related PRs

    #2316 - fix(kubescape): make ClusterSecurityException posture exceptions take effect [merged]
    #2434 - fix(kubescape): except GitOps-managed CronJobs from C-0026 posture control [merged]
    #2443 - fix(kubescape): keep scheduled posture scans local so results persist [merged]
    #2452 - fix(kubescape): bump posture scanner to v4.0.10 so exception CRs apply offline [merged]
    #2794 - fix(opencost): restore usage metrics [merged]


    πŸ“ Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    πŸ§ͺ Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    πŸ’¬ Have feedback or questions? Drop into our discord!

  4. moved this from πŸƒπŸ»β€β™‚οΈ In Progress to πŸ‘€ In Review in 🌊 Project Boardon Jul 28, 2026
  5. moved this from πŸ‘€ In Review to βœ… Done in 🌊 Project Boardon Jul 28, 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

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions