Allow checks to run globally across all resources
See original GitHub issueIs your feature request related to a problem? Please describe. I would like to define global checks, e.g. a Naming Convention check, that can apply globally to all resources, without me having to write out all the supported resources
Describe the solution you’d like I would like to write something like:
from checkov.terraform.checks.resource.base_check import BaseResourceCheck
class NamingCheck(BaseResourceCheck):
def __init__(self):
name = "Ensure naming convention is correct"
id = "MY_GLOBAL_001"
supported_resources = ['*']
# ...
The registry’s get_checks could also look at the *
resource, de-duplicating as necessary (maybe it could be a set?)
Describe alternatives you’ve considered Get a list of all terraform resources and put that in the list
Additional context
It could also be neat to do, for example, supported_resources = ["aws_*"]
, or more advanced matching, but that is not necessary for my purposes right now.
“Resource names must start with a letter or underscore, and may contain only letters, digits, underscores, and dashes” (source) so anything else should be fair game for matching
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (6 by maintainers)
Top GitHub Comments
I’ll try to think of a few. Some that we might look at are:
Closing issue due to inactivity. If you feel this is in error, please re-open, or reach out to the community via slack: https://slack.bridgecrew.io Thanks!