Pre-commit should scan non-Terraform files
See original GitHub issueIs your feature request related to a problem? Please describe.
Running Checkov by hand will scan .tf
, .yml
, .yaml
, and .json
files for ARM templates, Cloudformation files, and Kubernetes files as well as Terraform files. The pre-commit hook only scans .tf
files.
Describe the solution you’d like
I’d like to use checkov
as a pre-commit hook the same way we can in our pipeline.
Describe alternatives you’ve considered
Since checkov
is just running on the current directory via checkov -d .
, the scan works on the other file types as is. But the hook will be skipped if no .tf
files are changed,
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:14 (1 by maintainers)
Top Results From Across the Web
pre-commit hooks for Terraform - Rahul Lokurte Blog
pre -commit hooks automatically scan the codebase and point out the issues with a code such as linting errors, style violations, missing ...
Read more >Starting out with Terraform pre-commit - Mostly Technical
The repository mapping tells pre-commit where to get the code for the hook from. Then you choose a version, and you enable some...
Read more >How to leverage Pre-commits hooks with Terraform - SoKube
Using GIT pre-commits allows you to call hooks before each commit that will automatically launch custom scripts or commands.
Read more >Supported hooks - pre-commit
reorder-python-imports - This hook reorders imports in python files. ... script-must-have-extension - Non-executable shell script filename ends in .sh ...
Read more >How I use pre-commit for Terraform
pre -commit operates as a git hook, commits triggering a set of tools to check your code. You can set what tools to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also, the analysis runs on the entire repo if any file (currently any
.tf
file) is changed, failing checks in files that were unchanged. Only changed files should be analyzed. Betweenpass_filenames: true
in.pre-commit-hooks.yaml
and providing multiple--file
/-f
arguments tocheckov
, it seems like it should be doable.@libertyy This issue and my comments are regarding the pre-commit hook, not the GitHub action. I’m not clear on what the connection is.