Skip to content

Commit 293b64c

Browse files
authored
feat: Add checkov support (#143)
1 parent 45e16de commit 293b64c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.pre-commit-hooks.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,14 @@
7171
description: Static analysis of Terraform templates to spot potential security issues.
7272
entry: terraform_tfsec.sh
7373
language: script
74+
75+
- id: checkov
76+
name: Checkov
77+
description: Runs checkov on Terraform templates.
78+
entry: checkov -d .
79+
language: python
80+
pass_filenames: false
81+
always_run: false
82+
files: \.tf$
83+
exclude: \.+.terraform\/.*$
84+
require_serial: true

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* [`TFLint`](https://github.com/terraform-linters/tflint) required for `terraform_tflint` hook.
1212
* [`TFSec`](https://github.com/liamg/tfsec) required for `terraform_tfsec` hook.
1313
* [`coreutils`](https://formulae.brew.sh/formula/coreutils) required for `terraform_validate` hook on macOS (due to use of `realpath`).
14+
* [`checkov`](https://github.com/bridgecrewio/checkov) required for `checkov` hook.
1415

1516
##### MacOS
1617

@@ -76,6 +77,7 @@ There are several [pre-commit](https://pre-commit.com/) hooks to keep Terraform
7677
| `terragrunt_fmt` | Rewrites all [Terragrunt](https://github.com/gruntwork-io/terragrunt) configuration files (`*.hcl`) to a canonical format. |
7778
| `terragrunt_validate` | Validates all [Terragrunt](https://github.com/gruntwork-io/terragrunt) configuration files (`*.hcl`) |
7879
| `terraform_tfsec` | [TFSec](https://github.com/liamg/tfsec) static analysis of terraform templates to spot potential security issues. |
80+
| `checkov` | [checkov](https://github.com/bridgecrewio/checkov) static analysis of terraform templates to spot potential security issues. |
7981

8082
Check the [source file](https://github.com/antonbabenko/pre-commit-terraform/blob/master/.pre-commit-hooks.yaml) to know arguments used for each hook.
8183

0 commit comments

Comments
 (0)