Feature Request / Bug / Integration Issue - checkov environmental variables / feature flags #6805
Labels
contribution requested
This is a great feature idea, but we will need a contribution to get it added to Checkov.
Describe the feature
Sorry if this is a little of a rant, Checkov is great... It could be even better.
I'm not sure if this is a Bug, a Feature Request, and Integration Issue or poor design / sloppy implementation. The integration issue is with https://github.com/bridgecrewio/checkov-action, however other tools probably follow a similar approach as the documentation https://www.checkov.io/2.Basics/CLI%20Command%20Reference.html means alot of these features (and debugging issues) are harder than they need to be.
Many checkov features are implemented as ad-hoc environmental variables rather than feature flags as such they are 3rd class citizens. I initially thought this might be addressed by the
--var-file
cli arg, however that appears to be the terraform / helm environment rather than the checkov environmentI'm specifically referring to the following, however I imagine they are all through out the checkov code. The key issue with all of these is the use of
os.getenv
deep within code where there would ideally be a more consolidated approach. Examples that come to mind areLOG_LEVEL
CHECKOV_OUTPUT_CODE_LINE_LIMIT
Checkov is a really great tool, but when it's not doing what people expect it's really hard to figure out why, and the sad point is that most of the what people expect is available... but they have to dig through issues such as this one, to find things like
LOG_LEVEL
and then they need an understanding of python to put together where to look in checkov for where the thing they are after might be.In my specific case I have a private registry that's on an RFC1918 host using boring-registry. It works perfectly fine for terraform source of
However this was obviously not downloading. I initially tried to see if checkov had a
verbose
ordebug
cli flag (as opposed to the--quiet
flag, but no such luck. I then went to checking local http logs, firewall logs and performingcurl
tests to ensure that I was able to connect to the registry which was fine. It was only after an hour of searching I found theLOG_LEVEL
cli arg and then in those logs saw404 Client Error: Not Found for url: https://registry.terraform.io/vi/modules/hostname/namespace/name/system:0.0.1
and the line above showing the class (Thank You for the log info once I figured out how to expose it)Now we get to https://github.com/bridgecrewio/checkov-action which doesn't allow ad-hoc environmental variables, I cannot use the
var_file
arg because it's args passed to Terraform / Helm rather than the environment for checkov itself, I also cannot put this config into theconfig_file
arg because the ad-hocos.getenv
scattered through checkov.The text was updated successfully, but these errors were encountered: