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
fix(api,agents): point api->agents proxy at port 8084 and reorder /playbooks/runs
Beenu Arora1d7b3258e222
diff --git a/docker-compose.demo.yml b/docker-compose.demo.ymlindex 89df9bc73..8b7ad1fce 100644--- a/docker-compose.demo.yml+++ b/docker-compose.demo.yml@@ -149,6 +149,11 @@ services:ENVIRONMENT: developmentLOG_LEVEL: infoCORS_ORIGINS: http://localhost:3000+ # The agents service listens on port 8084 inside the Docker network+ # (see its Dockerfile + the agents service block below). Without this+ # the api defaults to `http://agents:8000` and every playbook / case+ # investigation request 503s with "All connection attempts failed".+ AGENTS_SERVICE_URL: http://agents:8084networks:- aisoc-demorestart: unless-stoppeddiff --git a/services/agents/app/api/playbooks.py b/services/agents/app/api/playbooks.pyindex 7b9a59ded..89b368351 100644--- a/services/agents/app/api/playbooks.py+++ b/services/agents/app/api/playbooks.py@@ -61,6 +61,35 @@ async def create_playbook(playbook: Playbook) -> dict:return created.model_dump()+# ---------------------------------------------------------------------------+# Run queries (declared BEFORE /{playbook_id} so FastAPI matches the literal+# "/runs" prefix instead of treating "runs" as a playbook_id path param).+# ---------------------------------------------------------------------------++[email protected]("/runs", summary="List recent playbook runs")+async def list_runs(limit: int = 50) -> list[dict]:+ recent = sorted(+ _runs.values(),+ key=lambda r: r.started_at or "",+ reverse=True,+ )[:limit]+ return [r.to_dict() for r in recent]++[email protected]("/runs/{run_id}", summary="Get a playbook run result")+async def get_run(run_id: str) -> dict:+ pr = _runs.get(run_id)+ if not pr:+ raise HTTPException(status_code=404, detail="Playbook run not found")+ return pr.to_dict()+++# ---------------------------------------------------------------------------+# CRUD by id+# ---------------------------------------------------------------------------++@router.get("/{playbook_id}", summary="Get a playbook")async def get_playbook(playbook_id: str) -> dict:store = PlaybookStore.default()@@ -135,21 +164,3 @@ async def _execute_and_update(playbook: Playbook, context: dict[str, Any], dry_r# Preserve the pre-allocated run_idpr.run_id = run_id_runs[run_id] = pr--[email protected]("/runs/{run_id}", summary="Get a playbook run result")-async def get_run(run_id: str) -> dict:- pr = _runs.get(run_id)- if not pr:- raise HTTPException(status_code=404, detail="Playbook run not found")- return pr.to_dict()--[email protected]("/runs", summary="List recent playbook runs")-async def list_runs(limit: int = 50) -> list[dict]:- recent = sorted(- _runs.values(),- key=lambda r: r.started_at or "",- reverse=True,- )[:limit]- return [r.to_dict() for r in recent]diff --git a/services/api/app/api/v1/endpoints/cases.py b/services/api/app/api/v1/endpoints/cases.pyindex 6566fa77d..437655df4 100644--- a/services/api/app/api/v1/endpoints/cases.py+++ b/services/api/app/api/v1/endpoints/cases.py@@ -14,7 +14,7 @@ from app.api.v1.deps import AuthUser, DBSession, require_permissionfrom app.db.rls import TenantDBSessionfrom app.models.case import Case, CaseTimeline-_AGENTS_URL = os.getenv("AGENTS_SERVICE_URL", "http://agents:8000")+_AGENTS_URL = os.getenv("AGENTS_SERVICE_URL", "http://agents:8084")router = APIRouter(prefix="/cases", tags=["cases"])diff --git a/services/api/app/api/v1/endpoints/playbooks.py b/services/api/app/api/v1/endpoints/playbooks.pyindex d7869111e..afd8c776a 100644--- a/services/api/app/api/v1/endpoints/playbooks.py+++ b/services/api/app/api/v1/endpoints/playbooks.py@@ -14,7 +14,7 @@ from typing import Anyimport httpxfrom fastapi import APIRouter, HTTPException, Request-_AGENTS_URL = os.getenv("AGENTS_SERVICE_URL", "http://agents:8000")+_AGENTS_URL = os.getenv("AGENTS_SERVICE_URL", "http://agents:8084")router = APIRouter(prefix="/playbooks", tags=["playbooks"])diff --git a/services/api/app/graphql/query.py b/services/api/app/graphql/query.pyindex 361e7ed95..63b0ddf50 100644--- a/services/api/app/graphql/query.py+++ b/services/api/app/graphql/query.py@@ -41,7 +41,7 @@ from app.models.case import Casefrom app.models.connector import Connectorfrom app.models.detection_rule import DetectionRule-_AGENTS_URL = os.getenv("AGENTS_SERVICE_URL", "http://agents:8000")+_AGENTS_URL = os.getenv("AGENTS_SERVICE_URL", "http://agents:8084")# ─── helpers ──────────────────────────────────────────────────────────────────