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
feat(phase-A3): ship connectors + graph-at-ingest in the default cold-boot stack (#448)
Beenu Arora85b14a308fb6
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.ymlindex 9308feae8..1835af31e 100644--- a/.github/workflows/integration.yml+++ b/.github/workflows/integration.yml@@ -141,6 +141,37 @@ jobs:- name: Assert the detection engine fires on the live streamrun: python3 scripts/integration/spine_test.py --detection --timeout 180+ # ── Phase A3: the default cold-boot stack is complete ────────────────+ # `docker compose up -d` (no profiles) now ships the connector runtime+ # and graph-at-ingest ON by default. Assert (a) the connectors service+ # booted in the default profile and (b) ingest enabled the Neo4j graph+ # writer, then (c) the graph actually has nodes after the spine flowed.+ - name: Assert default stack ships connectors + graph-at-ingest+ run: |+ set -euo pipefail+ echo "── connectors service present in default boot ──"+ docker compose ps --services | grep -qx connectors \+ || { echo "::error::connectors not in the default compose stack"; exit 1; }+ running="$(docker inspect -f '{{.State.Running}}' aisoc-connectors 2>/dev/null || echo false)"+ echo "connectors running: ${running}"+ [ "${running}" = "true" ] || { echo "::error::connectors container is not running"; docker compose logs --tail=60 --no-color connectors || true; exit 1; }++ echo "── ingest enabled the graph writer ──"+ docker compose logs --no-color ingest-worker 2>/dev/null | grep -q "graph: ingest-side writer enabled" \+ || { echo "::error::graph-at-ingest was not enabled by default"; docker compose logs --tail=60 --no-color ingest-worker || true; exit 1; }++ echo "── graph has nodes after the spine flowed ──"+ ok=""+ for i in $(seq 1 30); do+ N="$(docker compose exec -T neo4j cypher-shell -u neo4j -p neo4j_dev_secret --format plain \+ 'MATCH (n) RETURN count(n)' 2>/dev/null | tail -1 | tr -dc '0-9' || echo 0)"+ echo "graph node count (attempt ${i}): ${N:-0}"+ if [ "${N:-0}" -gt 0 ]; then ok=1; break; fi+ sleep 2+ done+ [ -n "${ok}" ] || { echo "::error::graph-at-ingest produced no nodes from the live stream"; \+ docker compose logs --tail=80 --no-color ingest-worker || true; exit 1; }+# ── Chaos: kill the fusion consumer, produce, restart, assert ────────# The event is produced while the consumer is down; on restart the# consumer group must resume from its committed offset and process it.diff --git a/CHANGELOG.md b/CHANGELOG.mdindex c2369b197..f817ef55e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0### Added+- **Phase A3 — the default cold-boot stack is complete ("just works").** A plain `docker compose up` previously started the core services but left the connector runtime behind a `connectors` profile and graph-at-ingest OFF, so a fresh install wasn't the full spine. Now `docker-compose.yml` ships the connector runtime in the default profile (it idles harmlessly with no configured instances) and enables graph-at-ingest by default on `ingest-worker` (`AISOC_GRAPH_ENABLED=true` + Neo4j env + `depends_on`; the writer soft-fails if Neo4j is unreachable, so it never blocks ingest). `integration.yml` gains a Phase A3 gate asserting the default boot ships the connectors service **and** ingest enabled the graph writer **and** the Neo4j graph has nodes after the spine flowed — so combined with A1 (lake) and A2 (detection), a cold `up` is proven end-to-end: ingest → OCSF normalize → Kafka → ClickHouse lake + entity graph + detection engine → fused alert row. Claim-to-gate matrix: "`pnpm aisoc:demo` boots the real stack" PARTIAL → GATED (18 GATED / 10 PARTIAL / 1 NO GATE).- **Phase A2 — the executable detection corpus now fires on the live event stream.** The reality audit's second SIEM gap: ~939 executable rules existed but only ran in CI fixture-replay — nothing evaluated them against ingested events, so any telemetry that wasn't a vendor-asserted finding (the promoter's job) never became an alert. New `services/fusion/app/services/detection_engine.py` loads the native corpus exported to `app/data/detection_ruleset.json` (817 rules, by `scripts/export_detection_ruleset.py`) and evaluates each ingested event's connector-normalized fields — recovered from `ocsf_event["raw_data"]`, the shape the specs were authored against — via a **vendored, parity-gated** copy of the canonical `match_when` matcher (`app/services/detection_matcher.py`; `test_detection_matcher_parity.py` asserts byte-for-behaviour agreement with `scripts/generate_detections.py` over every committed fixture). Each firing rule becomes a `RawAlert` routed through the normal fusion dedup/correlate/persist pipeline. Product routing is fuzzy (correctness-first: unknown product ⇒ evaluate all). Gates: `integration.yml` posts an event matching `aws-root-account-login` and asserts the alert appears; `validate-detections.yml` drift-checks the exported ruleset; 16 fusion unit tests. Claim-to-gate matrix adds a GATED row "Detection rules fire on the live event stream" (17 GATED / 11 PARTIAL / 1 NO GATE).- **Phase A1 — the ClickHouse event lake is now populated from the live stream.** The reality audit's central SIEM gap: the `aisoc.raw_events` lake table and its `/api/v1/lake/sql` read API existed with **no writer**, so every hunt/query ran against an empty warehouse. New `services/fusion/app/services/lake_writer.py` (`LakeWriter`) archives every normalized OCSF event from the `aisoc.raw_events` Kafka topic into ClickHouse — mapping the OCSF envelope to the lake columns (IPv4→IPv4-mapped-IPv6 coercion, `DateTime64` binding, MITRE/IOC extraction), batched by size **or** age, and **fail-soft** (a ClickHouse outage drops the batch and logs, never crashes the consumer). Archival is independent of promotion (a non-promoted Medium event is still queryable), and a background periodic-flush ticker guarantees a low-traffic batch is never stranded. Wired into the fusion consumer + lifespan; `docker-compose.yml` fusion service gets ClickHouse env + `depends_on`. `integration.yml` gains a Phase A1 gate asserting `SELECT count() FROM aisoc.raw_events > 0` after the spine ingests, against a live ClickHouse container (verified locally: a real INSERT round-trips). Claim-to-gate matrix adds a GATED row "Ingested events land in the queryable ClickHouse lake" (16 GATED / 11 PARTIAL / 1 NO GATE). At-least-once with a deterministic `event_id` (MergeTree does not dedup; the gate asserts queryability, not exact-once).diff --git a/docker-compose.yml b/docker-compose.ymlindex eb1d9098c..2ffc48761 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -269,6 +269,8 @@ services:depends_on:kafka:condition: service_healthy+ neo4j:+ condition: service_healthyports:- "127.0.0.1:8081:8080"- "127.0.0.1:9090:9090"@@ -281,6 +283,13 @@ services:LOG_LEVEL: infoJWT_SECRET: dev_secret_key_change_in_productionATTCK_DATA_PATH: /app/data/enterprise-attack.json+ # Phase A3 — graph-at-ingest is ON by default so a cold `up` builds the+ # entity graph out of the box. Soft-fails (writer disabled) if Neo4j is+ # unreachable, so this never blocks ingest.+ AISOC_GRAPH_ENABLED: "true"+ AISOC_NEO4J_URI: bolt://neo4j:7687+ AISOC_NEO4J_USER: neo4j+ AISOC_NEO4J_PASSWORD: neo4j_dev_secretnetworks:- aisocrestart: unless-stopped@@ -434,8 +443,9 @@ services:condition: service_healthyports:- "127.0.0.1:8088:8003"- profiles:- - connectors+ # Phase A3 — the connector runtime is part of the default stack now (was+ # profile-gated). It idles harmlessly with no configured instances; a cold+ # `up` therefore ships the full ingest→detect→respond spine out of the box.environment:KAFKA_BOOTSTRAP_SERVERS: kafka:29092REDIS_URL: redis://:redis_dev_secret@redis:6379/6diff --git a/docs/audit/CLAIM_TO_GATE_MATRIX.md b/docs/audit/CLAIM_TO_GATE_MATRIX.mdindex ca1adf9b8..4092212fe 100644--- a/docs/audit/CLAIM_TO_GATE_MATRIX.md+++ b/docs/audit/CLAIM_TO_GATE_MATRIX.md@@ -9,7 +9,7 @@ Statuses: `GATED` (a CI job fails when the claim stops being true) · `PARTIAL`| Claim | Source | Gate (workflow :: job) | Status | Closes in ||---|---|---|---|---|| Offline sandbox demo runs with no key/network in < 5 s | README L38 | `readme-gates.yml :: sandbox-offline` (ubuntu+macos matrix) | GATED | - |-| `pnpm aisoc:demo` boots the real stack | README L40, L45 | `compose-smoke.yml`, `compose-smoke-nightly.yml` (cold) | PARTIAL (health-probe only, no time-to-first-investigation assertion) | Phase 3.4 |+| `pnpm aisoc:demo` boots the real stack | README L40, L45 | `compose-smoke.yml` (cold health) + `integration.yml :: spine` (Phase A3 — default `docker compose up` ships connectors + graph-at-ingest by default; asserts cold-boot → ingest → lake + detection engine → alert row with the spine test's measured raw-event→alert latency) | GATED | - || 69 connectors | README L116, L168 | `ci.yml :: python-lint` (`generate_connector_count.py --check`) | GATED (count) | - || Connectors: schema-driven config + vault-encrypted secrets | README L168 | `ci.yml` connectors matrix (`test_schemas.py` + `test_conformance.py` — secret-shaped fields must be `type=secret`); vault tests | PARTIAL (schema + vault + secret-field-marking + runtime-contract conformance gated; live-vendor API smoke, rate-limit, checkpoint durability deferred) | Phase 10b || Connectors: live Test connection | README L168 | `ci.yml` connectors matrix (`test_conformance.py` — every connector implements the async `test_connection` contract) + `connector_conformance.py --check` published matrix | PARTIAL (contract conformance gated; live-vendor sandbox smoke deferred) | Phase 10b |