-
Notifications
You must be signed in to change notification settings - Fork 530
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
feat: add tfsec-checkgen test-check command to test custom check against tf test code #1436
feat: add tfsec-checkgen test-check command to test custom check against tf test code #1436
Conversation
Could this be added as an additional command to tfsec-checkgen? |
I added it as a new command as I think I've seen somewhere that the original purpose of checkgen is to generate custom checks? I'm not sure if that vision is still true tho, let me know if adding it into checkgen is preferred. :) |
Yeah, lets stick with it being part of checkgen since its all the same sort of thing. In answer to the other question, before we moved to defsec we had tfsec-skeleton which asked you a number of questions about services, required labels, required resources. I think it would do similar to that.... I think there is only so far we can go with automating the generation of custom checks so it will be a bit trial and error |
0862f56
to
c406637
Compare
…nst tf test code - new sub-command `tfsec-checkgen test-check <custom_check_file> -p <pass.tf> -f <fail.tf>` - number of --pass/-p/--fail/-f flags are optional and variable - had to modify the internal custom package to expose functions - subcommand `test-check` used to prep for future `test-checks` command that runs tests against more than one custom check files partially solves #1415
c406637
to
001b939
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again @gabrielleecredera - your contributions are really appreciated ❤️
hey @gabrielleecredera - looks like a goimports issue breaking the build |
53bafb6
to
b106047
Compare
apologies, forgot to add the fixed file to the merge commit haha |
tfsec-checktest test-check <custom_check_file> -p <pass.tf> -f <fail.tf>
--pass
/-p
/--fail
/-f
flags are optional and variabletest-check
used to prep for futuretest-checks
command that runs tests against more than one custom check filespartially solves #1415