From da4c429df93e3894c8d96410ab97079e3b45b26e Mon Sep 17 00:00:00 2001 From: YaaraVerner <86768411+YaaraVerner@users.noreply.github.com> Date: Tue, 21 Nov 2023 10:40:07 +0200 Subject: [PATCH] fix(terraform_plan): load terraform registry checks when using terraform plan (#5778) add terraform registry when using terraform plan --- .../features/policy_metadata_integration.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/checkov/common/bridgecrew/integration_features/features/policy_metadata_integration.py b/checkov/common/bridgecrew/integration_features/features/policy_metadata_integration.py index cbf72daedd0..e0fe5a537eb 100644 --- a/checkov/common/bridgecrew/integration_features/features/policy_metadata_integration.py +++ b/checkov/common/bridgecrew/integration_features/features/policy_metadata_integration.py @@ -4,6 +4,7 @@ import logging from typing import TYPE_CHECKING, Any, cast +from checkov.common.bridgecrew.check_type import CheckType from checkov.common.checks_infra.registry import get_graph_checks_registry from checkov.common.bridgecrew.integration_features.base_integration_feature import BaseIntegrationFeature from checkov.common.bridgecrew.platform_integration import bc_integration @@ -50,8 +51,10 @@ def pre_scan(self) -> None: if self.config and self.config.framework and "all" not in self.config.framework: registries = self.config.framework + if CheckType.TERRAFORM_PLAN in registries and CheckType.TERRAFORM not in registries: + registries.append(CheckType.TERRAFORM) else: - registries = ('terraform', 'cloudformation', 'kubernetes', 'bicep', 'terraform_plan') + registries = (CheckType.TERRAFORM, CheckType.CLOUDFORMATION, CheckType.KUBERNETES, CheckType.BICEP, CheckType.TERRAFORM_PLAN) for r in registries: registry = get_graph_checks_registry(r)