Skip to content

Commit

Permalink
feat(sca): support licenses custom policies enforcement rules (#6173)
Browse files Browse the repository at this point in the history
* support custom lic policies enforcement rules

* support custom lic policies enforcement rules

* support custom lic policies enforcement rules

* support custom lic policies enforcement rules

* stay backwards compatible

* flake 8

---------

Co-authored-by: oshimko <[email protected]>
  • Loading branch information
OfekShimko and oshimko authored Apr 18, 2024
1 parent b5540e1 commit 8fffdc6
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit 8fffdc6

Please sign in to comment.