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
Copy file name to clipboardExpand all lines: README.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,7 @@ If you are using `pre-commit-terraform` already or want to support its developme
43
43
*[terraform_tflint](#terraform_tflint)
44
44
*[terraform_tfsec](#terraform_tfsec)
45
45
*[terraform_validate](#terraform_validate)
46
+
*[terrascan](#terrascan)
46
47
*[Authors](#authors)
47
48
*[License](#license)
48
49
@@ -223,7 +224,7 @@ There are several [pre-commit](https://pre-commit.com/) hooks to keep Terraform
223
224
|`terraform_validate`| Validates all Terraform configuration files. [Hook notes](#terraform_validate)| - |
224
225
|`terragrunt_fmt`| Reformat all [Terragrunt](https://github.com/gruntwork-io/terragrunt) configuration files (`*.hcl`) to a canonical format. |`terragrunt`|
225
226
|`terragrunt_validate`| Validates all [Terragrunt](https://github.com/gruntwork-io/terragrunt) configuration files (`*.hcl`) |`terragrunt`|
226
-
|`terrascan`|[terrascan](https://github.com/accurics/terrascan) Detect compliance and security violations. |`terrascan`|
227
+
|`terrascan`|[terrascan](https://github.com/accurics/terrascan) Detect compliance and security violations. [Hook notes](#terrascan)|`terrascan`|
227
228
<!-- markdownlint-enable no-inline-html -->
228
229
229
230
Check the [source file](https://github.com/antonbabenko/pre-commit-terraform/blob/master/.pre-commit-hooks.yaml) to know arguments used for each hook.
@@ -550,6 +551,22 @@ Example:
550
551
551
552
**Warning:** If you use Terraform workspaces, DO NOT use this workaround ([details](https://github.com/antonbabenko/pre-commit-terraform/issues/203#issuecomment-918791847)). Wait to [`force-init`](https://github.com/antonbabenko/pre-commit-terraform/issues/224) option implementation.
552
553
554
+
### terrascan
555
+
556
+
1. `terrascan` supports custom arguments so you can pass supported flags like `--non-recursive` and `--policy-type` to disable recursive inspection and set the policy type respectively:
557
+
558
+
```yaml
559
+
- id: terrascan
560
+
args:
561
+
- --args=--non-recursive # avoids scan errors on subdirectories without Terraform config files
562
+
- --args=--policy-type=azure
563
+
```
564
+
565
+
See the `terrascan run -h` command line help for available options.
566
+
567
+
2. Use the `--args=--verbose` parameter to see the rule ID in the scaning output. Usuful to skip validations.
568
+
3. Use `--skip-rules="ruleID1,ruleID2"` parameter to skip one or more rules globally while scanning (e.g.: `--args=--skip-rules="ruleID1,ruleID2"`).
569
+
4. Use the syntax `#ts:skip=RuleID optional_comment` inside a resource to skip the rule for that resource.
0 commit comments