Repository navigation
fix(security): pin kubeconform and replace Checkov with Trivy's misconfiguration scan - #2464
Conversation
…2214 kubeconform has no pinned equivalent that validates every resource, so tools.lock pins it. The pinned Trivy covers the checks of Checkov, so the Checkov adapter goes and Trivy's misconfiguration scan takes its place.
tools.lock pins kubeconform 0.8.0. The recorded runs show the one report object that kubeconform writes. The new tests fail: the parser reads one object for each line, and a missing kubeconform runs the hand-written fallback.
kubeconform -output json writes one object, {"resources": [...]}. The
parser now gives one HIGH finding at <manifest>:<Kind>/<name> for each
resource with statusInvalid or statusError, and no finding for
statusValid or statusSkipped. tools.lock pins kubeconform, so the
hand-written fallback and the parser of one object for each line go.
With no kubeconform on PATH, the scan is unavailable. devops k8s
validate then says that the validation did not run and exits 1. The
agent tool k8s_validate_manifests replies as the other agent scan
tools reply.
The knowledge base page of kubeconform applies to 0.8, the version that tools.lock pins. It says what the report holds, which resources are findings, and that no hand-written check replaces a missing kubeconform. The scanner fake says when the kubeconform run was recorded.
The new tests fail: the registry holds no trivy-config scanner, devops scan iac still runs Checkov, and the agent tool scan_iac still runs Checkov. The tests that named Checkov as a sample program or a drifted manual now name kubeconform and grafana.md.
tools.lock does not pin Checkov, so each scan ran its hand-written checks. The pinned Trivy has a check for each defect that Checkov found on the same Dockerfile, Terraform and Kubernetes files, and it writes a severity for each check. Checkov wrote no severity without an API key and called pypi.org and api0.prismacloud.io on each run. The registry holds trivy-config, which runs trivy config over the target, in the place of the Checkov adapter. The agent tool scan_iac runs it. The Checkov adapter, its hand-written checks, the constants that only they read, and devops scan iac with its MCP tool go. devops scan trivy --type config scans IaC files from the command line, and its help names config in the place of iac, which Trivy does not have.
…scan Delete the knowledge base page of Checkov, its index row and the `devops scan iac` row of the knowledge base command reference. The knowledge base page of Trivy shows `devops scan trivy --type config` as the IaC scan and the `trivy-config` registry entry. The devcontainer document and the label of scope/security name kubeconform and no Checkov. The generated command, MCP and knowledge base documents are regenerated. tasks.md names #2427 for tflint and dive.
The change deletes `devops scan iac`, so the requirement of scan-json-stdout that names it is MODIFIED to name the other scan commands only. The k8s-validate requirement says what the command does when kubeconform finds nothing, and design.md records that a finding still exits 0, as `devops k8s check-deprecated` does.
The test that hides kubeconform set PATH to an empty directory. The command loads GitPython, which fails to import with no git on PATH, so the test passed only when an earlier test of the same worker had imported GitPython. The PATH of the test now holds git and no scanner.
The change deletes `devops scan iac`. The value command set of the format adoption test still named it, so the test failed. The set now holds 143 commands.
kubeconform reads each YAML and JSON file of a directory that it gets. It reported each Helm values file, Helm template, workflow and dashboard as `statusError`, and the parser made each of them a HIGH finding. Over `k8s/` of this repository, it gave 33 such findings. The adapter now gives kubeconform the path of each manifest of the target that git lists and does not ignore. A target with no manifest is `not_applicable`, and kubeconform does not start. The recorded runs name the manifest file, and the OpenSpec change records the decision.
… job The Checkov fallback was the IaC check of the CI security scan, and its findings went to code scanning. The change deletes Checkov, and `trivy-config` takes its place, but the static job had no Trivy. So the scan checked no IaC file. The static job now installs the pinned Trivy before the scan. Over this tree, `trivy-config` found the privileged container and the root user that the Checkov fallback found, in 23 s. The scan skips `trivy`, the filesystem scan, which took 194 s.
Trivy has no `iac` command, so `devops scan trivy k8s/ --type iac` stopped with an error. The routine scan now uses `--type config`, the IaC scan of the command line.
A kubeconform finding names the kind and the name of the resource, and its schema errors, from the manifest. The schema table of `devops k8s validate` read each cell as Rich markup, so a name such as `web[/bold]` stopped the command with a markup error. The table now escapes each cell, as the kube-linter table does.
…e sentences The proposal, the design and the spec deltas had sentences of more than 25 words, and the message of a validation that did not run used the passive voice. ASD-STE100 asks for at most 25 words in a description and for the active voice. The proposal also says that #2427 decides tflint and dive, which acceptance criterion 1 also names.
The run with findings of uv audit came from main (#2106). The images pin uv, and tools.lock does not. Thus the version test of the runs with findings does not compare the run of uv.
|
Test results of the head
The rebase had a conflict with #2446, which added a recorded uv audit run to Fail-to-pass, Tests that failed on the base |
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
TrivyScanner.build_command takes scan_type as str | None, so that a registry run uses the scan type of its class. The override of TrivySbomScanner kept str, and mypy refused the override.
The specs of scanner-adapters, agent-scan-tools and scan-json-stdout get the requirements of the change, and the new k8s-validate spec holds the outcome of devops k8s validate.
40ffa8e to
add6e91
Compare
|
The first run of Static Analysis failed on mypy: |
🤖 I have created a release *beep* *boop* --- ## [0.10.0](v0.9.0...v0.10.0) (2026-10-28) ### Features * **review:** devops review intake hands the findings of a session on merged code to roadmap intake ([#2455](#2455)) ([a5c7b82](a5c7b82)) * **security:** devops k8s audit runs Popeye in the tool sandbox with a kube-api network profile that only reads the API server ([#2467](#2467)) ([e02c3fb](e02c3fb)) * **security:** the App's installation tokens carry only the permissions the roadmap jobs use ([#2482](#2482)) ([9599ef2](9599ef2)), closes [#2473](#2473) ### Bug Fixes * **config:** a config file that is not valid YAML stops the load with an error that quotes none of its text ([#2468](#2468)) ([91fe5dc](91fe5dc)) * **config:** config set reports an unknown key as unknown, not as a key that needs a value ([#2465](#2465)) ([8b650a6](8b650a6)) * **devcontainer:** run the checkout's devops in devcontainer terminals ([#2460](#2460)) ([abd2d41](abd2d41)) * **k8s:** loki runs from the grafana-community chart on loki 3.7.9, out of reach of CVE-2026-21729 ([#2470](#2470)) ([96c50c9](96c50c9)) * **security:** a credential keyword at the end of a line no longer masks the first word of the next line ([#2461](#2461)) ([b754a73](b754a73)) * **security:** a credential value is masked also when the next line starts with a parenthesis ([#2477](#2477)) ([ece25ca](ece25ca)), closes [#2471](#2471) * **security:** pin kubeconform and replace Checkov with Trivy's misconfiguration scan ([#2464](#2464)) ([960e357](960e357)) * **security:** refuse GCONV_PATH, SHELLOPTS, BASHOPTS and PS4 from a caller, and archive the merged security changes ([#2453](#2453)) ([1f9231d](1f9231d)) ### Code Refactoring * **ai:** chat_structured is the one structured-output path ([#2452](#2452)) ([3509732](3509732)) * **github:** pr check-readiness reads one merge-readiness verdict from github/ ([#2456](#2456)) ([16442c4](16442c4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
The scanner registry held a kubeconform adapter and a Checkov adapter, but
tools.lockpinned neither tool, anddevops install-toolsinstalled neither. Both adapters had built-in patterns, so each scan ran hand-written checks in place of the tool. When a person installed a tool by hand, the adapter read its output wrong. The kubeconform parser read one JSON object for each line, butkubeconform -output jsonwrites one object,{"resources": [...]}, so a report with invalid resources gave no finding. The Checkov parser took the severity from the name of the check, so theLOWinALLOWmade a check LOW.kubeconform:
tools.lockpins kubeconform 0.8.0 as a binary with a SHA-256 for each platform. No other pinned tool validates each resource against the Kubernetes JSON schemas. Theschema-validationcheck of kube-linter is not in its default checks, and it does not report an object that does not decode into its Go type.resourcesof the report. Each resource withstatusInvalidorstatusErroris one HIGH finding at<manifest>:<Kind>/<name>. A resource withstatusValidorstatusSkippedgives no finding.statusError. A target with no manifest isnot_applicable, and kubeconform does not start.unavailableand has no finding.devops k8s validatethen says that the validation did not run and exits 1. The agent toolk8s_validate_manifestsruns the adapter and replies as the other agent scan tools reply. Thus a validation that did not run never reads as a pass.Checkov:
devops scan iacand its MCP tool, their help and message strings, and the knowledge base page of Checkov are deleted. The pinned Trivy has a check for each defect that Checkov 3.3.30 found in a Dockerfile, a Terraform security group and a Pod. Without a Prisma Cloud API key, Checkov writes no severity. Each Checkov run also connects topypi.organdapi0.prismacloud.io. A hashed pin of Checkov holds 97 packages.trivy-config, which runstrivy config <target> --severity <severities> --format json --quiet. Thusdevops scan reportstill scans IaC files. The agent toolscan_iacruns Trivy's misconfiguration scan.devops scan trivy --type configis the IaC scan of the command line.Tests and documents:
tests/fixtures/scanner_runs/runs_with_findings.jsonholds a run of kubeconform 0.8.0 with the command of the adapter, andtests/fixtures/scanner_runs/kubeconform_verbose_run.jsonholds a-verboserun with all four statuses. A contract test holds each run with findings to the version thattools.lockpins. The images pin uv, andtools.lockdoes not, so the test does not compare the run of uv audit.docs/ROUTINE_TASKS.mdshowdevops scan trivy --type configas the IaC scan.docs/DEVCONTAINER_USAGE.md,.github/labels.ymland the generated command, MCP tool and knowledge base documents name no Checkov.The tflint and dive adapters stay in the registry.
tools.lockdoes not pin them, and #2427 decides them.Closes #2214
Change:
openspec/changes/archive/2026-10-28-2214-pin-kubeconform-drop-checkov/