Repository navigation
Description
Update 2026-11-26 (infra move): add no ignore entry for this alert.
- The live manifest is in dan-petty/homelab. Its trivy check reads HIGH and CRITICAL findings only, and KSV-0022 is MEDIUM.
- The copy
k8s/llm/profiles/ollama-profiles.yamlhere deploys nothing. Step 17 (refactor(k8s): delete the environment files from devops-cli #7290) deletes it. - Close this issue when step 17 is merged and code scanning shows alert 232 as fixed.
Trivy reports a misconfiguration that no issue names.
- Rule: KSV-0022
- Path: k8s/llm/profiles/ollama-profiles.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-0022, a hostPath mount, for k8s/llm/profiles/ollama-profiles.yaml at MEDIUM severity, and alert 232 is open. The hostPath /var/lib/ollama holds the model cache of each GPU node, so replacing it needs a per-node storage design that touches the hand-written tiers and the render template. This item judges the alert with a time-limited entry in .trivyignore.yaml that states the reason and the tracking issue and expires 3 days after it is added, the agent's limit; the agent renews it to at most 14 days in all, and only the owner sets a longer date.
Acceptance criteria
Requirement: The KSV-0022 finding of the Ollama profiles file is ignored
.trivyignore.yaml SHALL hold one misconfigurations entry with the id KSV-0022, the path k8s/llm/profiles/ollama-profiles.yaml, a statement that names the hostPath model cache and the tracking issue #7107, and an expired_at no later than 3 days after the entry.
Scenario: The Security Scan drops KSV-0022
- WHEN An agent runs
uv run devops scan report . --scanner trivy-config --format jsonat the repository root before the entry'sexpired_at. - THEN The report holds no finding with the location
k8s/llm/profiles/ollama-profiles.yaml:KSV-0022.
Requirement: The entry hides no other finding
The entry SHALL hide KSV-0022 on k8s/llm/profiles/ollama-profiles.yaml alone and keep every other finding of the scan in the report.
Scenario: Other findings stay
- WHEN An agent runs
uv run devops scan report . --scanner trivy-config --format jsonat the merge commit and at its parent commit. - THEN The merge report holds each finding location of the parent report except
k8s/llm/profiles/ollama-profiles.yaml:KSV-0022, and adds none.
Requirement: The entry stops hiding the finding after its date
The entry SHALL stop hiding KSV-0022 after its expired_at date, so that the scan reports the finding again.
Scenario: The finding returns after the expiry date
- WHEN An agent runs
uv run devops scan report . --scanner trivy-config --format jsonon the day after the entry'sexpired_at. - THEN The report holds the finding with the location
k8s/llm/profiles/ollama-profiles.yaml:KSV-0022again.
Existing Tool Considered
No alternatives check has run. Trivy's own .trivyignore.yaml filter, open source and maintained by Aqua Security, covers the need, and the repository already uses it: TrivyConfigScanner names the file with --ignorefile (src/devops_cli/security/trivy.py:231), and an entry takes the rule id, the paths, a statement and an expiry date. It lacks a judgement: it hides a finding and leaves the risk decision, the reason and the expiry date to the author. This change builds no code.
Key questions
- Which judgement does alert 232 get?: A time-limited
.trivyignore.yamlentry. It names KSV-0022 andk8s/llm/profiles/ollama-profiles.yaml, states the reason and the tracking issue fix(security): judge KSV-0022 in k8s/llm/profiles/ollama-profiles.yaml #7107, and expires 3 days after the entry, the agent's limit; the agent renews it to at most 14 days in all, and a longer date is the owner's decision named in the statement. (best practice) [sources: SECURITY.md:126, SECURITY.md:127, SECURITY.md:128, .trivyignore.yaml:1, k8s/llm/profiles/ollama-profiles.yaml:196]- Rejected: Fix the manifest: replace each hostPath with a node-local PersistentVolume. The hostPath appears in the hand-written tiers above the render marker and in the rendered tiers of
tier-templates/ollama-48gib-slow.yaml, so the fix changes the storage of each GPU node and does not fit one pull request. - Rejected: Dismiss alert 232 in GitHub code scanning. SECURITY.md:128 leaves a dismissal to a person, and the record lives outside the repository with no date that forces a new judgement.
- Chosen: Time-limited
.trivyignore.yamlentry. The repository holds the file,devops scan reportnames it with--ignorefile, the next scan closes alert 232, and the expiry date forces a new judgement.
- Rejected: Fix the manifest: replace each hostPath with a node-local PersistentVolume. The hostPath appears in the hand-written tiers above the render marker and in the rendered tiers of
- Is the hostPath mount a defect that needs a code fix now?: The finding is true but mitigated: the mount is the model directory
/var/lib/ollamaof the GPU node, the pod runs as UID 10001 with RuntimeDefault seccomp and no privilege escalation, and the ollama container drops all capabilities and has a read-only root filesystem. Dropping the mount needs a per-node storage design, so the risk is recorded rather than removed in this item. (best practice) [sources: k8s/llm/profiles/ollama-profiles.yaml:92, k8s/llm/profiles/ollama-profiles.yaml:135, k8s/llm/profiles/ollama-profiles.yaml:196, SECURITY.md:127]- Rejected: Verified: fix the manifest now. The mount reaches a data directory that the workload owns, and the container holds no capability to change the host; the fix is a storage redesign of each GPU node.
- Chosen: Mitigated: accept the mount and record the reason. The manifest bounds the risk, and a time-limited entry records the judgement and its review date.
- Rejected: Invalidated: the finding is a false positive. The mount does reach the host, so the finding is true. The bounds limit the risk, not the finding.
- Does this change edit
k8s/llm/profiles/ollama-profiles.yaml?: No. The tiers above the# BEGIN rendered by devops ai gateway render from gpu-thresholds.yamlmarker at line 658 are hand-written, and the tiers below it are the output ofdevops ai gateway render --applyfromgpu-thresholds.yamlandtier-templates/ollama-48gib-slow.yaml. The hostPath volume appears in both regions, so a fix would change the hand-written tiers and the template, not this judgement. The ignore entry names the file and leaves it as it is. [sources: k8s/llm/profiles/ollama-profiles.yaml:198, k8s/llm/profiles/ollama-profiles.yaml:658, k8s/llm/profiles/tier-templates/ollama-48gib-slow.yaml:158, k8s/README.md:241] - Which expiry date does the entry get?: The day of the entry plus 3 days, the agent's limit; the agent renews it 3 days at a time to at most 14 days in all, and a longer date is the owner's decision, named in the statement. (best practice) [sources: SECURITY.md:81, SECURITY.md:127]
- Chosen: 3 days, renewed to at most 14 days. SECURITY.md:127 applies the limits of "A Finding with No Fix" to a Trivy-config entry: 3 days, renewed at most up to 14 days in all, and SECURITY.md:81 sets the date to the day of the entry plus 3 days.
- Rejected: 14 days in one entry. 14 days is the ceiling of the renewals, not the length of one entry.
- Rejected: 90 days. A longer date is the owner's decision (SECURITY.md:127), and no owner decision is recorded for this alert.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 25, 2026
Both follow the same Trivy-config alert judgment process, but target different rules and files.[-]fix(security): judge Trivy-config KSV-0022 in k8s/llm/profiles/ollama-profiles.yaml[/-][+]fix(security): judge KSV-0022 in k8s/llm/profiles/ollama-profiles.yaml[/+]devops-cli-service commentedon Nov 25, 2026
The job shortened the title of this item. The summary had 68 characters, and the limit is 60. The type and the scope stay.
fix(security): judge Trivy-config KSV-0022 in k8s/llm/profiles/ollama-profiles.yamlfix(security): judge KSV-0022 in k8s/llm/profiles/ollama-profiles.yamldevops-cli-service commentedon Nov 25, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
dan-petty commentedon Nov 26, 2026
Closed: step 17 (#7317) deleted
k8s/llm/profiles/ollama-profiles.yaml, and code scanning shows alert 232 as fixed on 2026-11-26.No manifest of this repository needs a change and no ignore entry is needed.