Skip to content

Commit adfe0a0

Browse files
authored
Merge pull request #171 from PaloAltoNetworks/fix/add-get-main-id
add get main rule id for enforcement rule
2 parents 85f1f92 + 4d80bab commit adfe0a0

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

prismacloud/cli/cspm/cmd_pov.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,17 +246,24 @@ def start_pov():
246246
pc_api.adoptionadvisor_report_create(report_to_add=body_params)
247247
logging.info("API - Created Cloud Security Report")
248248

249+
enforcement_rules = pc_api.enforcement_rules_read()
250+
251+
# Extract the id where mainRule is True
252+
main_rule_id = next((rule["id"] for rule in enforcement_rules["rules"] if rule.get("mainRule")), None)
253+
254+
logging.info(f"API - Enforcement rules - Main Rule ID: {main_rule_id}")
249255
# Prepare the body parameters for the update
250256
body_params = {
251-
"id": "8d57f69b-fbe6-4749-b53c-1e0f0881ad3d",
257+
"id": f"{main_rule_id}",
252258
"name": "Security default findings",
253259
"repositories": [],
260+
"labels": [],
254261
"codeCategories": {
255-
"LICENSES": {"softFailThreshold": "LOW", "hardFailThreshold": "OFF", "commentsBotThreshold": "LOW"},
256-
"VULNERABILITIES": {"softFailThreshold": "LOW", "hardFailThreshold": "OFF", "commentsBotThreshold": "LOW"},
262+
"LICENSES": {"softFailThreshold": "LOW", "hardFailThreshold": "OFF", "commentsBotThreshold": "HIGH"},
263+
"VULNERABILITIES": {"softFailThreshold": "LOW", "hardFailThreshold": "OFF", "commentsBotThreshold": "HIGH"},
257264
"IAC": {"softFailThreshold": "INFO", "hardFailThreshold": "OFF", "commentsBotThreshold": "INFO"},
258265
"WEAKNESSES": {"softFailThreshold": "OFF", "hardFailThreshold": "OFF", "commentsBotThreshold": "OFF"},
259-
"SECRETS": {"softFailThreshold": "LOW", "hardFailThreshold": "OFF", "commentsBotThreshold": "LOW"},
266+
"SECRETS": {"softFailThreshold": "LOW", "hardFailThreshold": "OFF", "commentsBotThreshold": "HIGH"},
260267
"BUILD_INTEGRITY": {"softFailThreshold": "OFF", "hardFailThreshold": "OFF", "commentsBotThreshold": "OFF"},
261268
},
262269
}

prismacloud/cli/cwpp/cmd_images.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def list_(limit=50):
2525
@click.option("-l", "--limit", default=50, help="Limit the number of images to process. Default limit is 50")
2626
def packages_(package, image_name, cluster, limit):
2727
"""Show deployed images package information."""
28-
query_params = {"limit": limit}
28+
# query_params = {"limit": limit}
29+
query_params = {}
2930
if image_name:
3031
query_params["image_name"] = image_name
3132
if cluster:

prismacloud/cli/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "0.8.10"
1+
version = "0.8.11"

0 commit comments

Comments
 (0)