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 d904f10d3be..d3853f9e90b 100644 --- a/checkov/common/bridgecrew/integration_features/features/policy_metadata_integration.py +++ b/checkov/common/bridgecrew/integration_features/features/policy_metadata_integration.py @@ -151,10 +151,11 @@ def _handle_customer_run_config(self, run_config: dict[str, Any]) -> None: # Custom policies are returned in run_config['customPolicies'] rather than run_config['policyMetadata']. if 'customPolicies' in run_config: for custom_policy in run_config['customPolicies']: - if 'guideline' in custom_policy: - self.check_metadata[custom_policy['id']] = { - 'guideline': custom_policy['guideline'] - } + custom_policy_check_metadata = { + 'severity': custom_policy.get('severity'), + 'guideline': custom_policy.get('guideline') + } + self.check_metadata[custom_policy['id']] = {k: v for k, v in custom_policy_check_metadata.items() if v is not None} pc_policy_id = custom_policy.get('pcPolicyId') if pc_policy_id: self.pc_to_ckv_id_mapping[pc_policy_id] = custom_policy['id']