Repository navigation
Description
Problem
_finding_from_report (src/devops_cli/security/kubelinter.py:44-59) reads the check name from the report's Diagnostic (:46-48). kube-linter puts Check and Remediation at report level, beside Diagnostic, which holds only Message. A local run of kube-linter lint k8s/cloudflared/deployment.yaml --format json (kube-linter 0.8.3, tree at da50329) returns one report with the keys Check, Diagnostic, Object and Remediation. Its Check is no-anti-affinity and its Diagnostic has only Message. So every kube-linter finding is titled [kube-linter-check] K8s Security Lint Warning, and its fix says "to resolve kube-linter-check". The bug has been there since the adapter was added in v0.1.8 (4e48cd7).
Two tests hide it. Both fixtures nest Check inside Diagnostic: tests/test_secops.py:67-70 (test_kubelinter_parser, "Check" at :69) and :165 (test_kubelinter_scanner_execution). tests/test_consolidation_security_scanner_base.py:349-359 has the real shape, but the contract test only asserts that some finding comes out (:470-473).
What it costs:
- Reviews. In S7 and S8 (
.data/reviews/20261003-005122and-012555), all 5 kube-linter candidates have the same title: 1 isno-anti-affinityand 4 aredangling-service. In S8 all 5 are in thesecurityclass, because the template title says "Security". They are 5 of S8's 17securitycandidates. The title and the fix name no check. kube-linter's message survives only in the description. - Scan reports.
devops scan reportdedupes by fingerprint, which is tool, rule id, path and message (src/devops_cli/security/normalization.py:150-159, deduped atsecurity/pipeline.py:141). The rule id is the title's bracket, and the message is the rest of the title. Both are the same for every kube-linter finding. A directory scan also locates every finding at the directory, not at the manifest.parse_kubelinter_jsonusestarget_path(kubelinter.py:62-65) and ignoresObject.Metadata.FilePath. I replayed this at da50329 with the real adapter andbuild_report. kube-linter overk8s/gives 7 reports, from 4 checks in 3 files. The report keeps 1 of the 7. Its rule id iskube-linter-check, its message is "K8s Security Lint Warning", and its location isk8s:Deployment/cloudflared. - SARIF and suppressions. SARIF's
ruleIdis that rule id (security/sarif.py:75,:103), so every kube-linter result has the same rule. A suppression by rule (security/suppression.py:63) cannot name one kube-linter check. - One message in one file. The fingerprint leaves out the symbol (
Service/prometheus). So two objects in one manifest with the same check and message also share a fingerprint. I replayed it with the check name and kube-linter's message in the title.k8s/monitoring/service-aliases.yamlthen keeps 3 of its 4dangling-servicefindings, because theprometheusandkube-prometheus-kube-prome-prometheusServices select the same labels. Thek8s/report keeps 6 of 7.
The taxonomy replay (defect_class, src/devops_cli/ai/review_schema.py:625-640):
- If the check name goes into today's template,
no-anti-affinitybecomesreliabilityanddangling-servicestayssecurity. 45 of the 63 checks built into kube-linter 0.8.3 would still besecurity, from the word in the template. - If kube-linter's message is the title, 6 of the 7
k8s/findings areother. That includesrun-as-non-root, which is a security misconfiguration.
Acceptance criteria
-
_finding_from_reportreadsCheckandRemediationfrom the report, andMessagefromDiagnostic. The title is[<check>] <message>, the same form the Bandit and Semgrep adapters use (security/bandit.py:33,security/semgrep.py:69). The fix is kube-linter'sRemediationwhen there is one, and the template otherwise. - The adapter sets the category to the class that the check name or the message names. When neither names a class, or they name only
security, the category issecurity_misconfiguration. - The location names the manifest from
Object.Metadata.FilePath, made relative as_manifest_locationdoes (kubelinter.py:21-34).target_pathis used only whenFilePathis missing. A directory scan names each file. -
NormalizedFinding.fingerprintincludes the symbol when the finding has one. A finding without a symbol keeps its fingerprint, and a test pins one. The line stays out of the fingerprint. A Kubernetes object's name, unlike a line, does not move when lines are added above it. - A test passes two Popeye issues on two resources of one sanitizer through
build_reportand keeps 2. It fails on the current code, which keeps 1. - The fixtures at
tests/test_secops.py:67-70and:165putCheckat report level. A fixture undertests/fixtures/holds the 7 reports ofkube-linter lint k8s --format jsonat da50329 (4 checks, 3 files), trimmed, withFilePathmade relative. A test parses it. It asserts that each title names its own check, each location names its own file,no-anti-affinityisreliabilityanddangling-serviceissecurity_misconfiguration. It fails on the current code. - A test passes that fixture through
build_reportand keeps 7 of 7 findings, with the rule idsdangling-service,no-anti-affinity,no-read-only-root-fsandrun-as-non-root.to_sarifemits those 4 rules. The test fails on the current code, which keeps 1 finding under 1 rule. - The kube-linter contract test (
tests/test_consolidation_security_scanner_base.py:444-473) asserts that its finding's title namesno-read-only-root-fs. - The tests run offline, call no kube-linter binary, and each runs well under 1 s.
-
changelog.d/1045.mdrecords the fix under### Fixed. It says that every symbol-located finding gets a new fingerprint, so a fingerprint suppression of a Trivy, Pluto, Popeye, Dive or kube-linter finding must be recorded again.CHANGELOG.mdis not edited. -
uv run devops cipasses. - (person-run)
devops scan report k8s --scanner kubelinterlists 7 findings under 4 rule ids.devops k8s lint k8s/cloudflared/deployment.yamlnamesno-anti-affinity.
Key questions
- What class should a kube-linter finding get when its words name none, or name only
security? (proposed)security_misconfiguration, set by the adapter after the check name and the message are tried. kube-linter checks manifests for misconfiguration. With words alone, 6 of the 7k8s/findings would beother,run-as-non-rootamong them. With today's template, 45 of the 63 built-in checks land insecurity, the catch-all. Under the proposed rule, S8's 5 kube-linter candidates become 1reliabilityand 4security_misconfiguration, and S8'ssecuritycount falls from 17 to 12. - Does the fingerprint change belong here? (proposed) Yes. Without it the
k8s/report keeps 6 of 7 even after the adapter fix. A line-located finding keeps its fingerprint. Every symbol-located finding gets a new one, not only kube-linter's: Trivy (<target>:<package>or<target>:<rule>,security/trivy.py:47,:70,:87), Pluto (pluto.py:41), Popeye (popeye.py:29) and Dive (dive.py:191). Their fingerprint suppressions and SARIFpartialFingerprintschange once. That also fixes the same collapse in Popeye. Its title is[<SANITIZER>] Cluster Sanitizer Findingfor every issue atk8s:<sanitizer>/<resource>(popeye.py:27-31). A replay of two issues on two resources throughbuild_reportat da50329 keeps 1. The project is pre-1.0, so the changelog fragment states the change and no migration is added. - Should the SARIF fingerprint key
devopsCli/v1(src/devops_cli/config/constants.py:2616) change? (proposed) Follow test(security): pin the finding fingerprint and run-store digest to literal values #855 if it has landed first. Its rule is that an algorithm change bumps the key and updates the pinned values. If it has not landed, keep the key, and the changelog fragment is the record. - Should Semgrep and Bandit findings carry their CWE ids in
references, so thatsecuritystops being the catch-all for them too? (proposed) Yes, but as a separate p3 item, not here. In S8, the 12securitycandidates left after this fix are 7 Semgrepnon-literal-importfindings and 5 Bandit B108 findings. Bandit's JSON hasissue_cwe: a local run gives B108{"id": 377}.assign_categorywould turn that intoCWE-377, whichCONST_REVIEW_CWE_DEFECT_CLASSES(src/devops_cli/config/constants.py:2981) themes asrace_condition. Semgrep rules carryextra.metadata.cwe, but the adapter reads onlycveandowasp(security/semgrep.py:39-48). The registry lists CWE-706 fornon-literal-import(not checked offline), and the table does not map 706. So those 7 would staysecurityuntil the table maps 706. It is separate because it changes two other adapters and the CWE table, and fix(review): the review's scanner config drops the rules that never produced a valid finding on this repository #1024 may dropnon-literal-importaltogether.
Depends on: none.
Order: no ordering constraint. The change touches security/kubelinter.py, security/normalization.py (fingerprint only) and their tests. #1024 removes dangling-service from the review's kube-linter config, and either order works. #1021's golden replays use S5's saved kube-linter findings with today's titles, so this change does not affect them. #855 (no milestone) pins fingerprints to literal values. Whichever lands second updates the pins for a symbol-located finding.
Related: #855 (fingerprint pins and the key-bump rule). #1024 (drops dangling-service and two Semgrep rules from the review's scanner config). #1021 (proposes that its restatement guard ignore scanner boilerplate words such as kube-linter's template. The new titles carry kube-linter's message instead). #948 (the category taxonomy that made the catch-all visible). #788 (scanner paths in review findings are absolute; this item fixes only kube-linter's directory location). #1023 (cloudflared's no-anti-affinity, the one valid kube-linter finding in S7 and S8).
Review redesign additions (2026-10-03)
This item is a phase P0 child of the evidence-first review (#1137). The body stands, with these additions:
Acceptance criteria (added).
- kube-linter runs once over the manifest set, with a per-file status, and the check name becomes the SARIF
ruleId. Evidence: D11 put 13–17 falsedangling-servicerows into every run of the ten-run loop S12–S21. - The symbol identity for symbol-located findings (kube-linter, Trivy, Pluto, Popeye, Dive) is written in fix(security): each finding keeps its own fingerprint across unrelated edits, and deduplication and correlation give one result in every input order, in devops scan and in reviews #1141's
logicalLocationsform (kind/namespace/name), so those findings change identity once when fix(security): each finding keeps its own fingerprint across unrelated edits, and deduplication and correlation give one result in every input order, in devops scan and in reviews #1141 replaces the fingerprint algorithm. This item's own fingerprint bullet stays, so the P0 fix is not weakened.
Related (added). #1141 (fingerprint v2; this item is its P0 child), #855 (its fingerprint pins move to #1141 and are pinned on v2).
Update 2026-10-09: re-scope before building (v0.2.30)
An assessor and a challenger checked this item against release/v0.2.30 (edd2578), replaying kube-linter 0.8.3 offline. The original body still holds and is built as written. Of the 2026-10-03 "review redesign additions":
- Kept: the check name becomes the SARIF ruleId (the new
[<check>] <message>title and a 4-ruleto_sariftest deliver it), and kube-linter's symbol isKind/<namespace>/<name>, orKind/namewhen kube-linter reports no namespace (Kubernetes' namespace/name key; the form Popeye already uses). - Dropped: "kube-linter runs once over the manifest set, with a per-file status". kube-linter 0.8.3 gives no per-file status from one run: a file that fails to load shows up only as a
-vstderr warning, and the exit code and JSON match a clean run with findings; a run over only unloadable files exits 0 with no output. Parsing that log text by hand is ruled out, and running once does not remove the falsedangling-servicerows either (they remain over the whole tree; fix(review): the review's scanner config drops the rules that never produced a valid finding on this repository #1024 drops the check from the review config). - Moved: Pluto's object form to fix(security): the pluto, popeye and gitleaks adapters read what those tools actually write #1434 (its parser reads
kind/filepath, but Pluto writesapi.kind/filePath); Trivy and Dive identity to fix(security): each finding keeps its own fingerprint across unrelated edits, and deduplication and correlation give one result in every input order, in devops scan and in reviews #1141 (purl@version, not Kubernetes objects). Popeye needs nothing more.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 3, 2026
What S10 adds (review session
20261003-034353, release/v0.2.25 at d6ebe97;.data/review-evaluation-20261003-s10.md, sections 3-4).The same-title bug also loses findings inside a review (D12).
k8s/llm/profiles/ollama-profiles.yamlgives 27 reports:no-read-only-root-fs,run-as-non-rootandunset-memory-requirements, 9 each._finding_from_reporttitles all 27[kube-linter-check] K8s Security Lint Warning, at the sameKind/namelocation for each DaemonSet.consolidate_duplicate_findings(_are_findings_duplicate,src/devops_cli/ai/review_schema.py:1039; description choice at:1156-1158) then merges them into 9. All 9 carry the read-only message, the longest of the three.run-as-non-root×9 was lost. The ollama hardening itself is now fix(k8s): the ollama tier DaemonSets drop privilege escalation and capabilities, use RuntimeDefault seccomp and a read-only root filesystem, and run as non-root where the model directory allows #1060.Suggested scope line: a test runs the 27 reports (a trimmed fixture) through the review's consolidation and keeps 27 candidates, 9 per check. It fails on the current code.
Related, p3 and outside kube-linter [inference; Semgrep was not re-run]:
yaml.kubernetes.security.*findings on the same file each merge 9 matches across DaemonSets that share a backticked symbol. A replay with synthetic matches gives 18 → 2.:50,:33), while its description names the 24gib one (:150,:136).dan-petty commentedon Oct 8, 2026
Placed in v0.2.30 on 2026-10-08 at the owner's request ("Populate 10 security and ci issues into each v0.2.30, v0.2.31, and v0.2.32 milestone"). This is a person's placement. Release theme: P1 secret and sandbox-boundary fixes, the review tools lock, kube-linter finding identity and a faster gate. Position 7 of 10 in the release's planned merge order. Its board Status is set to Ready, so the release-start fill keeps it.
dan-petty commentedon Oct 8, 2026
Linked: #788 (repo-relative Bandit and Semgrep paths) and #1140, whose per-manifest failure rule this item keeps for kube-linter and Pluto. Found by the 2026-10-08 backlog review.
fix(security): kube-linter findings carry their own check, message an…
dan-petty-bot commentedon Oct 9, 2026
What changed
#1471, merged into
release/v0.2.30as c58079f.16 file(s) changed.
How it was verified
Check runs at cc86c24:
Acceptance Criteria of
docs/agent/tasks/task-1045-kube-linter-finding-identity.md:_finding_from_reportreadsCheckandRemediationfrom the report andMessagefromDiagnostic. The title is[<check>] <message>, and the fix is theRemediation, or the template without one (test_each_title_names_its_own_check_and_message,test_the_fix_is_kube_linters_remediation,test_a_report_without_a_remediation_gets_the_template_fixintests/test_security_kubelinter.py).security_misconfigurationwhen neither names one or they name onlysecurity(test_the_category_is_the_class_the_check_names_or_a_misconfiguration).Object.Metadata.FilePath, made relative as_manifest_locationdoes;target_pathis used only whenFilePathis missing, and a directory scan names each file (test_each_location_names_its_own_file_and_object;test_kubelinter_locations_are_relative_to_the_nested_worktreeintests/test_secops.pycovers a report withoutFilePath).NormalizedFinding.fingerprintincludes the symbol when the finding has one, a finding without a symbol keeps its fingerprint, and the line stays out (test_a_fingerprint_distinguishes_two_objects_with_one_message,test_a_finding_without_a_symbol_keeps_its_fingerprint,test_a_fingerprint_survives_the_finding_moving_to_a_new_lineandtest_a_multi_line_result_keeps_its_fingerprint_when_it_movesintests/test_security_sarif.py).build_reportand both are kept; the base code kept 1 (test_two_popeye_issues_on_two_resources_of_one_sanitizer_are_kept).test_kubelinter_parserandtest_kubelinter_scanner_executionputCheckat report level (the second also putsKindunderGroupVersionKind).tests/fixtures/kubelinter/k8s-da50329.jsonholds the 7 reports ofkube-linter lint k8s --format jsonat da50329 (kube-linter 0.8.3, 4 checks, 3 files), trimmed toCheck,Diagnostic.Message,Remediation,Object.Metadata.FilePath(made relative) andObject.K8sObject, plusSummary.KubeLinterVersion.tests/test_security_kubelinter.pyparses it; each test failed on the base code.build_reportkeeps 7 of 7 findings in 7 clusters, whose 7--jsonentries are distinct, under the rule idsdangling-service,no-anti-affinity,no-read-only-root-fsandrun-as-non-root, andto_sarifdeclares those 4 rules; the base code kept 1 under 1 rule (test_a_scan_report_keeps_every_finding_under_its_own_rule).devops k8s lintprints the check in its Title column: a finding titled[no-anti-affinity] ...renders with[no-anti-affinity](test_the_kube_linter_table_names_each_checkintests/test_output.py; it failed before the cells were escaped).no-read-only-root-fs(test_kubelinter_contract_finding_names_its_checkintests/test_consolidation_security_scanner_base.py, beside the parametrized contract test).changelog.d/1045.mdrecords the fix under### Fixed, including the one-time fingerprint change of every symbol-located finding (Trivy, Pluto, Popeye, Dive, kube-linter).CHANGELOG.mdanddocs/ROADMAP.mdare not edited.uv run devops cipasses.ruleId, and kube-linter's symbol isKind/<namespace>/<name>, orKind/namewithout a namespace.consolidate_duplicate_findingskeeps the 7 fixture findings; the base code kept 6, because the registry Deployment's two checks merged (test_a_review_keeps_two_checks_on_one_object).devops scan report k8s --scanner kubelintershows one row per kube-linter report under its own check: 7 rows under 4 rule ids over da50329'sk8s/, 6 under 4 over the release head'sk8s/(the pyroscope alias is gone). An agent run on this branch with kube-linter 0.8.3 gave 6 findings in 6 distinct--jsonclusters, each naming its object.devops k8s lint k8s/cloudflared/deployment.yamlnamesno-anti-affinity. An agent run on this branch with kube-linter 0.8.3 showed[no-anti-affinity] object has 2 replicas ...in the Title column.feat(release): v0.2.30 (#1473)
fix(review): a review's scanners leave out the rules that never gave …