Skip to content

Correct vulnerability manifest references in workload summaries #5403

Open

Description

@devantler

🤖 Generated by the Agentic Engineer

Description

Vulnerability summaries can point to manifests in the wrong namespace. Readers then receive a missing result even when the referenced scan exists, so complete paired coverage cannot be established.

Steps to Reproduce

  1. Store vulnerability manifests in the scanner's configured namespace.
  2. Store a summary for a workload in a different namespace.
  3. Resolve the full-image and relevant-manifest references returned by that summary.

Expected Behavior

Both references identify the namespace in which their manifests were stored. The summary itself remains in the workload's namespace.

Actual Behavior

The manifest write uses the configured scanner namespace, but summary construction passes the workload namespace to the reference builder. The mismatch is visible in the pinned upstream source.

Acceptance Criteria

  • Reproduce the mismatch with independently configured workload and manifest-storage namespaces, including relevant findings enabled and disabled.
  • Preserve the summary's workload namespace while making every populated reference resolve in the actual manifest-storage namespace; retain names, counts and scan evidence.
  • Deliver through a tested, signed immutable artifact and the protected deployment path without adding privileges or discarding stored findings.
  • Observe fresh summaries whose references resolve by ordinary API reads and agree with their manifest counts. Preserve separate missing, stale and storage-coherence findings in the coverage check.

Part of #4263. The metadata-split repair in #5402 is a separate prerequisite for refreshing affected existing summaries; it does not correct reference construction.

Activity

  1. added theissue type on Oct 26, 2026
  2. moved this to 📥 Backlog in 🌊 Project Boardon Oct 26, 2026
  3. self-assigned this
    on Oct 26, 2026
  4. moved this from 📥 Backlog to 🏃🏻‍♂️ In Progress in 🌊 Project Boardon Oct 26, 2026
  5. added a commit that references this issue on Oct 26, 2026
  6. devantler commented on Nov 16, 2026

    @devantler
    ContributorAuthor

    🤖 Generated by the Agentic Engineer

    Progress, 16 November: the upstream fix is in production. 162 of 186 summaries now point to the right namespace. 24 old summaries have not been rewritten yet.

    • What changed. chore(deps): update helm release kubescape-operator to v1.42.0 #6221 moved the operator to chart 1.42.0, and production now runs kubevuln v0.3.578. That release includes upstream fix(deps): update helm release traefik to v35.4.0 #946, which builds references in the namespace where the manifests are stored. The chart also grants the label-watch access natively. I closed draft fix(kubescape): restore vulnerability summary references #5405 as superseded, since merging it would have downgraded the scanner to v0.3.574.

    • Live read-only check (one GET per summary, 2026-11-16 ~00:30Z):

      Count
      Summaries 186
      all reference in the scanner namespace 162
      all reference still in the workload namespace 24
      Scanner-namespace all references with no manifest of that name 2
      Scanner-namespace relevant references with no manifest of that name 9
    • The 24 that are still wrong are old summaries that have not been rewritten since the upgrade. All 24 workloads still exist. 22 of them are CronJobs or Jobs, which run only briefly, and 2 are Deployments. That matches what the coverage doc already says: rolling out a new image does not rewrite existing summaries. They need a rescan, not another code fix.

    Criteria 1 to 3 are covered by the upstream fix, shipped through the normal protected path. Criterion 4 is still open until the 24 old summaries are rescanned and the 11 references with no manifest are explained. For the rescan, I'll check whether the scanner's scheduled persistence picks up CronJob and Job workloads on its own before proposing a change.

  7. devantler commented on Nov 16, 2026

    @devantler
    ContributorAuthor

    🤖 Generated by the Agentic Engineer

    Re-check after the 01:12Z daily scan (read-only, one GET per summary, about 01:45Z): the daily scan did not rewrite the 24 old summaries.

    00:30Z 01:45Z
    Summaries 186 194
    all reference in the scanner namespace 162 170
    all reference still in the workload namespace 24 24 (20 CronJob, 3 Deployment, 1 Job)
    Scanner-namespace all references with no manifest of that name 2 4
    Scanner-namespace relevant references with no manifest of that name 9 17
    • All 8 new summaries point to the scanner namespace, so the fix holds for every summary written since the upgrade.
    • The daily scan skips images it has already scanned, so the 24 old summaries are only rewritten when their workload's image changes. Waiting for that is slow but needs no new machinery: most of them are CronJobs whose images Renovate moves regularly.
    • The dangling relevant references grew from 9 to 17. That is a separate question, about manifests being pruned or not yet written, and it does not depend on the namespace fix. I will check whether those names appear later before treating it as a defect.

    Next check: the next daily scan after a Renovate image bump to one of the listed CronJobs. Criterion 4 stays open until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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