Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.
Python agentic-aiai-securityalert-triageblue-teamcybersecuritydetection-engineeringincident-responselanggraphllm-agentsmcpmitre-attackmodel-context-protocolpurple-teamsecurity-operationsself-hostedsiemsoarsocthreat-detectionthreat-intelligence
style(replay): satisfy ruff 0.4.x lint + format (UP038, import sort, line wrap)
Beenu Arorac2b07ff33caf
diff --git a/services/api/app/api/v1/endpoints/replay.py b/services/api/app/api/v1/endpoints/replay.pyindex df9f352e6..ed4cda9a9 100644--- a/services/api/app/api/v1/endpoints/replay.py+++ b/services/api/app/api/v1/endpoints/replay.py@@ -110,10 +110,7 @@ async def _load_run_and_events(events = list((await db.execute(- select(InvestigationEvent)- .where(InvestigationEvent.run_id == run_id)- .order_by(InvestigationEvent.seq.asc())- .limit(10000)+ select(InvestigationEvent).where(InvestigationEvent.run_id == run_id).order_by(InvestigationEvent.seq.asc()).limit(10000))).scalars()@@ -277,9 +274,7 @@ async def get_public_replay(slug: str, db: DBSession) -> PublicReplay:# Best-effort view bump; never fail the read on a counter error.try:- await db.execute(- update(PublishedReplay).where(PublishedReplay.id == row.id).values(view_count=PublishedReplay.view_count + 1)- )+ await db.execute(update(PublishedReplay).where(PublishedReplay.id == row.id).values(view_count=PublishedReplay.view_count + 1))await db.commit()except Exception: # pragma: no cover - counter is best-effort onlyawait db.rollback()diff --git a/services/api/app/services/replay_redaction.py b/services/api/app/services/replay_redaction.pyindex 909e415de..3e15a2dd6 100644--- a/services/api/app/services/replay_redaction.py+++ b/services/api/app/services/replay_redaction.py@@ -58,7 +58,7 @@ def _collect_techniques(raw_alert: dict | None, events: list[dict]) -> list[str]def add(values: Any) -> None:if isinstance(values, str):values = [values]- if isinstance(values, (list, tuple)):+ if isinstance(values, list | tuple):for v in values:tid = str(v).upper().strip()if tid and tid.startswith("T") and tid not in seen:diff --git a/services/api/tests/test_replay_publish.py b/services/api/tests/test_replay_publish.pyindex 556e1da47..efe56801f 100644--- a/services/api/tests/test_replay_publish.py+++ b/services/api/tests/test_replay_publish.py@@ -10,7 +10,6 @@ from __future__ import annotationsfrom datetime import UTC, datetime, timedeltaimport pytest-from app.services.replay_redaction import build_redacted_snapshot