You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -82,6 +83,7 @@ If you are using `pre-commit-terraform` already or want to support its developme
82
83
*[`terrascan`](https://github.com/tenable/terrascan) required for `terrascan` hook.
83
84
*[`TFLint`](https://github.com/terraform-linters/tflint) required for `terraform_tflint` hook.
84
85
*[`TFSec`](https://github.com/liamg/tfsec) required for `terraform_tfsec` hook.
86
+
*[`Trivy`](https://github.com/aquasecurity/trivy) required for `terraform_trivy` hook.
85
87
*[`infracost`](https://github.com/infracost/infracost) required for `infracost_breakdown` hook.
86
88
*[`jq`](https://github.com/stedolan/jq) required for `terraform_validate` with `--retry-once-with-cleanup` flag, and for `infracost_breakdown` hook.
87
89
*[`tfupdate`](https://github.com/minamijoyo/tfupdate) required for `tfupdate` hook.
|`terraform_tflint`| Validates all Terraform configuration files with [TFLint](https://github.com/terraform-linters/tflint). [Available TFLint rules](https://github.com/terraform-linters/tflint/tree/master/docs/rules#rules). [Hook notes](#terraform_tflint). |`tflint`|
276
281
|`terraform_tfsec`|[TFSec](https://github.com/aquasecurity/tfsec) static analysis of terraform templates to spot potential security issues. [Hook notes](#terraform_tfsec)|`tfsec`|
282
+
|`terraform_trivy`|[Trivy](https://github.com/aquasecurity/trivy) static analysis of terraform templates to spot potential security issues. [Hook notes](#terraform_trivy)|`trivy`|
277
283
|`terraform_validate`| Validates all Terraform configuration files. [Hook notes](#terraform_validate)|`jq`, only for `--retry-once-with-cleanup` flag |
278
284
|`terragrunt_fmt`| Reformat all [Terragrunt](https://github.com/gruntwork-io/terragrunt) configuration files (`*.hcl`) to a canonical format. |`terragrunt`|
279
285
|`terragrunt_validate`| Validates all [Terragrunt](https://github.com/gruntwork-io/terragrunt) configuration files (`*.hcl`) |`terragrunt`|
@@ -681,7 +687,9 @@ To replicate functionality in `terraform_docs` hook:
681
687
```
682
688
683
689
684
-
### terraform_tfsec
690
+
### terraform_tfsec (deprecated)
691
+
692
+
**DEPRECATED**. [tfsec was replaced by trivy](https://github.com/aquasecurity/tfsec/discussions/1994), so please use [`terraform_trivy`](#terraform_trivy).
685
693
686
694
1. `terraform_tfsec` will consume modified files that pre-commit
687
695
passes to it, so you can perform whitelisting of directories
@@ -738,6 +746,48 @@ To replicate functionality in `terraform_docs` hook:
738
746
- --args=--config-file=.tfsec.json
739
747
```
740
748
749
+
### terraform_trivy
750
+
751
+
1. `terraform_trivy` will consume modified files that pre-commit
752
+
passes to it, so you can perform whitelisting of directories
753
+
or files to run against via [files](https://pre-commit.com/#config-files)
754
+
pre-commit flag
755
+
756
+
Example:
757
+
758
+
```yaml
759
+
- id: terraform_trivy
760
+
files: ^prd-infra/
761
+
```
762
+
763
+
The above will tell pre-commit to pass down files from the `prd-infra/` folder
764
+
only such that the underlying `trivy` tool can run against changed files in this
765
+
directory, ignoring any other folders at the root level
766
+
767
+
2. To ignore specific warnings, follow the convention from the
0 commit comments