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.

Merge remote-tracking branch 'origin/main' into depth/5.4-5.6-lane-c

Beenu Arorab0ebc5c7b3dd
diff --cc DEPTH_PROGRESS.md
index 58ed5f4c7,5567c305c..104f0eae6
--- a/DEPTH_PROGRESS.md
+++ b/DEPTH_PROGRESS.md
@@@ -58,16 -58,35 +58,41 @@@ is written. Next free at capture: migra
| ADR `0010` | 2.7 — entity and session context in CORE | **landed**, `docs/decisions/0010-entity-and-session-context-in-core.md`, accepted |
| migration `102` | 2.4 — `102_sessions.sql` | claimed |
| migration `103` | 2.5 — `103_posture_snapshots.sql` | claimed |
+ | migration `104` | 9.1 — `104_mcp_access.sql` | claimed |
+ | migration `105` | 9.2 — `105_semantic_memory.sql` | claimed |
+ | migration `106` | 9.3 — `106_case_depth.sql` | claimed |
+ | migration `107` | 9.4 — `107_case_war_rooms.sql` | claimed |
+ | migration `108` | 9.5 — `108_hunt_reports.sql` | claimed |
+ | migration `109` | 9.6 — `109_push_devices.sql` | claimed |
+ | migration `110` | 8.1 — `110_console_webauthn.sql` | claimed |
+ | migration `111` | 8.1 — `111_audit_retention.sql` | claimed |
+ | migration `112` | 8.1 — released, taken by another lane (D12) | **struck** |
+ | migration `113` | 8.1 — `113_entitlement_enforcement.sql` | claimed |
+ | ADR `0011` | 8.1 — truncating a hash-chained audit log | claimed |
+
-Highest migration on `main` at claim time was `101_audit_immutable_nullify.sql`,
-so `095`--`101` were taken by sibling lanes between the capture above and this
-claim; re-read `services/api/migrations/` rather than trusting the capture row.
+| migration `104` | 5.4 stateful user/manager verification (verification requests, answers, tenant opt-in) | claimed |
+| migration `105` | 5.6 plain-language playbook drafts (draft, preview, approval) | claimed |
+
+Lane B claimed `102`/`103` and landed that claim on `main` first, so Lane C's
+two moved to `104`/`105` and `102_playbook_verification.sql` was renamed with
+it. Both lanes had claimed before writing, as the plan requires -- what the
+rule cannot prevent is two lanes claiming the same free number before either
+merges, so re-read `services/api/migrations/` **and** this table before
+picking one.
+ Phase 9 re-read `services/api/migrations/` on 2026-10-11 before claiming:
+ `101_audit_immutable_nullify.sql` was still the highest on `main`, and `102`
+ and `103` were already spoken for in the table above, so Phase 9 takes `104`
+ through `109`, one per item. A number left unused at the end of the phase is
+ released by striking its row rather than by silently leaving a gap.
+
+ Item 8.1 re-read `services/api/migrations/` on 2026-10-11 before claiming:
+ `105_semantic_memory.sql` was the highest on `main`, and `102`--`109` were
+ already spoken for above, so 8.1 takes `110`--`112` and ADR `0011`. The three
+ sub-items that need no schema — the containerised-IdP CI leg,
+ internationalisation and accessibility — claim no number. The same release
+ rule applies: an unused number is struck, not silently skipped.
+
## Phase 0: Kickoff
- [x] **0.1** `DEPTH_PROGRESS.md` exists (this file), modelled on
@@@ -499,5 -724,10 +795,11 @@@ endpoint produces once triage falls thr
| 2026-10-09 | 3.3 | Identity privilege (18 rules) and a per-tenant first-seen store (2) built; 5 rules were never unreachable (gate operator drift, D9); 18 retired with a reason (D10). `MAX_UNREACHABLE` 45 → 2, the two remaining both needing the 3.4 baseline. Two matcher operators three shipped rules already used were implemented. |
| 2026-10-09 | 3.2 | Ordered and unordered sequences in the windowed engine; all four translatable Sigma correlation types compile, seven refusal reasons recorded. No upstream correlation rule exists in this tree to import (D8), so the corpus is first-party and labelled as such. |
| 2026-10-09 | 4.1 | Reproduced: `check_cloud_native_collection.py` on the unmodified tree reported all three collection paths absent. Implemented `aws_cloudtrail_s3` (SQS-notified S3 objects; management events, data events and VPC flow logs; delete-after-emit), `gcp_pubsub` (REST pull on a log-sink subscription; ack-after-read) and `azure_event_hubs` (Capture blobs over the Data Lake Gen2 JSON API, with a focused Avro OCF reader). Negative controls recorded in the PR: deleting the SQS message before the object is read, acknowledging the Pub/Sub batch before it is built, ignoring the Avro union branch index, and ignoring the flow-log header line each fail a named test, and all were restored. Connectors suite 1014 -> 1098 passed. |
+| 2026-10-11 | 5.4 | Reproduced: `check_stateful_verification.py` against `origin/main` reported eight problems — no `verification.py` at all, `verify_user` absent from the control-flow table, no resume path, no escalation, no `timed_out`, no sweep, no migration and no writer for the opt-in table. Built the stage machine on the existing pause row rather than a second table. Three negative controls recorded in the PR: reverting the run-loop break fails three tests including the `wait` regression (D11), removing `manager_ref=_extract_manager(body)` fails three SCIM tests, and removing `ENABLE ROW LEVEL SECURITY` from migration 102 fails the live tenancy test with "tenant B read tenant A's verification policy". Two pre-existing tests pinned the old shape and were widened rather than relaxed: the control-flow table's membership (still an equality, now of four) and the sweeper's return dict. Writing the gate found a hole in the gate: its first block extractor matched `\n\n\n`, which finds nothing for the *last* function in a module, so the ordering rule was skipped entirely over an injected violation. |
| 2026-10-09 | 3.1 | All 74 decided. 50 translated into `wd-*` rules derived from each original's own clauses and replayed through the real engine (162 assertions); 24 refused with a reason across five kinds. `MAX_UNREACHABLE` 119 → 45, published executable 2,603 → 2,529, windowed 18 → 68. Three findings recorded as D4–D6 below. |
+ | 2026-10-11 | 8.1 | parity 4.1's containerised-IdP leg **observed to pass**, both halves: `keycloak-oidc` verifies a real `id_token` against Keycloak's published JWKS with an audience-mismatch negative control, and `keycloak-saml` walks the whole SP-initiated flow to the real ACS and signs `[email protected]` in as `infosec`, with an untrusted-key control answering 400. Run `38124780886`, as `ENVIRONMENT=test` against the DML-only `aisoc_app` role. The SSO claim row moves PARTIAL → GATED on that evidence. Building it found two shipped defects no self-authored provider could expose: `resolve_saml_connection` bound `:i` untyped so `:i IS NULL` raised on asyncpg, and Keycloak's default role-list mapper emits one `<Attribute Name="Role">` per role, which python3-saml refuses. |
+ | 2026-10-11 | 8.1 | WebAuthn as a console second factor and MFA enforced per role. Fixing the branch's own gates found three `passkey_credentials` reads scoped by user id alone on a tenant-scoped table, and a permission-model violation where the MFA policy route imported `ROLE_PERMISSIONS` directly; the role *vocabulary* now has one owner in `role_grants.known_roles()`. 23 of 23 live cases pass against real Postgres, and deleting the login integration fails 14 of them — measured, where the workflow had said eight. |
+ | 2026-10-11 | 8.1 | An enforced audit retention window with a re-anchored checkpoint, ADR-0011, and 12 live cases. Writing them found that migration `111` declared `ON DELETE CASCADE` on the checkpoint table and then made the cascade impossible; and, separately, that `audit_log`'s own trigger from migration `101` blocks `DELETE FROM tenants` for every tenant that has written a row, so tenant deletion is impossible on `main`. Reproduced and filed as #1330 rather than fixed here. |
+ | 2026-10-11 | 8.1 | Opt-in per-tenant limit enforcement (migration `113`, D12), wired to `POST /connectors` and `POST /tenants/me/users` through one helper, with `GET`/`PUT /usage/enforcement` as the operator surface. Nine live cases, half of them positive controls: a guard that never refuses fails 1, a guard stuck closed fails 4. |
+ | 2026-10-11 | 8.1 | axe extended to the case list and case workspace, the two of parity 4.7's five views that were left out. Four real defects found and fixed: two `<select>` controls with no accessible name (one of them the control that writes a case's status), two indistinguishable `<aside>` landmarks, and panel headings at `h3` directly under the page's `h1`. |
+