question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pre-commit should scan non-Terraform files

See original GitHub issue

Is 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:open
  • Created 3 years ago
  • Reactions:7
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
OtherDevOpsGenecommented, Nov 10, 2020

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. Between pass_filenames: true in .pre-commit-hooks.yaml and providing multiple --file/-f arguments to checkov, it seems like it should be doable.

1reaction
OtherDevOpsGenecommented, Jan 7, 2021

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found