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.
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
- Our pick · Bash: ShellCheck, best for shell scripts
- Our pick · Docker: Hadolint, best for Dockerfiles
- Our pick · Terraform: Checkov, best for Terraform and cloud config
- Also good: Trivy, best for one tool for everything
- PR layer: GitHub AI Scan for PRs, best for GitHub repos
- Also good: Semgrep, best for teams already on Semgrep
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.
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.
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.
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.
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.
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.
Side by side
| Tool | Bash | Terraform | Dockerfile | License / price |
|---|---|---|---|---|
| ShellCheck | Yes | No | No | GPL-3.0, free |
| Hadolint | Inside RUN (via ShellCheck) | No | Yes | GPL-3.0, free |
| Checkov | No | Yes | Yes | Apache-2.0, free |
| Trivy | No | Yes | Yes | Apache-2.0, free |
| GitHub AI Scan for PRs | Yes | Yes | Yes | Free public; paid private |
| Semgrep | Experimental | Yes (GA) | Experimental | Free tier; paid Teams |
| SonarQube | Yes (Shell) | Yes | Yes | Free 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.
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
The ToolTier Drop
New tools worth your time and tier changes, every week. No hype.