CKV_GCP_26 - BaseResourceValueCheck class implementation
-from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
-from checkov.common.models.enums import CheckResult, CheckCategories
+from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
+from checkov.common.models.enums import CheckCategories
+from checkov.common.models.consts import ANY_VALUE
-class GoogleSubnetworkLoggingEnabled(BaseResourceCheck):
+class GoogleSubnetworkLoggingEnabled(BaseResourceValueCheck):
def __init__(self):
name = "Ensure that VPC Flow Logs is enabled for every subnet in a VPC Network"
id = "CKV_GCP_26"
@@ -10,10 +11,11 @@ class GoogleSubnetworkLoggingEnabled(BaseResourceCheck):
categories = [CheckCategories.NETWORKING]
super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
- def scan_resource_conf(self, conf):
- if 'log_config' in conf:
- return CheckResult.PASSED
- return CheckResult.FAILED
+ def get_inspected_key(self):
+ return 'log_config'
+
+ def get_expected_values(self):
+ return [ANY_VALUE]
check = GoogleSubnetworkLoggingEnabled()
