Repository navigation
Description
Problem
The tflint and dive adapters are in the scanner registry (security/registry.py), and devops scan report runs every scanner of the registry. But neither tool is in src/devops_cli/tools_lock/tools.lock, devops install-tools does not install them, and command -v finds neither in the devcontainer (2026-10-28).
- tflint. The adapter sets
has_builtin_patterns = True. With no tflint on PATH, each scan runs the hand-written check_run_native_fallback_tf_lintinsecurity/tflint.py, which reads each.tffile line by line for a security group open to0.0.0.0/0. The scan status is thenbuilt-in patterns: a hand-written check, not tflint. - dive. The adapter has no fallback, so each scan with no dive on PATH is
unavailable.
The fix of #2214 made the same decision for kubeconform (pinned, fallback deleted) and Checkov (adapter deleted, Trivy's misconfiguration scan trivy-config in its place). It did not change tflint and dive.
Proposed remedy
Decide one of these for each tool, with the evidence:
- Pin the tool in
tools.lockas a binary with a SHA-256 for each platform, as kubeconform and Pluto are. Record a run at the pinned version, fix the parser against it, and delete the hand-written fallback of tflint. - Delete the adapter, if a pinned tool covers its checks. Trivy 0.75.0's misconfiguration scan (
trivy config, pinned) reported an ingress rule from0.0.0.0/0to port 22 as AWS-0107 (HIGH), but it reported nothing for the same rule to port 8080. The tflint fallback reports both.
Existing Tool Considered
tflint (https://github.com/terraform-linters/tflint), dive (https://github.com/wagoodman/dive), and Trivy's misconfiguration scan (pinned).
Acceptance criteria
- Each tool the scanner registry names is in
tools.lockor is a pinned dev dependency, or its adapter is deleted. - No adapter keeps a hand-written fallback.
- Each pinned tool has a run with findings recorded at the pinned version in
tests/fixtures/scanner_runs/runs_with_findings.json. - Tests run offline on recorded output; each new test runs under 1 s.
Related: #2214 (kubeconform and Checkov), #1142 (tools lock).
Source: #2214
Proposed design
Problem statement
The tflint and dive adapters are in the scanner registry, but neither tool is in tools.lock. Without tflint on PATH, each scan runs a hand-written fallback that only checks one rule. Without dive on PATH, each scan is unavailable. The fix of #2214 pinned kubeconform and deleted the Checkov adapter, but it did not change tflint or dive.
Acceptance criteria
- Criterion 1: Each tool the scanner registry names is in tools.lock or its adapter is deleted.
Verification: Rungrep -c 'tflint\|dive' src/devops_cli/tools_lock/tools.lockand confirm both appear, or confirm their adapters are absent from security/registry.py. - Criterion 2: No adapter keeps a hand-written fallback.
Verification: Rungrep -rn '_run_native_fallback' src/devops_cli/security/and confirm no results. - Criterion 3: Each pinned tool has a run with findings recorded at the pinned version in tests/fixtures/scanner_runs/runs_with_findings.json.
Verification: Runpython -c "import json; d=json.load(open('tests/fixtures/scanner_runs/runs_with_findings.json')); print(list(d.keys()))"and confirm tflint and dive are present with a version field matching tools.lock. - Criterion 4: Tests run offline on recorded output and each new test runs under 1 second.
Verification: Runuv run pytest tests/test_tools_lock.py tests/test_install_tools.py -x --timeout=1and confirm all pass.
Key questions
- For tflint, pin it in tools.lock or delete its adapter?: Pin tflint in tools.lock. Trivy 0.75.0 does not report a 0.0.0.0/0 rule to port 8080, but the tflint fallback reports both. No pinned tool covers all tflint checks. (proposed)
- For dive, pin it in tools.lock or delete its adapter?: Pin dive in tools.lock. No pinned tool in tools.lock performs container image layer analysis. Trivy performs vulnerability scanning, which is a different check. (proposed)
- Is tflint currently in tools.lock?: No. The tools.lock file lists kubectl, kustomize, helm, argo, argocd, cloudflared, kubectl-argo-rollouts, trivy, kube-linter, popeye, pluto, k9s, gh-dash, tuicr, gitleaks, osv-scanner, golangci-lint, semgrep, bandit, openspec, and devcontainers-cli. tflint is absent. [sources: src/devops_cli/tools_lock/tools.lock]
- Is dive currently in tools.lock?: No. The tools.lock file does not contain a dive entry. [sources: src/devops_cli/tools_lock/tools.lock]
- Does the tflint adapter have a hand-written fallback?: Yes. The function _run_native_fallback_tf_lint at line 92 of src/devops_cli/security/tflint.py reads each .tf file line by line for a security group open to 0.0.0.0/0. [sources: src/devops_cli/security/tflint.py:92]
- Does Trivy 0.75.0 cover all tflint security group checks?: No. Trivy reported a 0.0.0.0/0 rule to port 22 as AWS-0107 (HIGH), but reported nothing for the same rule to port 8080. The tflint fallback reports both. [sources: src/devops_cli/tools_lock/tools.lock]
- What did fix(security): kubeconform and checkov are pinned and their adapters read what those tools write, or the adapters go #2214 do for kubeconform and Checkov?: It pinned kubeconform in tools.lock and deleted its fallback. It deleted the Checkov adapter and used Trivy's misconfiguration scan (trivy config) in its place. [sources: src/devops_cli/tools_lock/tools.lock]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
Activity
dan-petty commentedon Oct 28, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The fix ensures security scanners are properly installed and removes a weaker hand-written fallback, directly affecting security scan reliability.Security scanners silently degrade to weaker checks or become unavailable, leaving vulnerabilities undetected.Users rely on these scanners for security findings; a silent fallback or missing tool undermines trust in scan results.Requires pinning two tools with SHA-256 per platform, recording runs, fixing a parser, and deleting a fallback, or deleting adapters.Both manage scanner adapters in the security registry, but #2106 adds a uv audit adapter while the candidate pins or removes the tflint and dive adapters.dan-petty commentedon Oct 28, 2026
Status set to Ready at d739a47 (see proposed design in issue body).
fix(security): pin kubeconform and replace Checkov with Trivy's misco…
fix(security): pin tflint; remove dive and devops docker analyze-laye…
refactor(security): remove unused fallback path from scanner base cla…