Skip to content

fix(security): Judge Trivy-config KSV-0013 in cronjob-repos-drift.yaml #7106

Not planned

Description

@github-actions

Trivy reports a misconfiguration that no issue names.

  • Rule: KSV-0013
  • Path: k8s/devops/cronjob-repos-drift.yaml
  • Severity: MEDIUM

Open alerts:

Judge it under "Judging a Trivy-config Alert" in SECURITY.md: fix the file, dismiss the alert with a reason, or add a time-limited entry to .trivyignore.yaml. The owner judges a CRITICAL alert within 24 hours. An agent judges any other alert within 14 days.

Proposed design

Problem statement

Trivy reports KSV-0013, a medium misconfiguration, for k8s/devops/cronjob-repos-drift.yaml. The pod sets non-root values, but the container securityContext does not repeat them. The change sets runAsNonRoot and runAsUser on the container and makes the Trivy scan clean.

Acceptance criteria

Requirement: Container non-root security context

The repos-drift container MUST set runAsNonRoot: true and runAsUser: 1000 in its container securityContext.

Scenario: Trivy config scan is clean

  • WHEN uv run devops review path k8s/devops/cronjob-repos-drift.yaml runs
  • THEN The review reports no KSV-0013 finding for k8s/devops/cronjob-repos-drift.yaml.

Existing Tool Considered

No alternatives check has run. Trivy is the open, maintained scanner that reports KSV-0013, and the repository already uses it in its review tools (SECURITY.md). The change builds no code. It only sets fields in the Kubernetes manifest, so it has no build cost.

Key questions

  • Which remedy does SECURITY.md allow for KSV-0013: fix the file, dismiss the alert, or add a time-limited ignore entry?: Fix the file. Add runAsNonRoot: true and runAsUser: 1000 to the container securityContext. The pod already sets these values. The container repeats them, and the Trivy scan then passes. A dismissal has no evidence of a false positive. An ignore entry is not needed because a permanent fix is available. (best practice) [sources: SECURITY.md, k8s/devops/cronjob-repos-drift.yaml]
    • Chosen: Fix the manifest. The container can set the non-root fields with no behavior change, and the scan then passes.
    • Rejected: Dismiss the alert. The issue shows no false positive. The container context does not repeat the non-root fields.
    • Rejected: Add a time-limited ignore entry. A permanent manifest fix exists, so SECURITY.md does not need an ignore entry.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    scope/security
    on Nov 25, 2026
  2. added
    status/new
    value/medium
    effort/low
    on Nov 25, 2026
  3. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor
  4. changed the title [-]fix(security): judge Trivy-config KSV-0013 in k8s/devops/cronjob-repos-drift.yaml[/-] [+]fix(security): Judge Trivy-config KSV-0013 in cronjob-repos-drift.yaml[/+] on Nov 25, 2026
  5. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    The job shortened the title of this item. The summary had 66 characters, and the limit is 60. The type and the scope stay.

    • Before: fix(security): judge Trivy-config KSV-0013 in k8s/devops/cronjob-repos-drift.yaml
    • After: fix(security): Judge Trivy-config KSV-0013 in cronjob-repos-drift.yaml
    • Source of the summary: the background model
  6. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    Contributor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

  7. dan-petty commented on Nov 28, 2026

    @dan-petty
    Owner

    Superseded by #7562, which tracks the same Trivy-config KSV-0013 alert (1188) on k8s/devops/cronjob-repos-drift.yaml.

  8. removed
    status/new
    on Nov 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

    effort/lowpriority/p2-mediumscope/securitytype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions