Skip to content

Commit

Permalink
feat: add trivy terraform scan to pre-commit checks
Browse files Browse the repository at this point in the history
  • Loading branch information
bkenez committed Jan 13, 2025
1 parent f8c8cc2 commit 7bb011e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .lint/trivy/trivy-scan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Since Trivy does not have a pre-commit hook by default, this is a custom hook script
#!/bin/bash
trivy config --config .lint/trivy/trivy.yaml --ignorefile .trivyignore
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,11 @@ repos:
rev: 0.2.3
hooks:
- id: yamlfmt

- repo: local
hooks:
- id: trivy-scan
name: Trivy Scan
entry: .lint/trivy/trivy-scan.sh
language: script
types: [yaml, terraform]
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ terraform-docs 0.19.0
tflint 0.55.0

tfsec 1.28.13

trivy 0.58.1

0 comments on commit 7bb011e

Please sign in to comment.