Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for skip-path #55

Closed
josh-barker opened this issue Sep 15, 2021 · 4 comments · Fixed by #140
Closed

Add support for skip-path #55

josh-barker opened this issue Sep 15, 2021 · 4 comments · Fixed by #140

Comments

@josh-barker
Copy link

Hi,

I'd like to be able to specify to ignore a path in the action.

My terraform modules have the following directory structure:

./main.tf
./examples/default/main.tf

I'd like to run checkov on the root directory, but exclude the examples directory.

Cheers

@HariSekhon
Copy link

Use skip-path in .checkov.yaml - see my Templates repo for a working example that I use to skip scanning sub-modules:

https://github.com/HariSekhon/Templates/blob/master/.checkov.yaml

@josh-barker
Copy link
Author

Hey @HariSekhon , thanks for your suggestion. I was hoping to set skip-path in the github action, instead of .checkov.yaml.

Cheers

@HariSekhon
Copy link

Yes I completely understand that - you should be able to do both.

What I find is beneficial with the .checkov.yaml is that this use a single GitHub Actions reusable workflow across all repos, eg:

https://github.com/HariSekhon/GitHub-Actions/blob/master/.github/workflows/checkov.yaml

which can be imported in each repo with a few lines:

jobs:
  checkov:
    uses: HariSekhon/GitHub-Actions/.github/workflows/checkov.yaml@master

(eg. https://github.com/HariSekhon/Terraform/blob/master/.github/workflows/checkov.yaml)

but configure different settings in each repo's .checkov.yaml, allowing for the greatest code reuse and settings flexibility combination.

@josh-barker
Copy link
Author

Hey @HariSekhon, that's a nice pattern! Thanks for sharing! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants