Description
Trivy reports a misconfiguration that no issue names.
- Rule: DS-0029
- Path: .venv/lib/python3.14/site-packages/harbor/cli/template-adapter/task-template/environment/Dockerfile
- 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 reports DS-0029 at .venv/lib/python3.14/site-packages/harbor/cli/template-adapter/task-template/environment/Dockerfile, a template file of the locked harbor package inside the local virtual environment. The path is not repository source and no image build copies it, so the file cannot be fixed here, and the time-limited .trivyignore.yaml entry expired on 2026-11-26 and the alert returned. The change makes the trivy-config scan skip .venv, drops the expired .venv entries, and lets code-scanning alert 281 close when the scan on main no longer reports it.
Acceptance criteria
Requirement: The config scan skips the virtual environment
The trivy-config command SHALL name --skip-dirs .venv so the scan reads no file of the local virtual environment.
Scenario: Command of the config scan
- WHEN
uv run devops ci test tests/config/test_command_builders.pyruns the test ofbuild_trivy_scan_cmdfor theconfigscan type - THEN The command passes and the test asserts that the
configcommand holds--skip-dirsfollowed by.venv.
Requirement: Only the config scan skips the virtual environment
The fs scan of build_trivy_scan_cmd MUST build the same command as today, with no --skip-dirs.
Scenario: Command of the filesystem scan
- WHEN
uv run devops ci test tests/config/test_command_builders.pyruns the test ofbuild_trivy_scan_cmdfor thefsscan type - THEN The command passes and the test asserts that the
fscommand holds no--skip-dirs.
Requirement: The Security Scan reports no virtual-environment finding
The trivy-config scan of the repository MUST report no finding for a file under .venv without an ignore entry for that path.
Scenario: Config scan with the installed Harbor package and no virtual-environment ignore
- WHEN
uv run devops scan report --scanner trivy-config . --format jsonruns at the repository root afteruv syncinstalledharbor0.27.0 into.venvand the four.venventries have left.trivyignore.yaml - THEN The command reports no finding whose location is under
.venv.
Requirement: Pending a person after the merge
Code-scanning alert 281 SHALL close as fixed after the first Security Scan on main that skips .venv.
Scenario: Alert 281 after the merge
- WHEN After the merge,
uv run devops gh api repos/dan-petty/devops-cli/code-scanning/alerts/281 --jq '.state'runs once the Security Scan onmainhas uploaded its SARIF - THEN The command prints
fixed.
Existing Tool Considered
Trivy is the open, maintained tool that covers the need: the pinned ghcr.io/aquasecurity/trivy:0.76.2 (.github/actions/image-scan/action.yml:54) runs trivy config, and its --skip-dirs option leaves a directory out of a scan (openspec/changes/archive/2026-11-20-4361-runner-from-devtools/design.md:25). It lacks the knowledge that .venv holds installed packages rather than project source, so the change names .venv in the exclusion. No alternatives check has run.
Key questions
- Is the reported Dockerfile part of the repository or a built image?: Neither. The path is
.venv/lib/python3.14/site-packages/harbor/cli/template-adapter/task-template/environment/Dockerfile, a template file of the lockedharbor0.27.0 package thatuv syncinstalls into the gitignored local virtual environment;.dockerignoreleaves.venvout of every image build context, so no repository file and no built image holds it. [sources: uv.lock:1589, .trivyignore.yaml:9] - Which judgment does SECURITY.md require for a Trivy-config alert at a path inside
.venv?: Make thetrivy-configscan skip.venvand drop the expired.venventries from.trivyignore.yaml, so the finding no longer exists and code-scanning alert 281 closes as fixed. An agent must not dismiss the alert (SECURITY.md:132), and a time-limited ignore lets the same alert return when it expires, as the DS-0029 entry that expired on 2026-11-26 shows. If alert 281 is still open after the scan onmainno longer reports it, a person dismisses it underSECURITY.md:132; an agent does not. (best practice) [sources: SECURITY.md:129, SECURITY.md:131, SECURITY.md:132, .trivyignore.yaml:7, CHANGELOG.md:5910]- Rejected: Fix the Harbor template Dockerfile. The file is in the installed
harborpackage inside.venv, not in this repository, and no image build copies it. - Chosen: Exclude
.venvfrom the config scan. The scan stops reading files that are never project source, and the alert closes when the next analysis no longer reports it. - Rejected: Renew the
.trivyignore.yamlentry. The entry expired on 2026-11-26 and the alert returned; another date repeats the cycle. - Rejected: Dismiss alert 281 as a false positive. An agent does not dismiss an alert; only a person does, and the false positive would stay in the scan.
- Rejected: Fix the Harbor template Dockerfile. The file is in the installed
- How should the config scan exclude
.venv?: Add--skip-dirs .venvto theconfigcommand thatbuild_trivy_scan_cmdbuilds (src/devops_cli/config/commands.py:77), so the exclusion applies only to the config scan and a unit test covers the command. Do not add a roottrivy.yaml: Trivy reads that file for every scan that starts in the workspace, including the image scans whose runner uses the workspace as its working directory, so ascan.skip-dirsentry could also hide findings inside an image. (best practice) [sources: src/devops_cli/config/commands.py:77, src/devops_cli/security/trivy.py:147, .github/actions/image-scan/action.yml:50, openspec/changes/archive/2026-11-20-4361-runner-from-devtools/design.md:25]- Chosen: Pass
--skip-dirs .venvon theconfigcommand. It uses Trivy's own path exclusion, changes no other scan, and the command builder is covered by an offline test. - Rejected: Add a root
trivy.yamlwithscan.skip-dirs. Trivy reads it for every scan in the workspace, the image scans included, so the exclusion is wider than this finding. - Rejected: Filter the
.venvfindings in devops-cli code. It hides the finding after the scan instead of stopping the scan from reading a directory that is never source, and it keeps project code to maintain.
- Chosen: Pass
- Should the exclusion of
.venvbe permanent or time-limited?: Permanent, and the four.venventries leave.trivyignore.yaml..venvis a gitignored directory thatuv syncfills with installed packages, so it is never project source; an ignore entry expires and the finding returns, which is how this alert recurred. (best practice) [sources: .trivyignore.yaml:7, SECURITY.md:131, docs/ROUTINE_TASKS.md:46]- Chosen: Permanent exclusion and drop the
.venventries. The directory is never source, and dropping the entries follows the routine that renews or drops an ignore before its date. - Rejected: Time-limited ignore entry. The entry expires and the alert returns, as it did after 2026-11-26.
- Chosen: Permanent exclusion and drop the
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 27, 2026
A live HIGH severity security misconfiguration that must be judged within 14 days.Judge Trivy-config alert DS-0029 (alert 281) in the task-template Dockerfile by fixing the file, dismissing the alert, or adding a time-limited entry to .trivyignore.yamlas the change that both ask for.Same rule DS-0029, same file path, same alert 281, same severity, and same acceptance criteria as open item 7276.A person closes one of the two if that is so.[-]fix(security): judge Trivy-config DS-0029 in .venv/lib/python3.14/site-packages/harbor/cli/template-adapter/task-template/environment/Dockerfile[/-][+]fix(security): Judge Trivy-config DS-0029 in the Dockerfile[/+]devops-cli-service commentedon Nov 27, 2026
The job shortened the title of this item. The summary had 129 characters, and the limit is 60. The type and the scope stay.
fix(security): judge Trivy-config DS-0029 in .venv/lib/python3.14/site-packages/harbor/cli/template-adapter/task-template/environment/Dockerfiledevops-cli-service commentedon Nov 27, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
dan-petty commentedon Nov 28, 2026
Closing as a duplicate of #7559 (Alert 281,
DS-0029on.venv/lib/python3.14/site-packages/harbor/cli/template-adapter/task-template/environment/Dockerfile). PR #7570 skips.venvand**/.venvinTrivyConfigScannerand removes the obsolete.venv/.trivyignore.yamlentries.