diff --git a/.env.example b/.env.example index 958e5c7..8b6d0d9 100644 --- a/.env.example +++ b/.env.example @@ -58,6 +58,12 @@ REDIS_URL=redis://localhost:6379/0 # UI default page size (number of events shown per page) DEFAULT_PAGE_SIZE=24 +# Alert notifications (optional) +# Send triggered admin-ops alerts to a webhook (Slack, Teams, or generic) +ALERT_WEBHOOK_URL= +ALERT_WEBHOOK_FORMAT=generic # generic | slack | teams +ALERT_DEDUPE_MINUTES=15 + # Optional: privacy / access control # Hide entire services from users without PRIVACY_SERVICE_ROLES # PRIVACY_SERVICES=Exchange,Teams diff --git a/backend/config.py b/backend/config.py index 4966a26..74c17e7 100644 --- a/backend/config.py +++ b/backend/config.py @@ -63,6 +63,11 @@ class Settings(BaseSettings): # UI defaults DEFAULT_PAGE_SIZE: int = 24 + # Alert notifications + ALERT_WEBHOOK_URL: str = "" + ALERT_WEBHOOK_FORMAT: str = "generic" # generic | slack | teams + ALERT_DEDUPE_MINUTES: int = 15 + _settings = Settings() @@ -104,3 +109,7 @@ PRIVACY_SERVICE_ROLES = {r.strip() for r in _settings.PRIVACY_SERVICE_ROLES.spli REDIS_URL = _settings.REDIS_URL DEFAULT_PAGE_SIZE = _settings.DEFAULT_PAGE_SIZE + +ALERT_WEBHOOK_URL = _settings.ALERT_WEBHOOK_URL +ALERT_WEBHOOK_FORMAT = _settings.ALERT_WEBHOOK_FORMAT +ALERT_DEDUPE_MINUTES = _settings.ALERT_DEDUPE_MINUTES diff --git a/backend/database.py b/backend/database.py index 003358b..65b25ea 100644 --- a/backend/database.py +++ b/backend/database.py @@ -8,6 +8,7 @@ client = MongoClient(MONGO_URI or "mongodb://localhost:27017") db = client[DB_NAME] events_collection = db["events"] saved_searches_collection = db["saved_searches"] +alerts_collection = db["alerts"] logger = structlog.get_logger("aoc.database") diff --git a/backend/frontend/index.html b/backend/frontend/index.html index 706a16d..369a319 100644 --- a/backend/frontend/index.html +++ b/backend/frontend/index.html @@ -4,7 +4,7 @@
Search and review Microsoft audit events from Entra, Intune, Exchange, SharePoint, and Teams.
+