Skip to content

fix(security): pin tflint; remove dive and devops docker analyze-layers - #2712

Merged
dan-petty merged 6 commits into
mainfrom
fix/2427-pin-tflint-dive
Oct 29, 2026
Merged

dan-petty merged 6 commits into
mainfrom
fix/2427-pin-tflint-dive

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

This change removes the command devops docker analyze-layers and the agent tool docker_analyze_layers, with the dive scanner that they ran.

Refs #2427. This change delivers criteria 1, 2 and 4. Criterion 3 (the recorded tflint 0.65.0 run) stays open until a person records it with the commands in design.md.

What and why

The scanner registry held a tflint adapter and a dive adapter, but tools.lock pinned neither tool. Without tflint, each scan ran a hand-written check for 0.0.0.0/0. Without dive, each scan was unavailable.

  • tflint is pinned. tools.lock pins tflint 0.65.0 for linux-amd64, linux-arm64, darwin-amd64 and darwin-arm64. tflint publishes zip archives only, so the lock has a new zip format that the installer unpacks with the standard library zipfile. Each sha256 equals the release asset digest and the line of checksums.txt.
  • The tflint fallback is deleted. With no tflint on PATH, the scan is unavailable and has no finding. trivy-config checks 0.0.0.0/0 in IaC files.
  • A lint that did not run is not a pass. devops tf lint now says that the lint did not run and exits 1. The agent tool tf_lint replies as the other agent scan tools reply.
  • tflint runs with --recursive. Without it, tflint lints the starting directory only, so a target with .tf files in sub-directories alone would read as clean.
  • dive is removed. dive has had no commit on its default branch since 2025-05-16, and its newest release (0.13.1) has 39 findings of HIGH or CRITICAL severity (Trivy 0.75.0 over the binary). No pinned tool covers it. The change also deletes DEFAULT_DIVE_*, the dive models and strings, and its knowledge base page. The registry holds 13 scanners.
  • A test holds each scanner of the registry to a pinned program (tools.lock or the dev dependency zizmor).

The tflint report shape, exit codes and severity names were read from the tflint v0.65.0 source, and no downloaded program was run. The proposal's Feasibility section has the evidence.

Change: openspec/changes/archive/2026-10-29-2427-pin-tflint-dive/

Pin tflint 0.65.0 in tools.lock with a new zip archive format. Delete the
hand-written tflint fallback. devops tf lint and the tf_lint tool now report a
lint that did not run. Remove the dive adapter, devops docker analyze-layers
and the docker_analyze_layers tool: dive has had no commit for 17 months and
its release has 39 HIGH or CRITICAL findings.

Plans #2427.
Run tflint with --recursive, so a target whose .tf files are in
sub-directories is linted and does not read as clean.

Plans #2427.
@dan-petty dan-petty added scope/security Security linters (trivy, bandit, gitleaks, kubeconform) and Vault type/security Type security: a vulnerability or a leak labels Oct 29, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results

Targeted tests on the rebased branch: 522 passed (tests/security, test_tf, test_builtin_tools, test_tools_lock, test_install_tools, test_scanner_contract, test_kb, test_kb_manuals_metadata, test_docs, test_docker, test_agent, test_scan_outcomes_and_gating, test_swallowed_failures_ratchet, test_workflow_contracts, test_mcp, test_cli_format_adoption). devops docs check, devops openspec check and mypy on the changed source pass. No downloaded program ran: the tflint report shape comes from the tflint v0.65.0 source.

Pending a person: the recorded tflint 0.65.0 run (criterion 3). The commands are in design.md of the archived change.

Fail-to-pass (devops ci fail-to-pass --base origin/main)

23 tests fail on base and pass on this branch. Full output: .data/agent/sec/f2p-2427.txt of the author.

  failed on base: tests.test_install_tools::test_a_zip_build_unpacks_to_an_executable_file (pydantic_core._pydantic_core.ValidationError: 1 validation error for BinaryToo
  failed on base: tests.test_install_tools::test_each_archive_format_unpacks_to_the_tool[zip] (pydantic_core._pydantic_core.ValidationError: 1 validation error for Binary
  failed on base: tests.test_install_tools::test_a_zip_build_without_the_locked_member_is_refused_and_leaves_no_file (pydantic_core._pydantic_core.ValidationError: 1 vali
  failed on base: tests.test_kb::test_list_knowledge_base_articles_by_category (AssertionError: assert 28 == 27)
  failed on base: tests.test_kb::test_list_knowledge_base_articles_by_division (AssertionError: assert 38 == 37)
  failed on base: tests.test_kb::test_list_knowledge_base_articles_all (AssertionError: assert 77 == 76)
  failed on base: tests.test_kb::test_get_knowledge_base_stats (AssertionError: assert 38 == 37)
  failed on base: tests.test_agent::test_no_agent_tool_analyzes_image_layers (AssertionError: assert 'docker_analyze_layers' not in {'ai_ast_graph', 'ai_ast_parse', 'ai_b
  failed on base: tests.test_kb_manuals_metadata::test_every_target_manual_has_valid_front_matter (AssertionError: assert 61 == 60)
  failed on base: tests.test_tools_lock::test_the_lock_pins_tflint_as_four_zip_builds (KeyError: 'tflint')
  failed on base: tests.security.test_scanner_base_and_registry::test_the_default_registry_holds_13_scanners_and_no_dive (assert (14, <devops_...7bbde28f1a90>) == (13, No
  failed on base: tests.test_scanner_contract::test_every_scanner_of_the_registry_has_a_pinned_program (AssertionError: assert ['dive', 'tflint'] == [])
  failed on base: tests.test_mcp::test_all_cli_commands_are_either_exposed_or_excluded (AssertionError: assert ({('docker', ...ers')}, set()) == (set(), set()))
  failed on base: tests.test_tf::test_a_lint_that_did_not_run_says_so_and_fails[json] (assert (0, False, True) == (1, False, False))
  failed on base: tests.test_tf::test_a_lint_that_did_not_run_says_so_and_fails[table] (assert (0, True, False) == (1, False, False))
  failed on base: tests.test_builtin_tools::test_the_agent_terraform_lint_tool_replies_with_the_outcome_of_the_tflint_adapter (assert ["Found 1 TFL...but not used'] == ['
  failed on base: tests.test_builtin_tools::test_an_agent_scan_tool_whose_scanner_is_not_installed_says_so_and_not_clean[tflint] (AssertionError: assert 'TFLint scan ...i
  failed on base: tests.test_builtin_tools::test_an_agent_scan_tool_whose_scanner_fails_with_no_output_says_failed_and_not_clean[tflint] (assert ('TFLint scan...es found.
  failed on base: tests.security.test_tflint::test_a_tree_whose_tf_files_are_in_sub_directories_is_linted_there (AssertionError: assert (False, 'ran'...k/main.tf:1']) == 
  failed on base: tests.security.test_tflint::test_a_tflint_that_cannot_start_is_a_failed_scan_and_not_a_fallback (AssertionError: assert ('built-in pa...operties={})]) =
  failed on base: tests.security.test_tflint::test_a_scan_without_tflint_is_unavailable_and_has_no_finding (assert ('built-in pa...operties={})]) == ('unavailable... on P
  failed on base: tests.security.test_tflint::test_a_scan_starts_tflint_recursive_with_json_output_and_the_config_file (AssertionError: assert (['--format',...tflint_recu
  failed on base: tests.test_docker::test_docker_has_no_analyze_layers_command (assert (1, False) == (2, True))
23 failed on base (23 failed and 481 passed in tests/security/test_sarif_emission.py, tests/security/test_scanner_base_and_registry.py, tests/security/test_tflint.py, tests/test_agent.py, tests/test_builtin_tools.py, tests/test_cl

@dan-petty
dan-petty marked this pull request as ready for review October 29, 2026 22:52
@dan-petty
dan-petty merged commit 244bafb into main Oct 29, 2026
18 checks passed
@dan-petty
dan-petty deleted the fix/2427-pin-tflint-dive branch October 29, 2026 22:52
dan-petty pushed a commit that referenced this pull request Oct 30, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.21.0](v0.20.0...v0.21.0)
(2026-10-29)


### Features

* **telemetry:** count the project items by release tag, not by
milestone ([#2710](#2710))
([253a97d](253a97d))


### Bug Fixes

* **ai:** the MCP benchmark tool takes no server URL
([#2707](#2707))
([7f7f84b](7f7f84b)),
closes [#2638](#2638)
* **rag:** name the Qdrant span server by host and port
([#2705](#2705))
([57725c3](57725c3)),
closes [#2459](#2459)
* **roadmap:** take a plan that a person merged as a Planned item
([#2718](#2718))
([043463b](043463b)),
closes [#2714](#2714)
* **security:** pin tflint; remove dive and devops docker analyze-layers
([#2712](#2712))
([244bafb](244bafb))
* **vault:** the MCP tool vault_status takes no address
([#2706](#2706))
([68c226c](68c226c)),
closes [#2639](#2639)


---
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/security Security linters (trivy, bandit, gitleaks, kubeconform) and Vault type/security Type security: a vulnerability or a leak

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant