feat: Admin Operations SIEM — alerts, notifications, pre-built rules
- Add pluggable notification system (webhook, Slack, Teams) with retry
- Add alert deduplication: same rule + actor within 15 min = one alert
- Add 10 pre-built admin-ops rule templates seeded on startup:
- Failed Conditional Access, After-Hours Admin Activity
- New Application Registration, Admin Role Assignment
- License Change, Bulk User Deletion
- Device Compliance Failure, Exchange Transport Rule Change
- Service Principal Credential Added, External Sharing Enabled
- Add /api/alerts, /api/alerts/{id}/status, /api/alerts/summary endpoints
- Add alert dashboard to frontend with status filters and ack/resolve buttons
- Add alert summary badge in hero header (high/medium/low counts)
- New env vars: ALERT_WEBHOOK_URL, ALERT_WEBHOOK_FORMAT, ALERT_DEDUPE_MINUTES
This commit is contained in:
@@ -59,6 +59,7 @@ def test_evaluate_event_creates_alert(monkeypatch):
|
||||
inserted["doc"] = doc
|
||||
|
||||
monkeypatch.setattr(alerts_collection, "insert_one", mock_insert)
|
||||
monkeypatch.setattr(alerts_collection, "count_documents", lambda *args, **kwargs: 0)
|
||||
|
||||
event = {"id": "e1", "operation": "Add user", "timestamp": datetime.now(UTC).isoformat(), "dedupe_key": "dk1"}
|
||||
triggered = evaluate_event(event)
|
||||
|
||||
Reference in New Issue
Block a user