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: make the front door describe what the project is today (#1230)

Beenu Arora10dc1f9d1062
diff --git a/README.md b/README.md
index bf9acc151..39b9db8af 100644
--- a/README.md
+++ b/README.md
@@ -7,9 +7,9 @@
**An open-source, self-hostable AI Security Operations Center.** It ingests your security telemetry, detects and correlates threats, investigates them with AI agents whose reasoning is fully auditable, and proposes responses a human approves.
[![License: MIT](https://img.shields.io/badge/License-MIT-22c55e.svg?style=flat-square)](https://opensource.org/licenses/MIT) [![Version](https://img.shields.io/badge/version-17.1.0-f59e0b?style=flat-square)](CHANGELOG.md) [![CI](https://img.shields.io/github/actions/workflow/status/beenuar/AiSOC/ci.yml?branch=main&label=CI&style=flat-square)](https://github.com/beenuar/AiSOC/actions/workflows/ci.yml)
-[![CodeQL](https://img.shields.io/github/actions/workflow/status/beenuar/AiSOC/codeql.yml?branch=main&label=CodeQL&style=flat-square)](https://github.com/beenuar/AiSOC/actions/workflows/codeql.yml) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/beenuar/AiSOC/badge)](https://securityscorecards.dev/viewer/?uri=github.com/beenuar/AiSOC) [![Technical Guide](https://img.shields.io/badge/Technical%20Guide-22%20page%20PDF-dc2626?style=flat-square)](https://github.com/beenuar/AiSOC/blob/main/apps/web/public/papers/aisoc-technical-guide.pdf)
+[![CodeQL](https://img.shields.io/github/actions/workflow/status/beenuar/AiSOC/codeql.yml?branch=main&label=CodeQL&style=flat-square)](https://github.com/beenuar/AiSOC/actions/workflows/codeql.yml) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/beenuar/AiSOC/badge)](https://securityscorecards.dev/viewer/?uri=github.com/beenuar/AiSOC) [![Technical Guide](https://img.shields.io/badge/Technical%20Guide-26%20page%20PDF-dc2626?style=flat-square)](https://raw.githubusercontent.com/beenuar/AiSOC/main/apps/web/public/papers/aisoc-technical-guide.pdf)
-**[Technical Guide (PDF)](https://github.com/beenuar/AiSOC/blob/main/apps/web/public/papers/aisoc-technical-guide.pdf)** · [Docs](https://beenuar.github.io/AiSOC/) · [Architecture](docs/architecture/README.md) · [What actually works](docs/audit/REPOSITORY_REALITY.md) · [Discussions](https://github.com/beenuar/AiSOC/discussions)
+**[Technical Guide (PDF)](https://raw.githubusercontent.com/beenuar/AiSOC/main/apps/web/public/papers/aisoc-technical-guide.pdf)** · [Docs](https://beenuar.github.io/AiSOC/) · [Architecture](docs/architecture/README.md) · [What actually works](docs/audit/REPOSITORY_REALITY.md) · [Discussions](https://github.com/beenuar/AiSOC/discussions)
</div>
@@ -45,9 +45,8 @@ git clone https://github.com/beenuar/AiSOC && cd AiSOC
make up
```
-The [Technical Guide](apps/web/public/papers/aisoc-technical-guide.pdf) covers this in depth —
-server sizing, where the model runs, every failure mode with its cause and fix, the REST API, MCP,
-and a screenshot of each console surface.
+The [Technical Guide](https://raw.githubusercontent.com/beenuar/AiSOC/main/apps/web/public/papers/aisoc-technical-guide.pdf) covers this in depth: server sizing, where the
+model runs, every failure mode with its cause and fix, the REST API, MCP, and every console surface.
Needs Docker Compose v2 with **8 GB memory and 20 GB free disk in the Docker VM**, plus `python3`
(3.9+) and `bash`; `make doctor` checks all of it and
@@ -55,13 +54,13 @@ Needs Docker Compose v2 with **8 GB memory and 20 GB free disk in the Docker VM*
was measured against. The first run downloads a ~2 GB model into a volume only `make clean` clears.
`make up` also creates `.env` and generates the **fifteen** secrets in it — the credential vault, the
-session signing key, five service-to-service credentials and four datastore passwords — then creates
-an administrator and prints its password, generated on your machine, shown once and stored nowhere.
-Copy it, or mint another with `make bootstrap ARGS=--reset-password`.
+session signing key, five service-to-service credentials and four datastore passwords — then creates an
+administrator and prints its password, generated on your machine, shown once and stored nowhere. Lost
+it? `make bootstrap ARGS=--reset-password` mints another.
-**A port already in use does not stop the install.** AiSOC publishes on a free one, names what held
-the old one, and moves the console address with it — measured on a bare clone with 5432 and 11434
-both taken, 64 seconds to a signed-in console.
+**A port already in use does not stop the install.** AiSOC publishes on a free one, names what held the
+old one, and moves the console address with it: 64 seconds to a signed-in console on a bare clone with
+5432 and 11434 both taken.
Then **prove it works**. `make smoke` posts one real event to the ingest API and follows it through
Kafka, detection, correlation and Postgres, then reads the alert back out of the public API. Every
@@ -71,7 +70,6 @@ stage reports PASS or FAIL:
$ make smoke
[PASS] raw telemetry accepted by ingest
[PASS] event traversed the spine and became an alert
-[PASS] alert is retrievable by id from the API
PASS: 10/10 stages
```
@@ -97,27 +95,27 @@ curl -X POST http://localhost:8081/v1/ingest/batch \
```
Or pull, by configuring one of **87 click-and-connect data connectors** in **Settings → Connectors**
-(needs the `full` profile) — Splunk, Sentinel, Elastic, CrowdStrike, Okta, AWS and Kubernetes audit
-among those with vendor-specific normalization and setup docs
+— Splunk, Sentinel, Elastic, CrowdStrike, Okta, AWS and Kubernetes audit among those with
+vendor-specific normalization and setup docs
([coverage](https://beenuar.github.io/AiSOC/docs/connectors/api-coverage)). Without a vendor profile
a connector still ingests through a generic mapping that resolves host, user and source IP.
+**A real cloud estate does not hand you its logs over a REST call.** Four collectors read the
+surfaces one actually emits to: a CloudTrail organisation trail on **S3 notified over SQS**
+(management events, data events and VPC flow logs), a **GCP Pub/Sub** subscription on a Cloud Logging
+sink, an **Azure Event Hubs** capture, and a **syslog/CEF** listener. Each keeps a resumable cursor
+and a bounded per-poll budget, so a backlog applies backpressure instead of flooding ingest.
+
Bringing existing detections? `packages/aisoc-migrate` translates Splunk SPL, Sentinel KQL and
-Elastic EQL, and **refuses rather than approximating** what it cannot carry — an almost-right rule is
-harder to find than a missing one. On the 2,005 Splunk rules bundled here, 1,734 translate and 1,711
-of those are partial: field matches carried, thresholds did not
-([what to do with a partial](apps/docs/docs/migration/from-splunk.md)).
+Elastic EQL and **refuses rather than approximating** what it cannot carry, because an almost-right
+rule is harder to find than a missing one: of the 2,005 Splunk rules bundled here 1,734 translate and
+1,711 of those are partial ([what that means](apps/docs/docs/migration/from-splunk.md)).
## How it works
-Ingest normalizes to a common shape and Kafka carries it, then
-fusion runs 2511 executable detection rules, of 6991 on disk, plus 72 sliding-window rules that count across events, applies **your tenant's own tuning**
-on top — the disables, floors and suppressions the console writes, so a rule you turned off actually stops firing — and decides what
-becomes an alert. Correlation groups related alerts, an agent investigates and writes its reasoning
-to the Investigation Ledger, and a playbook may start from the result. Separately, new threat
-intelligence sweeps the lake for sightings you already collected, and a hypothesis becomes a hunt
-without anyone writing a query — the model fills a closed schema and every value is bound as a
-parameter, so it cannot express a query at all.
+Ingest normalizes to a common shape and stamps an **activity projection** on every event — actor, action, resource, location, outcome, with `actor.kind` read from each vendor's own documented field rather than inferred — then Kafka carries it.
+Then fusion runs 2511 executable detection rules, of 6991 on disk, plus 72 sliding-window rules (70 count across events; 2 match a sequence), applies **your tenant's own tuning** on top — the disables, floors and suppressions the console writes, so a rule you turned off actually stops firing — and decides what becomes an alert.
+Correlation groups related alerts, an agent investigates and writes its reasoning to the Investigation Ledger, and a playbook may start from the result. Separately, new threat intelligence sweeps the lake for sightings you already collected, and a hypothesis becomes a hunt without anyone writing a query — the model fills a closed schema and every value is bound as a parameter, so it cannot express a query at all.
**A playbook triggered by an alert previews before it acts.** Three switches must agree — the
deployment, the tenant, the playbook — and every default is off; anything less runs in preview with
@@ -129,16 +127,16 @@ hanging.
event is replayed through the real connector and engine and that rule is *watched to fire* — never
inferred from a directory or an `enabled:` flag. The proof can fail: `--prove-gate` reverts the
Windows connector and requires all 1,687 Windows rules to go silent. It means reachable, not that it
-detects an attack. 45 still cannot fire, counted by family rather than hidden.
-([why 1,362 were refused](docs/detections/sigma-compilation.md))
+detects an attack. **Two** rules still cannot fire — down from 119, because a rule that could not fire
+stopped being counted as executable — and both are waiting on a behavioural baseline. The ratchet
+only moves down. ([why 1,362 were refused](docs/detections/sigma-compilation.md))
**Every answer carries its receipts.** The copilot cites each checkable claim to the ledger entry behind
it and labels the rest *uncited* rather than dropping them, and any investigation exports as a **signed
evidence bundle** — byte-identical, prompts as digests, OCSF 1.9.0. ([how](docs/architecture/evidence-bundles.md))
-**[docs/architecture/README.md](docs/architecture/README.md)** walks that path one step at a time — eleven
-steps, five diagrams, every box linking to the code — and [mirrors to the docs
-portal](https://beenuar.github.io/AiSOC/docs/architecture).
+**[docs/architecture/README.md](docs/architecture/README.md)** walks that path one step at a time —
+eleven steps, five diagrams, every box linking to the code — and [mirrors to the docs portal](https://beenuar.github.io/AiSOC/docs/architecture).
## Deployment profiles
@@ -227,9 +225,11 @@ Agents triage alerts and investigate incidents. What they can and cannot do:
Secrets are generated per deployment and never committed; connector credentials are encrypted at rest. Services connect to Postgres as a DML-only role, so row-level security actually applies, and tenant isolation is enforced at the query layer in every store. RBAC gates every mutating route, ingest is authenticated, and the default install sends no prompt anywhere — the model runs beside it.
-SAML and OIDC sign-in with per-connection tenant and group mapping, SCIM provisioning, and a TOTP
-second factor with recovery codes and per-tenant enforcement ([SSO](apps/docs/docs/operations/enterprise-sso.md) ·
-[2FA](apps/docs/docs/operations/console-mfa.md)). Attribute conditions, time-boxed elevation and workload identities narrow a permission inside the one authorization path; enforcing MFA *per role* is still absent.
+SAML and OIDC sign-in with per-connection tenant and group mapping, SCIM provisioning, and console
+**MFA** — TOTP with recovery codes, enforceable per tenant. Attribute conditions, time-boxed
+elevation and workload identities run inside the one permission path, where a condition can only
+narrow a permission and never grant one. ([SSO](apps/docs/docs/operations/enterprise-sso.md) ·
+[access governance](docs/security/access-governance.md))
**A service with no credential refuses to serve rather than serving unauthenticated.** The [changelog](CHANGELOG.md) records each fix; report via [SECURITY.md](SECURITY.md).
diff --git a/apps/docs/docs/architecture.md b/apps/docs/docs/architecture.md
index e2f0485ba..3caa82179 100644
--- a/apps/docs/docs/architecture.md
+++ b/apps/docs/docs/architecture.md
@@ -60,8 +60,8 @@ curl -X POST http://localhost:8081/v1/ingest/batch \
**Pull.** [`services/connectors`](https://github.com/beenuar/AiSOC/tree/main/services/connectors)
polls a vendor API on a schedule, decrypts that tenant's stored credentials
through the vault at poll time, and forwards the result to the same ingest
-endpoint. It is a `full`-profile service; CORE accepts pushes instead. The
-registry is **now 87 connectors** — that figure is generated from
+endpoint. It runs in **CORE**, so a default install can pull as well as receive.
+The registry is **now 87 connectors** — that figure is generated from
`services/connectors/app/connectors/__init__.py` by
[`scripts/generate_connector_count.py`](https://github.com/beenuar/AiSOC/blob/main/scripts/generate_connector_count.py),
which fails CI if this sentence disagrees with the tree.
@@ -135,6 +135,14 @@ and its imported counterpart beside it. The YAML under `detections/` is a
published separately. See
[the detection truth table](https://github.com/beenuar/AiSOC/blob/main/docs/detections/truth-table.md).
+:::note The executable figure went down, and that was the fix
+It was 2,603. Rules naming a counter no telemetry emits were being loaded and
+counted while being unable to fire under any circumstances. They were either
+rewritten as windowed rules or refused with a recorded reason, and the total
+fell accordingly. A corpus figure that only ever grows is measuring the
+directory, not the engine.
+:::
+
Executable is a claim backed by a replay, not by a flag: a rule enters the
compiled ruleset only after a vendor-shaped event has been pushed through the
real connector and this engine and that rule was observed to fire, with an
@@ -151,6 +159,30 @@ It does not claim the rules detect attacks, only that they are reachable.
| Rules needing a time window | [`windowed_detection.py`](https://github.com/beenuar/AiSOC/blob/main/services/fusion/app/services/windowed_detection.py) |
| Events the consumer cannot parse | [`dlq.py`](https://github.com/beenuar/AiSOC/blob/main/services/fusion/app/services/dlq.py) → `aisoc.alerts.dlq` |
+### Detections that need more than one event
+
+A single-event match cannot express "five failures then a success". A separate
+**windowed** engine holds 72 compiled rules plus three built-ins:
+
+- **70 count** events, or distinct values, for one entity over a sliding window
+ and fire on a threshold.
+- **2 are sequences** — A then B by the same entity, ordered in time or not.
+ Stages are disjoint, so a slow drip cannot walk a sequence forward forever,
+ and the whole sequence must fit inside one window measured from its first
+ stage.
+
+Four of the 72 are compiled from Sigma **correlation** documents — `event_count`,
+`value_count`, `temporal` and `temporal_ordered` — by
+[`scripts/sigma_correlation.py`](https://github.com/beenuar/AiSOC/blob/main/scripts/sigma_correlation.py).
+It refuses what it cannot carry and records why on the rule: a correlation
+grouping by two fields is refused because the engine accumulates against one
+entity, and a `lt` condition is refused because firing when a count is *low*
+needs a baseline rather than a counter.
+
+This figure is published beside the executable count rather than added to it. A
+threshold over a window and a single-event match are different kinds of claim,
+and summing them would make two incomparable numbers into one.
+
## 5 · Enrichment, if it is running
[`services/enrichment`](https://github.com/beenuar/AiSOC/tree/main/services/enrichment)
@@ -249,11 +281,23 @@ Four properties, each enforced in code rather than asserted:
CORE ships a pinned `llama3.2:3b-instruct-q4_K_M` behind the gateway, so a
clone with no account produces a real verdict with real token counts. It is a
-3B quantized model, and the difference from a frontier model is visible: in a
-measured run of 19 auto-triages on a CORE stack, **7 returned schema-valid
-output and 12 did not**. The 12 fell back to the deterministic path, logged
-`auto_triage_worker.llm_failed_fallback`, and the Investigation Rail shows
-which path produced the verdict it is displaying.
+3B quantized model, and the difference from a frontier model is measurable:
+over 50 alerts from the committed synthetic corpus, through the gateway exactly
+as production routes, at the production `temperature=0.0` / `max_tokens=512`,
+replies triage could use went from **44 of 50 to 50 of 50** once the model was
+asked for a JSON object rather than having its prose corrected afterwards
+([`scripts/measure_triage_reliability.py`](https://github.com/beenuar/AiSOC/blob/main/scripts/measure_triage_reliability.py)).
+All six failures carried a correct verdict and confidence with a malformed
+`rationale`, and `finish_reason` was `stop` on all 50, so truncation was not
+involved. When validation does fail, triage falls back to the deterministic
+path, logs `auto_triage_worker.llm_failed_fallback`, and the Investigation Rail
+shows which path produced the verdict it is displaying.
+
+An earlier figure of "7 of 19" was published here. It does not reproduce, and
+it has been replaced by the harness above — which drives the production prompt
+and the production parser by importing them, and uses a *different* alert for
+every attempt, because production pins `temperature=0.0` and asking one alert
+twenty times measures one reply twenty times rather than a rate.
**No hosted provider has ever been exercised in this repository.** There is no
funded key, so per-model figures read *not measured* rather than zero. The
@@ -303,19 +347,49 @@ execution.
Without vendor credentials an executor returns `simulated` and says so.
`executed` is the single field that means a vendor was actually touched.
-Playbooks reach this same path. The engine's step vocabulary is 22 types
+Playbooks reach this same path. The engine's step vocabulary is **25 types**
([`models.py`](https://github.com/beenuar/AiSOC/blob/main/services/agents/app/playbook/models.py)),
-and the editor's palette offers **21** of them — `approval` is withheld because
-the engine is a single-threaded index walk with no pause or resume, so a step
-it cannot run is not offered as a button.
+and all 25 are runnable and offered in the console editor. Nine execute
+directly; the other **16 are governed verbs**, graded against a capability
+contract at dispatch — `notify` and `osquery_live_query` among them, because
+messaging a channel and running a live query across a fleet are both things an
+operator should be able to withhold.
+[`scripts/check_playbook_schema_parity.py`](https://github.com/beenuar/AiSOC/blob/main/scripts/check_playbook_schema_parity.py)
+holds the JSON schema, the engine, the shared TypeScript types and the editor in
+agreement **in both directions**: an editor offering a step the engine cannot
+run, and an engine carrying a step the editor hides, are the same defect seen
+from two sides.
+
+Beyond the linear walk the engine runs `wait` (a timer or a callback),
+`parallel` (fan out, then join) and `loop` (once per item, bounded). Each step
+execution carries an **idempotency key** derived from the run, the step and its
+path, so a resumed or retried run does not repeat something that already took
+effect.
+
+`approval` is a **durable pause**, which this page previously said it could not
+be. A run that reaches one suspends to PostgreSQL — the step index and the whole
+run context — survives a restart, resumes at the step *after* the approval, and
+expires with a recorded outcome rather than hanging. `playbook-pause-live.yml`
+proves it against live Postgres with a negative control.
---
## Where the path stops
-Step 10 has no automatic trigger. There is no code path that dispatches a
-response without a human. That is deliberate, and it is the honest boundary of
-the word "autonomous" in this project.
+A *playbook* can be triggered automatically by a fused alert, and three
+switches must all agree before one acts — the deployment, the tenant, and the
+playbook itself — with every default off. Anything short of all three runs in
+**preview**, with its plan and simulated steps attached to the alert so an
+analyst can read what it would have done. Preview is the default state, not a
+mode somebody has to remember to choose.
+
+What that did **not** change is step 10. Every response step is still graded
+against its own capability contract at dispatch and returns `pending_approval`
+on its own when a human is required, so approving a playbook never authorises
+whatever its steps happen to contain. There is still no code path that touches
+a vendor without either a human approval or an explicit per-tenant autonomy
+policy for that specific verb. That is the honest boundary of the word
+"autonomous" in this project.
## What runs in which profile
diff --git a/apps/docs/docs/architecture/overview.md b/apps/docs/docs/architecture/overview.md
index 9849bbe82..f5c684649 100644
--- a/apps/docs/docs/architecture/overview.md
+++ b/apps/docs/docs/architecture/overview.md
@@ -24,7 +24,8 @@ AiSOC/
│ ├── fusion/ # Python · dedup + ML scoring + per-alert confidence + correlation narrative
│ ├── agents/ # Python · LangGraph + Qdrant RAG + investigation ledger writer + hunt engine
│ ├── actions/ # Python · SOAR + blast-radius gating + ChatOps verification
-│ ├── threatintel/ # Python · TAXII / MISP / OTX / KEV + threat-actor attribution
+│ ├── threatintel/ # Python · CISA KEV by default; MISP / OTX / TAXII when an
+│ │ # operator configures one · threat-actor attribution
│ ├── realtime/ # Node.js · per-channel WebSocket fan-out + VAPID Web Push
│ ├── ueba/ # Python · User & Entity Behavior Analytics (Welford online baseline)
│ ├── honeytokens/ # Python · deceptive credential traps (HMAC-signed)
@@ -38,16 +39,18 @@ AiSOC/
│ ├── ui/ # Shared React primitives
│ ├── ocsf/ # OCSF normalization helpers
│ ├── sdk-ts/ # TypeScript client SDK for AiSOC API (npm: @aisoc/sdk — unpublished, see below)
-│ ├── sdk-py/ # Async Python client SDK (PyPI: aisoc-sdk — unpublished, see below)
+│ ├── sdk-py/ # Async Python client SDK (PyPI: aisoc-sdk — published)
│ ├── sdk-go/ # Go client SDK + models (module: github.com/beenuar/AiSOC/packages/sdk-go)
│ ├── plugin-sdk-ts/ # TypeScript plugin development SDK
-│ ├── plugin-sdk-py/ # Python plugin development SDK (PyPI: aisoc-plugin-sdk — unpublished, see below)
+│ ├── plugin-sdk-py/ # Python plugin development SDK (PyPI: aisoc-plugin-sdk — published)
│ ├── plugin-sdk-go/ # Go plugin development SDK (module: github.com/beenuar/AiSOC/packages/plugin-sdk-go)
-│ └── aisoc-cli/ # CLI: scaffold / validate / publish plugins & detections (PyPI: aisoc-cli — unpublished, see below)
+│ ├── aisoc-cli/ # CLI: scaffold / validate / publish plugins & detections (PyPI: aisoc-cli — published)
+│ ├── aisoc-sandbox/ # Offline 30-second simulator (PyPI: aisoc-sandbox — published)
+│ └── aisoc-detections/ # Python detection-authoring framework (PyPI: aisoc-detections — published)
├── detections/ # Detection rules as YAML. A *projection* of the compiled
│ # ruleset, not the engine's input: 6,991 rules on disk,
-│ # 2,511 executable. (7,022 YAML files live here; 25 are
-│ # response playbooks and 6 are Sigma correlations.) Recount with
+│ # 2,511 executable. (More YAML files than that live here —
+│ # the surplus are response playbooks, not rules.) Recount with
│ # scripts/generate_corpus_stats.py rather than trusting this line.
├── hunts/ # Hunt-as-Code YAML definitions (hypothesis + indicators + schedule)
├── playbooks/ # SOAR playbooks (YAML) — 62 packs
@@ -55,7 +58,8 @@ AiSOC/
├── marketplace/ # Marketplace index (JSON, generated by scripts/build_marketplace.py)
├── infra/
│ ├── coolify/ # Coolify (self-hosted Heroku-style PaaS) quickstart
-│ ├── fly/ # Fly.io machines + deploy script (canonical hosted demo target)
+│ ├── fly/ # Fly.io machines + deploy script (one recipe among several;
+│ │ # no hosted demo is operated from here)
│ ├── railway/ # Railway template (railway.toml)
│ ├── render/ # Render blueprint (render.yaml at repo root)
│ ├── terraform/ # AWS (VPC, EKS, RDS, ElastiCache, MSK) + GCP + Azure skeletons
@@ -90,6 +94,12 @@ services.
`litellm` and `ollama` are CORE — see [Architecture](../architecture.md) for
why the gateway without a model behind it could not do AI triage at all.
+`connectors` and `actions` are CORE too: a default install has to be able to
+*pull* from a vendor as well as receive a push, and the investigation agent's
+vendor tools have to reach something. CORE is 16 long-running services and
+`full` is 22 long-running services; both are enforced against `docker-compose.yml` by
+[`scripts/check_profile_service_counts.py`](https://github.com/beenuar/AiSOC/blob/main/scripts/check_profile_service_counts.py),
+so this table cannot drift from the compose file without failing CI.
| Service | Lang | Container | Host | Profile | Role |
|---|---|---|---|---|---|
@@ -99,12 +109,12 @@ why the gateway without a model behind it could not do AI triage at all.
| `fusion` | Python | 8003 | 8003 | core | Detection engine, promotion, correlation, confidence, narrative, lake writer |
| `agents` | Python · LangGraph | 8084 | 8001 | core | Auto-triage worker, investigation agents, playbook engine, ledger writer |
| `realtime` | Node.js · `ws` | 4000 | 8086 | core | Per-channel WebSocket fan-out, VAPID Web Push |
-| `threatintel` | Python | 8005 | 8005 | core | CISA KEV / TAXII / MISP / OTX polling, threat-actor attribution |
+| `threatintel` | Python | 8005 | 8005 | core | CISA KEV polling with no credentials; MISP, OTX and TAXII feeds register only when an operator supplies a URL and credentials. Threat-actor attribution |
| `litellm` | — (image) | 4000 | 4000 | core | LLM gateway; every `aisoc-<role>` alias resolves here and nowhere else |
| `ollama` | — (image) | 11434 | 11434 | core | The local model behind the gateway, pinned at `llama3.2:3b-instruct-q4_K_M` |
+| `actions` | Python | 8085 | 8002 | core | Governed capability execution and post-action verification |
+| `connectors` | Python | 8003 | 8088 | core | Scheduled vendor polling, credential vault, federated query translators |
| `enrichment` | Go | 8082 | 8080 | full | IOC enrichment fan-out (VT, AbuseIPDB, GreyNoise) |
-| `actions` | Python | 8085 | 8002 | full | Governed capability execution and post-action verification |
-| `connectors` | Python | 8003 | 8088 | full | Scheduled vendor polling, credential vault, federated query translators |
| `ueba` | Python | 8004 | 8007 | full | User and entity behaviour analytics |
| `honeytokens` | Python | 8005 | 8008 | extras | Honeytoken lifecycle and webhook alerting |
| `purple-team` | Python | 8006 | 8006 | extras | Atomic Red Team, Caldera, ATT&CK heatmap, detection drift |
@@ -127,16 +137,27 @@ why the gateway without a model behind it could not do AI triage at all.
## API surface
-The full OpenAPI 3.1 spec lives at [`docs/openapi.yaml`](https://github.com/beenuar/AiSOC/blob/main/docs/openapi.yaml). The interactive view is at `http://localhost:8000/api/docs` (Swagger) or `/api/redoc` (ReDoc) when you run the local stack.
+The full OpenAPI 3.1 spec lives at [`docs/openapi.yaml`](https://github.com/beenuar/AiSOC/blob/main/docs/openapi.yaml), and that committed file is the one to read.
-## On "unpublished"
+The interactive views — `/api/docs` (Swagger) and `/api/redoc` (ReDoc) — are mounted **only when the API is not in production mode**, and `make up` starts a production-class stack, so on a default install both answer 404 along with `/api/openapi.json`. That is deliberate rather than a bug: a public deployment should not serve a live schema explorer. Read the committed spec, or run the API with a non-production `ENVIRONMENT` if you want the explorer.
-`release.yml` builds and packs all eight packages on every tag, so the pipeline
-cannot rot. Only the upload is gated, and it is gated on registry credentials
-this repository does not hold — an account action, not an engineering one.
-Install from source in the meantime. The npm name `aisoc` is free; the PyPI
-name `aisoc` belongs to an unrelated project, which is why the Python sandbox
-package ships as `aisoc-sandbox`.
+## Package publication status
+
+Eight packages are declared. **Five are published and resolve today** — the PyPI
+side, uploaded by trusted publishing from a tag. The remaining **three are npm
+and are not published**, because the first upload needs an `NPM_TOKEN` this
+repository does not hold; that is an account action, not an engineering one.
+Build them from source in the meantime.
+
+`release.yml` builds and packs all eight on every tag regardless, so the
+pipeline cannot rot while half of it is idle, and
+[`scripts/check_published_packages.py`](https://github.com/beenuar/AiSOC/blob/main/scripts/check_published_packages.py)
+checks the tree against the live registries **in both directions**, so neither a
+package that quietly stopped resolving nor one described as unpublished after it
+shipped can survive a CI run.
+
+The PyPI name `aisoc` belongs to an unrelated project, which is why the Python
+sandbox package ships as `aisoc-sandbox`; the npm name `aisoc` is free.
## Next stops
diff --git a/apps/docs/static/llms-full.txt b/apps/docs/static/llms-full.txt
index 73cea9825..9f0c718e9 100644
--- a/apps/docs/static/llms-full.txt
+++ b/apps/docs/static/llms-full.txt
@@ -46,6 +46,10 @@ Services in the monorepo under `services/`: `api` (FastAPI), `agents`
`actions`, `mcp`, and others. Applications under `apps/`: `web` (Next.js
console) and `docs` (this documentation site).
+`connectors` and `actions` run in the core profile, not only in `full`. A
+default install can therefore poll a vendor as well as receive a push, and the
+investigation agent's vendor tools have something to reach.
+
Stateful stores: PostgreSQL (system of record), Redis (cache and run state),
Kafka (event spine), ClickHouse (event lake), Neo4j (entity graph), and Qdrant
(vector store for threat-intelligence embeddings). Tenant isolation is enforced
@@ -54,6 +58,118 @@ alone.
Read more: https://beenuar.github.io/AiSOC/docs/architecture
+## Where the entry points are
+
+If you are answering a question about how something works, these are the files
+to open first. Each is the real production path, not a wrapper.
+
+- **HTTP ingest:** `services/ingest/internal/server/server.go`. Normalization
+ is `services/ingest/internal/normalizer/` — `normalizer.go` holds the
+ per-connector profile table and `ocsf_classes.go` the OCSF class per
+ connector type.
+- **Detection:** `services/fusion/app/services/detection_engine.py` and
+ `detection_matcher.py`. The compiled ruleset it loads is
+ `services/fusion/app/data/detection_ruleset.json`. Rules that need a time
+ window are `windowed_detection.py`.
+- **Promotion and correlation:** `services/fusion/app/services/promoter.py`
+ decides whether an event becomes an alert; `correlator.py` decides which
+ incident it joins.
+- **Agent triage:** `FusedAlertTriageWorker` in `services/agents`. Deeper
+ investigation is `services/agents/app/investigator/`.
+- **The REST API:** `services/api/app/api/v1/endpoints/`. The committed
+ specification is `docs/openapi.yaml`.
+- **Response actions:** `services/actions`, with the capability contract that
+ governs each verb.
+- **Playbooks:** `services/agents/app/playbook/` — `models.py` holds the step
+ vocabulary, `engine.py` runs it.
+- **The console:** `apps/web/src/app/`.
+
+Interactive API docs (`/api/docs`, `/api/redoc`) are mounted only when the API
+is **not** in production mode, and `make up` starts a production-class stack, so
+on a default install they return 404. Read `docs/openapi.yaml` instead.
+
+## Which directory holds what
+
+```
+apps/web/ Next.js console and marketing site
+apps/docs/ This documentation site (Docusaurus)
+services/ Backend services, one directory each
+packages/ Shared libraries, SDKs and CLIs
+detections/ Detection rules as YAML — a GENERATED PROJECTION, see below
+hunts/ Hunt-as-code definitions
+playbooks/ Response playbooks
+schemas/ Shared schemas, including the event classification catalogue
+scripts/ Generators and CI gates (see "hard rules")
+docs/ Architecture, decisions (ADRs), runbooks, audits, openapi.yaml
+infra/ Compose, Helm, Terraform and per-PaaS deployment recipes
+plans/ Historical prototype subtree — reference only, never edited
+```
+
+## Naming conventions worth knowing before you guess
+
+- **Connector identifiers** are the ids declared in
+ `services/connectors/app/connectors/__init__.py` — `crowdstrike`, not
+ `crowdstrike_falcon`. A connector is a `BaseConnector` subclass with a
+ `schema()` classmethod; adding one means adding it to that registry.
+- **Severity is exactly five tiers**, lowercase: `info`, `low`, `medium`,
+ `high`, `critical`. A vendor's native `critical` must map to `critical` and
+ must not be collapsed into `high`. Confidence is separate: an integer 0–100.
+- **The event envelope key is `raw_event`**, never `raw`. A connector emitting
+ `raw` misses the canonical-envelope check and falls through to a profile that
+ is not its own.
+- **Editing `detections/*.yaml` changes nothing.** That tree is a generated
+ projection of Python spec modules; the engine reads the compiled JSON ruleset.
+ The lever is adding a spec and re-exporting.
+- **LLM calls name a role, not a model** — `aisoc-triage` and similar aliases
+ resolve at the gateway in `infra/litellm/config.yaml`.
+
+## Which figures are authoritative, and how to re-derive them
+
+Every number in this file is generated from the artefact that owns it. If you
+need to state one, re-derive it rather than quoting a figure from prose —
+including from this file, which is a snapshot of version 17.1.0.
+
+```
+python3 scripts/generate_corpus_stats.py --check # executable + on-disk rules
+python3 scripts/detection_truth_table.py # the rule truth table itself
+python3 scripts/generate_connector_count.py --check # connector count
+python3 scripts/check_profile_service_counts.py # services per profile
+python3 scripts/check_published_packages.py # what is really on a registry
+python3 scripts/check_claim_gate_matrix.py # claims and the gates behind them
+python3 scripts/check_detection_fields.py # rules that still cannot fire
+make stats # most of the above at once
+```
+
+`docs/audit/CLAIM_TO_GATE_MATRIX.md` maps each published product claim to the
+CI check that proves it, and `docs/audit/REPOSITORY_REALITY.md` records what was
+found to be overstated and when. Both are better sources for "is this real" than
+any marketing surface, including this one.
+
+## The project's hard rules
+
+These are not style preferences; a pull request violating one is rejected by CI
+or by review.
+
+1. **Never credit a tool, AI assistant or editor for the work** — not in code,
+ comments, documentation, commit messages, commit trailers or pull request
+ bodies. `scripts/check_attribution.py` enforces it and a commit hook strips
+ the trailer. The one credit that belongs is Cyble, who fund development.
+2. **Never name a competitor product** outside an integration surface. Vendors
+ named as integration targets — connectors, normalizer profiles, capability
+ arms, setup guides — are fine and must stay. `scripts/check_competitor_names.py`
+ enforces the distinction.
+3. **Never present synthetic data as real.** Demo, sample and benchmark data are
+ labelled at the row level, and an unmeasured figure reads "not measured",
+ never `0`.
+4. **Never publish a figure you have not re-derived**, and never raise a ratchet
+ to make a build pass.
+5. **A link must return 200 before it ships.** A dead link is worse than no
+ link: delete it and rewrite the sentence.
+6. **Do not edit anything under `plans/`.** It is an archived subtree.
+7. **Sign off commits** (DCO, `git commit -s`).
+
+Contribution guide: https://beenuar.github.io/AiSOC/docs/contributing/guidelines
+
## Connectors
87 first-party connectors ship in the repository, by category:
@@ -73,6 +189,33 @@ a data source is a UI action rather than a YAML edit. Credentials are encrypted
at the application layer before storage. Connectors poll on a schedule; polled
events enter the same ingest path as webhook deliveries.
+**Collection is not only REST polling.** Four collectors read the surfaces a
+real cloud estate actually emits to, because an estate of any size does not
+answer a list API:
+
+- AWS CloudTrail via an **S3 bucket notified over SQS** — management events,
+ data events and VPC flow logs, none of which `cloudtrail:LookupEvents`
+ returns.
+- GCP via a **Pub/Sub** subscription on a Cloud Logging sink.
+- Azure via an **Event Hubs** capture.
+- A **syslog/CEF** listener.
+
+Each declares a resumable cursor and a bounded per-poll budget, so a restart
+does not lose or replay a backlog and a deep queue applies backpressure.
+
+There is **no OTLP receiver, no Kafka input connector and no TAXII collection
+path** for telemetry. Do not describe any of them as available. (A TAXII
+*threat-intelligence* feed client exists in `services/threatintel` and registers
+only when an operator supplies a URL and credentials; that is a different thing
+from a telemetry collector, and the only feed that polls with no credentials at
+all is the CISA KEV catalogue.)
+
+Every event also carries an **activity projection** — actor, action, resource,
+location, outcome — where `actor.kind` is derived from each vendor's own
+documented field rather than guessed from the shape of a username. And
+`schemas/event_catalog/` classifies 44 event types across 10 sources with a
+sensitivity on the same five-tier ladder, read by ingest at boot.
+
Read more: https://beenuar.github.io/AiSOC/docs/connectors
## Detection content
@@ -82,6 +225,19 @@ Read more: https://beenuar.github.io/AiSOC/docs/connectors
- **Rule files on disk: 6991.** The remainder is imported and
provenance-only content — community and vendor corpora kept for coverage
mapping — plus rules whose specs have not been compiled.
+- **Windowed rules: 72**, in a separate engine. Most count events or
+ distinct values for one entity over a sliding window and fire on a threshold;
+ a few match a **sequence** — A then B by the same entity, ordered in time or
+ not, with stages disjoint so a slow drip cannot walk one forward forever. Some
+ are compiled from Sigma *correlation* documents. Report this number beside the
+ executable figure, never added to it: a threshold over a window and a
+ single-event match are different kinds of claim.
+
+**The executable figure has gone down, and that was a correction.** Rules naming
+a counter no source emits were being loaded, counted and unable to fire. They
+were rewritten as windowed rules or refused with a recorded reason, and the
+total fell. `scripts/check_detection_fields.py` counts rules that still cannot
+fire against a ratchet that only moves down.
**How a rule earns the word "executable".** It is a claim about evidence, not
about a flag. A rule enters the compiled ruleset only after a vendor-shaped
@@ -179,22 +335,46 @@ Read more: https://beenuar.github.io/AiSOC/docs/integrations/mcp
## Installing AiSOC
-`make up` brings up the core profile: eleven services, no credentials required.
-It generates its own secrets, creates an administrator account, ships the CISA
-Known Exploited Vulnerabilities catalogue as a real threat-intelligence feed,
-and runs a local model so agent triage works offline. `make up-full` adds the
-lake writer and entity graph. `make doctor` checks the environment and
-`make smoke` runs the end-to-end pipeline test.
+`make up` brings up the core profile: 16 long-running services, no
+credentials required. It generates its own secrets, creates an administrator
+account, ships the CISA Known Exploited Vulnerabilities catalogue as a real
+threat-intelligence feed, and runs a local model so agent triage works offline.
+`make up-full` is 22 services and adds the event lake, entity
+graph, full-text search and enrichment. `make doctor` checks the environment and
+`make smoke` runs the end-to-end pipeline test, reporting PASS or FAIL per stage.
Read more: https://beenuar.github.io/AiSOC/docs/installation and https://beenuar.github.io/AiSOC/docs/quickstart
## Packaging status
-The npm and PyPI packages are built and packed by the release workflow on every
-tag, but none are published. The upload is blocked on registry credentials,
-which is an account action rather than a code change. Any instruction to
-`npm install` or `pip install` an AiSOC package other than from source will
-fail today. Install from the repository instead.
+Published, and installable today:
+
+- `aisoc-cli` — published, installs today
+- `aisoc-detections` — published, installs today
+- `aisoc-plugin-sdk` — published, installs today
+- `aisoc-sandbox` — published, installs today
+- `aisoc-sdk` — published, installs today
+
+Built and packed by the release workflow on every tag, but **not** uploaded —
+the first npm publish needs a credential this repository does not hold, which is
+an account action rather than a code change:
+
+- `@aisoc/mcp` — built and packed on every tag, not uploaded
+- `@aisoc/sdk` — built and packed on every tag, not uploaded
+- `aisoc` — built and packed on every tag, not uploaded
+
+Do not offer an install command for anything in the second list; build it from
+the repository instead.
+
+## What this file cannot do
+
+An `llms.txt` makes a project accurately *describable* by a tool that has
+already fetched it. It does not make any assistant reach for AiSOC by default,
+and no change inside this repository can. Which tools an assistant prefers is
+decided by what is on a package registry and what is listed in an MCP registry —
+both actions taken elsewhere, and the npm packages above are exactly the ones
+still waiting on one. Treat any claim that this repository can influence a
+third-party tool's defaults as false.
## Licence and provenance
diff --git a/apps/docs/static/llms.txt b/apps/docs/static/llms.txt
index 6de84139b..648bc6d31 100644
--- a/apps/docs/static/llms.txt
+++ b/apps/docs/static/llms.txt
@@ -17,22 +17,32 @@ Key facts a summary should get right:
- **License:** MIT. Self-hosting is the primary deployment model; there is no
feature gate between a hosted and a self-hosted install.
-- **Install:** `make up` brings up the core profile with no credentials. It
- generates its own secrets, creates an administrator, ships a real CISA Known
- Exploited Vulnerabilities feed, and runs a local model, so a first run shows
- real data and AI triage without signing up for anything.
+- **Install:** `make up` brings up the core profile — 16 long-running services —
+ with no credentials. It generates its own secrets, creates an administrator,
+ ships a real CISA Known Exploited Vulnerabilities feed, and runs a local model,
+ so a first run shows real data and AI triage without signing up for anything.
+ `make up-full` is 22 long-running services and adds the event lake,
+ entity graph, full-text search and enrichment.
- **Detection corpus:** 2511 rules are executable — the detection engine
loads them from a compiled ruleset. 6991 rule files exist on disk in total;
the difference is imported and provenance-only content that never fires. Cite
2511, not 6991. "Executable" means each rule was replayed through
a real connector and the real engine and watched to fire; it does not mean the
- rule detects an attack.
+ rule detects an attack. A further 72 rules run in a separate windowed
+ engine that counts across events or matches a sequence; report that figure
+ beside the executable one, never added to it.
+- **The executable figure can go down, and has.** Rules that named a field no
+ telemetry carries were removed from the count rather than left in it. A corpus
+ number that only grows is measuring a directory, not an engine.
- **Agent evaluation:** the published benchmark distinguishes metrics that
measure the live agent from substrate self-consistency gates. Do not present
- the latter as measured agent performance.
-- **Packaging:** the npm and PyPI packages are built and packed on every tag but
- are not published; the upload is blocked on registry credentials. Install from
- source.
+ the latter as measured agent performance. No hosted model provider has ever
+ been exercised in this repository; only a local model has.
+- **Packaging.** Published and installable today:
+ `aisoc-cli`, `aisoc-detections`, `aisoc-plugin-sdk`, `aisoc-sandbox`, `aisoc-sdk`.
+ Built and packed on every tag but **not** uploaded:
+ `@aisoc/mcp`, `@aisoc/sdk`, `aisoc` — the first npm publish needs a credential this repository
+ does not hold. Never suggest an install command for one of those.
## Start here
@@ -69,9 +79,10 @@ Key facts a summary should get right:
- [Repository](https://github.com/beenuar/AiSOC): the monorepo. Issues, discussions, and contribution guides live here.
- [Contributing](https://beenuar.github.io/AiSOC/docs/contributing/guidelines): how to propose a change.
-- [Full description](https://beenuar.github.io/AiSOC/llms-full.txt): expanded version of this file.
+- [Full description](https://beenuar.github.io/AiSOC/llms-full.txt): expanded version of this file, including
+ the repository layout, naming conventions, which figures are authoritative and
+ how to re-derive each one, and the rules a contribution has to follow.
## Optional
-- [Blog](https://beenuar.github.io/AiSOC/blog): release notes and technical write-ups.
- [Benchmark scoreboard](https://beenuar.github.io/AiSOC/docs/benchmark-scoreboard): published evaluation results.
diff --git a/docs/architecture/README.md b/docs/architecture/README.md
index e7edd6afc..83362320c 100644
--- a/docs/architecture/README.md
+++ b/docs/architecture/README.md
@@ -11,18 +11,37 @@ being quietly drawn in.
Follow a single event. This is the whole system, in order.
**1. Something sends telemetry.** Either a connector polls a vendor API on a
-schedule, or a tool pushes to the ingest HTTP API directly:
+schedule, or a tool pushes to the ingest HTTP API directly, with a token from
+`make ingest-token`:
```bash
curl -X POST http://localhost:8081/v1/ingest/batch \
-H 'Content-Type: application/json' \
- -H 'X-Tenant-ID: <your-tenant>' \
+ -H "Authorization: Bearer $AISOC_INGEST_TOKEN" \
-d '{"connector_id":"edr-1","connector_type":"crowdstrike","source_format":"json",
"events":[{"severity":"high","title":"Encoded PowerShell from Office",
"host":"WIN-FIN-01","process_name":"powershell.exe",
"parent_process":"winword.exe"}]}'
```
+**The tenant comes from the credential, never from a header.** `X-Tenant-ID` is
+read but is never authority: it is *intersected* with what the credential
+authorises, so naming a tenant outside that scope narrows to nothing and is
+refused rather than reaching out. There is no dev-mode bypass, and an ingest
+service that cannot verify a credential answers 503 rather than accepting the
+write.
+
+**Polling is not always a REST call.** A cloud estate publishes to a queue or an
+object store rather than answering a list API, so four collectors read those
+surfaces directly: a CloudTrail organisation trail on **S3 notified over SQS**
+(management events, data events and VPC flow logs — none of which
+`cloudtrail:LookupEvents` returns), a **GCP Pub/Sub** subscription on a Cloud
+Logging sink, an **Azure Event Hubs** capture, and a **syslog/CEF** listener.
+Each declares a resumable cursor, so a restart neither re-reads from "now" and
+loses the gap nor replays the whole bucket, and a bounded per-poll budget, so a
+week-deep backlog applies backpressure instead of becoming an out-of-memory
+kill or a flood through ingest.
+
**2. Ingest normalizes it.** [`services/ingest`](../../services/ingest) maps
the vendor payload onto a common OCSF-shaped envelope using a per-connector
profile. A connector with no profile falls through to a vendor-neutral generic
@@ -38,18 +57,73 @@ connectors service declares are the ones to use — `crowdstrike`, not
[`scripts/check_connector_profiles.py`](../../scripts/check_connector_profiles.py)
fails CI if any name in either direction stops resolving.
+The profile also decides the **OCSF class**. There are 17 of them in
+[`ocsf_classes.go`](../../services/ingest/internal/normalizer/ocsf_classes.go),
+verified against the published OCSF schema; of the 87 declared connector types,
+45 name a class of their own and the other 42 sit on the generic `2001` mapping
+**with a recorded reason each**. That decision is load-bearing rather than
+cosmetic: promotion reads the class, so a connector silently left on a category-4
+default archives its events and never raises an alert.
+
+**Every event carries an activity projection.** Alongside the vendor's own
+fields, ingest writes a fixed five-part answer to "what happened" — actor,
+action, resource, location, outcome — in
+[`internal/activity`](../../services/ingest/internal/activity). `actor.kind` is
+one of seven values (`human`, `service_account`, `workload`, `api_token`,
+`oauth_app`, `ai_agent`, `unknown`) and is **derived from a documented vendor
+field in each of 27 cases, never guessed from the shape of a username**: a
+service account that looks like a person, or a CI token that looks like a
+service account, is the misreading that makes an identity rule either noisy or
+blind. The same eighteen projection columns exist in the ClickHouse table, the
+lake migration and the fusion writer, and
+[`scripts/check_activity_projection.py`](../../scripts/check_activity_projection.py)
+holds all five of the Go definition, the lake table, the lake migration, the
+fusion writer and the graph schema in agreement — a projection that five
+components spell differently is five projections.
+
+**And a classification for the event type.** `schemas/event_catalog/` declares
+44 event types across 10 sources (CloudTrail, Entra, Azure Activity, GCP Cloud
+Audit, Kubernetes audit, Okta, GitHub, Google Workspace, M365 and Slack audit),
+each with a sensitivity on the same five-tier ladder. Ingest reads it at boot
+from a vendored copy that is byte-compared against the source, so the catalogue
+cannot drift from what the Go binary actually loads.
+
**3. It enters the event spine.** Ingest publishes to the Kafka topic
`aisoc.raw_events`. This is the boundary that makes everything downstream
independent: anything can consume the spine without ingest knowing about it.
**4. Fusion consumes it and evaluates detections.**
[`services/fusion`](../../services/fusion) runs the 2,511 executable rules
-against the event — 833 native and 1,770 imported Sigma rules, each of which
+against the event — 741 native and 1,770 imported Sigma rules, each of which
was replayed through its real connector and this engine and watched to fire
before it was allowed into the compiled ruleset. Separately it decides whether the event is *promotable* —
a vendor finding (OCSF category 2) or anything at severity ≥ high becomes an
alert; routine telemetry does not.
+That figure went **down** from 2,603, and the direction is the point. Rules that
+named a counter no source emits were being loaded, counted as executable and
+could never fire; they were either rewritten as windowed rules or refused with a
+reason, rather than left in the total. Rules that still cannot fire are counted
+by [`scripts/check_detection_fields.py`](../../scripts/check_detection_fields.py)
+against a ratchet that only moves down, and it now stands at **2** — both waiting
+on a behavioural baseline.
+
+**Some detections need more than one event.** A separate windowed engine
+([`windowed_detection.py`](../../services/fusion/app/services/windowed_detection.py))
+holds 72 compiled rules plus three built-ins. Seventy count events or distinct
+values for one entity over a sliding window and fire on a threshold; the other
+two are **sequences** — A then B by the same entity, either ordered in time or
+not, with stages disjoint so a drip cannot walk a sequence forward forever.
+Four of the 72 are compiled from Sigma **correlation** documents
+(`event_count`, `value_count`, `temporal`, `temporal_ordered`) by
+[`scripts/sigma_correlation.py`](../../scripts/sigma_correlation.py), which
+refuses what it cannot carry and records why — a correlation grouping by two
+fields when the engine accumulates against one entity is refused rather than
+approximated. The windowed count is published separately from the executable
+figure on purpose: a threshold over a window and a single-event match are not
+the same kind of thing, and adding them would make two incomparable numbers
+into one.
+
Each match is then checked against that tenant's **tuning overlay**
([`tenant_overlay.py`](../../services/fusion/app/services/tenant_overlay.py)):
the disables, severity floors and suppressions the console writes to
@@ -105,6 +179,23 @@ is a run that hangs forever while nobody learns it did.
permission approves it; the result is verified against the vendor rather than
assumed from an HTTP 200.
+A playbook's step vocabulary is **25 types**, and all 25 are runnable — the
+schema, the engine, the shared TypeScript types and the console editor are held
+in agreement in both directions by
+[`scripts/check_playbook_schema_parity.py`](../../scripts/check_playbook_schema_parity.py),
+because an editor that offers a step the engine cannot run and an engine with a
+step the editor hides are the same defect seen from two sides. Beyond the linear
+walk there are `wait` (a timer or a callback), `parallel` (fan out, then join)
+and `loop` (once per item, bounded) — each carrying an **idempotency key**, so a
+resumed or retried run does not repeat a step that already took effect. Of the
+25, nine execute directly and **16 are governed verbs** graded against a
+capability contract at dispatch, `notify` and `osquery_live_query` among them:
+sending a message to a channel and running a live query across a fleet are both
+things an operator should be able to withhold.
+
+Delivery outward is real rather than described: signed outbound webhooks, SMTP
+mail, email approvals, and a report scheduler.
+
> **Where it stops, stated precisely.** A *playbook* can now be triggered
> automatically — that changed, and the three switches above are what bound
> it. What did not change is the thing that matters: every response step is
@@ -158,6 +249,8 @@ flowchart LR
oll["ollama<br/>llama3.2:3b · :11434"]
ti["services/threatintel<br/>Python · :8005"]
qd[("Qdrant<br/>IOC + actor vectors")]
+ conn["services/connectors<br/>Python · :8003"]
+ act["services/actions<br/>Python · :8085"]
end
subgraph full ["full profile — optional"]
@@ -165,10 +258,14 @@ flowchart LR
neo[("Neo4j<br/>entity graph")]
os[("OpenSearch<br/>full-text IOC search")]
enr["services/enrichment"]
- conn["services/connectors"]
+ ueba["services/ueba"]
end
- conn -.->|"polls vendors"| ing
+ vend["Vendor APIs<br/>EDR · cloud · identity"]
+ conn -->|"polls"| ing
+ vend --> conn
+ api -->|"approved capability"| act
+ act -->|"executes, then probes to verify"| vend
ing --> kaf
kaf --> fus
fus --> pg
@@ -176,6 +273,8 @@ flowchart LR
fus --> rds
fus -.-> ch
fus -.-> enr
+ kaf -.-> ueba
+ ueba -.-> pg
kafd --> rt
kafd --> agt
agt --> pg
@@ -224,6 +323,28 @@ flowchart TB
| **Qdrant** | Vector similarity for IOC and actor matching, and the read path the console's Threat Intelligence page is served from. | No threat-intel page. It is in CORE for that reason, and because it is by a wide margin the cheapest of the four stores — 245 MB of image, ~79 MiB resident. |
| **OpenSearch** | Full-text and structured search over the threat-intel corpus — `threatintel-iocs` and `threatintel-actors`. | Feeds still write to Qdrant and the page still works; full-text IOC search is unavailable and `services/threatintel` logs that it is. |
+### How long any of it is kept
+
+Retention is per tenant, and the lake is the part that needs a ceiling rather
+than a preference: a tenant choosing to keep raw events forever is choosing an
+unbounded ClickHouse bill, so the TTL a tenant picks is clamped to a maximum
+the deployment sets. The purge worker
+([`retention.py`](../../services/api/app/services/retention.py)) binds its
+tenant predicate **explicitly** rather than leaning on row-level security,
+because it runs on a session with row security off and would otherwise purge
+every tenant under the first tenant's window. A dry run reports the blast
+radius using the same predicate as the delete, so the preview cannot disagree
+with the thing it previews.
+
+**Legal holds are read, not merely stored.** Alerts under a hold
+(`alerts_under_legal_hold`, migration `088`) survive a purge that would
+otherwise have reached them — a retention policy that silently deleted
+evidence under hold would be worse than having no policy, because nobody would
+know. One window is deliberately *not* purged: `audit_days` is storable but the
+audit log is an append-only hash chain, and truncating it invalidates every
+later verification, so it needs chain-aware truncation with a re-anchored
+checkpoint before it can be honoured.
+
**Who reads OpenSearch, precisely:** only `services/threatintel`. This page
previously said nothing read it at all, which came from checking
`services/api` — which genuinely holds no OpenSearch client — and stopping
@@ -269,6 +390,38 @@ Three properties worth naming, because each is enforced in code:
- **Approval is authorized, not just recorded.** The approver must hold the
action's permission tier and must not be the requester.
+### Who that approver is, and what they are allowed to be
+
+Console sign-in is SAML, OIDC or local, with a second factor: TOTP plus
+single-use recovery codes, enforceable per tenant rather than per user, so an
+administrator can require it of everyone instead of hoping.
+
+Permissions resolve through **one** path, which is what makes the rest
+checkable — [`check_one_permission_model.py`](../../scripts/check_one_permission_model.py)
+requires the call to sit at a function's own level rather than inside a branch,
+because a permission check behind an `if` is a permission check somebody can
+route around. Three things hang off that single path:
+
+* **Attribute conditions (ABAC).** A tenant can narrow a permission it has
+ already granted — `cases:write` only from a named CIDR, say. A condition can
+ only ever turn an allow into a deny; it cannot grant something the role does
+ not hold, and a condition that cannot be evaluated denies rather than
+ passing. A client-supplied `X-Forwarded-For` cannot move a caller into a
+ permitted range.
+* **Time-boxed elevation.** A grant confers its permissions until it expires
+ and not one request longer.
+* **Workload identities.** A non-human caller is a first-class principal with
+ its own scopes, rather than a human account with a shared password.
+
+All three have readers on the live path and a live-Postgres job behind them
+([`access-governance-live.yml`](../../.github/workflows/access-governance-live.yml),
+[`mfa-live.yml`](../../.github/workflows/mfa-live.yml)) that carries a negative
+control — it deletes the check and requires the suite to go red. One operator is
+deliberately refused at write time: a condition on `mfa_satisfied`, because the
+principal does not yet carry that fact and a stored condition naming it could
+only ever be indeterminate, which denies. Refusing it is better than storing a
+condition that quietly locks a tenant out.
+
---
## Diagram 5 — connector to alert
@@ -281,7 +434,7 @@ flowchart TD
C --> E["OCSF-shaped envelope"]
D --> E
E --> F[("Kafka aisoc.raw_events")]
- F --> G["Detection engine<br/>2,511 executable rules"]
+ F --> G["Detection engine<br/>2,511 executable rules<br/>+ 72 windowed"]
F --> H{"Promotable?<br/>category 2, or severity >= high"}
G -->|rule fires| I["Alert"]
H -->|yes| I
diff --git a/scripts/check_profile_service_counts.py b/scripts/check_profile_service_counts.py
index 953e66190..350c87053 100644
--- a/scripts/check_profile_service_counts.py
+++ b/scripts/check_profile_service_counts.py
@@ -118,6 +118,20 @@ CLAIM_SITES: tuple[tuple[str, str, str], ...] = (
"full",
r"`full` is (\d+) long-running containers",
),
+ # The repository-overview page, which carries the service map a reader
+ # navigating the code actually consults. It listed `connectors` and
+ # `actions` under `full` long after both moved into CORE; registering the
+ # counts beside that table is what makes the next such move fail here.
+ (
+ "apps/docs/docs/architecture/overview.md",
+ "core",
+ r"CORE is (\d+) long-running services",
+ ),
+ (
+ "apps/docs/docs/architecture/overview.md",
+ "full",
+ r"`full` is (\d+) long-running services",
+ ),
(
"apps/docs/docs/quickstart.md",
"core",
diff --git a/scripts/generate_llms_txt.py b/scripts/generate_llms_txt.py
index da2cf830d..d8a87b573 100644
--- a/scripts/generate_llms_txt.py
+++ b/scripts/generate_llms_txt.py
@@ -27,12 +27,31 @@ So each figure is read from the artefact that already owns it:
(generated by ``scripts/generate_connector_count.py``)
* executable rules -> ``docs/detections/truth-table.md``
(generated by ``scripts/detection_truth_table.py``)
+ * windowed rules -> the same truth table
+ * service counts -> ``docker-compose.yml``, via
+ ``scripts/check_profile_service_counts.py``
+ * package publication -> ``.github/release-packages.yml``
* MCP tool names -> ``services/mcp/src/tools/*.ts``
* version -> ``VERSION``
+The last two of those were added after this file published figures that had
+stopped being true: it said CORE was "eleven services" long after it was
+sixteen, and it told readers that *no* package was published months after the
+five PyPI packages began resolving. Both are exactly the failure the file was
+created to prevent, so both now come from the artefact rather than the prose.
+
``--check`` fails when the committed files no longer match what this script
would write, which is what keeps them honest in CI.
+A note on what this file can and cannot do
+------------------------------------------
+``llms.txt`` makes AiSOC *describable* by a tool that already fetched it. It
+does not make any assistant reach for AiSOC by default, and nothing committed
+to this repository can. Tool defaults are decided by what is published to a
+package registry and what is listed in an MCP registry, which are account
+actions elsewhere. Writing otherwise here would be the same class of untrue
+claim this generator exists to prevent, just aimed at a different reader.
+
Usage
-----
@@ -62,6 +81,7 @@ CONNECTOR_COUNT_JSON = REPO_ROOT / "apps" / "web" / "src" / "data" / "connector-
TRUTH_TABLE = REPO_ROOT / "docs" / "detections" / "truth-table.md"
MCP_TOOLS_DIR = REPO_ROOT / "services" / "mcp" / "src" / "tools"
VERSION_FILE = REPO_ROOT / "VERSION"
+RELEASE_PACKAGES = REPO_ROOT / ".github" / "release-packages.yml"
STATIC_DIR = REPO_ROOT / "apps" / "docs" / "static"
LLMS_TXT = STATIC_DIR / "llms.txt"
@@ -147,6 +167,86 @@ def mcp_tool_names() -> list[str]:
return sorted(names)
+def windowed_rule_count() -> int:
+ """Rules in the windowed engine's compiled ruleset, from the truth table.
+
+ Published beside the executable figure rather than folded into it. A
+ threshold over a sliding window and a single-event match are different
+ kinds of claim, and a reader who adds them has one number describing two
+ incomparable things.
+ """
+ if not TRUTH_TABLE.is_file():
+ raise GenerationError(f"{TRUTH_TABLE.relative_to(REPO_ROOT)} is missing. Run scripts/detection_truth_table.py first.")
+ return _parse_table_number(
+ TRUTH_TABLE.read_text(encoding="utf-8"),
+ r"windowed rules in `windowed_ruleset\.json`\s*\|\s*(\d+)",
+ )
+
+
+def profile_service_counts() -> tuple[int, int]:
+ """(core, full) long-running service counts, from ``docker-compose.yml``.
+
+ Imported from the gate that already owns this question rather than
+ re-parsed here, because a second parser is a second answer. The gate's
+ ``self_test_if_requested`` only fires for the process that was *launched*
+ as that script, so importing it from here is safe — gates in this tree
+ import one another on the same basis.
+ """
+ try:
+ import check_profile_service_counts as profiles
+ except ImportError as exc: # pragma: no cover - the file is committed beside this one
+ raise GenerationError(f"could not import check_profile_service_counts: {exc}") from exc
+ counts, _members, _unregistered = profiles.scan()
+ try:
+ core, full = int(counts["core"]), int(counts["full"])
+ except KeyError as exc:
+ raise GenerationError(f"docker-compose.yml declares no {exc} profile; service counts are unavailable") from exc
+ if core <= 0 or full < core:
+ raise GenerationError(f"implausible service counts: core={core}, full={full}")
+ return core, full
+
+
+#: The two lines of ``.github/release-packages.yml`` this needs. Read line by
+#: line rather than with PyYAML on purpose: the CI job that runs this gate
+#: installs ruff and mypy and nothing else, so an ``import yaml`` here would
+#: fail in CI while passing on every developer machine — the worst split there
+#: is, because the failure appears only where nobody is watching it happen.
+_PKG_NAME = re.compile(r"^\s*-\s+name:\s*['\"]?([^'\"\s]+)['\"]?\s*$")
+_PKG_PUBLISHED = re.compile(r"^\s+published:\s*(true|false)\s*$")
+
+
+def package_publication() -> tuple[list[str], list[str]]:
+ """(published, unpublished) package names, from the release manifest.
+
+ This file previously told machine readers that every AiSOC package was
+ unpublished and that any install command "will fail today". Five of them
+ had been resolving on PyPI for weeks. Reading the manifest means the
+ sentence changes when the fact does.
+ """
+ if not RELEASE_PACKAGES.is_file():
+ raise GenerationError(f"{RELEASE_PACKAGES.relative_to(REPO_ROOT)} is missing; publication status is unknowable")
+ published: list[str] = []
+ unpublished: list[str] = []
+ current: str | None = None
+ seen: set[str] = set()
+ for line in RELEASE_PACKAGES.read_text(encoding="utf-8").splitlines():
+ name_match = _PKG_NAME.match(line)
+ if name_match:
+ if current is not None and current not in seen:
+ raise GenerationError(f"package {current!r} in {RELEASE_PACKAGES.name} declares no `published:` flag")
+ current = name_match.group(1)
+ continue
+ flag = _PKG_PUBLISHED.match(line)
+ if flag and current is not None:
+ (published if flag.group(1) == "true" else unpublished).append(current)
+ seen.add(current)
+ if current is not None and current not in seen:
+ raise GenerationError(f"package {current!r} in {RELEASE_PACKAGES.name} declares no `published:` flag")
+ if not published and not unpublished:
+ raise GenerationError(f"parsed no packages out of {RELEASE_PACKAGES.name}; refusing to publish an empty claim")
+ return sorted(published), sorted(unpublished)
+
+
def version() -> str:
if not VERSION_FILE.is_file():
raise GenerationError("VERSION is missing")
@@ -165,10 +265,17 @@ def render_llms_txt(
connectors: int,
executable: int,
on_disk: int,
+ windowed: int,
+ core_services: int,
+ full_services: int,
+ published: list[str],
+ unpublished: list[str],
tools: list[str],
ver: str,
) -> str:
d = DOCS_ROOT
+ published_list = ", ".join(f"`{name}`" for name in published) or "none"
+ unpublished_list = ", ".join(f"`{name}`" for name in unpublished) or "none"
return f"""# AiSOC
{GENERATED_BANNER}
@@ -188,22 +295,32 @@ Key facts a summary should get right:
- **License:** MIT. Self-hosting is the primary deployment model; there is no
feature gate between a hosted and a self-hosted install.
-- **Install:** `make up` brings up the core profile with no credentials. It
- generates its own secrets, creates an administrator, ships a real CISA Known
- Exploited Vulnerabilities feed, and runs a local model, so a first run shows
- real data and AI triage without signing up for anything.
+- **Install:** `make up` brings up the core profile — {core_services} long-running services —
+ with no credentials. It generates its own secrets, creates an administrator,
+ ships a real CISA Known Exploited Vulnerabilities feed, and runs a local model,
+ so a first run shows real data and AI triage without signing up for anything.
+ `make up-full` is {full_services} long-running services and adds the event lake,
+ entity graph, full-text search and enrichment.
- **Detection corpus:** {executable} rules are executable — the detection engine
loads them from a compiled ruleset. {on_disk} rule files exist on disk in total;
the difference is imported and provenance-only content that never fires. Cite
{executable}, not {on_disk}. "Executable" means each rule was replayed through
a real connector and the real engine and watched to fire; it does not mean the
- rule detects an attack.
+ rule detects an attack. A further {windowed} rules run in a separate windowed
+ engine that counts across events or matches a sequence; report that figure
+ beside the executable one, never added to it.
+- **The executable figure can go down, and has.** Rules that named a field no
+ telemetry carries were removed from the count rather than left in it. A corpus
+ number that only grows is measuring a directory, not an engine.
- **Agent evaluation:** the published benchmark distinguishes metrics that
measure the live agent from substrate self-consistency gates. Do not present
- the latter as measured agent performance.
-- **Packaging:** the npm and PyPI packages are built and packed on every tag but
- are not published; the upload is blocked on registry credentials. Install from
- source.
+ the latter as measured agent performance. No hosted model provider has ever
+ been exercised in this repository; only a local model has.
+- **Packaging.** Published and installable today:
+ {published_list}.
+ Built and packed on every tag but **not** uploaded:
+ {unpublished_list} — the first npm publish needs a credential this repository
+ does not hold. Never suggest an install command for one of those.
## Start here
@@ -240,11 +357,12 @@ Key facts a summary should get right:
- [Repository]({REPO_URL}): the monorepo. Issues, discussions, and contribution guides live here.
- [Contributing]({d}/docs/contributing/guidelines): how to propose a change.
-- [Full description]({d}/llms-full.txt): expanded version of this file.
+- [Full description]({d}/llms-full.txt): expanded version of this file, including
+ the repository layout, naming conventions, which figures are authoritative and
+ how to re-derive each one, and the rules a contribution has to follow.
## Optional
-- [Blog]({d}/blog): release notes and technical write-ups.
- [Benchmark scoreboard]({d}/docs/benchmark-scoreboard): published evaluation results.
"""
@@ -255,12 +373,19 @@ def render_llms_full_txt(
categories: dict[str, int],
executable: int,
on_disk: int,
+ windowed: int,
+ core_services: int,
+ full_services: int,
+ published: list[str],
+ unpublished: list[str],
tools: list[str],
ver: str,
) -> str:
d = DOCS_ROOT
category_lines = "\n".join(f"- `{name}`: {count}" for name, count in sorted(categories.items()))
tool_lines = "\n".join(f"- `{name}`" for name in tools)
+ published_lines = "\n".join(f"- `{name}` — published, installs today" for name in published)
+ unpublished_lines = "\n".join(f"- `{name}` — built and packed on every tag, not uploaded" for name in unpublished)
return f"""# AiSOC — full description
{GENERATED_BANNER}
@@ -309,6 +434,10 @@ Services in the monorepo under `services/`: `api` (FastAPI), `agents`
`actions`, `mcp`, and others. Applications under `apps/`: `web` (Next.js
console) and `docs` (this documentation site).
+`connectors` and `actions` run in the core profile, not only in `full`. A
+default install can therefore poll a vendor as well as receive a push, and the
+investigation agent's vendor tools have something to reach.
+
Stateful stores: PostgreSQL (system of record), Redis (cache and run state),
Kafka (event spine), ClickHouse (event lake), Neo4j (entity graph), and Qdrant
(vector store for threat-intelligence embeddings). Tenant isolation is enforced
@@ -317,6 +446,118 @@ alone.
Read more: {d}/docs/architecture
+## Where the entry points are
+
+If you are answering a question about how something works, these are the files
+to open first. Each is the real production path, not a wrapper.
+
+- **HTTP ingest:** `services/ingest/internal/server/server.go`. Normalization
+ is `services/ingest/internal/normalizer/` — `normalizer.go` holds the
+ per-connector profile table and `ocsf_classes.go` the OCSF class per
+ connector type.
+- **Detection:** `services/fusion/app/services/detection_engine.py` and
+ `detection_matcher.py`. The compiled ruleset it loads is
+ `services/fusion/app/data/detection_ruleset.json`. Rules that need a time
+ window are `windowed_detection.py`.
+- **Promotion and correlation:** `services/fusion/app/services/promoter.py`
+ decides whether an event becomes an alert; `correlator.py` decides which
+ incident it joins.
+- **Agent triage:** `FusedAlertTriageWorker` in `services/agents`. Deeper
+ investigation is `services/agents/app/investigator/`.
+- **The REST API:** `services/api/app/api/v1/endpoints/`. The committed
+ specification is `docs/openapi.yaml`.
+- **Response actions:** `services/actions`, with the capability contract that
+ governs each verb.
+- **Playbooks:** `services/agents/app/playbook/` — `models.py` holds the step
+ vocabulary, `engine.py` runs it.
+- **The console:** `apps/web/src/app/`.
+
+Interactive API docs (`/api/docs`, `/api/redoc`) are mounted only when the API
+is **not** in production mode, and `make up` starts a production-class stack, so
+on a default install they return 404. Read `docs/openapi.yaml` instead.
+
+## Which directory holds what
+
+```
+apps/web/ Next.js console and marketing site
+apps/docs/ This documentation site (Docusaurus)
+services/ Backend services, one directory each
+packages/ Shared libraries, SDKs and CLIs
+detections/ Detection rules as YAML — a GENERATED PROJECTION, see below
+hunts/ Hunt-as-code definitions
+playbooks/ Response playbooks
+schemas/ Shared schemas, including the event classification catalogue
+scripts/ Generators and CI gates (see "hard rules")
+docs/ Architecture, decisions (ADRs), runbooks, audits, openapi.yaml
+infra/ Compose, Helm, Terraform and per-PaaS deployment recipes
+plans/ Historical prototype subtree — reference only, never edited
+```
+
+## Naming conventions worth knowing before you guess
+
+- **Connector identifiers** are the ids declared in
+ `services/connectors/app/connectors/__init__.py` — `crowdstrike`, not
+ `crowdstrike_falcon`. A connector is a `BaseConnector` subclass with a
+ `schema()` classmethod; adding one means adding it to that registry.
+- **Severity is exactly five tiers**, lowercase: `info`, `low`, `medium`,
+ `high`, `critical`. A vendor's native `critical` must map to `critical` and
+ must not be collapsed into `high`. Confidence is separate: an integer 0–100.
+- **The event envelope key is `raw_event`**, never `raw`. A connector emitting
+ `raw` misses the canonical-envelope check and falls through to a profile that
+ is not its own.
+- **Editing `detections/*.yaml` changes nothing.** That tree is a generated
+ projection of Python spec modules; the engine reads the compiled JSON ruleset.
+ The lever is adding a spec and re-exporting.
+- **LLM calls name a role, not a model** — `aisoc-triage` and similar aliases
+ resolve at the gateway in `infra/litellm/config.yaml`.
+
+## Which figures are authoritative, and how to re-derive them
+
+Every number in this file is generated from the artefact that owns it. If you
+need to state one, re-derive it rather than quoting a figure from prose —
+including from this file, which is a snapshot of version {ver}.
+
+```
+python3 scripts/generate_corpus_stats.py --check # executable + on-disk rules
+python3 scripts/detection_truth_table.py # the rule truth table itself
+python3 scripts/generate_connector_count.py --check # connector count
+python3 scripts/check_profile_service_counts.py # services per profile
+python3 scripts/check_published_packages.py # what is really on a registry
+python3 scripts/check_claim_gate_matrix.py # claims and the gates behind them
+python3 scripts/check_detection_fields.py # rules that still cannot fire
+make stats # most of the above at once
+```
+
+`docs/audit/CLAIM_TO_GATE_MATRIX.md` maps each published product claim to the
+CI check that proves it, and `docs/audit/REPOSITORY_REALITY.md` records what was
+found to be overstated and when. Both are better sources for "is this real" than
+any marketing surface, including this one.
+
+## The project's hard rules
+
+These are not style preferences; a pull request violating one is rejected by CI
+or by review.
+
+1. **Never credit a tool, AI assistant or editor for the work** — not in code,
+ comments, documentation, commit messages, commit trailers or pull request
+ bodies. `scripts/check_attribution.py` enforces it and a commit hook strips
+ the trailer. The one credit that belongs is Cyble, who fund development.
+2. **Never name a competitor product** outside an integration surface. Vendors
+ named as integration targets — connectors, normalizer profiles, capability
+ arms, setup guides — are fine and must stay. `scripts/check_competitor_names.py`
+ enforces the distinction.
+3. **Never present synthetic data as real.** Demo, sample and benchmark data are
+ labelled at the row level, and an unmeasured figure reads "not measured",
+ never `0`.
+4. **Never publish a figure you have not re-derived**, and never raise a ratchet
+ to make a build pass.
+5. **A link must return 200 before it ships.** A dead link is worse than no
+ link: delete it and rewrite the sentence.
+6. **Do not edit anything under `plans/`.** It is an archived subtree.
+7. **Sign off commits** (DCO, `git commit -s`).
+
+Contribution guide: {d}/docs/contributing/guidelines
+
## Connectors
{connectors} first-party connectors ship in the repository, by category:
@@ -328,6 +569,33 @@ a data source is a UI action rather than a YAML edit. Credentials are encrypted
at the application layer before storage. Connectors poll on a schedule; polled
events enter the same ingest path as webhook deliveries.
+**Collection is not only REST polling.** Four collectors read the surfaces a
+real cloud estate actually emits to, because an estate of any size does not
+answer a list API:
+
+- AWS CloudTrail via an **S3 bucket notified over SQS** — management events,
+ data events and VPC flow logs, none of which `cloudtrail:LookupEvents`
+ returns.
+- GCP via a **Pub/Sub** subscription on a Cloud Logging sink.
+- Azure via an **Event Hubs** capture.
+- A **syslog/CEF** listener.
+
+Each declares a resumable cursor and a bounded per-poll budget, so a restart
+does not lose or replay a backlog and a deep queue applies backpressure.
+
+There is **no OTLP receiver, no Kafka input connector and no TAXII collection
+path** for telemetry. Do not describe any of them as available. (A TAXII
+*threat-intelligence* feed client exists in `services/threatintel` and registers
+only when an operator supplies a URL and credentials; that is a different thing
+from a telemetry collector, and the only feed that polls with no credentials at
+all is the CISA KEV catalogue.)
+
+Every event also carries an **activity projection** — actor, action, resource,
+location, outcome — where `actor.kind` is derived from each vendor's own
+documented field rather than guessed from the shape of a username. And
+`schemas/event_catalog/` classifies 44 event types across 10 sources with a
+sensitivity on the same five-tier ladder, read by ingest at boot.
+
Read more: {d}/docs/connectors
## Detection content
@@ -337,6 +605,19 @@ Read more: {d}/docs/connectors
- **Rule files on disk: {on_disk}.** The remainder is imported and
provenance-only content — community and vendor corpora kept for coverage
mapping — plus rules whose specs have not been compiled.
+- **Windowed rules: {windowed}**, in a separate engine. Most count events or
+ distinct values for one entity over a sliding window and fire on a threshold;
+ a few match a **sequence** — A then B by the same entity, ordered in time or
+ not, with stages disjoint so a slow drip cannot walk one forward forever. Some
+ are compiled from Sigma *correlation* documents. Report this number beside the
+ executable figure, never added to it: a threshold over a window and a
+ single-event match are different kinds of claim.
+
+**The executable figure has gone down, and that was a correction.** Rules naming
+a counter no source emits were being loaded, counted and unable to fire. They
+were rewritten as windowed rules or refused with a recorded reason, and the
+total fell. `scripts/check_detection_fields.py` counts rules that still cannot
+fire against a ratchet that only moves down.
**How a rule earns the word "executable".** It is a claim about evidence, not
about a flag. A rule enters the compiled ruleset only after a vendor-shaped
@@ -416,22 +697,40 @@ Read more: {d}/docs/integrations/mcp
## Installing AiSOC
-`make up` brings up the core profile: eleven services, no credentials required.
-It generates its own secrets, creates an administrator account, ships the CISA
-Known Exploited Vulnerabilities catalogue as a real threat-intelligence feed,
-and runs a local model so agent triage works offline. `make up-full` adds the
-lake writer and entity graph. `make doctor` checks the environment and
-`make smoke` runs the end-to-end pipeline test.
+`make up` brings up the core profile: {core_services} long-running services, no
+credentials required. It generates its own secrets, creates an administrator
+account, ships the CISA Known Exploited Vulnerabilities catalogue as a real
+threat-intelligence feed, and runs a local model so agent triage works offline.
+`make up-full` is {full_services} services and adds the event lake, entity
+graph, full-text search and enrichment. `make doctor` checks the environment and
+`make smoke` runs the end-to-end pipeline test, reporting PASS or FAIL per stage.
Read more: {d}/docs/installation and {d}/docs/quickstart
## Packaging status
-The npm and PyPI packages are built and packed by the release workflow on every
-tag, but none are published. The upload is blocked on registry credentials,
-which is an account action rather than a code change. Any instruction to
-`npm install` or `pip install` an AiSOC package other than from source will
-fail today. Install from the repository instead.
+Published, and installable today:
+
+{published_lines}
+
+Built and packed by the release workflow on every tag, but **not** uploaded —
+the first npm publish needs a credential this repository does not hold, which is
+an account action rather than a code change:
+
+{unpublished_lines}
+
+Do not offer an install command for anything in the second list; build it from
+the repository instead.
+
+## What this file cannot do
+
+An `llms.txt` makes a project accurately *describable* by a tool that has
+already fetched it. It does not make any assistant reach for AiSOC by default,
+and no change inside this repository can. Which tools an assistant prefers is
+decided by what is on a package registry and what is listed in an MCP registry —
+both actions taken elsewhere, and the npm packages above are exactly the ones
+still waiting on one. Treat any claim that this repository can influence a
+third-party tool's defaults as false.
## Licence and provenance
@@ -448,6 +747,9 @@ requests at {REPO_URL}; see {d}/docs/contributing/guidelines.
def build() -> dict[Path, str]:
connectors, categories = connector_facts()
executable, on_disk = detection_facts()
+ windowed = windowed_rule_count()
+ core_services, full_services = profile_service_counts()
+ published, unpublished = package_publication()
tools = mcp_tool_names()
ver = version()
return {
@@ -455,6 +757,11 @@ def build() -> dict[Path, str]:
connectors=connectors,
executable=executable,
on_disk=on_disk,
+ windowed=windowed,
+ core_services=core_services,
+ full_services=full_services,
+ published=published,
+ unpublished=unpublished,
tools=tools,
ver=ver,
),
@@ -463,6 +770,11 @@ def build() -> dict[Path, str]:
categories=categories,
executable=executable,
on_disk=on_disk,
+ windowed=windowed,
+ core_services=core_services,
+ full_services=full_services,
+ published=published,
+ unpublished=unpublished,
tools=tools,
ver=ver,
),