Repository navigation
Description
Problem
Lines cited at 05e9388 (release/v0.2.29).
How each tool's output was checked:
- Run offline against a scratch manifest: Pluto 5.24.4 and kube-linter 0.8.3.
- Popeye 0.22.1: read from its
--helpand the JSON tags in its binary. - gitleaks: taken from its upstream documentation.
The defects:
- Pluto.
parse_pluto_jsonreadskind,apiVersion,replacementandfilepath(security/pluto.py:27-33). Pluto writesfilePathandapi.{kind,version,replacement-api}. Every finding therefore reports the defaults (Resource,v1,apps/v1) and the scan target instead of the file. - Popeye.
build_popeye_cmdpasses-s error,warn(config/commands.py:145), but-sis--sections(resource kinds). The level flag is-l.- The parser reads
sanitizers(security/popeye.py:50-51). Popeye 0.22's JSON hassectionsandlinter, so the parser returns no findings. run_popeye_scanacceptsnamespaceand never passes it to the command (:104-111,:73-81).
- Gitleaks.
build_gitleaks_cmd(config/commands.py:188-195) runsdetect --report-format jsonwithout--report-path. gitleaks v8 writes the report only to that path, so stdout carries no JSON, and a leak (exit 1) surfaces as a failed scan.detectis also deprecated in favour ofgitanddir.
Scope moved out (2026-10-25)
The kubeconform and Checkov parts move to #2214, because neither tool is in tools.lock. devops install-tools does not install them, and command -v finds neither in the devcontainer. So this item cannot test their adapters on output recorded at a pinned version. Pinning kubeconform also needs a fetch of its schemas before the network-less review run (#2096). This item keeps Pluto, Popeye (with scan_popeye) and Gitleaks.
Confirmed on 2026-10-25 with the pinned tools:
- Gitleaks 8.30.1:
detect --report-format json --no-git --source <dir>writes nothing to stdout. With--report-path -, it writes the JSON report.devops scan secretson a directory with one leaked token says "Gitleaks was not run (Scanner exited with code 1 ... leaks found: 1)" and exits 0. - Popeye 0.22.1:
-o json -s error,warnexits 1 with "no linters matched query".-o json -l warn -n <namespace>writespopeye.sections[]withlinter,gvr,tallyandissues(resource<namespace>/<name>to a list ofgroup,gvr,level,message). - Pluto 5.24.4: the parser now reads
api.*andfilePath. It still puts invented defaults (Resource,v1,apps/v1) in place of an empty field. Pluto writesfilePathas its working directory joined to the path it gets, so an absolute path gives a wrong file path (/tmp//tmp/x/deploy.yaml).
Proposed remedy
- Fix the flags.
- Popeye:
-l warn, plus-nwhen a namespace is given. - Gitleaks:
dir(orgitfor history scans) with--report-format json --report-path -and--redact.
- Popeye:
- Parse each tool's documented JSON.
- Test each adapter on output recorded from the real tool at a pinned version (feat(review): review tools install from a tools lock with exact versions, binary checksums and hashed Python requirements, and every review records them #1142's tools lock once it lands).
Key questions
- Does gitleaks print JSON to stdout without
--report-path? (proposed) No. Confirm this once against the pinned gitleaks before recording the fixture. The fix (--report-path -) is the same either way.
Acceptance criteria
- A recorded Pluto report yields findings carrying Pluto's kind, apiVersion, replacement API and file path.
- A recorded Popeye report at warn level yields one finding per issue, and the command carries
-l warnand the namespace. - A recorded gitleaks report with one leak yields one finding with status ok, not failed.
- Adapter tests use the process fake replaying the recorded output.
- Tests run offline with fakes only at process and HTTP edges; each new test runs under 1 s.
-
uv run devops cipasses.
Related: #1045 (kube-linter), #1141 (fingerprints), #1332, #1142, #772.
Found by the 2026-10-08 client-library audit.
Opened as a borrow (#1153, budget/borrowed): the agent filing quota is spent for this cycle, and this is a defect or security finding of the owner-requested 2026-10-08 client-library audit.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty-bot commentedon Oct 8, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
Security scanners silently produce incorrect or empty results, undermining review confidence, but the system still runs and no active vulnerability is exposed.Users relying on these five scanners for security reviews are receiving wrong or no findings, defeating the purpose of the security gate.Fixing CLI flags and JSON parsing across five adapters plus adding recorded-output tests is well-scoped but touches multiple modules.dan-petty commentedon Oct 9, 2026
Folded in from the #1045 re-scope (2026-10-09)
Pluto's Kubernetes object symbol moves here from #1045:
Kind/<namespace>/<name>, orKind/namewhen Pluto reports no namespace (the form #1045 gives kube-linter). The parser readskindandfilepath, but Pluto writesapi.kindandfilePath, so fixing those keys comes first; adding a namespace alone would giveResource/ns/name.dan-petty commentedon Oct 24, 2026
Added scope, 2026-10-24 (from #1435). Intake judged this part to belong to this item.
Friction
The agent scan tool
scan_popeye(src/devops_cli/ai/tools/builtin_tools.py) still runs its ownpopeyeargv and reads its text output. #1435 moved the other six agent scan tools onto thesecurity/*adapters, butPopeyeScannercannot yet do what the agent tool does.Evidence (found during #1435, 2026-10-24)
build_popeye_cmdpasses-s error,warn.popeye --help(0.22.1) shows that-sis--sections(a list of resources). The level flag is-l, --lint.sanitizers, which Popeye 0.22 does not write.ok.What should happen
After #1434 gives
PopeyeScanner-l warn, the namespace and a parser for the JSON of Popeye 0.22,scan_popeyecalls the adapter and replies with its outcome (status first, then the findings throughmask_secrets), as the other agent scan tools do since #1435. Thepopeyeargv inbuiltin_tools.pygoes.Deliver it in the same pull request as the Popeye adapter fix of this item.
fix(security): the agent scan tools run the scanner adapters and repo…
test(review): scanner_fake answers the review scanners through the To…
feat(review): a review runs its tools in the network-less sandbox by …
[-]fix(security): the pluto, popeye, kubeconform, gitleaks and checkov adapters read what those tools actually write[/-][+]fix(security): the pluto, popeye and gitleaks adapters read what those tools actually write[/+]