0

How can I give or supply an input to checkov's custom policy in python? For example, I want to check if terraform plan output json file has the values that I defined, in the resources, or the names of the resource are expected as I defined.

So far I created custom policy and runs on a terraform output json file, and it works. Now I want to enhance it to read of takes an input argument to the policy and checks accordingly.

kini_dot
  • 33
  • 1
  • 6
  • Please share the code you already have and add as much detail as possible – Sibtain Feb 17 '23 at 12:29
  • My code is almost like the sample custom policy documentation [here](https://www.checkov.io/3.Custom%20Policies/Python%20Custom%20Policies.html) The only missing part in the doc is how I can give the input parameters the `scan_resource_conf` function, and I cannot find any other good resource on this. – kini_dot Feb 17 '23 at 15:31
  • @kini_dot if I understnad you correctly, you want to control the parameters to `scan_resource_conf`, but `checkov` is actually just reading the files and seperates all resources in a file to a `conf` which the above function gets. Do you want to do something else rather than check part of your resource? – Barak Fatal Mar 09 '23 at 13:19

0 Answers0