Skip to content

fix(security): Judge KSV-0014 in gpu-feature-discovery daemonset #5791

Description

@github-actions

Trivy reports a misconfiguration that no issue names.

  • Rule: KSV-0014
  • Path: k8s/gpu-feature-discovery/daemonset.yaml
  • Severity: HIGH

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 config reports KSV-0014 for k8s/gpu-feature-discovery/daemonset.yaml (alert 268, HIGH): the gpu-feature-discovery container has no read-only root file system. The container sets only privileged: true. SECURITY.md makes the file fix the first choice, so the change sets readOnlyRootFilesystem: true and keeps the privileged access that the dated KSV-0017 entry covers. If a GPU node shows that gpu-feature-discovery writes to its own root file system, the fallback is a dated .trivyignore.yaml entry with a statement and an expiry, under the limits of "A Finding with No Fix".

Acceptance criteria

Requirement: Read-only root file system

The gpu-feature-discovery container SHALL set readOnlyRootFilesystem to true.

Scenario: The manifest sets a read-only root file system

  • WHEN A test loads k8s/gpu-feature-discovery/daemonset.yaml and reads the securityContext of the gpu-feature-discovery container.
  • THEN The test finds readOnlyRootFilesystem set to true.

Requirement: Privileged GPU access stays

The change MUST keep privileged: true and the two hostPath mounts of the gpu-feature-discovery container.

Scenario: The privileged access is unchanged

  • WHEN A test loads k8s/gpu-feature-discovery/daemonset.yaml.
  • THEN The test finds privileged set to true and the hostPath volumes output-dir and host-sys.

Requirement: No KSV-0014 result

The IaC scan SHALL report no KSV-0014 result for k8s/gpu-feature-discovery/daemonset.yaml.

Scenario: A Trivy config run on the folder

  • WHEN trivy config runs on k8s/gpu-feature-discovery with the repository ignore file and the check update off.
  • THEN The scan prints no result whose ID is KSV-0014 for that path.

Existing Tool Considered

No alternatives check has run. Trivy config covers the need: the repository already runs it in the Security Scan step and in .github/workflows/trivy-config-alerts.yml, it reports KSV-0014, and it reads .trivyignore.yaml. It lacks a fix: it names the missing field and changes no manifest. The change builds no code; it adds one YAML field and one test, so its cost is minutes of edit and review, not tokens of build and upkeep.

Key questions

  • Which part of k8s/gpu-feature-discovery/daemonset.yaml does KSV-0014 name?: The container securityContext holds only privileged: true. KSV-0014 is the Trivy check for a container with no read-only root file system, so it names the missing readOnlyRootFilesystem field. Refine confirms the rule text from the Trivy Kubernetes check documentation. [sources: k8s/gpu-feature-discovery/daemonset.yaml, .trivyignore.yaml]
  • Does the gpu-feature-discovery container write to its own root file system?: No path shows a write there. The container writes the feature file to the output-dir hostPath mount at /etc/kubernetes/node-feature-discovery/features.d and reads /sys from the host-sys mount. A GPU node confirms this when the manifest rolls out. [sources: k8s/gpu-feature-discovery/daemonset.yaml]
  • Should the change fix the manifest, add an ignore entry, or dismiss the alert?: Fix the manifest. SECURITY.md makes the fix the first choice, and no evidence shows that a read-only root file system breaks the workload. (best practice) [sources: SECURITY.md]
    • Chosen: Set readOnlyRootFilesystem: true in the manifest. SECURITY.md names the file fix as the first choice, and the container writes only to its mounted paths.
    • Rejected: Add a KSV-0014 entry to .trivyignore.yaml. SECURITY.md allows an ignore entry only when the fix breaks the workload or needs an unreleased change, and neither holds here.
    • Rejected: Dismiss the alert in code scanning. SECURITY.md lets only a person dismiss an alert, and an agent does not.
  • How does the change keep the privileged GPU access that KSV-0017 names?: Keep privileged: true and the two hostPath mounts. The dated KSV-0017 entry in .trivyignore.yaml stays until 2026-11-17, and the fix adds only readOnlyRootFilesystem: true. (best practice) [sources: .trivyignore.yaml, k8s/gpu-feature-discovery/daemonset.yaml]
    • Chosen: Keep privileged and add a read-only root file system. gpu-feature-discovery needs the NVIDIA device and sysfs access, and the KSV-0017 entry already covers that access until its date.
    • Rejected: Drop privileged in the same change. gpu-feature-discovery loses device and sysfs access, and the KSV-0017 entry would stay with no cause.
  • How does a test check the fix offline?: A test parses the manifest and asserts readOnlyRootFilesystem true on the gpu-feature-discovery container. The Security Scan step of CI then shows that the alert closes. (best practice) [sources: SECURITY.md, tests/invariants/test_k8s_mcp_server_policies.py]
    • Chosen: A YAML-parse test in tests/invariants/. It runs offline with no Trivy cache, and the folder already holds manifest invariants such as test_k8s_mcp_server_policies.py.
    • Rejected: Run trivy config inside the test. It needs the Trivy check bundle and is slower, and the CI scan already covers the rule.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

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

    @devops-cli-service
    Contributor
    • Priority: P1-High. The alert is a live HIGH severity security misconfiguration that needs a judgement.
    • Possible duplicate: fix(security): Judge Trivy-config KSV-0014 in gpu-feature-discovery #5639, which may ask for the same change. The model names Judge Trivy-config alert 268 for rule KSV-0014 in k8s/gpu-feature-discovery/daemonset.yaml by a fix, a dismissal or a time-limited .trivyignore.yaml entry. as the change that both ask for. Item 5639 names the same rule KSV-0014, the same path and the same alert 268, so one delivery closes both. A person closes one of the two if that is so.
  4. added
    priority/p1-high
    on Nov 15, 2026
  5. changed the title [-]fix(security): judge Trivy-config KSV-0014 in k8s/gpu-feature-discovery/daemonset.yaml[/-] [+]fix(security): Judge KSV-0014 in gpu-feature-discovery daemonset[/+] on Nov 15, 2026
  6. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

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

    • Before: fix(security): judge Trivy-config KSV-0014 in k8s/gpu-feature-discovery/daemonset.yaml
    • After: fix(security): Judge KSV-0014 in gpu-feature-discovery daemonset
    • Source of the summary: the background model
  7. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Waiting for the alternatives check to run. The next refine round looks at the item again after the check records a verdict.

  8. added
    status/in-review
    and removed
    status/new
    on Nov 15, 2026
  9. removed
    status/in-review
    on Nov 15, 2026
  10. added a commit that references this issue on Nov 15, 2026
  11. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-15 13:55 UTC

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/p1-highscope/securitytype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions