AnalysisType: rule
RuleID: Wiz.CICD.Scan.Policy.Updated.Or.Deleted
Description: This rule detects updates and deletions of CICD scan policies.
DisplayName: Wiz CICD Scan Policy Updated Or Deleted
Runbook: Verify that this change was planned. If not, revert the change and ensure this doesn't happen again.
Reference: https://www.wiz.io/academy/ci-cd-security-best-practices
Enabled: true
Filename: wiz_cicd_scan_policy_updated_or_deleted.py
Severity: Medium
Reports:
MITRE ATT&CK:
- TA0005:T1562.001 # Impair Defenses: Disable or Modify Tools
LogTypes:
- Wiz.Audit
DedupPeriodMinutes: 60
Threshold: 1
Tests:
- Name: DeleteCICDScanPolicy
ExpectedResult: true
Log:
{
"action": "DeleteCICDScanPolicy",
"actionparameters": {
"input": {
"id": "12345-cd1f-4a4b-b3e4-12345"
}
},
"id": "12345-de20-4e00-b958-12345",
"log_type": null,
"requestid": "12345-284b-4166-aea7-12345",
"serviceaccount": null,
"sourceip": "8.8.8.8",
"status": "SUCCESS",
"timestamp": "2023-09-01 14:27:42.694",
"user": {
"id": "test@company.com",
"name": "test@company.com"
}
}
- Name: CreateUser
ExpectedResult: false
Log:
{
"id": "220d23be-f07c-4d97-b4a6-87ad04eddb14",
"action": "CreateUser",
"requestId": "0d9521b2-c3f8-4a73-bf7c-20257788752e",
"status": "SUCCESS",
"timestamp": "2024-07-29T09:40:15.66643Z",
"actionParameters": {
"input": {
"assignedProjectIds": null,
"email": "testy@company.com",
"expiresAt": null,
"name": "Test User",
"role": "GLOBAL_ADMIN"
},
"selection": [
"__typename",
{
"user": [
"__typename",
"id"
]
}
]
},
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
"sourceIP": "8.8.8.8",
"serviceAccount": null,
"user": {
"id": "someuser@company.com",
"name": "someuser@company.com"
}
}
- Name: DeleteCICDScanPolicy - Fail
ExpectedResult: false
Log:
{
"action": "DeleteCICDScanPolicy",
"actionparameters": { },
"id": "12345-de20-4e00-b958-12345",
"log_type": null,
"requestid": "12345-284b-4166-aea7-12345",
"serviceaccount": null,
"sourceip": "8.8.8.8",
"status": "FAILED",
"timestamp": "2023-09-01 14:27:42.694",
"user": {
"id": "test@company.com",
"name": "test@company.com"
}
}
# ------ paired body: wiz_cicd_scan_policy_updated_or_deleted.py ------
from panther_wiz_helpers import wiz_actor, wiz_alert_context, wiz_success
SUSPICIOUS_ACTIONS = ["DeleteCICDScanPolicy", "UpdateCICDScanPolicy"]
def rule(event):
if not wiz_success(event):
return False
return event.get("action", "ACTION_NOT_FOUND") in SUSPICIOUS_ACTIONS
def title(event):
actor = wiz_actor(event)
return (
f"[Wiz]: [{event.get('action', 'ACTION_NOT_FOUND')}] action "
f"performed by {actor.get('type')} [{actor.get('name')}]"
)
def dedup(event):
return event.get("id")
def alert_context(event):
return wiz_alert_context(event)