Skip to content

security(umami): disposition CKV_K8S_38 β€” the provisioning Lease client needs its SA tokenΒ #3198

Description

@devantler

πŸ€– Generated by the Agentic Engineer

Evidence

CKV_K8S_38 ("Ensure that Service Account Tokens are only mounted where necessary") fails on
CronJob.umami.umami-provision-tenants. Reproduced with the repository's own
scripts/megalinter-scan-counts.sh at main (9a84e92b): 3 failing checkov checks, of which
this is one β€” the other two are the CKV_K8S_40 pair tracked by #2904.

It appeared after #3116 and #3122 reworked this CronJob's credential handling; it is the last
finding on this workload.

Why the token is necessary

The check is a false positive here, and the reason is verifiable in the manifests rather than
asserted:

  • The provisioning script reads /var/run/secrets/kubernetes.io/serviceaccount/{token,namespace,ca.crt}
    and calls coordination.k8s.io/v1 directly (KUBERNETES_SERVICE_HOST) to hold a Lease, which
    serialises the scheduled and bootstrap provisioners against each other.
  • role-provision-tenants.yaml grants exactly get + update on leases, narrowed by
    resourceNames to the single umami-provision-tenants Lease. No Secrets, no workloads, no other
    coordination object.
  • service-account-provision-tenants.yaml keeps the account-level default
    automountServiceAccountToken: false, so the token is opted into per pod, not granted broadly.

That is already the least-privilege shape the check exists to encourage: the token is both required
and minimally scoped. Removing the mount would break run serialisation; there is nothing left to
tighten.

Expected behaviour

The finding is dispositioned with a scoped, stated reason, matching the existing
checkov.io/skip1 on this same CronJob and the pattern used in vault-backup/job.yaml β€” never a
blanket disable.

Acceptance criteria

Rough size: small β€” one annotation plus its rationale comment.

Part of #2787.

Activity

  1. coderabbitai commented on Aug 17, 2026

    @coderabbitai
    Contributor
    πŸ”— Related PRs

    #3086 - security(minio): read the root credential from a file instead of the environment [merged]
    #3113 - fix(coredns): disposition CKV_K8S_11 as a stored-spec blind spot [merged]
    #3116 - fix(umami): run the tenant-provisioning container on a read-only root filesystem [merged]
    #3142 - docs(kubescape): correct the controller-rbac migration guidance [merged]
    #3166 - fix(umami): declare the provisioning ServiceAccount so Flux can reconcile it [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!

  2. added a commit that references this issue on Aug 17, 2026
  3. moved this from πŸ‘€ In Review to πŸ“₯ Backlog in 🌊 Project Boardon Aug 17, 2026
  4. moved this from πŸ“₯ Backlog to βœ… Done in 🌊 Project Boardon Aug 17, 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

    Fields

    No fields configured for Security.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions