-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Labels
Description
Would adding support for autodiscovery of terraform projects within a monrepo root or subdirectory be possible? Currently I've got 3 or 4 projects where I have to write several hundreds lines of yaml to manually add each project (also remembering to update yaml when a new project is added).
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
btilford commentedon Feb 9, 2021
njgibbon commentedon Feb 27, 2021
Hello @btilford
I think we may be able to satisfy what you're after as-is. I'm not sure about excluding dirs yet. But checkout below:
I use this action configuration to run a recursive checkov scan only in the 'modules' directory. By specifying 'framework: terraform' I am only running terraform scans.
Will this do what you want? You could do things like use several blocks if you want to choose different specific dirs and subdirs to scan.
alen-z commentedon Jan 14, 2022
Did not test, but
directory: dir1/ -d dir2/ -d dir3/might do the trick to scan selected set of directories.While we're at it, can we enable Checkov GH actions to take multiple directories?
Edit: Alternative could be to run Checkov multiple times by changing
directoryvariable from matrix which is dynamically built based on extracted changed directories in the repository. Similar to: https://tomasvotruba.com/blog/2020/11/16/how-to-make-dynamic-matrix-in-github-actions/HariSekhon commentedon Feb 22, 2022
@alen-z I'm using
.checkov.yamlto work around more options than the GitHub Action supports, such as a list of directories to skip usingskip-path.Here is my working template that I use in this and other repos:
https://github.com/HariSekhon/Templates/blob/master/.checkov.yaml