Skip to content

armgit / AiSOC

Public Imported from GitHub
0

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.

docs(ws9): connector capability matrix, ITSM-as-projection, Sonali Q-set, SYSTEM_DESIGN §12

Beenu Arorab826fe383959
diff --git a/AI_STACK_PLAN_PROGRESS.md b/AI_STACK_PLAN_PROGRESS.md
index ae735cfdf..dddb1e2a2 100644
--- a/AI_STACK_PLAN_PROGRESS.md
+++ b/AI_STACK_PLAN_PROGRESS.md
@@ -29,8 +29,8 @@ Tracking progress against `~/.cursor/plans/ai-stack-data-integration-plan_e90071
| 5 | Self-healing | DONE | OAuth refresh + backfill + freshness SLO + UI badges |
| 6 | Universal capture | DONE | `/v1/inbox/*` in `services/ingest` + tokens panel |
| 7 | Tenant lake API | DONE | endpoints + rewriter + rate limiter + 69/69 tests |
-| 8 | Bidirectional ITSM | PENDING | push_case + `/v1/inbox/itsm` + actions worker |
-| 9 | Docs + Sonali | PENDING | `api-coverage.md` + `itsm-as-source-of-truth.md` + question list |
+| 8 | Bidirectional ITSM | DONE | push_case + `/v1/inbox/itsm` + fan-out service + 113/113 tests |
+| 9 | Docs + Sonali | DONE | `api-coverage.md` + `itsm-as-source-of-truth.md` + `sonali-consultation-questions.md` + sidebars + SYSTEM_DESIGN §12 |
---
@@ -51,7 +51,7 @@ User asked for:
| gh-4 | Secret scan with gitleaks + triage false positives | DONE (`.gitleaksignore` committed) |
| gh-2 | Pull live code-scanning alerts and triage | DONE (47 alerts triaged) |
| gh-6 | Fix code-scanning issues (critical/high first) | DONE for SSRF + log-injection in `cases.py` + `fusion.py`; remaining notes (unused imports, bind-all, weak hash) triaged as benign |
-| gh-5 | Sync docs/architecture so GitHub matches current state | PENDING (covered by WS9) |
+| gh-5 | Sync docs/architecture so GitHub matches current state | DONE (`docs/architecture/SYSTEM_DESIGN.md` §12 added; topology + service table updated) |
| gh-commit-pre-rewrite | Commit fixes + tracker with `Beenu Arora <[email protected]>`, no co-authors | IN PROGRESS |
| gh-3a..gh-3e | History-rewrite plan (filter-repo + force-push) | PENDING |
| gh-prs | Close 19 dependabot PRs; comment on #37 for K4R7IK to rebase | PENDING |
@@ -202,24 +202,153 @@ post-rewrite block.
---
-## WS8 — Bidirectional ITSM (pending)
+## WS8 — Bidirectional ITSM (shipped)
-Plan calls for:
-- `push_case` + `push_status_change` capabilities on `jira_connector` and
- `servicenow` (services/connectors).
-- `POST /v1/inbox/itsm` inbound webhook in `services/ingest`.
-- Actions worker in `services/api/app/workers/` to fan out case events.
+### What landed
+
+- `services/connectors/app/connectors/base.py` — extended `BaseConnector` with
+ abstract `push_case` and `push_status_change` methods, plus
+ `Capability.PUSH_CASE` / `Capability.PUSH_STATUS` enum members.
+- `services/connectors/app/connectors/jira_connector.py` —
+ - `push_case`: creates Jira issue with ADF-formatted description, severity →
+ priority mapping, summary truncation at 255 chars, `aisoc-case-{id}` label
+ for round-trip identification, returns `{external_id, external_url, vendor,
+ external_status}`.
+ - `push_status_change`: discovers transitions via
+ `GET /rest/api/3/issue/{key}/transitions`, picks the matching transition by
+ target status name, POSTs the transition; no-op when target status isn't
+ exposed by the workflow.
+ - Falls through to `push_case` when `external_ref is None` (first push).
+- `services/connectors/app/connectors/servicenow.py` —
+ - `push_case`: POSTs to `/api/now/table/incident`, sets
+ `correlation_id="aisoc:{case_id}"` for round-tripping AiSOC case identity,
+ severity → impact/urgency mapping, short_description truncation at 160 chars.
+ - `push_status_change`: PATCHes `/api/now/table/incident/{sys_id}` with
+ `state`; for `Resolved`/`Closed` adds `close_code` + `close_notes` (required
+ by stock instances), otherwise omits them.
+- `services/connectors/app/api/router.py` —
+ - `POST /connectors/{connector_id}/push_case`
+ - `POST /connectors/{connector_id}/push_status_change`
+- `services/api/migrations/035_case_external_refs.sql` — `case_external_refs`
+ table (one row per `(case_id, vendor)`) with `external_id`, `external_url`,
+ `external_status`, `last_synced_at`, `sync_state`, plus indexes for
+ inbound webhook lookup by `(vendor, external_id)`.
+- `services/api/app/services/case_fanout.py` — projection layer:
+ - `fanout_create_case(case_id, tenant_id)` — finds enabled ITSM connectors,
+ decrypts auth via `CredentialVault`, POSTs to connectors service, persists
+ `case_external_refs` row, returns `FanoutResult`.
+ - `fanout_status_change(case_id, tenant_id, old_status, new_status)` —
+ looks up existing refs, calls `push_status_change`, updates row.
+ - `_serialize_case_for_push(case_row)` — accepts dict or SQLAlchemy `Row`
+ (`._mapping`); the test suite uses dicts and the production path uses Rows.
+- `services/api/app/api/v1/endpoints/cases.py` — `create_case` and `update_case`
+ invoke fan-out after the response is committed (best-effort, errors logged
+ not raised).
+- `services/api/app/api/v1/endpoints/inbox_itsm.py` — public-surface inbound
+ webhook (`POST /v1/inbox/itsm/{token}`) with:
+ - HMAC-SHA256 verification via `X-AiSOC-Signature` header.
+ - Vendor-specific payload parsing (Jira `issue.key`/`fields.status.name`,
+ ServiceNow `sys_id`/`state`).
+ - `_map_inbound_status` collapsing vendor statuses → AiSOC statuses.
+ - `case_external_refs` lookup by `(vendor, external_id)`.
+ - Idempotent AiSOC case status updates (skips if already at target status).
+- `services/api/app/api/v1/endpoints/inbox.py` — `itsm-inbound` template added
+ to `ALLOWED_TEMPLATE_IDS` and `_TEMPLATE_CATALOG`; `_build_inbox_url` now
+ routes ITSM tokens through `OAUTH_PUBLIC_BASE_URL` to the API service.
+
+### Tests — done
+
+- `services/api/tests/test_inbox_itsm_endpoint.py` — **69/69 passing**.
+ Covers HMAC verification, payload parsing for both vendors, status mapping,
+ external-ref lookup, idempotency, missing-token / wrong-signature paths.
+- `services/api/tests/test_case_fanout.py` — **21/21 passing**. Covers
+ payload serialization, vault decryption, connector RPC happy path, missing
+ external_id, unsupported capability, status-change with no refs, status-change
+ with orphaned refs, transport errors.
+- `services/connectors/tests/test_push_capabilities.py` — **23/23 passing**.
+ Covers Jira `push_case` (payload shape, ADF, label, priority mapping, 255-char
+ truncation, 4xx propagation), Jira `push_status_change` (no-ref fallthrough,
+ unknown-status no-op, missing-transition no-op, transition discovery + POST,
+ 4xx on transition POST), ServiceNow `push_case` (correlation_id round-trip,
+ short_description truncation at 160, 4xx propagation), ServiceNow
+ `push_status_change` (no-ref fallthrough, unknown-status no-op, in-progress
+ state-only PATCH, Resolved/Closed close_code+close_notes, 4xx propagation),
+ capability declarations on both classes.
+
+**Total WS8 test count: 113/113 passing.**
+
+### Test gotcha — `respx` is not in the connectors test environment
+
+`services/connectors/pyproject.toml` declares `respx` as a dev dep but the
+local venv doesn't have it installed (collection errors out for
+`test_azure_connectors.py`, `test_gcp_connectors.py`). For
+`test_push_capabilities.py` we use `unittest.mock.patch` against
+`httpx.AsyncClient` instead — same pattern as
+`services/api/tests/test_case_fanout.py`. Helper `_build_response` mocks
+`status_code`, `json()`, `text`, `request`, and `raise_for_status` so the
+connector code under test sees a faithful `httpx.Response` substitute.
+
+### Test gotcha — `_serialize_case_for_push` accepts dict or Row, not SimpleNamespace
+
+`SimpleNamespace` is *not* iterable as key-value pairs, so
+`dict(SimpleNamespace(...))` raises `TypeError`. The serializer goes through
+`getattr(case_row, "_mapping", None)` then falls back to `dict(case_row)`,
+which works for SQLAlchemy `Row` (production) and plain `dict` (tests). All
+test fixtures in `test_case_fanout.py` use `_make_case_row()` returning a dict.
Reference plan §WS8.
---
-## WS9 — Docs + Sonali (pending)
+## WS9 — Docs + Sonali (shipped)
+
+### What landed
-- `apps/docs/docs/connectors/api-coverage.md` — coverage matrix for all
- connectors × capabilities × OAuth status.
-- `apps/docs/docs/architecture/itsm-as-source-of-truth.md`.
-- Draft Sonali consultation question list (separate file in repo, plan §WS9).
+- `apps/docs/docs/connectors/api-coverage.md` — capability matrix for all
+ 42 connectors. Generated programmatically from `BaseConnector` subclasses
+ by parsing `capabilities()` return tuples and `ConnectorSchema(...)`
+ invocations directly out of source. Grouped by `category` (edr, siem,
+ cloud, iam, saas, vcs, network) and includes columns for `OAuth (hosted)`
+ and `Federated search`. Closes the "what works where" question Sonali
+ flagged — no more reading source to know if a given connector can
+ `PUSH_CASE` or only `PULL_ALERTS`.
+- `apps/docs/docs/architecture/itsm-as-source-of-truth.md` — explains why
+ AiSOC is the canonical store for case state and ITSM systems are
+ projections. Covers the outbound path (`case_fanout` → `push_case` /
+ `push_status_change`), the inbound path (`POST /v1/inbox/itsm` with
+ HMAC verification, `_JIRA_INBOUND_STATUS` / `_SNOW_INBOUND_STATUS`
+ mapping, `case_external_refs` resolution), conflict resolution rules,
+ and what is explicitly **not** synced (Jira priority, ServiceNow
+ assignment_group, etc.). Includes a `mermaid` flowchart.
+- `apps/docs/docs/operations/sonali-consultation-questions.md` — structured
+ question set for CISO / Head of SecOps / IR Lead pre-deployment
+ conversations. Covers outcomes, threat model, data sources, case
+ lifecycle, agent autonomy, compliance, identity/access, ops, reporting.
+ Designed to surface boundary disagreements early rather than discovering
+ them mid-rollout.
+- `apps/docs/sidebars.ts` — registered all three new pages. Added a new
+ "Architecture" category (so `itsm-as-source-of-truth.md` has a home
+ outside the Concepts bucket), and slotted the other two under their
+ existing "Connectors" and "Operations" categories.
+- `docs/architecture/SYSTEM_DESIGN.md` — root-level architecture doc
+ resynced with v2.1 reality. Topology diagram now shows `services/api`
+ (inbox tokens + HMAC webhooks + CEF/HEC/DNS) and `services/connectors`
+ (APScheduler poll + 42 connector classes + push_case/status) as
+ parallel front doors feeding `services/ingest`. Service responsibilities
+ table gained a `services/connectors` row and `services/api` was
+ extended with "ITSM webhook inbox, case fan-out". A new §12 captures
+ the v2.1 additions in narrative form with cross-links to the
+ Docusaurus pages above.
+
+### Cross-links from §12
+
+- §12.1 → `apps/docs/docs/connectors/api-coverage.md`,
+ `apps/docs/docs/operations/credentials.md`
+- §12.4 → `apps/docs/docs/architecture/itsm-as-source-of-truth.md`
+- §12.6 → `apps/docs/docs/plugins/python-sdk.md`,
+ `apps/docs/docs/plugins/go-sdk.md`
+
+Reference plan §WS9.
---
@@ -231,8 +360,18 @@ Reference plan §WS8.
{"id": "gh-4", "content": "Secret scan working tree before any commit/push (gitleaks)", "status": "completed"},
{"id": "gh-2", "content": "Pull live GitHub code-scanning alerts and triage by severity", "status": "completed"},
{"id": "gh-6", "content": "Fix code-scanning issues with minimal diffs (critical/high first)", "status": "completed"},
- {"id": "gh-5", "content": "Sync docs/architecture (WS3-WS7) so GitHub matches current state", "status": "pending"},
- {"id": "gh-commit-pre-rewrite", "content": "Commit all fixes/docs with Beenu Arora <[email protected]> identity (no co-author trailers)", "status": "in_progress"},
+ {"id": "ws7-tests", "content": "WS7: lake endpoint unit tests (POST /lake/sql, GET /lake/schema, helpers)", "status": "completed"},
+ {"id": "ws8-tests-inbox", "content": "WS8: Inbox ITSM webhook tests (69 passing)", "status": "completed"},
+ {"id": "ws8-tests-fanout", "content": "WS8: Tests for case_fanout service (21 passing)", "status": "completed"},
+ {"id": "ws8-tests-push", "content": "WS8: Tests for jira/snow push_case/push_status_change methods (23 passing)", "status": "completed"},
+ {"id": "tracker-update", "content": "Update AI_STACK_PLAN_PROGRESS.md to reflect WS8 completion", "status": "completed"},
+ {"id": "ws9-api-coverage", "content": "WS9: write apps/docs/docs/connectors/api-coverage.md", "status": "completed"},
+ {"id": "ws9-itsm-sot", "content": "WS9: write apps/docs/docs/architecture/itsm-as-source-of-truth.md", "status": "completed"},
+ {"id": "ws9-sonali", "content": "WS9: write apps/docs/docs/operations/sonali-consultation-questions.md", "status": "completed"},
+ {"id": "ws9-sidebar", "content": "WS9: register new docs in apps/docs/sidebars.ts", "status": "completed"},
+ {"id": "gh-5", "content": "Sync docs/architecture (WS3-WS8) so GitHub matches current state", "status": "completed"},
+ {"id": "tracker-update-ws9", "content": "Update AI_STACK_PLAN_PROGRESS.md to mark WS9 done", "status": "completed"},
+ {"id": "gh-commit", "content": "Commit all WS9 + tracker docs with Beenu Arora <[email protected]> identity (no co-author trailers)", "status": "pending"},
{"id": "gh-3a", "content": "Backup current main to refs/heads/backup/pre-rewrite-2026-05-08 on origin", "status": "pending"},
{"id": "gh-3b", "content": "Install git-filter-repo and build authors/message callbacks (strip cursoragent + AiSOC Bot trailers, canonicalize all to [email protected])", "status": "pending"},
{"id": "gh-3c", "content": "Run git-filter-repo on a fresh mirror; verify locally that all commits show Beenu Arora <[email protected]> and no Co-authored-by trailers remain", "status": "pending"},
@@ -240,10 +379,7 @@ Reference plan §WS8.
{"id": "gh-3e", "content": "Verify GitHub contributors graph shows only beenu", "status": "pending"},
{"id": "gh-prs", "content": "Close 19 dependabot PRs with explanation; comment on #37 asking K4R7IK to rebase", "status": "pending"},
{"id": "gh-7", "content": "Verify code-scanning alerts cleared after push; record any remaining", "status": "pending"},
- {"id": "ws7-tests", "content": "WS7: finish lake endpoint unit tests (POST /lake/sql, GET /lake/schema, helpers)", "status": "pending"},
- {"id": "ws7-verify", "content": "WS7: run full pytest + mcp build, ensure no regressions", "status": "pending"},
- {"id": "ws8-itsm", "content": "WS8: bidirectional ITSM (push_case/push_status_change, /v1/inbox/itsm webhook, actions worker)", "status": "pending"},
- {"id": "ws9-docs", "content": "WS9: connectors/api-coverage.md, architecture/itsm-as-source-of-truth.md, Sonali consultation question list", "status": "pending"}
+ {"id": "tryaisoc-cj", "content": "Customer journey review of tryaisoc.com — find and fix bugs", "status": "pending"}
]
```
@@ -263,10 +399,19 @@ Reference plan §WS8.
## Resume here
-1. Re-run `git log -5 --format='%h %an <%ae>%n%(trailers:only=true)'` to
+All nine plan workstreams (WS1-WS9) are now DONE. Remaining work is the
+GitHub hygiene tail.
+
+1. **Commit current working tree** (`gh-commit`): commit the WS9 docs +
+ `SYSTEM_DESIGN.md` §12 + this tracker update with identity
+ `Beenu Arora <[email protected]>`. Run the `commit-msg` hook check
+ afterwards to confirm no `Co-authored-by` trailers slipped through.
+2. **Push to origin** (`gh-push`): `git push origin main`.
+3. Re-run `git log -5 --format='%h %an <%ae>%n%(trailers:only=true)'` to
confirm no `Co-authored-by` trailers in the last few commits.
-2. Continue down the GitHub hygiene table above (`gh-3a` → `gh-7`):
+4. Continue down the GitHub hygiene table above (`gh-3a` → `gh-7`):
backup, history rewrite via `git filter-repo`, force-push, verify
contributors, close stale PRs, verify code-scanning alerts cleared.
-3. Then resume the plan workstreams: `ws7-tests` → `ws7-verify` → WS8 → WS9.
-4. Workspace rule: do not stop until every todo is done.
+5. Then `tryaisoc-cj`: customer journey review of `tryaisoc.com` for
+ bugs.
+6. Workspace rule: do not stop until every todo is done.
diff --git a/apps/docs/docs/architecture/itsm-as-source-of-truth.md b/apps/docs/docs/architecture/itsm-as-source-of-truth.md
new file mode 100644
index 000000000..95780f4bb
--- /dev/null
+++ b/apps/docs/docs/architecture/itsm-as-source-of-truth.md
@@ -0,0 +1,169 @@
+---
+sidebar_position: 1
+title: ITSM as a projection of AiSOC
+description: Why AiSOC is the source of truth for security cases, how the bidirectional ITSM bridge works, and how status conflicts are resolved.
+---
+
+# ITSM as a projection of AiSOC
+
+A common ask from security teams adopting AiSOC is "can the case also live in our ITSM?" The honest answer is: yes, but the ITSM ticket is a **projection** of the AiSOC case, not a peer of it. AiSOC is the source of truth for the security investigation; Jira and ServiceNow are downstream representations that human responders, change-management processes, and executive dashboards consume.
+
+This page explains how the bidirectional bridge is built, what state lives where, and how conflicts are resolved.
+
+## Why AiSOC is the source of truth
+
+A security case is more than a row in a ticketing system. It carries:
+
+- **Detection lineage** — which detection rule(s) fired, what raw events were involved, what the OCSF-normalized representation of those events looks like.
+- **Agent reasoning** — the chain of investigative steps the multi-step agent took, including which tools it called, what each tool returned, and the confidence the agent expressed at each step.
+- **Evidence graph** — entities (hosts, users, IPs, domains, hashes, vulnerabilities) connected by the relationships the agent or analyst discovered. This graph is queryable and is what makes "show me everything we know about this user during the past hour" possible.
+- **Containment intent + outcome** — the actual API calls AiSOC issued to EDRs, identity providers, and firewalls, and the responses it got back.
+- **Audit trail** — append-only record of every state transition, who/what caused it, and when.
+
+ITSM systems are excellent at the **last** layer of that — assignment, SLA tracking, executive visibility, change-management approval. They are not built to hold the first four. So the architecture question becomes: how do we let the ITSM workflow drive the parts it owns (assignment, status, due dates) without letting it lose or overwrite the parts AiSOC owns (evidence, reasoning, containment outcome)?
+
+The answer is the projection model: AiSOC owns the canonical record; the ITSM ticket is a thin reflection that the bridge keeps in sync, with explicit, narrow rules for what flows in each direction.
+
+## State boundaries — what lives where
+
+| Concern | Owned by AiSOC | Owned by ITSM | Synced |
+|---|---|---|---|
+| Detection rule + raw events | ✅ | — | ITSM gets a summary + a deep link back into AiSOC. |
+| Evidence graph (hosts/users/IPs/files) | ✅ | — | ITSM gets a flat "involved entities" list. |
+| Agent reasoning chain | ✅ | — | ITSM gets the agent's final summary as a comment. |
+| Containment actions issued | ✅ | — | ITSM gets a comment per action with timestamp + outcome. |
+| Severity (initial) | ✅ | — | One-way push at create time. |
+| **Status / lifecycle state** | ✅ (canonical) | ✅ (operational) | Bidirectional — AiSOC reflects ITSM transitions back into the canonical record. |
+| Assignee | — | ✅ | One-way pull. AiSOC stores it as metadata for filtering. |
+| Comments authored by humans in ITSM | — | ✅ | Pulled into AiSOC as annotations on the case timeline. |
+| Due date / SLA timer | — | ✅ | AiSOC does not enforce; ITSM owns the clock. |
+
+The principle is: **anything that informs detection, response, or audit lives in AiSOC. Anything about who is doing the work and how the org tracks it lives in ITSM.** Nothing critical to investigation is _only_ in the ITSM ticket.
+
+## The pieces
+
+The bridge is implemented across three layers:
+
+1. **Outbound from connectors** — `push_case` and `push_status_change` methods on the [`Jira`](https://github.com/AiSOC-community/AiSOC/blob/main/services/connectors/app/connectors/jira_connector.py) and [`ServiceNow`](https://github.com/AiSOC-community/AiSOC/blob/main/services/connectors/app/connectors/servicenow.py) connectors. These are the verbs AiSOC uses to mint a ticket and to project a status transition onto an existing one. They are declared on the connector via the [`PUSH_CASE` / `PUSH_STATUS`](/docs/connectors/api-coverage) capabilities.
+2. **Case fan-out service** — `services/api/app/services/case_fanout.py`. When a case is created or its status changes inside AiSOC, this service iterates every connector instance for the tenant that declares `PUSH_CASE` / `PUSH_STATUS` and calls them. Successful pushes are recorded in `case_external_refs`; failures are recorded with the error and retried on the next state change.
+3. **Inbound webhook** — `POST /v1/inbox/itsm`, implemented in `services/api/app/api/v1/endpoints/inbox_itsm.py`. ITSM systems call this with a signed payload when a ticket they are tracking transitions; the webhook verifies the HMAC, looks up the corresponding AiSOC case via `case_external_refs`, and applies the (filtered) status change idempotently to the canonical case.
+
+```mermaid
+flowchart LR
+ subgraph AiSOC
+ C[Case<br/>canonical record] -->|status change| F[case_fanout]
+ I[/v1/inbox/itsm/] -->|status update| C
+ X[(case_external_refs)] <-.bind.-> C
+ end
+ subgraph "External ITSM"
+ J[Jira issue]
+ S[ServiceNow incident]
+ end
+ F -->|push_case / push_status_change| J
+ F -->|push_case / push_status_change| S
+ J -->|webhook<br/>X-AiSOC-Signature| I
+ S -->|webhook<br/>X-AiSOC-Signature| I
+```
+
+## The `case_external_refs` table
+
+The bridge needs a stable mapping between AiSOC cases and external tickets. That is what `case_external_refs` (migration `035_case_external_refs.sql`) holds:
+
+| Column | Meaning |
+|---|---|
+| `tenant_id` | Owner of both the case and the connector instance. Always scoped. |
+| `case_id` | AiSOC case (FK). |
+| `connector_id` | Which connector instance is pushing — multiple ITSMs can mirror the same case. |
+| `vendor` | `jira` / `servicenow` / future ITSMs. Indexed because the inbound webhook routes on it. |
+| `external_id` | Stable vendor identifier — Jira issue key (`AISOC-1234`), ServiceNow `sys_id`. |
+| `external_url` | Direct link the UI surfaces on the case sidebar. |
+| `last_pushed_status` | Last status AiSOC projected to the vendor. Used to suppress redundant pushes. |
+| `last_inbound_status` | Last status the vendor told us. Used to suppress projection loops (we will not push back a status we just received). |
+| `created_at` / `updated_at` | Standard. |
+
+The `(connector_id, vendor, external_id)` triple is unique, which is what makes the inbound webhook idempotent: a duplicate webhook delivery (vendors retry aggressively) resolves to the same row and does the same no-op.
+
+## Outbound: case create
+
+When `POST /v1/cases` mints a new case, the create endpoint hands the row to `case_fanout.fanout_create_case`. That function:
+
+1. Loads every active connector instance for the tenant where `PUSH_CASE` is in `connector.capabilities()`.
+2. Decrypts the connector's `auth_config` via the [credential vault](/docs/operations/credentials) and instantiates the typed connector.
+3. Calls `push_case(case)` and gets back a `PushResult` with the vendor's external ID and URL.
+4. Inserts a `case_external_refs` row recording the binding.
+5. Logs the push outcome on the case timeline so the analyst sees "minted JIRA-1247" without leaving the case view.
+
+If a single connector fails, fan-out continues for the rest. The case itself is never blocked on a downstream ITSM call — the ITSM is a projection, not a gate. Failed pushes are visible on the connector card and are re-attempted on the next status transition or via a manual "resync" action.
+
+## Outbound: status change
+
+When a case status moves inside AiSOC (`open → triage → contained → resolved → closed`), `case_fanout.fanout_status_change` runs:
+
+1. Loads every `case_external_refs` row for the case.
+2. For each row, instantiates the connector and calls `push_status_change(external_id, new_status)`.
+3. The connector translates the AiSOC status into its vendor's vocabulary — Jira via the **Transitions API** (resolving the right transition ID for the target status), ServiceNow via a `PATCH` on the incident table with the appropriate `state` and `incident_state` values.
+4. Updates `last_pushed_status` on the ref row.
+
+Two safety properties are enforced here:
+
+- **No-op suppression.** If `last_pushed_status` already equals the target, fan-out skips the call. This avoids generating noise in the ITSM activity feed when a status is set to its current value (which happens during reconciliation).
+- **Loop suppression.** If `last_inbound_status` was just set to the same target by a webhook seconds ago, fan-out also skips. This prevents the classic ping-pong (we push to Jira → Jira webhooks back to us → we push back to Jira) that plagues naïve bridges.
+
+## Inbound: webhook from ITSM
+
+`POST /v1/inbox/itsm` is the public-facing surface that Jira and ServiceNow webhooks call when a ticket they hold transitions. The handler:
+
+1. **Authenticates the request** via `X-AiSOC-Signature`, an HMAC over the raw body keyed by the per-tenant inbox token. The token is provisioned through the regular [inbox token flow](/docs/api/rest) using the `itsm-inbound` template.
+2. **Identifies the vendor** from the payload shape (Jira sends `issue.fields`, ServiceNow sends `sys_id` + `state`) and pulls the canonical external ID and the vendor-native status.
+3. **Maps the vendor status** through `_JIRA_INBOUND_STATUS` / `_SNOW_INBOUND_STATUS` to AiSOC's status ladder. Statuses outside the mapped set (e.g. exotic Jira workflows) are accepted but the case is not transitioned — the webhook returns `200 OK` with `{"applied": false, "reason": "unmapped_status"}` so the vendor stops retrying.
+4. **Resolves the case** by joining `case_external_refs` on `(vendor, external_id)`, scoped by the tenant the inbox token was minted for.
+5. **Applies the status idempotently.** If the case is already in the target status (perhaps because we pushed it ourselves a second ago), the handler is a no-op. Otherwise, it transitions the case and writes three timeline rows: the status change itself, the `actor_label` ("itsm-webhook (jira)"), and the inbound payload reference for audit.
+6. **Updates `last_inbound_status`** so the next outbound fan-out round can suppress the loop.
+
+The handler commits exactly once. Any failure during the transition rolls the whole thing back — the ITSM webhook will retry, and since the binding is still in place, the second attempt will succeed cleanly.
+
+## Conflict resolution
+
+The bridge can hit four kinds of conflicts. Here is how each is resolved:
+
+1. **AiSOC status moves while ITSM is mid-transition.**
+ AiSOC wins. The fan-out runs, `push_status_change` overwrites the ITSM state, `last_pushed_status` is updated. The vendor's webhook for the in-flight transition arrives a moment later; because it matches `last_pushed_status` (it's the status we just set), it is a no-op.
+2. **ITSM status moves while AiSOC is processing a containment action.**
+ ITSM wins for the **status field only** — that is its responsibility. The containment outcome continues to be appended to the AiSOC case timeline. The case status reflects the ITSM state; the evidence record reflects everything else.
+3. **Same status arrives from both sides at the same time.**
+ The idempotency check resolves it — whichever transaction commits first wins; the second sees the case already at the target and exits cleanly.
+4. **Vendor returns a transition error** (e.g. Jira will not allow `Resolved → To Do` directly).
+ `push_status_change` records the failure on the ref row and surfaces it on the connector card. The case in AiSOC still transitions; the ITSM ticket stays where it was. A human can either fix the Jira workflow or trigger a manual "force-sync" that bypasses the transition graph by using the admin API.
+
+## What is _not_ synced
+
+To keep this contract small enough to reason about, we deliberately do **not** mirror:
+
+- **Free-text comments** authored inside AiSOC. The agent writes a lot of analysis. It would be noise in the ITSM activity feed. The ITSM ticket carries one structured summary block plus the deep link.
+- **Severity changes after creation.** The initial severity is pushed; subsequent changes inside AiSOC do not touch the ITSM. This is deliberate — security severity reflects detection confidence, ticketing severity reflects business priority, and they are not the same axis.
+- **Detection rule edits, suppression rules, agent prompt changes.** All of these live in AiSOC and have no ITSM analog.
+- **The evidence graph itself.** AiSOC exposes it through the case API and the UI; the ITSM ticket links to it.
+
+If a team wants any of these mirrored, the right answer is usually a small detection-content workflow or a dashboard, not extending the projection contract.
+
+## Operational notes
+
+- **Webhook secrets are per-tenant.** Provision them through the existing inbox-token flow with template `itsm-inbound`. The same token is used for both Jira and ServiceNow webhooks — the handler tells them apart from the body, not from the URL.
+- **Backfill.** When you turn on the bridge against a tenant that already has open cases, the first fan-out pass mints tickets for them. This can be a lot of work; gate it with a feature flag and ramp by case count if your ITSM has rate limits. Both Jira Cloud and ServiceNow have surprisingly tight per-minute API caps.
+- **Observability.** Every push and every webhook lands as a row on the case timeline with the `itsm-webhook (vendor)` actor label. Filter by that label to see the cross-system traffic for any case in one view.
+- **Disabling the bridge.** Removing a connector instance does **not** delete its `case_external_refs` rows. Old links remain, but no further pushes happen. Re-enabling the connector picks up exactly where it left off, idempotently.
+
+## Where this lives in the code
+
+| Concern | File |
+|---|---|
+| Outbound contract | `services/connectors/app/connectors/base.py` (`push_case`, `push_status_change`, `Capability.PUSH_CASE`, `Capability.PUSH_STATUS`) |
+| Jira impl | `services/connectors/app/connectors/jira_connector.py` |
+| ServiceNow impl | `services/connectors/app/connectors/servicenow.py` |
+| Outbound HTTP routes | `services/connectors/app/api/router.py` |
+| Fan-out orchestrator | `services/api/app/services/case_fanout.py` |
+| Case lifecycle hooks | `services/api/app/api/v1/endpoints/cases.py` |
+| Inbound webhook | `services/api/app/api/v1/endpoints/inbox_itsm.py` |
+| External-ref table | `services/api/migrations/035_case_external_refs.sql` |
+
+For the per-connector capability picture (which ITSMs declare `PUSH_CASE` today, which do not yet), see the [capability matrix](/docs/connectors/api-coverage).
diff --git a/apps/docs/docs/connectors/api-coverage.md b/apps/docs/docs/connectors/api-coverage.md
new file mode 100644
index 000000000..0978b10b0
--- /dev/null
+++ b/apps/docs/docs/connectors/api-coverage.md
@@ -0,0 +1,128 @@
+---
+sidebar_position: 14
+title: Capability matrix
+description: Per-connector capability coverage — which connectors can pull alerts, query logs, pivot on entities, push cases to ITSM, isolate hosts, and more.
+---
+
+# Capability matrix
+
+Every connector in AiSOC declares a set of **capabilities** — concrete verbs the orchestrator and agents are allowed to ask it to perform. Capabilities are not free text; they are members of the [`Capability` enum](https://github.com/AiSOC-community/AiSOC/blob/main/services/connectors/app/connectors/base.py) defined in `services/connectors/app/connectors/base.py`. The agent runtime, the federated-search planner, and the case-fanout service all consult this set before dispatching work; a connector that does not declare `PUSH_CASE`, for example, will simply be skipped when AiSOC tries to mint an ITSM ticket.
+
+This page is the canonical "what works where" reference. It is generated from the connector source and is kept in sync with the registry in `services/connectors/app/connectors/__init__.py`.
+
+## Capabilities, defined
+
+| Capability | What it means in practice |
+|---|---|
+| `PULL_ALERTS` | Connector polls the vendor on a schedule and emits normalized alert/detection events into the AiSOC ingest stream. |
+| `PULL_AUDIT` | Connector polls the vendor's audit/activity log surface (admin actions, sign-ins, configuration changes) and emits normalized audit events. |
+| `QUERY_LOGS` | Connector exposes an ad-hoc search interface (KQL / SPL / ES&#124;QL / vendor DSL) so the federated-search planner can fan a single human question across multiple SIEMs. |
+| `PIVOT_HOST` / `PIVOT_USER` / `PIVOT_IP` / `PIVOT_DOMAIN` | Connector can answer "what else has this entity touched?" — used by agents during investigation to widen the blast-radius view. |
+| `ISOLATE_HOST` / `UNISOLATE_HOST` | Containment verb. The connector can ask the vendor to network-isolate or release an endpoint. Always gated behind ChatOps verification. |
+| `QUARANTINE_FILE` / `BLOCK_HASH` | Endpoint response verbs — push a file to quarantine, block a hash globally. Also gated behind ChatOps verification. |
+| `ENRICH_DOMAIN` / `ENRICH_VULN` / `ENRICH_ASSET` | Read-only enrichment — fetch reputation, CVE detail, or asset metadata to attach to a case as evidence. |
+| `READ_AUDIT_TRAIL` | Connector exposes a stable, queryable audit trail used by compliance flows (e.g. "show me every grant of admin to this user across the last 90 days"). |
+| `PUSH_CASE` | **Bidirectional ITSM, outbound.** Connector can mint a new ticket in the external system from an AiSOC case. AiSOC remains source of truth — see [ITSM as source of truth](/docs/architecture/itsm-as-source-of-truth). |
+| `PUSH_STATUS` | **Bidirectional ITSM, outbound.** Connector can project an AiSOC case status change onto the external ticket (transitioning it through the vendor's workflow, closing it, etc.). |
+
+When a capability is not listed for a connector, the connector simply does not support it today — it is **not** a misconfiguration to surface. Adding a capability requires an explicit code change in that connector's `capabilities()` classmethod and matching method implementation.
+
+## Coverage table — 42 connectors
+
+The matrix below is grouped by category. `OAuth (hosted)` indicates the connector is wired into the hosted OAuth marketplace flow (no client secret in tenant config). `Federated search` means the connector participates in the federated-query planner.
+
+### Identity / IAM
+
+| Connector | OAuth (hosted) | Federated search | Capabilities |
+|---|---|---|---|
+| Auth0 (`auth0`) | ✅ | — | `PULL_AUDIT`, `PIVOT_USER`, `READ_AUDIT_TRAIL` |
+| Microsoft Entra ID (`azure_entra`) | ✅ | — | `PULL_AUDIT`, `PULL_ALERTS` |
+| Duo Security (`duo_security`) | — | — | `PULL_AUDIT` |
+| Okta (`okta`) | ✅ | — | `PULL_AUDIT` |
+| 1Password Events (`onepassword`) | — | — | `PULL_AUDIT` |
+
+### EDR / XDR
+
+| Connector | OAuth (hosted) | Federated search | Capabilities |
+|---|---|---|---|
+| Microsoft Defender (`azure_defender`) | ✅ | — | `PULL_ALERTS` |
+| VMware Carbon Black Cloud (`carbon_black`) | — | — | `PULL_ALERTS`, `PULL_AUDIT`, `PIVOT_HOST`, `ISOLATE_HOST`, `QUARANTINE_FILE`, `BLOCK_HASH` |
+| Cortex XDR (`cortex_xdr`) | — | — | `PULL_ALERTS` |
+| CrowdStrike Falcon (`crowdstrike`) | — | — | `PULL_ALERTS` |
+| SentinelOne (`sentinelone`) | — | — | `PULL_ALERTS` |
+| Trend Vision One (`trend_vision_one`) | — | — | `PULL_ALERTS`, `PULL_AUDIT`, `PIVOT_HOST`, `ISOLATE_HOST`, `UNISOLATE_HOST` |
+
+### SIEM
+
+| Connector | OAuth (hosted) | Federated search | Capabilities |
+|---|---|---|---|
+| Google Chronicle (`chronicle`) | — | — | `PULL_ALERTS`, `QUERY_LOGS`, `PIVOT_HOST`, `PIVOT_USER`, `PIVOT_IP` |
+| Cortex XSIAM (`cortex_xsiam`) | — | — | `PULL_ALERTS`, `QUERY_LOGS`, `PIVOT_HOST`, `PIVOT_USER`, `ISOLATE_HOST` |
+| Datadog Cloud SIEM (`datadog_cloud_siem`) | — | — | `PULL_ALERTS`, `QUERY_LOGS`, `PIVOT_HOST`, `PIVOT_USER`, `PIVOT_IP` |
+| Elastic SIEM (`elastic`) | — | ✅ | `PULL_ALERTS`, `QUERY_LOGS` |
+| Microsoft Sentinel (`microsoft_sentinel`) | — | ✅ | `PULL_ALERTS`, `QUERY_LOGS` |
+| Rapid7 InsightIDR (`rapid7_insightidr`) | — | — | `PULL_ALERTS`, `QUERY_LOGS`, `PIVOT_HOST`, `PIVOT_USER` |
+| Splunk (`splunk`) | — | ✅ | `PULL_ALERTS`, `QUERY_LOGS` |
+| Sumo Logic Cloud SIEM (`sumo_logic`) | — | — | `PULL_ALERTS`, `QUERY_LOGS`, `PIVOT_HOST`, `PIVOT_USER` |
+| Trellix Helix (`trellix_helix`) | — | — | `PULL_ALERTS`, `QUERY_LOGS`, `PIVOT_HOST`, `PIVOT_USER` |
+
+### Cloud (control plane / posture)
+
+| Connector | OAuth (hosted) | Federated search | Capabilities |
+|---|---|---|---|
+| AWS Security Hub (`aws_security_hub`) | — | — | `PULL_ALERTS` |
+| Azure Activity Logs (`azure_activity`) | ✅ | — | `PULL_AUDIT` |
+| GCP Cloud Audit Logs (`gcp_cloud_audit`) | — | — | `PULL_AUDIT` |
+| GCP Security Command Center (`gcp_scc`) | — | — | `PULL_ALERTS` |
+| Lacework (`lacework`) | — | — | `PULL_ALERTS`, `QUERY_LOGS`, `PIVOT_HOST`, `PIVOT_IP`, `ENRICH_VULN` |
+| Tenable.io (`tenable_io`) | — | — | `PULL_ALERTS`, `PIVOT_HOST`, `PIVOT_IP`, `ENRICH_VULN`, `ENRICH_ASSET` |
+| Wiz (`wiz`) | — | — | `PULL_ALERTS` |
+
+### SaaS
+
+| Connector | OAuth (hosted) | Federated search | Capabilities |
+|---|---|---|---|
+| Cloudflare (`cloudflare`) | — | — | `PULL_AUDIT` |
+| Email Inbox / IMAP (`email_inbox`) | — | — | `PULL_ALERTS` |
+| Google Workspace (`google_workspace`) | — | — | `PULL_AUDIT` |
+| Jira (`jira`) | ✅ | — | `PULL_ALERTS`, **`PUSH_CASE`**, **`PUSH_STATUS`** |
+| Microsoft 365 Audit (`m365_audit`) | ✅ | — | `PULL_AUDIT` |
+| Mimecast (`mimecast`) | — | — | `PULL_ALERTS`, `PULL_AUDIT`, `PIVOT_USER`, `ENRICH_DOMAIN` |
+| Proofpoint TAP (`proofpoint`) | — | — | `PULL_ALERTS` |
+| Salesforce (`salesforce`) | ✅ | — | `PULL_AUDIT`, `QUERY_LOGS`, `PIVOT_USER`, `READ_AUDIT_TRAIL` |
+| ServiceNow (`servicenow`) | — | — | `PULL_ALERTS`, **`PUSH_CASE`**, **`PUSH_STATUS`** |
+| Slack Audit (`slack_audit`) | ✅ | — | `PULL_AUDIT`, `PIVOT_USER`, `READ_AUDIT_TRAIL` |
+
+### VCS / AppSec
+
+| Connector | OAuth (hosted) | Federated search | Capabilities |
+|---|---|---|---|
+| GitHub (`github`) | ✅ | — | `PULL_AUDIT`, `PULL_ALERTS` |
+| Snyk (`snyk`) | — | — | `PULL_ALERTS` |
+
+### Network
+
+| Connector | OAuth (hosted) | Federated search | Capabilities |
+|---|---|---|---|
+| Cisco Umbrella (`cisco_umbrella`) | — | — | `PULL_ALERTS`, `QUERY_LOGS`, `PIVOT_DOMAIN`, `PIVOT_IP`, `ENRICH_DOMAIN` |
+| Tailscale (`tailscale`) | — | — | `PULL_AUDIT` |
+| Zscaler Internet Access (`zscaler`) | — | — | `PULL_ALERTS` |
+
+## How the orchestrator uses this
+
+Three subsystems read this matrix at runtime:
+
+1. **The agent runtime.** Before an agent calls a connector tool, it checks `connector.capabilities()`. If the agent wants to ask "isolate this host," and the only EDR connected for that tenant is one that does not declare `ISOLATE_HOST`, the tool is hidden from the model's tool list — the model never sees a button it cannot push.
+2. **The federated-search planner.** A natural-language query is translated into per-vendor DSLs only for connectors that declare `QUERY_LOGS`. SIEMs without that capability are skipped silently.
+3. **The case fan-out service** (`services/api/app/services/case_fanout.py`). When an AiSOC case is created or its status changes, the fan-out service iterates connector instances filtered by `PUSH_CASE` / `PUSH_STATUS` and calls them in turn. A connector without those capabilities is invisible to the ITSM projection layer — see [ITSM as source of truth](/docs/architecture/itsm-as-source-of-truth) for the full lifecycle.
+
+## Adding a capability to a connector
+
+If you are extending an existing connector to do more (e.g. teaching SentinelOne to `ISOLATE_HOST`):
+
+1. Implement the corresponding method on the connector class (`isolate_host`, `push_case`, `query_logs`, etc.). The base contracts live in `services/connectors/app/connectors/base.py`.
+2. Add the new value to the connector's `capabilities()` classmethod.
+3. Add a focused unit test under `services/connectors/tests/` — happy path, error path, and one vendor-specific edge case (status mapping, ID resolution, transitions).
+4. Update this page so the matrix stays honest. The capability column is the contract the rest of the system relies on; if the matrix says `ISOLATE_HOST`, the runtime will route isolation requests to that connector.
+
+The full method signatures and contracts are in [`base.py`](https://github.com/AiSOC-community/AiSOC/blob/main/services/connectors/app/connectors/base.py); for end-to-end ITSM examples see the [Jira](/docs/connectors/) and [ServiceNow](/docs/connectors/) connector docs (per-vendor walkthroughs).
diff --git a/apps/docs/docs/operations/sonali-consultation-questions.md b/apps/docs/docs/operations/sonali-consultation-questions.md
new file mode 100644
index 000000000..285dcfd09
--- /dev/null
+++ b/apps/docs/docs/operations/sonali-consultation-questions.md
@@ -0,0 +1,187 @@
+---
+sidebar_position: 3
+title: Adoption consultation questions
+description: A structured question set to run with a security leader before deploying AiSOC — coverage, agent autonomy, compliance, ITSM, SLOs, and success metrics.
+---
+
+# Adoption consultation questions
+
+This page is the question set we walk through with a security leader (CISO, head of SecOps, IR lead) before deploying AiSOC. It exists because most failed SOC-tooling rollouts fail not on capability but on **boundary** — the tool was given too much or too little autonomy, was wired to the wrong source of truth, or was measured against a goal it could not move.
+
+The structure below is meant to be taken **in order**. Each section depends on answers from the section above it. Skipping ahead — particularly to "agent autonomy" before answering "what does success look like" — is the most common way these conversations go sideways.
+
+Use this as a working doc. Capture the answers in your own copy of the file (or in a Notion / Confluence equivalent), commit it next to the deployment plan, and revisit it at the end of every quarter.
+
+---
+
+## 1. Outcomes & success criteria
+
+Establish the goal _before_ talking about tools.
+
+1. **What is the single number that is unacceptable today?**
+ (Mean time to triage? P1 backlog? Analyst hours per week on false positives? Time to contain a confirmed identity compromise?)
+2. **In 90 days, what change in that number is the bar for "AiSOC is working"?**
+ Concrete numbers only — "fewer false positives" is not an answer.
+3. **Who reviews that number with you, and how often?**
+ (Board, CIO, weekly ops review, monthly business review.)
+4. **What change in that number would cause you to expand AiSOC?** **What change would cause you to roll it back?**
+5. **Are there qualitative outcomes the number does not capture?**
+ (Analyst retention, on-call burden, audit findings, cyber-insurance posture.)
+6. **Which two adjacent teams stand to benefit if this works?**
+ (IT ops, fraud, GRC, SRE — these are the natural expansion vectors and worth scoping early.)
+
+---
+
+## 2. Threat model & coverage requirements
+
+Before integrations, agree on what AiSOC must detect and respond to.
+
+1. **What are your top three threat scenarios?**
+ Phrase each as a story: who, doing what, against which asset, and what would tip you off. Avoid generic categories like "ransomware."
+2. **What detection coverage do you have today for those three?**
+ (Detection rules in your SIEM? EDR queries? Manual hunting? Nothing?)
+3. **For each scenario, where does the relevant signal _originate_?**
+ Identity provider audit, EDR, cloud control plane, email security, network logs, SaaS audit. This is the connector shopping list.
+4. **What signal do you _not_ collect today that you would need to catch these scenarios reliably?**
+5. **What attacker behavior would you accept missing entirely** in the first 6 months in exchange for shipping the rest faster?
+6. **Do you have a hunt or red-team program?** If so, is its output already structured (test cases, MITRE technique IDs, scenario YAML), or is it free-text reports that we would need to convert?
+7. **Do you maintain a "crown jewel" or asset criticality list?** Where does it live, and who owns it?
+
+---
+
+## 3. Data sources & connector inventory
+
+Map the existing surface area to the [connector catalog](/docs/connectors/api-coverage).
+
+1. **Identity provider(s).** Entra ID, Okta, Google Workspace, Auth0 — which? Is SSO mandatory? Is MFA enforced for everyone?
+2. **EDR.** Which vendor? What licensing tier? Do you have isolation API access enabled? Who owns the API credentials today?
+3. **SIEM(s).** Are you on Sentinel, Splunk, Elastic, Sumo, Chronicle, Datadog, Sumo, Trellix, or none? If multiple, which is canonical and which are read-only second copies? Are you paying licensing on data you do not query?
+4. **Cloud platforms.** AWS, GCP, Azure — which accounts are in scope? Do you already have CloudTrail / Cloud Audit / Activity Logs centralized? Where?
+5. **SaaS surfaces.** M365 audit? Google Workspace audit? GitHub audit? Slack audit? Salesforce login history? Which of these does compliance require you to retain, and for how long?
+6. **Network.** Cisco Umbrella / Zscaler / Tailscale / firewall syslog — which are present, and is there a centralized aggregator?
+7. **Vulnerability + posture.** Tenable, Wiz, Lacework — what runs today, and where do its findings flow?
+8. **For each integration above, who owns the credential rotation policy?** Who would be paged if AiSOC's poll started failing?
+9. **Are any sources only available behind your corporate VPN / on-prem network?** This determines whether the air-gap deployment shape is needed.
+
+---
+
+## 4. Case lifecycle & ITSM source of truth
+
+This is where rollouts most often break — see [ITSM as a projection of AiSOC](/docs/architecture/itsm-as-source-of-truth) for the architectural answer.
+
+1. **Where does an incident "live" today?**
+ (Jira project, ServiceNow Security Incident Response, a Confluence runbook, a Slack channel, an email thread.)
+2. **Which of those would you give up?**
+ The honest answer is rarely "all of them." Get the realistic one.
+3. **Who owns the lifecycle transitions today?**
+ Detection author? Tier-1 analyst? Manager? An automated rule? Two of these?
+4. **What status vocabulary do you use, and is it stable?**
+ (`triage / open / in progress / contained / resolved / closed`, or some variant — does it match across teams or does each team have its own?)
+5. **Do you currently push security incidents back into IT change-management?**
+ If yes — under what conditions, and who approves?
+6. **Are there incident types you would _not_ want mirrored to ITSM?**
+ (Insider risk, executive impersonation attempts, ongoing red-team exercises, anything HR-adjacent.)
+7. **Do you need approval workflows in the ticket itself**, or are approvals out of band (chat, email)?
+8. **Who reviews closed cases?** Is that a real ritual or theoretical?
+
+---
+
+## 5. Agent autonomy & response boundaries
+
+The hardest conversation. Refusing it explicitly is a red flag.
+
+1. **What actions is AiSOC _allowed_ to take without human approval, ever?**
+ (Enrich a domain. Pull a process tree. Query the SIEM. Read mailbox audit.)
+2. **What actions require explicit human approval before AiSOC takes them?**
+ (Isolate a host. Disable a user account. Quarantine a file. Block a hash globally. Revoke a token.)
+3. **For the approval-required actions, who can approve, on which channel, and what is the timeout?**
+ (ChatOps verification model — see the action contracts.)
+4. **What actions are _never_ allowed regardless of approval?**
+ (Touch executive identity, isolate a domain controller, kill a process on the CEO's laptop, anything in a regulated environment without change-management.)
+5. **What blast-radius limits do you want enforced?**
+ (Max N hosts isolated per hour. Max M users disabled per day. Stop and require human re-confirmation if exceeded.)
+6. **Who is on the approval rotation, and what is the fallback when they are unreachable?**
+7. **Is there a "panic stop" you want — a single switch that puts the agent into pure-advisory mode?**
+8. **Are you comfortable with the agent _proposing_ a multi-step plan and a human approving the whole plan once,** or do you want each step approved individually?
+
+---
+
+## 6. Compliance, data residency, audit
+
+1. **Which regulatory regimes apply?**
+ (SOC 2, ISO 27001, PCI DSS, HIPAA, GDPR, FedRAMP, regional regulators.)
+2. **Where must the data physically reside?**
+ (Single region, multi-region, on-prem only, EU only.)
+3. **What is your data retention requirement** for raw logs, normalized events, and case records? Do they differ?
+4. **Who is your DPO / privacy contact?** Have they reviewed how AiSOC handles PII (usernames, IPs, email addresses, device names)?
+5. **What is your encryption standard for data at rest and for credentials?**
+ (AiSOC uses Fernet AES-128-CBC + HMAC-SHA256 by default; if you require AES-256 or KMS-backed keys, we need to know now.)
+6. **Do you require an immutable audit trail of every action AiSOC takes?**
+ (We provide one — make sure it is reviewed.)
+7. **Is air-gapped deployment a hard requirement** for any of your environments? If yes, see [air-gap operations](/docs/operations/airgap).
+8. **Are you subject to AI-specific regulation** (EU AI Act, sectoral AI guidance) that constrains which model providers are usable?
+
+---
+
+## 7. Identity, access, and tenancy
+
+1. **How will analysts log in to AiSOC?**
+ (SSO via your IdP — which?) Will MFA be enforced at the IdP, the app, or both?
+2. **What is the role model in AiSOC?**
+ (Read-only, triage, responder, admin, super-admin — how does that map to your existing security team structure?)
+3. **Do you need SCIM provisioning?**
+4. **Is multi-tenancy needed within your org?**
+ (Per-business-unit isolation, MSSP serving multiple customers, regulated subsidiary.)
+5. **Who owns the "break-glass" admin account, where is its credential stored, and what triggers using it?**
+6. **Is there a separation-of-duties requirement** between who configures detection rules and who can approve containment?
+
+---
+
+## 8. Operations, SLOs, and on-call
+
+1. **What is your in-hours and out-of-hours coverage today?**
+2. **What latency do you need from event ingest to detection?**
+ (Seconds, minutes, hours.)
+3. **What latency do you need from detection to a triaged case?**
+4. **What is your acceptable false-positive rate** on the top 10 detection rules? How is that measured?
+5. **How do you want to be alerted when AiSOC itself is degraded?**
+ (Connector failing, ingest backlog, agent unable to call its tools.)
+6. **Who owns the on-call rotation for AiSOC the platform** (separate from the SOC analyst rotation)?
+7. **What is your release tolerance?**
+ (Auto-update is fine. Bi-weekly windows. Quarterly with internal validation.)
+8. **Do you require a staging environment** that mirrors prod? At what fidelity?
+
+---
+
+## 9. Reporting & stakeholder communication
+
+1. **What does the weekly report to leadership need to contain?**
+2. **What does the quarterly report to the board need to contain?**
+3. **Are there external reporting obligations** — to insurers, customers, regulators — that AiSOC outputs need to feed?
+4. **Do you need an exec dashboard** distinct from the analyst console?
+5. **What language do you use for severity, externally?**
+ (Critical / high / medium / low? P1-P4? Numbered SEV?) AiSOC needs to map to it.
+
+---
+
+## 10. Failure modes & exit
+
+The honest question that almost no procurement conversation asks.
+
+1. **Under what conditions would you decommission AiSOC?**
+ Be specific.
+2. **What data would you need to take with you?**
+ (Cases, evidence, audit trail, detection rules.)
+3. **Who is the off-boarding executive sponsor** if the project lead leaves?
+4. **What does success look like _without_ AiSOC** — i.e. if it works so well it makes itself less needed?
+
+---
+
+## How to use this list in practice
+
+1. Walk it top to bottom in a 90-minute working session with the security leader and the SOC lead present. Skip nothing in §1 and §10.
+2. Fill the gaps with their team async. Most of §3 (data sources) and §6 (compliance) can be answered on paper.
+3. Write the answers down, in this same file, in the deployment repo. The answers _are_ the deployment plan.
+4. Revisit at quarter end. The answers in §1, §4, and §5 will move; the questions stay the same.
+
+If a question on this page does not apply to you, write down _why_ it does not, in the doc, before moving on. The act of writing the "why not" is what catches the wrong assumption six months later.
diff --git a/apps/docs/sidebars.ts b/apps/docs/sidebars.ts
index 04b897727..a0e00cb4b 100644
--- a/apps/docs/sidebars.ts
+++ b/apps/docs/sidebars.ts
@@ -21,11 +21,17 @@ const sidebars: SidebarsConfig = {
"features/attack-path-agent",
],
},
+ {
+ type: "category",
+ label: "Architecture",
+ items: ["architecture/itsm-as-source-of-truth"],
+ },
{
type: "category",
label: "Connectors",
items: [
"connectors/index",
+ "connectors/api-coverage",
"connectors/universal-capture",
"connectors/azure-entra",
"connectors/azure-activity",
@@ -42,7 +48,11 @@ const sidebars: SidebarsConfig = {
{
type: "category",
label: "Operations",
- items: ["operations/credentials", "operations/airgap"],
+ items: [
+ "operations/credentials",
+ "operations/airgap",
+ "operations/sonali-consultation-questions",
+ ],
},
{
type: "category",
diff --git a/docs/architecture/SYSTEM_DESIGN.md b/docs/architecture/SYSTEM_DESIGN.md
index 2ecfbf149..217122541 100644
--- a/docs/architecture/SYSTEM_DESIGN.md
+++ b/docs/architecture/SYSTEM_DESIGN.md
@@ -11,11 +11,22 @@ This document describes the end-to-end architecture of the AiSOC platform after
│ External Sources │
│ EDR / SIEM / Cloud / Identity / Network │
│ CrowdStrike · Splunk · AWS · Okta · Sentinel│
- └─────────────────────┬────────────────────────┘
- │
- Webhooks / Pull
- │
- ▼
+ └─────────┬───────────────────────┬────────────┘
+ │ │
+ Webhooks / Email Vendor APIs
+ (Universal Capture) (poll loop)
+ │ │
+ ▼ ▼
+ ┌─────────────────┐ ┌──────────────────────┐
+ │ services/api │ │ services/connectors │
+ │ inbox tokens + │ │ APScheduler poll │
+ │ HMAC webhooks │ │ 42 connector classes│
+ │ CEF / HEC / DNS│ │ push_case + status │
+ └────────┬────────┘ └──────────┬───────────┘
+ │ │
+ └───────────┬───────────┘
+ │
+ ▼
┌──────────────────────────────────────────────────────┐
│ services/ingest (Go) │
│ ─ OCSF normalizer │
@@ -79,7 +90,8 @@ This document describes the end-to-end architecture of the AiSOC platform after
| `services/ingest` | Go 1.21 | Normalize raw events → OCSF, tag ATT&CK, enrich Shodan | Emit `vulnerability.matches` topic |
| `services/enrichment` | Go 1.21 | Per-IOC TTL-cached enrichment lookups | n/a |
| `services/fusion` | Python 3.11 | Simhash dedup → correlation → ML scoring → publish fused alerts | Background ML retrain on feedback |
-| `services/api` | Python 3.11 | REST + WS, RBAC, case mgmt, rule engine, graph queries | Schema migrations on boot |
+| `services/api` | Python 3.11 | REST + WS, RBAC, case mgmt, rule engine, graph queries, ITSM webhook inbox, case fan-out | Schema migrations on boot |
+| `services/connectors` | Python 3.11 | 42 connector classes, APScheduler poll, `push_case` / `push_status_change` for Jira & ServiceNow | CredentialVault decrypt at poll time |
| `services/agents` | Python 3.11 | LangGraph multi-agent investigation runs | Loads full ATT&CK STIX bundle on boot, optional Qdrant embed |
| `services/actions` | Python 3.11 | SOAR action execution with blast-radius gating | Approval workflows |
| `services/threatintel` | Python 3.11 | IOC/actor search API | APScheduler poll loop for TAXII/MISP/OTX/KEV |
@@ -286,3 +298,75 @@ Each agent emits chain-of-thought traces persisted in PostgreSQL for explainabil
* [API Reference](../api/API_REFERENCE.md)
* [Local Development](../runbooks/LOCAL_DEVELOPMENT.md)
* [PROGRESS.md](../../PROGRESS.md)
+
+---
+
+## 12. v2.1 Additions (Connector Platform, Case Fan-out, Bidirectional ITSM)
+
+The following subsystems were added on top of the v2 design described above. They are additive — none of the previous architecture changed semantically; the data flow into `services/ingest` simply gained two new front doors.
+
+### 12.1 Connector Platform (`services/connectors`)
+
+A first-class, in-process polling tier with 42 registered connector classes spanning seven categories — `edr`, `siem`, `cloud`, `iam`, `saas`, `vcs`, `network`. Every connector subclasses `BaseConnector` and declares:
+
+* `schema()` — self-describing `ConnectorSchema(name, label, category, fields, oauth, default_poll_interval_seconds)` consumed by the web console for the connect form.
+* `capabilities()` — tuple of `Capability` enum values (`PULL_ALERTS`, `PUSH_CASE`, `PUSH_STATUS`, `FEDERATED_SEARCH`, …) that the orchestrator inspects at runtime.
+* `normalize()` — collapses each vendor's severity ladder into the four-tier `info | low | medium | high` scheme.
+
+Sensitive `auth_config` fields (marked `secret=True` in the schema) are encrypted at the application layer by `CredentialVault` (Fernet AES-128-CBC + HMAC-SHA256, vault token format `vault:v1:<base64>`). Key rotation is supported via `MultiFernet` with `AISOC_CREDENTIAL_KEY_ROTATION_FROM`. The API service holds the encrypt/decrypt keypair authority; `services/connectors` ships a vendored read-path `decrypt_dict()` so the scheduler can decrypt at poll time without owning the write path.
+
+Polling runs in-process via `ConnectorScheduler` (APScheduler): one job per enabled instance, 5-minute default cadence, overridable per-instance via `connector_config.poll_interval_seconds`. The scheduler reloads jobs every 30 seconds. Disable in tests with `AISOC_CONNECTORS_DISABLE_SCHEDULER=1`.
+
+Normalized events flow through `IngestClient` to `services/ingest`'s `/v1/ingest/batch` endpoint with an `X-Tenant-ID` header — preserving the OCSF normalization, ATT&CK tagging, and KEV correlation already described in §1.
+
+→ [Connector capability matrix](../../apps/docs/docs/connectors/api-coverage.md)
+→ [Credential vault threat model](../../apps/docs/docs/operations/credentials.md)
+
+### 12.2 Universal Capture (`/v1/inbox/...`)
+
+For sources that don't fit a polled connector — internal SIEM forwarders, syslog/CEF gateways, vendor webhooks, email alerts — `services/api` exposes a per-tenant token-authenticated webhook inbox. Each token is bound to a `template_id` (`generic-json`, `cef`, `splunk-hec`, `dns-zonefile`, `itsm-inbound`, …) that controls how the body is parsed before it hits the same OCSF normalizer.
+
+Tokens are minted via `POST /v1/inbox/tokens`, stored hashed (never plaintext), and rate-limited per token. The HMAC verification path (`X-AiSOC-Signature: sha256=<hex>`) is shared between universal capture and the ITSM inbound webhook described in §12.4.
+
+### 12.3 Tenant Lake API
+
+A scoped, tenant-isolated query surface over the OpenSearch `events-*` indices. Every query is rewritten to inject `tenant_id` as a top-level filter before reaching OpenSearch — defense in depth on top of the existing index-level RBAC. Query timeouts and result-size caps are enforced per-tenant.
+
+### 12.4 Case Fan-out and Bidirectional ITSM (WS8)
+
+AiSOC is the **source of truth** for case state. ITSM systems (Jira, ServiceNow) are projections — analysts working in their familiar ticket UI still see correct context, but the canonical state lives in AiSOC.
+
+**Outbound (AiSOC → ITSM):** When a case is created or its status changes, `services/api/app/services/case_fanout.py` looks up every connector instance the tenant has enabled with `Capability.PUSH_CASE` (or `PUSH_STATUS`) and projects the change. Successes write a row to `case_external_refs (case_id, connector_id, external_system, external_id, external_url, external_status, last_synced_at)` so subsequent updates target the correct external record. Failures are logged but never block the AiSOC case write — the canonical state is already durable.
+
+**Inbound (ITSM → AiSOC):** A public-facing webhook at `POST /v1/inbox/itsm` accepts Jira and ServiceNow status-change payloads. The endpoint:
+
+1. Verifies the per-tenant HMAC (`X-AiSOC-Signature`).
+2. Parses the vendor-specific payload (`issue.key` + `issue.fields.status.name` for Jira; `sys_id` + `state` for ServiceNow).
+3. Maps the vendor status into the AiSOC enum via `_JIRA_INBOUND_STATUS` / `_SNOW_INBOUND_STATUS`.
+4. Looks up the matching `case_external_refs` row to find the AiSOC `case_id`.
+5. Idempotently applies the status change to the AiSOC case (no-op if the case is already in that state).
+
+The mapping is intentionally lossy in one direction: vendor-specific fields (Jira priority, ServiceNow assignment_group, etc.) are **not** synced back into AiSOC. The contract is "case status converges, ITSM-specific metadata stays in ITSM."
+
+→ [ITSM as a projection of AiSOC (full architecture doc)](../../apps/docs/docs/architecture/itsm-as-source-of-truth.md)
+
+### 12.5 Test Coverage
+
+The v2.1 surfaces ship with focused unit tests rather than mocked integration tests against live vendor APIs:
+
+| Surface | Tests | Location |
+|---------|-------|----------|
+| Inbound ITSM webhook | 69 | `services/api/tests/test_inbox_itsm_endpoint.py` |
+| Case fan-out | 21 | `services/api/tests/test_case_fanout.py` |
+| `push_case` / `push_status_change` (Jira + ServiceNow) | 23 | `services/connectors/tests/test_push_capabilities.py` |
+| **Total** | **113** | |
+
+All 113 are passing on the current `main`. Vendor HTTP calls are mocked at the `httpx.AsyncClient` layer; database calls are mocked at the SQLAlchemy `text(...).bindparams(...)` layer with a `_bind_params` helper that tolerates SQLAlchemy 2.x.
+
+### 12.6 Plugin SDK and Marketplace
+
+Connectors are also the unit of distribution. Every connector ships a marketplace manifest at `plugins/<connector-id>/plugin.yaml` mirroring its `schema()`. The marketplace index at `marketplace/index.json` is synced to `apps/web/public/marketplace/` via `pnpm marketplace:sync` and consumed by the in-app connector picker. Third-party authors can ship plugins via the same SDK without modifying core.
+
+→ [Plugin SDK (Python)](../../apps/docs/docs/plugins/python-sdk.md)
+→ [Plugin SDK (Go)](../../apps/docs/docs/plugins/go-sdk.md)
+