Skip to content

fix(security): Judge KSV-0017 in k8s/gpu-feature-discovery/daemonset.yaml #5640

Closed

Description

@github-actions

Trivy reports a misconfiguration that no issue names.

  • Rule: KSV-0017
  • 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-0017 at HIGH for k8s/gpu-feature-discovery/daemonset.yaml. The gpu-feature-discovery container runs with privileged: true. The GFD v0.16.2 workload needs this access for NVIDIA GPU devices and sysfs. The change adds a short-lived .trivyignore.yaml entry and files the real manifest fix as a deferred issue.

Acceptance criteria

Requirement: Ignore entry names rule and path

The .trivyignore.yaml file SHALL hold one entry with id: KSV-0017 and paths: [k8s/gpu-feature-discovery/daemonset.yaml].

Scenario: Entry matches the open alert

  • WHEN A reviewer reads .trivyignore.yaml after the pull request.
  • THEN The file holds one entry with the rule KSV-0017 and the path k8s/gpu-feature-discovery/daemonset.yaml.

Requirement: Ignore entry has a short expiry

The entry MUST set expired_at to a date no more than 3 days after the merge date.

Scenario: Entry expires within the agent limit

  • WHEN A reviewer reads the expired_at value.
  • THEN The date is no more than 3 days after the date of the entry.

Requirement: Ignore entry states the reason and tracking issue

The entry statement MUST name the privileged GPU access reason and the deferred tracking issue.

Scenario: Statement is complete

  • WHEN A reviewer reads the statement value.
  • THEN The text names the reason and the number of the deferred issue.

Requirement: Manifest stays unchanged

The pull request SHALL NOT change k8s/gpu-feature-discovery/daemonset.yaml.

Scenario: Privileged mode stays for the GPU workload

  • WHEN A reviewer reads the pull request diff.
  • THEN The diff holds no change to k8s/gpu-feature-discovery/daemonset.yaml.

Requirement: Trivy scan honors the entry

The Trivy config scan SHALL report no open KSV-0017 alert for the path after the entry.

Scenario: Scan reads the ignore file

  • WHEN trivy config runs on the repository with .trivyignore.yaml.
  • THEN The scan reports no KSV-0017 finding for k8s/gpu-feature-discovery/daemonset.yaml.

Existing Tool Considered

No alternatives check has run. Trivy config is the open, maintained tool in the Security Scan. It detects KSV-0017 and reads .trivyignore.yaml. It does not remove the need for the deferred manifest fix. This proposal builds no code, so the build cost is zero.

Key questions

  • Should the change fix the manifest or add a time-limited ignore entry?: Add a time-limited .trivyignore.yaml entry and defer the manifest fix. The GFD v0.16.2 workload needs privileged access to GPU devices and sysfs. A manifest fix would remove that access. (best practice) [sources: SECURITY.md, k8s/gpu-feature-discovery/daemonset.yaml]
    • Rejected: Fix the manifest. Removing privileged: true would remove GPU device access that GFD v0.16.2 needs.
    • Chosen: Add a time-limited ignore entry. SECURITY.md allows this when a fix breaks the workload, and the entry expires by itself.
    • Rejected: Dismiss the alert. An agent does not dismiss a code-scanning alert; only a person does.
  • What expiry does SECURITY.md require for an agent ignore entry?: 3 days, with renewals of at most 14 days in all. A longer date is the owner's decision. [sources: SECURITY.md]
  • Which manifest field does the deferred fix change?: The securityContext.privileged field of the gpu-feature-discovery container in k8s/gpu-feature-discovery/daemonset.yaml. [sources: k8s/gpu-feature-discovery/daemonset.yaml]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

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

    @devops-cli-service
    Contributor
    • Priority: P1-High. HIGH severity security alert with a 14-day judgment deadline.
    • Possible duplicate: fix(security): Judge KSV-0017 in gpu-feature-discovery daemonset #5371, which may ask for the same change. The model names Judge (fix, dismiss, or ignore) the KSV-0017 Trivy-config alert in k8s/gpu-feature-discovery/daemonset.yaml as the change that both ask for. Same rule KSV-0017, same file, same alert 217, same acceptance criteria as item 5371. A person closes one of the two if that is so.
  4. added
    priority/p1-high
    status/ready
    and removed
    status/new
    on Nov 14, 2026
  5. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 0410772 (see proposed design in issue body).

    Moved to new items: #5646.

  6. changed the title [-]fix(security): judge Trivy-config KSV-0017 in k8s/gpu-feature-discovery/daemonset.yaml[/-] [+]fix(security): Judge KSV-0017 in k8s/gpu-feature-discovery/daemonset.yaml[/+] on Nov 14, 2026
  7. devops-cli-service commented on Nov 14, 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-0017 in k8s/gpu-feature-discovery/daemonset.yaml
    • After: fix(security): Judge KSV-0017 in k8s/gpu-feature-discovery/daemonset.yaml
    • Source of the summary: the background model
  8. added
    owner/service
    on Nov 14, 2026
  9. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Staged: branch fix/5640-judge-ksv-0017-in-k8s-gpu, draft pull request #5654. The pull request plans the item and closes no issue.

    The task groups, with the tokens of the inputs of each step, for a budget of 64000 tokens:

    1. Add the dated KSV-0017 ignore entry and its test: 14249 tokens

    A model review of the plan found these points. They stop no draft, and a person judges them:

    • major contrived_test at tasks (1): The new test re-reads the entry that the same group writes and accepts any parseable date, so it passes for a wrong expiry and proves nothing about the issue's 3-day limit or the reason in the statement. Evidence: "asserts a statement that holds #5646 and an expired_at that parses as a date"
    • minor spec_delta_wrong at spec trivy-config-alerts (The privileged GPU workload holds a dated ignore entry): Scenario 1's THEN says only "an expiry date", so no test asserts the requirement's 3-day bound, and scenario 2's second-entry case cannot be exercised by a test that reads the committed file. Evidence: "it finds one misconfiguration entry of the rule KSV-0017 and the path of the GPU feature discovery DaemonSet, and the entry holds a statement with the tracking issue fix(security): remove privileged mode from gpu-feature-discovery #5646 and an expiry date"
    • minor criterion_dropped at issue (The Trivy config scan SHALL report no open KSV-0017 alert for the path after the entry.): The plan has no task that runs trivy config or devops scan report, and the only verify runs pytest, so the criterion that the scan report no KSV-0017 finding for the path is never exercised. Evidence: "The Trivy config scan SHALL report no open KSV-0017 alert for the path after the entry."
    • minor false_premise at proposal (feasibility): The feasibility says the test allowlists each other entry, but the group's implementation only finds the KSV-0017 entry and asserts it; no allowlist exists. Evidence: "the test allowlists each other entry with the reason that another judged alert owns it"

    The runs of the planner and the review made 72 model request(s), and used 4357551 input tokens and 104601 output tokens. The tool calls, in order:

    1. list_files({"directory":""})
    2. search_code({"text":"trivyignore"})
    3. read_file({"path":"SECURITY.md","start_line":55,"end_line":140})
    4. read_file({"path":"tests/security/test_trivy_config_ignore.py"})
    5. search_code({"text":"Judging a Trivy-config Alert"})
    6. list_files({"directory":".github/workflows"})
    7. read_file({"path":"SECURITY.md","start_line":87,"end_line":130})
    8. read_file({"path":".github/workflows/trivy-config-alerts.yml"})
    9. read_file({"path":".github/workflows/ci.yml","start_line":600,"end_line":720})
    10. search_code({"text":"trivy config"})
    11. search_code({"text":"Security Scan"})
    12. search_code({"text":"KSV-"})
    13. read_file({"path":".github/workflows/ci.yml","start_line":60,"end_line":140})
    14. read_file({"path":"src/devops_cli/security/trivy.py"})
    15. read_file({"end_line":300,"path":"src/devops_cli/security/trivy.py","start_line":179})
    16. search_code({"text":"CONST_TRIVY_CONFIG_IGNORE_FILE"})
    17. read_file({"path":".trivyignore"})
    18. list_files({"directory":"k8s/gpu-feature-discovery"})
    19. list_files({"directory":"k8s"})
    20. search_code({"text":"privileged: true"})
    21. find_issues({"terms":"gpu-feature-discovery"})
    22. find_issues({"terms":"KSV-0017"})
    23. read_issue({"number":5646})
    24. read_issue({"number":5371})
    25. search_code({"text":"case path forces the manifest kind"})
    26. search_code({"text":"manifest"})
    27. read_spec({"capability":"roadmap-stage/task-groups","requirement":"A case path forces the manifest kind"})
    28. read_spec({"capability":"trivy-config-alerts"})
    29. search_code({"text":"case_path"})
    30. search_code({"text":"_CASE_PATH"})
    31. read_file({"path":"src/devops_cli/roadmap/stage/stage_form.py","start_line":40,"end_line":90})
    32. read_file({"path":"src/devops_cli/roadmap/stage/stage_form.py","start_line":180,"end_line":300})
    33. read_file({"path":"openspec/specs/trivy-config-alerts/spec.md"})
    34. find_issues({"terms":"trivyignore.yaml"})
    35. search_code({"text":"import yaml"})
    36. read_issue({"number":5639})
    37. read_issue({"number":5092})
    38. read_spec({"capability":"roadmap-stage/task-groups","requirement":"A task group has the kind manifest"})
    39. read_spec({"capability":"roadmap-stage/task-groups","requirement":"The manifest verify runs a case of the group"})
    40. search_code({"text":"Acceptance criteria"})
    41. read_file({"path":"SECURITY.md","start_line":75,"end_line":125})
    42. list_files({"directory":""})
    43. read_file({"path":"tests/security/test_trivy_config_ignore.py"})
    44. read_file({"path":".trivyignore"})
    45. search_code({"text":"CONST_TRIVY_CONFIG_IGNORE_FILE"})
    46. read_issue({"number":5646})
    47. search_code({"text":"privileged: true"})
    48. search_code({"text":"scan report --sarif"})
    49. file_symbols({"path":"src/devops_cli/security/trivy.py"})
    50. find_issues({"terms":"trivyignore.yaml KSV-0017"})
    51. read_issue({"number":5371})
    52. read_spec({"capability":"trivy-config-alerts","requirement":"The IaC scan reads the ignore file with an expiry"})
    53. list_files({"directory":""})
    54. read_spec({})
    55. read_spec({"capability":"trivy-config-alerts"})
    56. search_code({"text":"trivy-config-alerts"})
    57. read_spec({"capability":"trivy-config-alerts","requirement":"The IaC scan reads the ignore file with an expiry"})
    58. read_file({"path":"SECURITY.md","start_line":80,"end_line":140})
    59. read_file({"path":".github/workflows/ci.yml","start_line":80,"end_line":120})
    60. search_code({"text":"ci test"})
    61. references({"name":".trivyignore.yaml"})
    62. read_issue({"number":5646})
    63. read_file({"path":"src/devops_cli/security/alert_filer.py","start_line":55,"end_line":115})
    64. read_file({"path":"openspec/specs/trivy-config-alerts/spec.md","start_line":40,"end_line":75})
    65. read_file({"end_line":860,"path":"tests/invariants/test_agents_md.py","start_line":815})
    66. search_code({"text":"trivyignore"})
    67. read_file({"end_line":445,"path":".github/workflows/ci.yml","start_line":418})
    68. read_file({"end_line":712,"path":".github/workflows/ci.yml","start_line":690})
    69. read_file({"end_line":275,"path":"src/devops_cli/security/trivy.py","start_line":215})
    70. search_code({"text":"\"trivy-config\""})
    71. read_issue({"number":5371})
    72. read_issue({"number":5642})
    73. search_code({"text":"misconfigurations"})
    74. search_code({"text":"REPO_ROOT"})
    75. search_code({"text":"def scan_report"})
    76. search_code({"text":"skip"})
    77. read_file({"end_line":1075,"path":"src/devops_cli/commands/scan.py","start_line":986})
    78. search_code({"text":"def _resolve_selected_scanners"})
    79. read_file({"end_line":985,"path":"src/devops_cli/commands/scan.py","start_line":900})
    80. read_file({"end_line":160,"path":"src/devops_cli/security/trivy.py","start_line":100})
    81. search_code({"text":"cwd="})
    82. search_code({"text":"def scan("})
    83. read_file({"end_line":100,"path":"src/devops_cli/security/trivy.py","start_line":160})
    84. read_file({"end_line":900,"path":"src/devops_cli/security/base.py","start_line":770})
    85. read_issue({"number":5640})
    86. read_issue({"number":4409})
    87. search_code({"text":"trivyignore"})
    88. list_files({"directory":"tests/security"})
    89. list_files({"directory":"openspec/changes"})
    90. list_files({"directory":"openspec"})
    91. read_file({"path":"openspec/changes/3253-map-all-issue-requirements-to-a/proposal.md"})
    92. read_file({"path":"openspec/changes/3427-refuse-a-group-verify-that-runs/proposal.md"})
    93. search_code({"text":"criterion_problems"})
    94. search_code({"text":"class StageCriterion"})
    95. read_file({"end_line":140,"path":"src/devops_cli/roadmap/stage/stage_criteria.py","start_line":1})
    96. read_file({"end_line":260,"path":"src/devops_cli/roadmap/stage/stage_criteria.py","start_line":140})
    97. read_file({"end_line":40,"path":"tests/support/paths.py","start_line":1})
    98. search_code({"text":"test_trivy_config_ignore"})
    99. git_log({"path":".trivyignore.yaml"})
    100. git_log({"path":"tests/security/test_trivy_config_ignore.py"})
    101. read_file({"path":"openspec/changes/archive/2026-11-11-4401-52-trivy-config-alerts-stay-open/tasks.md"})
    102. read_file({"path":"openspec/changes/archive/2026-11-11-4401-52-trivy-config-alerts-stay-open/specs/trivy-config-alerts/spec.md"})
    103. search_code({"text":"def path_problems"})
    104. search_code({"text":"creates"})
    105. read_file({"end_line":760,"path":"src/devops_cli/roadmap/stage/stage_paths.py","start_line":640})
    106. search_code({"text":"def form_problems"})
    107. read_file({"end_line":340,"path":"src/devops_cli/roadmap/stage/stage_form.py","start_line":200})
    108. read_file({"end_line":200,"path":"src/devops_cli/roadmap/stage/stage_form.py","start_line":100})
    109. read_file({"end_line":100,"path":"src/devops_cli/roadmap/stage/stage_form.py","start_line":1})
    110. search_code({"text":"def build_trivy_scan_cmd"})
    111. read_file({"end_line":140,"path":"src/devops_cli/config/commands.py","start_line":74})
    112. read_spec({"capability":"openspec-check"})
    113. read_spec({"capability":"roadmap-stage/tests-gate"})
    114. search_code({"text":"import yaml"})
    115. search_code({"text":"pyyaml"})
    116. find_issues({"terms":"trivyignore.yaml KSV-0017"})
    117. read_issue({"number":5641})

    Tool calls: file_symbols=1 (empty=0), find_issues=5 (empty=0), git_log=2 (empty=1), list_files=9 (empty=0), read_file=40 (empty=0), read_issue=12 (empty=0), read_spec=10 (empty=0), references=1 (empty=0), search_code=37 (empty=0)

    The stage job read the open pull requests and their files in 1 GraphQL request(s).

  10. removed
    owner/service
    on Nov 14, 2026
  11. 2 remaining items

  12. added
    status/planned
    owner/service
    status/in-progress
    and removed
    status/planned
    on Nov 14, 2026
  13. added
    status/in-review
    and removed
    status/in-progress
    on Nov 14, 2026
  14. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Stopped at group 1.

    Failure class: limit_reached.
    Action taken: none.
    Action left: raise_limit: raise the limit that the run went over.

    Step Status Attempts Tokens in/out Last failing command
    group 1 stopped 1 1937362/14472 -

    Reason:

    LimitReached: The step spent its budget `roadmap.implement.step_time_limit_seconds=10800`.
    Refused commands: uv 1. Other retries: 0.
    

    Last message of the agent (a claim that no check verified): I'll start by reading the relevant files.

    The job discarded this work. Read it before you retry:

    diff --git a/.trivyignore.yaml b/.trivyignore.yaml
    new file mode 100644
    index 000000000..75257ff6c
    --- /dev/null
    +++ b/.trivyignore.yaml
    @@ -0,0 +1,14 @@
    +# Trivy config (IaC) ignore file. The `trivy config` scan names this file with `--ignorefile`.
    +# An entry holds the rule `id`, the `paths` of the file, a `statement` with the reason and the
    +# tracking issue, and an `expired_at` date. Trivy stops applying the entry after that date.
    +misconfigurations:
    +  # The gpu-feature-discovery container of GFD v0.16.2 runs `privileged: true` to read the NVIDIA
    +  # GPU devices and the host sysfs of the node. The manifest change is deferred to #5646, and this
    +  # entry expires 3 days after its date (SECURITY.md, "Judging a Trivy-config Alert").
    +  - id: KSV-0017
    +    paths:
    +      - k8s/gpu-feature-discovery/daemonset.yaml
    +    statement: >-
    +      The gpu-feature-discovery container of the GFD v0.16.2 DaemonSet runs privileged to read the
    +      NVIDIA GPU devices and the host sysfs of the node. The manifest change is deferred to #5646.
    +    expired_at: 2026-11-17
    diff --git a/tests/security/test_trivy_config_ignore.py b/tests/security/test_trivy_config_ignore.py
    index 3dd463ef1..91ac30f44 100644
    --- a/tests/security/test_trivy_config_ignore.py
    +++ b/tests/security/test_trivy_config_ignore.py
    @@ -7,9 +7,19 @@ is named with `--ignorefile`.
     
     from __future__ import annotations
     
    +from datetime import date
     from pathlib import Path
     
    +import yaml
    +
     from devops_cli.security.trivy import TrivyConfigScanner, TrivyScanner
    +from tests.support.paths import REPO_ROOT
    +
    +# The rule, the path and the tracking issue of the judged alert of the privileged GPU workload
    +# (#5640).
    +KSV_0017 = "KSV-0017"
    +GPU_FEATURE_DISCOVERY_DAEMONSET = "k8s/gpu-feature-discovery/daemonset.yaml"
    +PRIVILEGED_GPU_TRACKING_ISSUE = "#5646"
     
     
     def test_the_config_scan_names_the_yaml_ignore_file_of_its_directory(tmp_path: Path) -> None:
    @@ -33,3 +43,23 @@ def test_the_other_trivy_scans_keep_the_plain_ignore_file(tmp_path: Path) -> Non
         cmd = TrivyScanner().build_command(tmp_path, cwd=tmp_path)
     
         assert "--ignorefile" not in cmd
    +
    +
    +def test_the_repository_ignore_file_holds_the_privileged_gpu_entry() -> None:
    +    """Verify the dated KSV-0017 entry of the privileged GPU feature discovery DaemonSet (#5640).
    +
    +    The entry judges the alert and not the manifest, so the test reads the rule, the path, the
    +    tracking issue of the statement and the expiry date, and it accepts the other entries of the
    +    file.
    +    """
    +    ignore = yaml.safe_load((REPO_ROOT / ".trivyignore.yaml").read_text(encoding="utf-8"))
    +    matching = [
    +        entry
    +        for entry in ignore["misconfigurations"]
    +        if entry["id"] == KSV_0017 and GPU_FEATURE_DISCOVERY_DAEMONSET in entry["paths"]
    +    ]
    +
    +    assert len(matching) == 1
    +    (entry,) = matching
    +    assert PRIVILEGED_GPU_TRACKING_ISSUE in entry["statement"]
    +    assert date.fromisoformat(str(entry["expired_at"]))

    The item is Blocked, and the job will not run it. Fix the cause. Then comment implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits of roadmap.implement.digest_clears_per_class and roadmap.implement.digest_clears_per_item allow it.

  15. added
    status/blocked
    and removed
    status/in-review
    on Nov 14, 2026
  16. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-runner-20261114-131905-6918 ended: succeeded.
    Image digest: sha256:a3e30c23480a05adffa79895dbb3f2ad177ba00690aae950b8e1ae3334561191

    The last lines of its log:

    Tool call: run_command, program uv, ok.
    Tool call: grep, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: write_file, ok.
    Tool call: run_command, started: uv run devops ci test tests/security/test_trivy_config_ignore.py
    Tool call: run_command, program uv, ok.
    Tool call: read_file, ok.
    Tool call: grep, ok.
    Tool call: grep, ok.
    Tool call: run_command, started: grep -rn also_copy .venv/lib/python3.14/site-packages/mutmut/ | head ...
    Tool call: run_command, program grep, ok.
    Tool call: read_file, ok.
    Tool call: run_command, started: git ls-files -o -c --exclude-standard -- ...
    Tool call: run_command, program git, ok.
    Tool call: grep, ok.
    Tool call: list_files, ok.
    Tool call: grep, ok.
    Tool call: read_file, ok.
    Tool call: run_command, started: uv run ruff check tests/security/test_trivy_config_ignore.py
    Tool call: run_command, started: uv run devops openspec check
    Tool call: run_command, program uv, ok.
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: uv run devops ci test tests/security
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: grep -rn test-tree\\|test_tree src/devops_cli/ci/ --include=<masked> | ...
    Tool call: run_command, program grep, ok.
    Tool call: run_command, started: grep -rn test-tree src/ tests/gate/ --include=<masked> ...
    Tool call: run_command, program grep, ok.
    Tool call: run_command, started: uv run devops ci test-tree
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: grep -n <masked> src/devops_cli/commands/ci.py | head ...
    Tool call: run_command, program grep, ok.
    Tool call: run_command, started: grep -rn <masked> src/devops_cli/ci/*.py | head ...
    Tool call: run_command, program grep, ok.
    Tool call: read_file, ok.
    Tool call: run_command, started: grep -n _python_check_cmd src/devops_cli/commands/ci.py | head ...
    Tool call: run_command, program grep, ok.
    Failure class limit_reached. Action left: raise_limit.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    
  17. removed
    owner/service
    on Nov 14, 2026
  18. removed
    status/blocked
    on Nov 14, 2026
  19. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-14 17:02 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/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions