Skip to content

Commit

Permalink
THREAT-315 Wiz Alert passthrough - updated according to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
akozlovets098 authored and egibs committed Jun 28, 2024
1 parent 4ed5f30 commit a64f187
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 8 deletions.
7 changes: 7 additions & 0 deletions packs/wiz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
AnalysisType: pack
PackID: PantherManaged.Wiz
Description: Group of all Wiz detections
DisplayName: "Panther Wiz Pack"
PackDefinition:
IDs:
- Wiz.Alert.Passthrough
26 changes: 19 additions & 7 deletions rules/wiz_rules/wiz_alert_passthrough.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from panther_base_helpers import deep_get


def rule(event):
return event.get("status") == "OPEN"

Expand All @@ -17,16 +20,25 @@ def dedup(event):
return event.get("id")


def description(event):
return event.deep_get("sourceRule", "controlDescription", default="<DESCRIPTION_NOT_FOUND>")


def runbook(event):
return event.deep_get(
"sourceRule", "resolutionRecommendation", default="<RECOMMENDATION_NOT_FOUND>"
)


def alert_context(event):
security_subcategories = event.deep_get("sourceRule", "securitySubCategories", default=[{}])
return {
"id": event.get("id", "<ID_NOT_FOUND>"),
"type": event.get("type", "<TYPE_NOT_FOUND>"),
"description": event.deep_get(
"sourceRule", "controlDescription", default="<DESCRIPTION_NOT_FOUND>"
),
"resolution_recommendation": event.deep_get(
"sourceRule", "resolutionRecommendation", default="<RECOMMENDATION_NOT_FOUND>"
),
"severity": event.get("severity", "<SEVERITY_NOT_FOUND>"),
"entity_snapshot": event.get("entitySnapshot", {}),
"mitre_attack_categories": [
subcategory
for subcategory in security_subcategories
if deep_get(subcategory, "category", "framework", "name") == "MITRE ATT&CK Matrix"
],
}
22 changes: 21 additions & 1 deletion rules/wiz_rules/wiz_alert_passthrough.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,27 @@ Tests:
"controlDescription": "Alert Description",
"id": "12345",
"name": "Alert Name",
"resolutionRecommendation": "Alert Resolution Recommendation"
"resolutionRecommendation": "Alert Resolution Recommendation",
"securitySubCategories": [
{
"category": {
"framework": {
"name": "Wiz for Risk Assessment"
},
"name": "High Profile Threats"
},
"title": "High-profile vulnerability exploited in the wild"
},
{
"category": {
"framework": {
"name": "MITRE ATT&CK Matrix"
},
"name": "TA0001 Initial Access"
},
"title": "T1190 Exploit Public-Facing Application"
},
]
},
"status": "OPEN",
"statusChangedAt": "2024-06-04 02:28:06.597355000",
Expand Down

0 comments on commit a64f187

Please sign in to comment.