checkov custom policy working only with terraform code and not with cloudformation

Viewed 177

I created a Checkov custom YAML policy and noticed that only terraform files are getting scanned with the custom policy. Did not find any documentation that confirms this as the expected behavior. How can I scan cloudformation code with custom policy?

Here is the custom policy I used (Basic query) - https://www.checkov.io/3.Custom%20Policies/Examples.html

Below are the commands

# cd to cfn folder
# my custom policy is in my_extra_checks folder
checkov -d . --external-checks-dir my_extra_checks

output has other scans but not the custom scan.

cloudformation scan results:
Passed checks: 1, Failed checks: 1, Skipped checks: 0
1 Answers

It all depends how you define your resources, I had a similar problem. I removed the scope, and also set my attributes to Tags.

Related