> guide · scripts & infrastructure

Best static analysis tools for Bash, Terraform and Docker (2026)

The glue code AI agents write most, and most security tools skip. Here's what to run on it.

Bash scripts, Terraform and Dockerfiles are where coding agents quietly do a lot of work, and where mainstream code scanners have been weakest. CodeQL doesn't cover any of them. The good news: the best tools here are free, open source and fast enough to run on every commit. Use one specialist per file type, then optionally add a PR-level scanner on top.

← All tier lists · FAQ

Last updated:

Some links elsewhere on ToolTier are affiliate links that may earn us a commission at no extra cost to you. None of the links on this page are, and affiliate status never affects a tool's tier.

Quick picks

The picks

Our pick · Bash

ShellCheck

The standard linter for bash and sh scripts. It catches quoting bugs, unsafe globbing and portability problems before they bite, explains each warning on its wiki, and runs in CI, in most editors, or in the browser at shellcheck.net.

🎯 Best for: Shell scripts💲 Free and open source (GPL-3.0)

Official site ↗

Our pick · Docker

Hadolint

A Dockerfile linter that parses the file properly and checks it against Docker best practices. It also runs ShellCheck on the commands inside RUN instructions, so it catches shell bugs too.

🎯 Best for: Dockerfiles💲 Free and open source (GPL-3.0)

Official site ↗

Our pick · Terraform

Checkov

Policy-as-code scanner for infrastructure. It scans Terraform (including plan files), OpenTofu, CloudFormation, Kubernetes, Helm and Dockerfiles for security and compliance misconfigurations, using graph-based checks that understand how resources connect.

🎯 Best for: Terraform and cloud config💲 Free and open source (Apache-2.0)

Official site ↗

Also good

Trivy

One binary for misconfigurations (Terraform, Dockerfiles, Kubernetes), vulnerable packages, container images, secrets and SBOMs. tfsec is now part of Trivy. Heads-up: Trivy's GitHub Actions and some releases were hijacked in a March 2026 supply-chain attack, so use trivy-action v0.35.0 or later and pin actions to a commit SHA.

🎯 Best for: One tool for everything💲 Free and open source (Apache-2.0)

Official site ↗

PR layer

GitHub AI Scan for PRs

Since Oct 15, GitHub's AI Scan reviews Bash, Terraform (HCL) and Dockerfile changes in pull requests and suggests autofixes. Findings are advisory, so keep a linter above as the hard gate.

🎯 Best for: GitHub repos💲 Free on public repos · private repos need Code Security or Advanced Security; usage billed in AI credits

Official site ↗

Also good

Semgrep

Terraform support is generally available; Bash and Dockerfile support is still experimental. Worth it if you already use Semgrep for app code and want one rules engine.

🎯 Best for: Teams already on Semgrep💲 Free up to 10 contributors · Teams from $30/contributor/mo

Official site ↗

Side by side

ToolBashTerraformDockerfileLicense / price
ShellCheckYesNoNoGPL-3.0, free
HadolintInside RUN (via ShellCheck)NoYesGPL-3.0, free
CheckovNoYesYesApache-2.0, free
TrivyNoYesYesApache-2.0, free
GitHub AI Scan for PRsYesYesYesFree public; paid private
SemgrepExperimentalYes (GA)ExperimentalFree tier; paid Teams
SonarQubeYes (Shell)YesYesFree up to 50k LOC

A starter setup

Run ShellCheck on *.sh, Hadolint on every Dockerfile, and Checkov (or Trivy) on your Terraform directory as separate CI steps. Each finishes in seconds. Fail the build on errors, warn on the rest. If you're on GitHub, turn on AI Scan for PRs as a second opinion. SonarQube Cloud's Team plan also covers Shell, Terraform and Docker if you'd rather have one dashboard.

How we picked

This is ToolTier's take, an editorial ordering rather than a formal tier. None of these tools are on our tier lists yet, so we built it from research and official docs and pricing pages, checked Oct 18, 2026. We weigh how fast you can get it running, how much it catches, how well it fits a small team's workflow, and price. No tool paid to be included, and none of the links on this page are affiliate links. How we rank.

FAQ

What is the best static analysis tool for Bash scripts?

ShellCheck. It's free, open source, runs everywhere and is the de facto standard for linting bash and sh scripts.

What is the best Terraform security scanner?

Checkov for most teams: it's free, open source and scans Terraform plans as well as source. Trivy is a good alternative if you want one tool for IaC, containers and dependencies. tfsec is now part of Trivy.

How do I lint a Dockerfile?

Use Hadolint. It checks Dockerfiles against best practices and runs ShellCheck on RUN instructions. Checkov and Trivy also scan Dockerfiles for security misconfigurations.

Does GitHub code scanning cover Bash, Terraform and Dockerfiles?

CodeQL doesn't. GitHub's AI Scan for pull requests does, since Oct 15, 2026, with advisory findings. It's free on public repos and needs Code Security or Advanced Security on private repos.

// built for builders

Ranking the rest of your stack?

ToolTier ranks AI coding agents, IDEs, app builders, hosting, backends and model APIs in S, A and B tiers, kept current daily.

See every tier list →   Coding Agents   AI Workflows   AI Code Review   AI IDEs   Deploy & Hosting

Related guides and tier lists

CodeQL alternativesGitHub Advanced Security alternativesAI Code Review tier listDeploy & Hosting tier listHow we rank

// weekly · free

The ToolTier Drop

New tools worth your time and tier changes, every week. No hype.