Skip to content

security(k8s): the KSV-01010 opaque-value detector also matches container image references #3243

Description

@devantler

🤖 Generated by the Agentic Engineer

Evidence

The KSV-01010 content-premise guard's opaque-value detector uses the base64url character class so it
can catch modern tokens (#3240 / PR #3241):

^[[:space:]]*[A-Za-z0-9_.-]+:[[:space:]]*"?[A-Za-z0-9+/=_.-]{40,}"?[[:space:]]*$

/, . and - are all members, so a container image reference of 40+ characters matches it.
Measured:

ghcr.io/devantler-tech/provider-upjet-unifi              (43) -> MATCHES
registry.k8s.io/kube-state-metrics/kube-state-metrics    (53) -> MATCHES
https://platform.devantler.tech/some/long/path/here      (51) -> no match (":" not in the class)

Impact

Low and fail-closed. If a long image reference is ever added to one of the three excepted ConfigMaps
(k8s/clusters/{prod,local}/bootstrap/config-map.yaml, k8s/bases/apps/actual-budget/config-map.yaml)
the guard fails CI claiming credential-shaped content. That is the safe direction — a human re-reads
the exception — but it is a false positive, and a guard that cries wolf is one people learn to
route around.

No such value exists in any of the three files today, which is why this is a follow-up rather
than a fix inside #3241.

Why the obvious fix is wrong

Dropping / from the class would remove the false positive and weaken real detection: standard
base64 credentials contain /, and catching a pasted base64 blob is the detector's original purpose.

Expected

Exclude registry/image-reference shape rather than a character. A value whose leading segment looks
like a host (^[a-z0-9-]+(\.[a-z0-9-]+)+/) is an image or path reference, not credential material,
and can be skipped before the length test — leaving base64 and base64url detection untouched.

Acceptance criteria

  • A 40+ character image reference in an excepted ConfigMap does not trip the guard.
  • The existing detector self-test still passes unchanged, and both per-detector ablations still
    fire (narrowing the value class, and neutralising the prefix detector).
  • A standard-base64 credential containing / is still caught — add it as a fixture, since that
    is the case the naive fix would have broken.

Size

Small. The self-test harness and its per-detector assertions already exist; this adds one exclusion
and two fixtures.

Part of #2787

Activity

  1. moved this to 📥 Backlog in 🌊 Project Boardon Aug 19, 2026
  2. coderabbitai commented on Aug 19, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #3222 - ci(security): fail when a checkov skip reason is truncated by YAML comment syntax [merged]
    #3229 - security(k8s): rule on the KSV-0014 findings on the vendored VM-stack operators [merged]
    #3210 - security(k8s): disposition vendored KubeVirt and CDI operator RBAC as a class [merged]
    #3212 - docs(kubescape): record the keep decision for the three unfalsifiable controls [merged]
    #3216 - security(trivy): declare the trusted registries so KSV-0125 gates instead of noises [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!

  3. self-assigned this
    on Aug 29, 2026
  4. added a commit that references this issue on Aug 29, 2026
  5. moved this from 📥 Backlog to 👀 In Review in 🌊 Project Boardon Aug 29, 2026
  6. moved this from 👀 In Review to ✅ Done in 🌊 Project Boardon Aug 30, 2026
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

Fields

No fields configured for Security.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions