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: refresh for 800/6113 rule counts, tier UX, and tryaisoc.com demo

Beenu Aroraa0a2f61c9a42
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 10d5d359a..d80d66036 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,128 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
-_No unreleased changes._
+### Honesty + scale pass (P0–P4 of the post-gimmick improvement plan)
+
+This is a "fix the foundations" pass: tighten security defaults, drop
+overclaims, harden CI, fix DX rough edges, scale detection content from
+~200 to 6,913 rules with explicit tiering, and ship a public demo
+hosted on `tryaisoc.com` via Cloudflare Tunnel.
+
+#### Security defaults (P0)
+
+- **GraphQL tenant scoping** (`services/api/app/graphql/`) — every
+ resolver is wrapped with a `tenant_scope` helper, GraphiQL is forced
+ off in production, and a tenant-isolation regression test asserts
+ cross-tenant reads return 0 rows.
+- **Plugin signature gate** (`services/api/app/services/plugin_manager.py`,
+ `packages/plugin-sdk-py/src/aisoc_plugin_sdk/loader.py`,
+ `packages/plugin-sdk-go/aisoc/loader.go`) — Ed25519 signature
+ verification is required before loading any plugin. `PLUGIN_TRUST_MODE`
+ controls policy: `strict` (default, signed only), `permissive` (warn
+ + load), `dev` (skip). Publisher signing flow is documented in
+ `packages/plugin-sdk-py/README.md` and `packages/plugin-sdk-go/README.md`.
+- **`/metrics` and compose hardening** (`docker-compose.yml`,
+ `docker-compose.demo.yml`, `services/api/app/main.py`,
+ `services/api/app/core/security.py`) — service ports bind to
+ `127.0.0.1` by default, the API logs a loud warning if `SECRET_KEY`
+ is unset or default, the `admin` role permissions are corrected to
+ match the documented matrix, and `/metrics` is gated behind
+ `METRICS_TOKEN`.
+
+#### Honesty surface (P1)
+
+- **Fusion pipeline framing** (`services/agents/app/fusion/`,
+ `apps/docs/docs/architecture.md`) — replaced "real fusion pipeline"
+ with the actual scope (rule-based + ML scoring fan-in, no
+ reinforcement learning).
+- **CI cadence wording** (`README.md`, `CONTRIBUTING.md`) — "every
+ commit" → "every push and PR to `main`".
+- **Eval harness honesty** (`scripts/eval/`, `apps/docs/docs/`) —
+ removed "Macro F1" references, reframed the 200-incident synthetic
+ dataset as substrate self-consistency, dropped the hardcoded
+ `SUITES` constant, fixed the broken `--report` flag, and aligned
+ Prophet usage in code and docs.
+
+#### CI gates (P2)
+
+- **No more `|| true`** (`.github/workflows/ci.yml`) — removed every
+ silent failure suppression.
+- **Web Vitest smoke** — `apps/web` ships a Vitest suite covering
+ marketplace filters, detection coverage view, and core layouts.
+- **SDK + service jobs** — added Python pytest + Vitest jobs for
+ `packages/sdk-{py,ts,go}` and `packages/plugin-sdk-{py,go}`, plus
+ pytest jobs for `services/{api,agents,actions,connectors}`.
+- **Detection + playbook validation in CI**
+ (`.github/workflows/validate-detections.yml`,
+ `.github/workflows/check-openapi.yml`) — `validate_detections.py`
+ runs against all 6,913 rules and the OpenAPI spec is regenerated
+ and compared on every PR.
+
+#### DX (P3)
+
+- **`aisoc-doctor` probes fixed** (`tools/aisoc-doctor/`) — checks
+ match the actual ports, env var names, and service URLs.
+- **CLI consistency** (`packages/cli/`, `README.md`,
+ `apps/docs/docs/`) — `npx aisoc` and `aisoc` resolve identically;
+ package names, missing pnpm scripts, and the `mcp` service
+ reference are corrected; branching/tooling and env var names match
+ across docs.
+- **Infra READMEs** — `infra/k8s/`, `infra/helm/`, `infra/terraform/`,
+ `infra/render/`, `infra/fly/`, `infra/railway/`, `infra/coolify/`
+ each have a `README.md` documenting prerequisites, secrets, and
+ invocation.
+
+#### Detection scale + tiering (P4)
+
+- **800 native rules** — added 600 new Sigma-shaped detections across
+ five new spec modules (`scripts/detection_specs_part3_cloud.py`,
+ `_identity.py`, `_endpoint.py`, `_network.py`,
+ `_application.py`), each with `match_when`, MITRE tagging, and
+ auto-generated positive/negative fixtures via
+ `scripts/detection_specs_part3_helpers.py`. Native total:
+ 200 → **800**.
+- **6,113 imported rules with provenance** — wired importers under
+ `tools/detection_import/{sigma,splunk,chronicle,car}_importer.py`
+ for SigmaHQ, Splunk Security Content, Chronicle, and MITRE CAR.
+ Each imported rule is tagged with its source, license, and original
+ ID; rules whose mappings cannot be replayed against AiSOC fixtures
+ are quarantined under `detections/<source>-imports/quarantine/`
+ (~5,937 quarantined, ~6,113 active).
+- **Title → name migration** — imported YAMLs now use the canonical
+ `name:` field instead of `title:`, matching `validate_detections.py`'s
+ required schema. `tools/detection_import/common.py` was updated and
+ 6,113 existing files were migrated in place.
+- **Marketplace tier UX** (`apps/web/src/components/marketplace/MarketplaceView.tsx`,
+ `MarketplaceView.test.tsx`, `marketplace/index.json`,
+ `apps/web/public/marketplace/index.json`,
+ `scripts/build_marketplace.py`) — items now expose a `tier` field
+ (`stable` / `beta` / `imported` / `community`), the marketplace UI
+ defaults to `stable` and shows per-tier counts on filter chips,
+ and `build_marketplace.py` infers tiers from `plugin.yaml` and
+ source paths.
+- **MITRE ATT&CK coverage view** (`apps/web/src/app/(app)/detection/coverage/`,
+ `apps/web/src/lib/mitreTactics.ts`) — new in-app dashboard rendering
+ the coverage matrix from the marketplace index.
+- **Documentation refresh** — updated `README.md`,
+ `apps/docs/docs/intro.md`, `apps/docs/docs/quickstart.md`,
+ `apps/docs/docs/concepts/detections.md`,
+ `apps/docs/docs/contributing/dev-setup.md`,
+ `detections/README.md`, and `.github/workflows/validate-detections.yml`
+ to reflect 800 native + ~6,000 imported (filterable by tier) and
+ drop stale "200+ rules" claims.
+
+#### Public demo on `tryaisoc.com`
+
+- **Cloudflare Tunnel infra** (`infra/cloudflare/`) — `config.yml`,
+ `tunnel.sh`, and a README explaining how to run the demo profile
+ behind `tryaisoc.com` via `cloudflared`.
+- **`make demo-public` target** — boots `docker-compose.demo.yml`
+ (read-only demo profile with seeded incidents) and brings up the
+ Cloudflare tunnel that maps `tryaisoc.com` → `localhost:3000`
+ (web), `api.tryaisoc.com` → `localhost:8000` (API), and
+ `docs.tryaisoc.com` → `localhost:3001` (Docusaurus).
+- **README "Try it live"** — top-of-README link to the public demo
+ with a one-liner for hosting your own.
---
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ced72ce74..f997dce00 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -22,8 +22,9 @@ See [README.md](README.md#development) for detailed setup instructions.
### Code Style
- **TypeScript/JavaScript**: ESLint + Prettier (config in root)
-- **Python**: Black + isort + mypy (config in pyproject.toml)
-- **Go**: gofmt + golangci-lint
+- **Python**: `ruff` for linting and formatting, `mypy` for type checking
+ (config in [`ruff.toml`](ruff.toml) and per-service `pyproject.toml`)
+- **Go**: `gofmt` + `go vet`
### Commit Messages
@@ -51,8 +52,11 @@ re-graded against the public eval harness. The harness lives under
[`services/agents/tests/`](services/agents/tests/).
```bash
-# Generate 200 synthetic incidents and run all four substrate eval suites
-python scripts/run_evals.py --count 200 --report eval_report.json
+# Run all four substrate eval suites against the bundled 200-incident
+# dataset and write a JSON report. The dataset size is fixed by
+# services/agents/tests/eval_data/synthetic_incidents.json — there is no
+# --count flag.
+python scripts/run_evals.py --out eval_report.json
# Or run a single eval axis
pytest services/agents/tests/test_mitre_accuracy.py
@@ -79,9 +83,14 @@ before/after delta in the PR body.
## Submitting a Pull Request
1. Update your branch: `git fetch upstream && git rebase upstream/main`
-2. Run tests: `pnpm test` (frontend) and `poetry run pytest` (Python)
+2. Run tests:
+ - `pnpm --filter @aisoc/web test` (web smoke tests)
+ - `pytest services/<name>/tests/` for any Python service you touched
+ - `( cd services/<name> && go test ./... )` for any Go service you touched
3. Push to your fork: `git push origin feature/my-feature`
-4. Open a PR on GitHub with a clear description of changes
+4. Open a PR on GitHub against `main` with a clear description of changes.
+ CI also runs on `develop` for integration branches; both targets are
+ accepted, but most contributors should target `main`.
## Adding New Connectors
diff --git a/LICENSES.md b/LICENSES.md
new file mode 100644
index 000000000..b25414f44
--- /dev/null
+++ b/LICENSES.md
@@ -0,0 +1,84 @@
+# Third-Party Content Licenses
+
+AiSOC ships under [Apache-2.0](LICENSE). Some content under [`detections/`](detections/) is **imported** from upstream open-source detection corpora and is redistributed under each upstream project's own license. Every imported rule carries a `provenance` block documenting its source, upstream id, commit SHA, and license, so you can always trace a rule back to its origin.
+
+This file is the canonical attribution registry. It is updated automatically when [`tools/detection-import/import.py`](tools/detection-import/import.py) runs.
+
+> ⚠️ **If you redistribute AiSOC's detection corpus** (e.g. ship it as part of a managed-service offering), you are responsible for honoring every upstream license below in your own attribution notices.
+
+---
+
+## Imported detection sources
+
+### SigmaHQ — `detections/sigma-imports/`
+
+| Field | Value |
+|---|---|
+| **Upstream repo** | [SigmaHQ/sigma](https://github.com/SigmaHQ/sigma) |
+| **License** | [Detection Rule License (DRL) 1.1](https://github.com/SigmaHQ/Detection-Rule-License) |
+| **License classification** | Permissive, redistribution-allowed with attribution |
+| **Imported via** | [`tools/detection-import/sigma_importer.py`](tools/detection-import/sigma_importer.py) |
+| **Provenance file** | every rule carries `provenance.source: SigmaHQ/sigma`, `provenance.source_id: <upstream uuid>`, `provenance.source_commit: <sha>` |
+
+DRL-1.1 summary: you may use, modify, and redistribute Sigma rules provided you keep attribution intact. Each imported rule retains its upstream `id` (UUID) inside the `provenance` block.
+
+### MITRE Cyber Analytics Repository (CAR) — `detections/car-imports/`
+
+| Field | Value |
+|---|---|
+| **Upstream repo** | [mitre-attack/car](https://github.com/mitre-attack/car) |
+| **License** | [Apache-2.0](https://github.com/mitre-attack/car/blob/master/LICENSE) |
+| **Imported via** | [`tools/detection-import/car_importer.py`](tools/detection-import/car_importer.py) |
+| **Provenance file** | every rule carries `provenance.source: mitre-attack/car`, `provenance.source_id: CAR-YYYY-MM-NNN`, `provenance.source_commit: <sha>` |
+
+### Splunk Security Content — `detections/splunk-imports/`
+
+| Field | Value |
+|---|---|
+| **Upstream repo** | [splunk/security_content](https://github.com/splunk/security_content) |
+| **License** | [Apache-2.0](https://github.com/splunk/security_content/blob/develop/LICENSE) |
+| **Imported via** | [`tools/detection-import/splunk_importer.py`](tools/detection-import/splunk_importer.py) |
+| **Note** | SPL → Sigma transpile is best-effort. Rules that don't round-trip cleanly are emitted with `enabled: false` and surfaced in [`detections/REVIEW.md`](detections/REVIEW.md). |
+
+### Chronicle Detection Rules — `detections/chronicle-imports/`
+
+| Field | Value |
+|---|---|
+| **Upstream repo** | [chronicle/detection-rules](https://github.com/chronicle/detection-rules) |
+| **License** | [Apache-2.0](https://github.com/chronicle/detection-rules/blob/main/LICENSE) |
+| **Imported via** | [`tools/detection-import/chronicle_importer.py`](tools/detection-import/chronicle_importer.py) |
+| **Note** | YARA-L 2.0 → Sigma conversion covers ~60% of upstream rules cleanly. The hard cases (statistical aggregations, `match` clauses with windowed joins) are deferred and tracked in [`detections/REVIEW.md`](detections/REVIEW.md). |
+
+### Atomic Red Team mappings — `detections/atomic-imports/` (planned)
+
+| Field | Value |
+|---|---|
+| **Upstream repo** | [redcanaryco/atomic-red-team](https://github.com/redcanaryco/atomic-red-team) |
+| **License** | [MIT](https://github.com/redcanaryco/atomic-red-team/blob/master/LICENSE.txt) |
+| **Note** | Used for fixture generation only — atomics are test payloads, not detection logic. We import them to drive purple-team replay, not as standalone rules. |
+
+---
+
+## Native AiSOC content
+
+Everything under `detections/cloud/`, `detections/identity/`, `detections/endpoint/`, `detections/network/`, `detections/application/`, and `detections/data-exfil/` is **native AiSOC content** authored against AiSOC's own normalized event schema. Native rules are licensed under [Apache-2.0](LICENSE) and carry a `provenance.source: native` marker.
+
+`detections/community/` carries community contributions, also under Apache-2.0 with the contributor named in the provenance block.
+
+---
+
+## Plugins
+
+Each plugin under [`plugins/`](plugins/) declares its own license in `plugin.yaml`. Plugins shipped with AiSOC core are MIT or Apache-2.0; community plugins under `plugins/community/` may declare any OSI-approved license.
+
+---
+
+## How to add a new imported source
+
+1. Add an importer to [`tools/detection-import/`](tools/detection-import/) that emits the AiSOC YAML schema with a populated `provenance` block.
+2. Add a section to this file describing the upstream license and any redistribution caveats.
+3. Run `python3 scripts/validate_detections.py` and `pnpm marketplace:build` to confirm the new rules parse and surface.
+
+---
+
+_Last updated by `tools/detection-import/import.py` on first run; subsequent runs only append new sources, never rewrite the file._
diff --git a/MIGRATION.md b/MIGRATION.md
index faf118ac6..6ef03d4b0 100644
--- a/MIGRATION.md
+++ b/MIGRATION.md
@@ -225,8 +225,10 @@ curl -s -X POST http://localhost:8000/graphql \
# Plugin manager loaded?
curl http://localhost:8000/api/v1/plugins | jq .[].id
-# Run the public eval harness (offline, no LLM call required)
-python3 scripts/run_evals.py --count 200 --report eval_report.json
+# Run the public eval harness against the bundled 200-incident dataset
+# (offline, no LLM call required). The dataset size is fixed — there is no
+# --count flag, and the output flag is --out, not --report.
+python3 scripts/run_evals.py --out eval_report.json
```
Expected output:
diff --git a/PROGRESS.md b/PROGRESS.md
index 4cc40d638..1ed54fdc2 100644
--- a/PROGRESS.md
+++ b/PROGRESS.md
@@ -117,7 +117,7 @@ or `pnpm aisoc:lab` for the full lab stack.
| ledger-api | `GET /api/v1/investigations/*` for listing, retrieving, and replaying ledger entries by case | Completed |
| eval-harness-v2 | 200-incident synthetic dataset covering all 14 MITRE tactics + 4 eval gates: alert reduction (real measurement) plus MITRE-tactic / completeness / response-quality substrate self-consistency gates | Completed |
| benchmark-page | Public eval harness page at `/benchmark` (docs + web) with published numbers, full method, comparison to other AI SOC offerings, and explicit "what each suite measures" framing | Completed |
-| ci-eval-gates | `scripts/run_evals.py --ci` wired into `.github/workflows/ci.yml` so every commit is gated on substrate self-consistency + alert-reduction thresholds | Completed |
+| ci-eval-gates | `scripts/run_evals.py --ci` wired into `.github/workflows/ci.yml` so every PR targeting `main` / `develop` is gated on substrate self-consistency + alert-reduction thresholds | Completed |
| responder-pwa | Installable PWA (`apps/web/src/app/(responder)/`) with service worker, offline shell, manifest, icons | Completed |
| passkeys | WebAuthn passkey registration + login for Responder surface (FIDO2 platform authenticators only) | Completed |
| oncall | On-call schedule + handoff (`oncall.py` + Responder home page + alert page badge) | Completed |
diff --git a/README.md b/README.md
index 6ff125a59..1e9af22c4 100644
--- a/README.md
+++ b/README.md
@@ -11,9 +11,9 @@ An open-source, self-hostable AI SOC. The agent's prompts, tool calls, and ratio
[![PRs welcome](https://img.shields.io/badge/PRs-welcome-8b5cf6?style=flat-square)](CONTRIBUTING.md)
[![Version](https://img.shields.io/badge/version-5.2.0-f59e0b?style=flat-square)](CHANGELOG.md)
-[How AiSOC compares](#how-aisoc-compares) · [Public eval harness](apps/docs/docs/benchmark.md) · [Deployment options](#deployment-options) · [Architecture](#architecture) · [Docs](apps/docs/)
+[Live demo](https://tryaisoc.com) · [How AiSOC compares](#how-aisoc-compares) · [Public eval harness](apps/docs/docs/benchmark.md) · [Deployment options](#deployment-options) · [Architecture](#architecture) · [Docs](apps/docs/)
-<sub>AiSOC is fully self-hostable. Follow the [quick start](#quick-start) or pick a [deployment target](#deployment-options) below.</sub>
+<sub>The demo at <a href="https://tryaisoc.com">tryaisoc.com</a> is a self-hosted instance fronted by a Cloudflare Tunnel — when it's reachable, the stack is running locally on a maintainer's box. It can therefore go offline at any time. To run your own (in 3.5 min, with seeded data), see <a href="#one-shot-demo">One-shot demo</a>; to expose your own instance on your own domain via Cloudflare Tunnel, see <a href="#public-demo-on-your-own-domain">Public demo on your own domain</a>.</sub>
</div>
@@ -26,7 +26,7 @@ AiSOC is a single self-hostable stack that ingests security events, correlates t
Three properties distinguish it from closed-source AI SOC vendors:
1. **Agent decisions are logged.** The Investigation Ledger stores the LLM prompt, the response, the evidence cited, and the downstream tool calls for every step of every run. Replays are available later.
-2. **The substrate has a public eval harness in CI.** A 200-incident harness gates every commit. Alert reduction is a real measurement against a fixed noisy stream; the MITRE-tactic, investigation-completeness, and response-quality suites are substrate self-consistency gates over deterministic templates and synthetic data. The [benchmark page](apps/docs/docs/benchmark.md) explains exactly which is which.
+2. **The substrate has a public eval harness in CI.** Four suites gate every PR targeting `main` / `develop`: a 200-incident synthetic dataset drives the MITRE-tactic, investigation-completeness, and response-quality gates, and a separately generated 1,000-alert noisy stream drives the alert-reduction gate. Alert reduction is a real measurement against that fixed stream; the other three are substrate self-consistency gates over deterministic templates. The [benchmark page](apps/docs/docs/benchmark.md) explains exactly which is which.
3. **It runs entirely on your infrastructure.** No callbacks to a vendor cloud and no data exfiltration for "model improvement."
The orchestrator is a ~600-line LangGraph in [`services/agents/`](services/agents/). It is small enough to read end-to-end, swap models in, and patch.
@@ -35,19 +35,19 @@ The orchestrator is a ~600-line LangGraph in [`services/agents/`](services/agent
## How AiSOC compares
-| Capability | AiSOC | Wazuh | Splunk ES | Anvilogic | Prophet Security |
-|---|---|---|---|---|---|
-| Open-source license | MIT | GPL-2 | proprietary | proprietary | proprietary |
-| Self-hostable | yes | yes | enterprise-only | cloud-only | cloud-only |
-| Autonomous AI investigation | LangGraph | no | partial (Splunk AI) | yes | yes |
-| Agent decision audit trail | public Investigation Ledger | n/a | n/a | not published | not published |
-| Public substrate eval harness | CI-gated, reproducible | n/a | n/a | not published | not published |
-| Detection content | 200+ Sigma rules | 1,200+ rules | 1,000+ apps | curated | curated |
-| Plugin SDK | Python / TypeScript / Go | YAML rules only | apps | proprietary | proprietary |
-| Data residency | your infra | your infra | partial | vendor cloud | vendor cloud |
-| Pricing | $0 (self-host) | $0 (self-host) | per ingest GB | enterprise | enterprise |
+| Capability | AiSOC | Wazuh | Splunk ES | Closed-source AI SOC |
+|---|---|---|---|---|
+| Open-source license | MIT | GPL-2 | proprietary | proprietary |
+| Self-hostable | yes | yes | enterprise-only | cloud-only |
+| Autonomous AI investigation | LangGraph | no | partial (Splunk AI) | yes |
+| Agent decision audit trail | public Investigation Ledger | n/a | n/a | not published |
+| Public substrate eval harness | CI-gated, reproducible | n/a | n/a | not published |
+| Detection content | 800 native + 6,000+ imported (Sigma / Splunk / Chronicle / CAR) | 1,200+ rules | 1,000+ apps | curated |
+| Plugin SDK | Python / TypeScript / Go | YAML rules only | apps | proprietary |
+| Data residency | your infra | your infra | partial | vendor cloud |
+| Pricing | $0 (self-host) | $0 (self-host) | per ingest GB | enterprise |
-Closed-source AI SOC vendors (Anvilogic, Prophet, Tines, Dropzone) ship working products. AiSOC's contribution is making the agent itself open, the per-step decision trail readable, and the substrate gated by a public eval harness on every commit.
+Closed-source AI SOC vendors ship working products. AiSOC's contribution is making the agent itself open, the per-step decision trail readable, and the substrate gated by a public eval harness on every PR targeting `main` / `develop`.
---
@@ -335,6 +335,66 @@ When you're done: `pnpm aisoc:demo:down` (deletes the demo volumes).
The full development quick start with all services (UEBA, Honeytokens, Purple Team, ClickHouse, OpenSearch, Neo4j, Qdrant) is below.
+### Public demo on your own domain
+
+The same demo stack can be reached from the public internet without exposing
+ports, opening firewall rules, or paying for a cloud VM. AiSOC ships a
+Cloudflare Tunnel template plus a wrapper script that:
+
+1. Brings up the slim demo profile via `pnpm aisoc:demo --no-open` (Postgres, Redis, Kafka, api, agents, realtime, web).
+2. Creates a named `cloudflared` tunnel (or reuses one if it already exists).
+3. Renders an ingress config from [`infra/cloudflare/config.yml.example`](infra/cloudflare/config.yml.example) into `~/.cloudflared/<tunnel-name>.yml`, after validating it with `cloudflared tunnel ingress validate`.
+4. Adds DNS routes on your zone so the apex (`https://<your-domain>`) and the `api`, `ws`, `docs` subdomains all resolve to the tunnel.
+5. Runs `cloudflared tunnel run` in the foreground (Ctrl+C exits cleanly; the local stack keeps running).
+
+The result: a publicly reachable, fully self-hosted SOC console, served from
+your laptop, accepting only traffic that came in through Cloudflare. No
+inbound ports are opened on your router or firewall.
+
+#### Prerequisites
+
+- A domain whose DNS is managed by Cloudflare.
+- The [`cloudflared`](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/) CLI installed locally (`brew install cloudflared` on macOS).
+- `cloudflared tunnel login` run once on this machine — it drops a `cert.pem` in `~/.cloudflared/` that authorises this host to manage tunnels and DNS records on the zone.
+
+#### Run it
+
+```bash
+# Default: tryaisoc.com (apex → web, api/ws/docs.tryaisoc.com → api/realtime/docs)
+pnpm demo:public
+
+# Or point it at any zone you control:
+DOMAIN=demo.example.com pnpm demo:public
+
+# Already have the local stack running? Just bring the tunnel up:
+pnpm demo:public:tunnel-only
+
+# Just provision the tunnel + DNS, but don't run cloudflared
+# (useful before `cloudflared service install` to leave it running 24/7):
+SKIP_RUN=1 pnpm demo:public:setup
+```
+
+All env vars are forwarded to [`infra/cloudflare/tunnel.sh`](infra/cloudflare/tunnel.sh):
+`DOMAIN` (apex, default `tryaisoc.com`), `TUNNEL_NAME` (default `aisoc-tryaisoc`),
+`SUBDOMAINS` (default `"api ws docs"`), `SKIP_DNS=1` (don't touch DNS records),
+`SKIP_RUN=1` (set up everything but don't run the tunnel).
+Run `bash scripts/demo-public.sh --help` to see the full set, or read
+[`infra/cloudflare/README.md`](infra/cloudflare/README.md) for the topology
+diagram and production-hardening notes (running `cloudflared` as a launchd /
+systemd service, layering Cloudflare Access in front, etc).
+
+#### Stop it
+
+```bash
+# Ctrl-C in the tunnel terminal stops cloudflared.
+# Then bring the local stack down:
+pnpm aisoc:demo:down
+```
+
+The `tryaisoc.com` instance linked at the top of this README is exactly that:
+this script, running from a maintainer's machine. The tunnel infra is
+upstream so anyone can do the same on their own domain.
+
### Full stack (development)
#### Prerequisites
@@ -408,14 +468,17 @@ If any check fails, the doctor tells you exactly what to fix before logging in.
#### 5b. Run the public eval harness (optional)
```bash
-# Generate 200 synthetic incidents and run all four substrate eval suites
-python scripts/run_evals.py --count 200 --report eval_report.json
+# Run all four substrate eval suites against the bundled 200-incident
+# dataset and write a machine-readable report. The dataset size is fixed by
+# services/agents/tests/eval_data/synthetic_incidents.json — there is no
+# --count flag.
+python scripts/run_evals.py --out eval_report.json
# Or run a single eval gate
pytest services/agents/tests/test_mitre_accuracy.py
```
-The harness writes `eval_report.json` and `eval_mitre_accuracy_report.json`, which the [public eval harness page](apps/docs/docs/benchmark.md) renders. The same harness runs in CI on every PR — see [`.github/workflows/ci.yml`](.github/workflows/ci.yml).
+The harness writes `eval_report.json` and `eval_mitre_accuracy_report.json`, which the [public eval harness page](apps/docs/docs/benchmark.md) renders. The same harness runs in CI on every PR targeting `main` / `develop` — see [`.github/workflows/ci.yml`](.github/workflows/ci.yml).
The harness runs deterministic substrate code (extractors, fusion, templates, judges) against synthetic data — it does not call the live LLM agent. Three of the four metrics are substrate self-consistency gates rather than agent accuracy scores. The [benchmark page](apps/docs/docs/benchmark.md) documents what each suite measures and what it does not.
@@ -537,15 +600,21 @@ Interactive docs: `http://localhost:8000/docs` (Swagger) or `http://localhost:80
## Plugin and detection SDK
+The CLI is published as a Python package. Install it with `pipx` (recommended) or `pip`:
+
```bash
+pipx install aisoc-cli # PyPI release
+# or, from the monorepo:
+pip install -e packages/aisoc-cli
+
# Scaffold a new plugin
-npx aisoc-cli scaffold plugin my-connector
+aisoc scaffold plugin my-connector
# Validate a detection rule
-npx aisoc-cli validate detection ./detections/my-rule.yaml
+aisoc validate detection ./detections/my-rule.yaml
# Publish to community registry (Ed25519 signed)
-npx aisoc-cli publish plugin ./my-connector --key ~/.aisoc/signing.key
+aisoc publish plugin ./my-connector --key ~/.aisoc/signing.key
```
SDKs:
diff --git a/apps/docs/docs/benchmark.md b/apps/docs/docs/benchmark.md
index 657fc7409..ebfaf1f31 100644
--- a/apps/docs/docs/benchmark.md
+++ b/apps/docs/docs/benchmark.md
@@ -10,10 +10,12 @@ description: AiSOC's open, deterministic regression harness. 200 synthetic incid
>
> This page is _not_ a leaderboard for AI SOC agents. It is a CI-gated harness
> that exercises the deterministic substrate underneath AiSOC — the keyword
-> extractors, the fusion pipeline, the report and response templates, and the
-> offline judges that grade them. The dataset, the harness, and the CI gate are
-> all in the repo. You can reproduce every number on this page in under
-> 10 seconds on a laptop.
+> extractors, the in-harness fusion grouping (a faithful re-implementation of
+> the production Tier 1/2/3 logic in `services/fusion`, minus the DB-backed
+> dedup and ML scoring), the report and response templates, and the offline
+> judges that grade them. The dataset, the harness, and the CI gate are all in
+> the repo. You can reproduce every number on this page in under 10 seconds on
+> a laptop.
[![MITRE Accuracy](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fbeenuar%2FAiSOC%2Feval-results%2Feval%2Fresults%2Fbadge-mitre.json)](#latest-results)
[![Alert Reduction](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fbeenuar%2FAiSOC%2Feval-results%2Feval%2Fresults%2Fbadge-reduction.json)](#latest-results)
@@ -22,11 +24,14 @@ description: AiSOC's open, deterministic regression harness. 200 synthetic incid
:::warning Read this first
This harness does **not** exercise the live LLM agent (`services/agents`
-LangGraph orchestrator). It runs **deterministic substrate code** against
-**synthetic data** so we can gate every commit in milliseconds. Three of the
-four metrics on this page measure the **internal consistency** of that
-substrate — not agent accuracy. We explain exactly what each suite measures —
-and doesn't — below.
+LangGraph orchestrator), and the `alert_reduction` suite does **not** call the
+production `services/fusion` engine — it calls a standalone re-implementation
+of the same Tier 1/2/3 grouping rules that lives in the test file. It runs
+**deterministic substrate code** against **synthetic data** so we can gate
+every PR targeting `main` / `develop` in milliseconds. Three of the four
+metrics on this page measure the **internal consistency** of that substrate —
+not agent accuracy. We explain exactly what each suite measures — and doesn't
+— below.
:::
## Why this exists
@@ -38,16 +43,19 @@ opposite approach: ship a small harness, label which metrics are real
measurements and which are substrate self-checks, and let anyone reproduce
the numbers.
-1. **The dataset is in the repo** — [`services/agents/tests/eval_data/synthetic_incidents.json`](https://github.com/beenuar/AiSOC/blob/main/services/agents/tests/eval_data/synthetic_incidents.json), 200 cases, deterministic, regenerable.
+1. **The dataset is in the repo** — [`services/agents/tests/eval_data/synthetic_incidents.json`](https://github.com/beenuar/AiSOC/blob/main/services/agents/tests/eval_data/synthetic_incidents.json), 200 cases, deterministic, regenerable. Three of the four suites use it; the alert-reduction suite uses a separately generated 1 000-alert stream produced by `generate_noisy_alert_stream` in the test file.
2. **The harness is in the repo** — four pytest suites under [`services/agents/tests/`](https://github.com/beenuar/AiSOC/tree/main/services/agents/tests).
-3. **The CI gate runs on every commit** — [latest run](https://github.com/beenuar/AiSOC/actions/workflows/ci.yml).
-4. **Historical numbers are queryable** — every successful build pushes its `eval_report.json` to the [`eval-results`](https://github.com/beenuar/AiSOC/tree/eval-results) branch as `eval/results/<commit_sha>.json`.
+3. **The CI gate runs on every PR targeting `main` / `develop`** — [latest run](https://github.com/beenuar/AiSOC/actions/workflows/ci.yml). (CI is currently scoped to those two branches; PRs to long-lived feature branches are not gated.)
+4. **Historical numbers are queryable** — every successful build pushes its report (written by `scripts/run_evals.py --out`) to the [`eval-results`](https://github.com/beenuar/AiSOC/tree/eval-results) branch as `eval/results/<commit_sha>.json`.
## Latest results
-The four numbers below are produced by `scripts/run_evals.py` against the
-200-incident synthetic dataset. They run in roughly 25 milliseconds total (no
-LLM calls, no DB) so they're cheap enough to gate every commit.
+The four numbers below are produced by `scripts/run_evals.py`. The MITRE,
+completeness, and response-quality suites run against the 200-incident
+synthetic dataset; the alert-reduction suite runs against a separately
+generated 1 000-alert noisy stream. The whole run takes roughly 25 ms total
+(no LLM calls, no DB) so it's cheap enough to gate every PR targeting `main`
+or `develop`.
| Suite | Metric | Latest | Target | What it checks |
|--------------------------------|-----------------------|-----------|---------|----------------|
@@ -98,18 +106,23 @@ python3 scripts/run_evals.py --ci --out report.json
A 1 000-alert noisy stream — pure duplicates, near-duplicates within a
30-minute host window, multi-host rule storms, and benign low-score chatter —
-is fed into the **real** fusion pipeline:
+is fed into the in-harness `fuse_alerts` function. That function is a
+deterministic, in-memory re-implementation of the same Tier 1/2/3 grouping
+rules used by the production `services/fusion` engine — minus the
+DB-backed deduplicator and the ML scorer. The grouping logic itself is the
+same:
- **Tier 1** — same `(rule, host, user)` within 10 minutes → 1 incident
- **Tier 2** — same `(rule, host)` within 30 minutes → merge into a Tier-1 incident
- **Tier 3** — same rule within 5 minutes across ≥ 3 hosts → "storm" incident
Incidents below the noise threshold (`score < 0.35`) are dropped. The output is
-whatever the code produces — a fusion regression will move the number. This is
-a legitimate measurement of fusion behavior on a controlled dataset.
+whatever the code produces — a fusion-rule regression will move the number.
+This is a legitimate measurement of grouping behavior on a controlled dataset,
+but it is **not** end-to-end coverage of the production fusion service.
-The reported ~75 % is the actual output of the fusion pipeline on this fixed
-dataset. It is not tuned to match a marketing number.
+The reported ~75 % is the actual output of the in-harness grouping function on
+this fixed dataset. It is not tuned to match a marketing number.
### 2. MITRE ATT&CK tactic accuracy — `Substrate self-consistency`
@@ -182,16 +195,16 @@ references from the synthesizer, or the rubric stops matching) — it is
## Comparison to other AI SOC offerings
-| Capability | AiSOC | Wazuh | Splunk | Anvilogic | Prophet | Dropzone |
-|-----------------------------------------------|:-----:|:-----:|:------:|:---------:|:-------:|:--------:|
-| Open-source (MIT) | yes | yes | no | no | no | no |
-| Self-hostable | yes | yes | yes | no | no | no |
-| Agent decisions step-by-step auditable | yes | n/a | n/a | no | no | no |
-| Public, reproducible regression harness | yes | no | no | no | no | no |
-| Eval dataset shipped in the repo | yes | no | no | no | no | no |
-| Substrate-level regression gate in CI | yes | no | no | no | no | no |
-| Plugin SDK (Python + Go) | yes | yes | yes | partial | no | no |
-| Free | yes | yes | no | no | no | no |
+| Capability | AiSOC | Wazuh | Splunk | Closed-source AI SOC |
+|-----------------------------------------------|:-----:|:-----:|:------:|:---------------------:|
+| Open-source (MIT) | yes | yes | no | no |
+| Self-hostable | yes | yes | yes | no |
+| Agent decisions step-by-step auditable | yes | n/a | n/a | no |
+| Public, reproducible regression harness | yes | no | no | no |
+| Eval dataset shipped in the repo | yes | no | no | no |
+| Substrate-level regression gate in CI | yes | no | no | no |
+| Plugin SDK (Python + Go) | yes | yes | yes | partial |
+| Free | yes | yes | no | no |
A self-hostable, MIT-licensed agent with a published regression harness is
something an auditor or regulated buyer can review directly. Vendor cloud
diff --git a/apps/docs/docs/concepts/detections.md b/apps/docs/docs/concepts/detections.md
index 0b6a41573..ba768c826 100644
--- a/apps/docs/docs/concepts/detections.md
+++ b/apps/docs/docs/concepts/detections.md
@@ -4,121 +4,192 @@ sidebar_position: 3
# Detection Rules
-AiSOC supports multiple rule languages for broad coverage across data sources.
+AiSOC ships detection content in a Sigma-inspired YAML format and arranges it
+into four **tiers** based on origin, the legal redistribution chain, and what
+the AiSOC engine can run as-is.
-## Supported Rule Languages
+## Tiers
-| Language | Backend | Use Case |
-|----------|---------|----------|
-| Sigma (YAML) | OpenSearch / ClickHouse | General-purpose log detection |
-| YARA | File / memory scanning | Malware, suspicious file content |
-| KQL (Kusto) | ClickHouse | Windows event log analytics |
-| EQL (Event Query) | Elastic-compatible | Sequence-based endpoint events |
+| Tier | Where | Default state | What CI enforces |
+| ----------- | ------------------------------------------------------ | ---------------- | -------------------------------------------------------------------- |
+| Native | `detections/<category>/` | enabled | schema + fixture replay (positive matches, negative does not) |
+| Imported | `detections/<source>-imports/<category>/` | source-dependent | schema + populated `provenance` block |
+| Quarantined | `detections/<source>-imports/_quarantine/<category>/` | `enabled: false` | schema + provenance, plus a populated `quarantine_reason` |
+| Community | `detections/community/<category>/` | `enabled: false` | schema only (provenance encouraged) |
-## Rule Format (Sigma / AiSOC YAML)
+The native tier is the strict-quality, AiSOC-authored layer (currently 800
+fixture-tested rules with 1,200 positive/negative fixtures). Imported tiers are
+normalized into the AiSOC schema by
+the source-specific importers under [`tools/detection_import/`](https://github.com/beenuar/AiSOC/blob/main/tools/detection_import/README.md)
+and remain empty in a fresh checkout until you run them.
+
+## Native rule format
+
+Native rules live in `detections/<category>/`. Every rule has a positive
+fixture and a negative fixture under `detections/fixtures/`; both are replayed
+on every PR using the runtime matcher.
```yaml
-id: brute-force-login-001
+id: det-brute-force-login-001
name: Brute-Force Login Attempt
-description: Detects more than 10 failed logins in 5 minutes from the same IP
+description: |
+ Detects 10+ failed logins in 5 minutes from the same source IP.
+version: "1.0.0"
severity: high
-tactics:
- - credential-access
-techniques:
- - T1110
+category: identity
tags:
- - brute-force
- - authentication
+ - mitre.attack.t1110
+ - tlp.white
+log_source:
+ product: auth_logs
detection:
- source: auth_logs
- condition:
- field: event.type
- value: failed_login
- threshold:
- count: 10
- window_seconds: 300
- group_by:
- - source.ip
- - user.name
-response:
- auto_create_case: true
- playbook_id: brute-force-response-v1
+ fields: [event.type, source.ip, user.name]
+ condition: PATTERN_MATCH_ANY({"event.type": "failed_login"})
+false_positives:
+ - Password manager retries during outages
+playbook: tpl-brute-force-response-v1
+enabled: true
+author: AiSOC
+created: "2026-04-01"
+modified: "2026-05-04"
references:
- https://attack.mitre.org/techniques/T1110/
```
-### Required Fields
+### Required fields
-| Field | Type | Description |
-|-------|------|-------------|
-| `id` | string | Unique rule identifier (kebab-case) |
-| `name` | string | Human-readable rule name |
-| `severity` | enum | `critical`, `high`, `medium`, `low`, `info` |
-| `tactics` | list | MITRE ATT&CK tactic names |
-| `detection` | object | Detection logic |
+| Field | Type | Description |
+| ------------ | ------- | ---------------------------------------------------------- |
+| `id` | string | Stable identifier; native rules use the `det-` prefix |
+| `name` | string | Human-readable rule name |
+| `severity` | enum | `critical` \| `high` \| `medium` \| `low` |
+| `category` | enum | `cloud` \| `identity` \| `endpoint` \| `network` \| `application` \| `data-exfil` |
+| `detection` | object | Detection block (`condition`, `fields`, or tier-specific block) |
-### Optional Fields
+### Optional fields
-| Field | Description |
-|-------|-------------|
-| `techniques` | MITRE technique IDs (e.g. `T1110`) |
-| `tags` | Free-form labels |
-| `response.auto_create_case` | Auto-open a case on first trigger |
-| `response.playbook_id` | Auto-execute a playbook |
-| `references` | External links (MITRE, CVE, blog posts) |
+| Field | Description |
+| --------------------- | --------------------------------------------------------- |
+| `tags` | MITRE ATT&CK technique IDs (`mitre.attack.tXXXX`) + TLP |
+| `log_source.product` | The expected source product (`syslog`, `cloudtrail`, ...) |
+| `false_positives` | Known benign triggers operators should know about |
+| `playbook` | Auto-trigger this playbook on first match |
+| `references` | External links (MITRE, CVE, vendor advisories) |
-## Directory Structure
+## Imported rule format
-```
-detections/
-├── README.md
-├── application/
-│ └── sql-injection-attempt.yaml
-├── cloud/
-│ ├── aws-root-account-login.yaml
-│ └── aws-s3-public-bucket.yaml
-├── endpoint/
-│ ├── credential-dumping-lsass.yaml
-│ ├── lolbas-execution.yaml
-│ └── ransomware-file-extension-change.yaml
-├── identity/
-│ ├── brute-force-login.yaml
-│ └── impossible-travel.yaml
-└── network/
- ├── c2-beacon-high-frequency.yaml
- ├── dns-data-exfiltration.yaml
- └── port-scan-internal.yaml
+Imported rules carry a populated `provenance` block; the validator rejects
+imported rules that omit it. The `id` prefix and `provenance.source` together
+identify the upstream corpus.
+
+```yaml
+id: sigmahq-sigma-aws-root-account-usage-abc123def456
+name: AWS Root Account Usage
+description: |
+ Detects the AWS root account performing actions, which should be exceptional.
+severity: high
+category: cloud
+enabled: true
+tags:
+ - mitre.attack.t1078.004
+detection:
+ condition: event.userIdentity.type == "Root"
+provenance:
+ source: SigmaHQ/sigma
+ source_id: 8d486989-5bb5-4f76-8ddd-9cf2a04d0e0e
+ source_commit: 5f06d76d68b2a18d99cba1a8c1a6f72f3e3aa6a8
+ license: DRL-1.1
+ license_url: https://github.com/SigmaHQ/sigma/blob/master/LICENSE.Detection.Rules.md
+ imported_at: 2026-05-04
+ imported_by: tools.detection_import.sigma_importer
+ upstream_path: rules/cloud/aws/aws_root_account_usage.yml
```
-## CI Validation
+The full attribution table for every redistributed corpus lives in the repo's
+[`LICENSES.md`](https://github.com/beenuar/AiSOC/blob/main/LICENSES.md).
-All rules are validated on every PR via GitHub Actions:
+### Quarantine
-```bash
-python3 scripts/validate_detections.py detections/
+A rule lives in `detections/<source>-imports/_quarantine/<category>/` when it
+parses cleanly but the engine cannot execute the upstream query as-is. This
+covers Splunk SPL, Chronicle YARA-L, and MITRE CAR pseudocode out of the box.
+Quarantined rules ship with `enabled: false` and a `quarantine_reason`. They
+are still indexed for coverage accounting and surfaced in the UI as
+"imported, requires translation" — never silently activated.
+
+## CI validation
+
+The validator at [`scripts/validate_detections.py`](https://github.com/beenuar/AiSOC/blob/main/scripts/validate_detections.py)
+classifies every rule by tier from its on-disk path and applies the right
+checks:
+
+- **Native** — `det-` ID prefix, fixtures must replay correctly.
+- **Imported** — source-specific ID prefix (`sigmahq-sigma-`, `mitre-car-`,
+ `splunk-security-content-`, `chronicle-detection-rules-`), required
+ `provenance` block.
+- **Community** — schema check only.
+
+The summary line breaks the count down by tier and quarantine state so a
+typical green CI run looks like:
+
+```
+Validated 6913 rules — 6913 passed, 0 failed, 0 fixture warnings
+ Tiers: native=800 imported=6113 (quarantined=5937)
```
-The validator checks:
-- Required fields present
-- Valid severity value
-- MITRE tactic names
-- Detection condition syntax
-- Referenced playbook IDs exist (if specified)
+Counts move as importers refresh upstream sources; the line above is a
+sample from the November 2026 pull, not a hard target.
+
+CI integration is wired into the [`Validate Detection Rules`](https://github.com/beenuar/AiSOC/actions/workflows/validate-detections.yml)
+workflow.
-## One-Click Install from Marketplace
+## MITRE coverage
-Community rules published to the marketplace can be installed from the UI (`/marketplace`) or via CLI:
+The marketplace builder walks every tier and emits per-technique coverage
+counts to `marketplace/index.json::mitre_coverage`. The web UI at
+`/detection/coverage` renders this as a tactic × technique matrix so you can
+see exactly which techniques are covered today, by which tier, and how many
+rules each technique has.
+
+## One-click install from the marketplace
+
+Marketplace items can be installed from `/marketplace` in the UI or via the
+API:
```bash
curl -X POST http://localhost:8000/api/v1/marketplace/install \
-H "Authorization: Bearer <token>" \
- -d '{"plugin_id": "community/brute-force-bundle"}'
+ -d '{"type": "detection", "id": "det-brute-force-login-001"}'
```
-## Contributing Rules
+## Contributing native rules
+
+1. Add a spec dict to `scripts/detection_specs.py` or
+ `scripts/detection_specs_part2.py` (the canonical source of truth — the
+ on-disk YAML files are serialized artifacts).
+2. Required keys: `slug`, `name`, `severity`, `mitre`, `log_source`, `fields`,
+ `match_when`, `fp`, `positive`, `negative`.
+3. Run `python3 scripts/generate_detections.py` to materialize the YAML and
+ fixtures.
+4. Run `python3 scripts/validate_detections.py --strict-fixtures` to confirm
+ the fixtures replay correctly.
+5. Open a PR — CI runs the validator against every tier touched.
+
+## Importing third-party rules
+
+The importers under [`tools/detection_import/`](https://github.com/beenuar/AiSOC/blob/main/tools/detection_import/README.md)
+clone pinned upstream commits, normalize each rule into the AiSOC schema, and
+emit them into the matching `detections/<source>-imports/` tree with
+provenance attached.
+
+```bash
+# Run all four importers (SigmaHQ, MITRE CAR, Splunk, Chronicle)
+python3 -m tools.detection_import.import_orchestrator
+
+# Run a single source
+python3 -m tools.detection_import.import_orchestrator --source sigmahq
+```
-1. Create a YAML file in the appropriate sub-directory
-2. Follow the schema — `id`, `name`, `severity`, `tactics`, `detection` are required
-3. Run `python3 scripts/validate_detections.py detections/` locally
-4. Open a PR — CI will validate and summarise your rule
-5. Once merged, the rule appears in the community marketplace automatically
+Splunk SPL, Chronicle YARA-L, and MITRE CAR rules are written into the
+`_quarantine/` subdirectory by default because the AiSOC engine cannot execute
+those query languages as-is.
diff --git a/apps/docs/docs/contributing/dev-setup.md b/apps/docs/docs/contributing/dev-setup.md
index 0e43b6a26..4fda87919 100644
--- a/apps/docs/docs/contributing/dev-setup.md
+++ b/apps/docs/docs/contributing/dev-setup.md
@@ -203,8 +203,8 @@ substrate self-consistency gates.
AiSOC ships a curated marketplace at
[`marketplace/index.json`](https://github.com/beenuar/AiSOC/blob/main/marketplace/index.json)
-that aggregates ~200 detections, 50+ playbooks, and 15 first-party
-plugins. To add to the catalog:
+that aggregates 6,900+ detections (filtered by tier), 50+ playbooks, and
+15 first-party plugins. To add to the catalog:
1. Drop your YAML into `detections/<vendor>/` or `playbooks/<vendor>/`.
2. Add or update the plugin under `plugins/<vendor>/`.
diff --git a/apps/docs/docs/contributing/guidelines.md b/apps/docs/docs/contributing/guidelines.md
index 53a461abf..9f8b6d3d2 100644
--- a/apps/docs/docs/contributing/guidelines.md
+++ b/apps/docs/docs/contributing/guidelines.md
@@ -12,18 +12,23 @@ All contributors must follow our [Code of Conduct](https://github.com/beenuar/Ai
## Branching Strategy
-- `main` — stable, tagged releases
-- `dev` — active development
+- `main` — the long-lived branch most contributors target. Tags cut here.
+- `develop` — optional integration branch; CI watches both `main` and
+ `develop`, so coordinated multi-PR work can land here first.
- `feature/<name>` — new features
- `fix/<name>` — bug fixes
## Pull Requests
-1. Fork the repo and create a branch from `dev`
-2. Write tests for any new code
-3. Ensure CI passes (`pytest`, `go test ./...`, `pnpm lint`)
-4. Update documentation if needed
-5. Open a PR against `dev`
+1. Fork the repo and create a branch from `main`
+ (or from `develop` if you are coordinating a stack of changes there).
+2. Write tests for any new code.
+3. Ensure CI passes locally: `pnpm lint`, `pnpm --filter @aisoc/web test`,
+ `pytest services/<name>/tests/` for Python services you touched, and
+ `go test ./...` for Go services you touched.
+4. Update documentation if behavior, commands, or APIs changed.
+5. Open a PR against `main` (or `develop` if your work is being coordinated
+ on the integration branch).
## Commit Messages
diff --git a/apps/docs/docs/deployment/docker.md b/apps/docs/docs/deployment/docker.md
index f304d01f0..42117e8bc 100644
--- a/apps/docs/docs/deployment/docker.md
+++ b/apps/docs/docs/deployment/docker.md
@@ -100,5 +100,7 @@ Each service exposes the same shape on its own port (`8001`, `8002`, `8003`, `80
```bash
docker compose logs -f agents
docker compose logs -f api
-docker compose logs -f mcp
+docker compose logs -f realtime
```
+
+The full list of services is in [`docker-compose.yml`](https://github.com/beenuar/AiSOC/blob/main/docker-compose.yml) — `api`, `agents`, `fusion`, `actions`, `connectors`, `threatintel`, `ueba`, `honeytokens`, `purple-team`, `realtime`, `ingest-worker`, `enrichment`, `web`, plus the data-plane services (`postgres`, `redis`, `kafka`, `clickhouse`, `opensearch`, `qdrant`).
diff --git a/apps/docs/docs/deployment/env-vars.md b/apps/docs/docs/deployment/env-vars.md
index 489cf347e..f3a16b0f6 100644
--- a/apps/docs/docs/deployment/env-vars.md
+++ b/apps/docs/docs/deployment/env-vars.md
@@ -86,7 +86,7 @@ Source: [`services/api/app/auth/saml.py`](https://github.com/beenuar/AiSOC/blob/
| `DATABASE_MAX_OVERFLOW` | `10` | SQLAlchemy max overflow |
| `REDIS_URL` | `redis://localhost:6379/0` | Redis DSN |
| `REDIS_POOL_SIZE` | `20` | Redis connection pool size |
-| `KAFKA_BROKERS` | `localhost:9092` | Comma-separated broker list |
+| `KAFKA_BOOTSTRAP_SERVERS` | `localhost:9092` | Comma-separated broker list (canonical name; `KAFKA_BROKERS` is honored as a back-compat alias) |
| `KAFKA_TOPIC_EVENTS` | `aisoc.normalized_events` | Topic for normalized events |
| `KAFKA_TOPIC_ALERTS` | `aisoc.alerts` | Topic for emitted alerts |
@@ -186,7 +186,7 @@ Source: [`services/ingest/internal/config/config.go`](https://github.com/beenuar
| Variable | Default | Description |
|----------|---------|-------------|
| `HTTP_PORT` | `8080` | HTTP listener port |
-| `KAFKA_BROKERS` | `localhost:9092` | Comma-separated broker list |
+| `KAFKA_BOOTSTRAP_SERVERS` | `localhost:9092` | Comma-separated broker list (canonical; `KAFKA_BROKERS` accepted as alias) |
| `KAFKA_TOPIC` | `security.events` | Topic for normalized events |
| `REDIS_ADDR` | `localhost:6379` | Redis address (for dedup and rate limiting) |
| `DATABASE_DSN` | `postgres://aisoc:aisoc@localhost:5432/aisoc?sslmode=disable` | Postgres DSN |
@@ -291,7 +291,7 @@ SECRET_KEY=$(openssl rand -hex 32)
ACCESS_TOKEN_EXPIRE_MINUTES=30
DATABASE_URL=postgresql+asyncpg://aisoc:changeme@localhost:5432/aisoc
REDIS_URL=redis://localhost:6379/0
-KAFKA_BROKERS=localhost:9092
+KAFKA_BOOTSTRAP_SERVERS=localhost:9092
OPENSEARCH_URL=http://localhost:9200
QDRANT_URL=http://localhost:6333
CORS_ORIGINS=http://localhost:3000
diff --git a/apps/docs/docs/intro.md b/apps/docs/docs/intro.md
index b64ac7343..585b1c973 100644
--- a/apps/docs/docs/intro.md
+++ b/apps/docs/docs/intro.md
@@ -8,7 +8,7 @@ AiSOC (v5.2.0) is an open-source AI Security Operations Center maintained by
the AiSOC community. The agent itself is MIT-licensed, self-hostable, and
auditable: every LLM prompt, tool call, evidence citation, and decision is
recorded in a replayable Investigation Ledger, and the substrate is gated by a
-public, reproducible eval harness on every commit.
+public, reproducible eval harness on every PR targeting `main` / `develop`.
## Capabilities
@@ -22,12 +22,12 @@ public, reproducible eval harness on every commit.
- **UEBA** — per-user Welford online baseline, Z-score anomaly scoring, and Kafka-integrated anomaly publishing.
- **Honeytokens** — HMAC-SHA256 signed deceptive credentials (URL, file, AWS key, email) with first-touch webhook alerting.
- **Purple Team** — Atomic Red Team YAML parser + Caldera executor, ATT&CK coverage heatmap, tabletop sessions.
-- **Detection engineering** — 200+ Sigma rules over OpenSearch + ClickHouse, YARA, KQL / EQL, community catalog with one-click install.
+- **Detection engineering** — 800 native Sigma-shaped rules plus ~6,000 imported from SigmaHQ, Splunk Security Content, Chronicle, and MITRE CAR (each tagged with provenance), running over OpenSearch + ClickHouse, YARA, KQL / EQL, community catalog with one-click install.
- **Playbook engine** — 50+ community SOAR playbooks with explicit decision trees and human-approval gates on destructive actions.
- **Threat intelligence** — TAXII 2.1, MISP, OTX, CISA KEV with triple storage (search, vector, graph).
- **Governance** — SAML 2.0 + OIDC SSO, multi-tenant RLS, granular RBAC, immutable audit log.
- **Compliance dashboards** — SOC 2, ISO 27001, NIST CSF, PCI-DSS, HIPAA, DORA evidence with MTTD / MTTR / MTTC SLA tracking.
-- **Marketplace** — 15 first-party plugins, 50+ playbooks, 200+ detections, surfaced in-app via [`marketplace/index.json`](https://github.com/beenuar/AiSOC/tree/main/marketplace).
+- **Marketplace** — 15 first-party plugins, 50+ playbooks, 6,900+ detections (filtered by tier: stable / beta / imported / community), surfaced in-app via [`marketplace/index.json`](https://github.com/beenuar/AiSOC/tree/main/marketplace).
- **SDKs** — Python, TypeScript, and Go SDKs for client and plugin development; Ed25519-signed publishing.
- **Model Context Protocol** — `@aisoc/mcp` exposes 11 tools to Claude, Cursor, Continue, and Cody so analysts can replay agent decisions from inside their IDE ([MCP integration](./integrations/mcp)).
diff --git a/apps/docs/docs/plugins/publishing.md b/apps/docs/docs/plugins/publishing.md
index a56b72d1e..444ceaa49 100644
--- a/apps/docs/docs/plugins/publishing.md
+++ b/apps/docs/docs/plugins/publishing.md
@@ -8,9 +8,10 @@ Share your plugin with the AiSOC community via the marketplace.
## Steps
-1. **Build and test** your plugin locally
-2. **Publish to PyPI / pkg.go.dev** (or host on GitHub)
-3. **Add an entry** to `marketplace/index.json`:
+1. **Build and test** your plugin locally.
+2. **Sign the plugin** with an Ed25519 key (see [Signing](#signing) below). Production AiSOC deployments default to `PLUGIN_TRUST_MODE=strict` and refuse to load unsigned code.
+3. **Publish to PyPI / pkg.go.dev** (or host on GitHub).
+4. **Add an entry** to `marketplace/index.json`:
```json
{
@@ -22,17 +23,70 @@ Share your plugin with the AiSOC community via the marketplace.
"version": "1.0.0",
"tags": ["threat-intel", "enrichment"],
"url": "https://github.com/myorg/aisoc-virustotal",
- "install": "pip install aisoc-plugin-virustotal"
+ "install": "pip install aisoc-plugin-virustotal",
+ "signing_key_id": "myorg-prod"
}
```
-4. **Open a PR** — CI validates the JSON schema and the marketplace bot posts a preview
-5. **Merge** — your plugin appears on the `/marketplace` page
+5. **Open a PR** — CI validates the JSON schema, verifies your `plugin.sig` against the registered `signing_key_id`, and the marketplace bot posts a preview.
+6. **Merge** — your plugin appears on the `/marketplace` page.
+
+## Signing
+
+AiSOC verifies plugins with Ed25519 before executing any code from `plugin.py`. The signing flow is deliberately mechanical so it slots into CI:
+
+### 1. Generate a publisher keypair (once)
+
+```bash
+aisoc plugin keygen --out ./keys/myorg
+# writes keys/myorg.pem (public, share this) and keys/myorg.key (private, keep secret)
+```
+
+The private key never leaves your release pipeline. Store it in your CI secret manager (GitHub Actions encrypted secrets, AWS Secrets Manager, Vault, etc.).
+
+### 2. Sign the plugin directory
+
+```bash
+aisoc plugin sign \
+ --plugin-dir ./my-enricher \
+ --private-key $AISOC_PUBLISHER_KEY \
+ --out ./my-enricher/plugin.sig
+```
+
+The signer hashes a canonical JSON document containing:
+
+- the manifest (`plugin.yaml` or `aisoc-plugin.json`) with the `signature` and `trust` keys stripped, and
+- a sorted `{relative_path: sha256_hex}` map of every `*.py` file in the plugin directory tree.
+
+The resulting Ed25519 signature is written to `plugin.sig` as a hex string. Any change to the manifest or any source file invalidates the signature, so an attacker cannot swap out `plugin.py` after publishing.
+
+### 3. Register your public key with the operator
+
+Operators install your `keys/myorg.pem` into `PLUGIN_TRUSTED_KEYS_DIR` (defaults to `/opt/aisoc/plugin-keys`). Multiple PEM files can live there — every key is tried, and a single match is enough to trust the plugin.
+
+```bash
+# operator side
+cp myorg.pem /opt/aisoc/plugin-keys/
+sudo systemctl restart aisoc-api
+```
+
+### 4. Choose a trust mode
+
+The `PLUGIN_TRUST_MODE` setting controls what the loader does on signature failure:
+
+| Mode | Behaviour | When to use |
+|---|---|---|
+| `strict` (default) | Refuse to load unsigned, invalid, or untrusted-key plugins. | Production. |
+| `warn` | Load anyway but tag the plugin record with `signature_status="unsigned"` or `"invalid"` and emit a structured warning log. | Bootstrapping a key-rotation programme, when you need to flush the warnings out of audit logs before flipping back to strict. |
+| `disabled` | Skip the signature check entirely. `signature_status="skipped"`. | Throwaway dev sandboxes only. Never production. |
+
+The `signature_status` value is exposed on `GET /api/v1/plugins` so operators can spot unsigned plugins in their marketplace UI.
## Plugin Quality Guidelines
-- Include a `README.md` with installation and configuration instructions
-- Write tests with ≥ 80% coverage
-- Follow the AiSOC [Code of Conduct](https://github.com/beenuar/AiSOC/blob/main/CODE_OF_CONDUCT.md)
-- Pin dependency versions for reproducibility
-- Never log or store credentials in plain text
+- Include a `README.md` with installation and configuration instructions.
+- Write tests with ≥ 80% coverage.
+- Follow the AiSOC [Code of Conduct](https://github.com/beenuar/AiSOC/blob/main/CODE_OF_CONDUCT.md).
+- Pin dependency versions for reproducibility.
+- Never log or store credentials in plain text.
+- Ship a signed `plugin.sig`. Unsigned plugins are refused in production.
diff --git a/apps/docs/docs/plugins/python-sdk.md b/apps/docs/docs/plugins/python-sdk.md
index 0b85228c8..c4946490d 100644
--- a/apps/docs/docs/plugins/python-sdk.md
+++ b/apps/docs/docs/plugins/python-sdk.md
@@ -7,9 +7,12 @@ sidebar_position: 2
## Installation
```bash
-pip install aisoc-sdk
+pip install aisoc-plugin-sdk
```
+The PyPI distribution is `aisoc-plugin-sdk`; the import path is
+`aisoc_plugin_sdk`. The source lives in `packages/plugin-sdk-py/`.
+
## Quick Start: Enricher
```python
diff --git a/apps/docs/docs/quickstart.md b/apps/docs/docs/quickstart.md
index ad6b8b20d..5a27b63dc 100644
--- a/apps/docs/docs/quickstart.md
+++ b/apps/docs/docs/quickstart.md
@@ -140,8 +140,11 @@ fix.
### 6. Run the public eval harness (optional)
```bash
-# Generate 200 synthetic incidents and run all four substrate eval suites
-python scripts/run_evals.py --count 200 --report eval_report.json
+# Run all four substrate eval suites against the bundled 200-incident
+# dataset and write a JSON report. The dataset size is fixed by
+# services/agents/tests/eval_data/synthetic_incidents.json — there is no
+# --count flag.
+python scripts/run_evals.py --out eval_report.json
# Or run a single eval gate
pytest services/agents/tests/test_mitre_accuracy.py
@@ -176,12 +179,12 @@ it on your phone via "Add to Home Screen" and sign in with a passkey.
| Alerts | `/alerts` | Raw signal feed with Ambient Copilot suggestions |
| Cases | `/cases` | Unified case management |
| Case workspace | `/cases/<id>` | Evidence timeline + **Investigation Ledger** + attack graph |
-| Detections | `/detections` | Sigma/YARA/KQL rule catalog (200+ rules) |
+| Detections | `/detections` | Sigma/YARA/KQL rule catalog (800 native + ~6,000 imported, filterable by tier) |
| Playbooks | `/playbooks` | SOAR automation builder (50+ packs) |
| UEBA | `/ueba` | User behavior anomaly timeline |
| Honeytokens | `/honeytokens` | Deceptive token lifecycle |
| Purple Team | `/purple-team` | ATT&CK coverage · emulation runs · tabletop |
-| Marketplace | `/marketplace` | 15 plugins + 50+ playbooks + 200+ detections |
+| Marketplace | `/marketplace` | 15 plugins + 50+ playbooks + 6,900+ detections (tier-filtered) |
| Benchmark | `/benchmark` | Public eval harness — alert reduction + substrate self-consistency gates |
| Compliance | `/compliance` | SOC 2, ISO 27001, NIST CSF, PCI-DSS, HIPAA, DORA |
| Audit Log | `/audit` | Immutable, tenant-scoped activity ledger |
diff --git a/apps/docs/src/pages/index.tsx b/apps/docs/src/pages/index.tsx
index 3b9e3ba21..72d2a4272 100644
--- a/apps/docs/src/pages/index.tsx
+++ b/apps/docs/src/pages/index.tsx
@@ -119,8 +119,7 @@ const COMPARE_HEADERS = [
'AiSOC',
'Wazuh',
'Splunk Enterprise Security',
- 'Anvilogic',
- 'Prophet Security',
+ 'Closed-source AI SOC',
] as const;
const COMPARE_ROWS: ReadonlyArray<{ feature: string; cells: CompareCell[] }> = [
@@ -131,7 +130,6 @@ const COMPARE_ROWS: ReadonlyArray<{ feature: string; cells: CompareCell[] }> = [
{ kind: 'yes', label: 'Yes — GPLv2' },
{ kind: 'no', label: 'No' },
{ kind: 'no', label: 'Cloud-only' },
- { kind: 'no', label: 'Cloud-only' },
],
},
{
@@ -141,7 +139,6 @@ const COMPARE_ROWS: ReadonlyArray<{ feature: string; cells: CompareCell[] }> = [
{ kind: 'caveat', label: 'No agent layer' },
{ kind: 'no', label: 'Black-box ML' },
{ kind: 'no', label: 'Black-box agent' },
- { kind: 'no', label: 'Black-box agent' },
],
},
{
@@ -151,7 +148,6 @@ const COMPARE_ROWS: ReadonlyArray<{ feature: string; cells: CompareCell[] }> = [
{ kind: 'no', label: 'Not published' },
{ kind: 'no', label: 'Not published' },
{ kind: 'caveat', label: 'Vendor-claimed only' },
- { kind: 'caveat', label: 'Vendor-claimed only' },
],
},
{
@@ -161,7 +157,6 @@ const COMPARE_ROWS: ReadonlyArray<{ feature: string; cells: CompareCell[] }> = [
{ kind: 'no', label: 'No' },
{ kind: 'caveat', label: 'Splunk AI Assistant add-on' },
{ kind: 'yes', label: 'Closed-source' },
- { kind: 'yes', label: 'Closed-source' },
],
},
{
@@ -170,7 +165,6 @@ const COMPARE_ROWS: ReadonlyArray<{ feature: string; cells: CompareCell[] }> = [
{ kind: 'yes', label: 'Built-in' },
{ kind: 'caveat', label: 'Partial' },
{ kind: 'caveat', label: 'Premium add-on' },
- { kind: 'yes', label: 'Yes' },
{ kind: 'caveat', label: 'Limited' },
],
},
@@ -181,7 +175,6 @@ const COMPARE_ROWS: ReadonlyArray<{ feature: string; cells: CompareCell[] }> = [
{ kind: 'caveat', label: 'Wodles only' },
{ kind: 'yes', label: 'Splunkbase' },
{ kind: 'no', label: 'Vendor-only' },
- { kind: 'no', label: 'Vendor-only' },
],
},
{
@@ -191,7 +184,6 @@ const COMPARE_ROWS: ReadonlyArray<{ feature: string; cells: CompareCell[] }> = [
{ kind: 'no', label: 'No' },
{ kind: 'yes', label: 'Premium add-on' },
{ kind: 'caveat', label: 'Reporting only' },
- { kind: 'caveat', label: 'Reporting only' },
],
},
];
@@ -263,7 +255,7 @@ export default function Home(): React.JSX.Element {
return (
<Layout
title={siteConfig.title}
- description="An open-source AI SOC platform. Agent decisions are recorded in an investigation ledger and a public eval harness is run on every commit. MIT-licensed and self-hostable, with built-in UEBA, honeytokens, purple-team emulation, and SOC 2 / ISO 27001 / NIST CSF compliance reporting.">
+ description="An open-source AI SOC platform. Agent decisions are recorded in an investigation ledger and a public eval harness is run on every PR targeting main / develop. MIT-licensed and self-hostable, with built-in UEBA, honeytokens, purple-team emulation, and SOC 2 / ISO 27001 / NIST CSF compliance reporting.">
<HomepageHeader />
<main>
<ComparisonTable />
diff --git a/detections/README.md b/detections/README.md
index d9da53a4c..d5c2142c0 100644
--- a/detections/README.md
+++ b/detections/README.md
@@ -1,44 +1,55 @@
# AiSOC Detection Rules
-This directory contains AiSOC detection rules in a Sigma-inspired YAML format.
-
-The pack contains 200 fixture-tested rules across six categories. Every rule
-has a positive fixture (a synthetic event that should fire it) and a negative
-fixture (a near-miss event that should not fire it). CI replays both on every
-PR using the canonical runtime matcher.
-
-## Distribution
-
-| Category | Rules | Focus |
-| ------------- | ----- | --------------------------------------------------------------- |
-| `cloud/` | 40 | AWS / GCP / Azure misconfig, IAM, key-rotation, S3, CloudTrail |
-| `identity/` | 40 | Auth, MFA, SSO, IdP federation, session abuse, OAuth grants |
-| `endpoint/` | 40 | Process exec, persistence, LOLBAS, credential theft, ransomware |
-| `network/` | 30 | C2, scanning, beaconing, DNS abuse, Tor, lateral movement |
-| `application/`| 30 | Web, API, DB, secrets, supply chain, dependency abuse |
-| `data-exfil/` | 20 | DLP, large transfers, archive uploads, tunneling, off-corp dest |
-| Total | 200 | |
-
-## Structure
-
-```
-detections/
-├── cloud/ # 40 rules
-├── identity/ # 40 rules
-├── endpoint/ # 40 rules
-├── network/ # 30 rules
-├── application/ # 30 rules
-├── data-exfil/ # 20 rules
-├── fixtures/
-│ ├── positive/ # one .json per rule — should match
-│ └── negative/ # one .json per rule — should NOT match
-└── sigma-imports/ # optional auto-imported SigmaHQ rules with attribution
-```
-
-## Rule Format
+This directory contains AiSOC detection content in a Sigma-inspired YAML format.
+Rules are organized into four **tiers** based on origin, quality bar, and what
+the AiSOC engine can do with them out of the box.
+
+| Tier | Where it lives | Status when shipped | Quality bar |
+| --------- | ----------------------------------------- | ------------------- | ------------------------------------------------- |
+| Native | `detections/<category>/` | enabled | YAML schema + fixture replay + MITRE mapping |
+| Imported | `detections/<source>-imports/<category>/` | varies (see below) | YAML schema + provenance block; fixtures optional |
+| Quarantined | `detections/<source>-imports/_quarantine/<category>/` | disabled (`enabled: false`) | parses, but engine cannot execute upstream query |
+| Community | `detections/community/<category>/` | disabled by default | YAML schema; provenance encouraged |
+
+The native tier currently ships **800 fixture-tested rules** (1,200 fixtures —
+positive + negative) across six categories, generated from the spec modules
+under [`scripts/detection_specs*.py`](../scripts/) by
+[`scripts/build_detections_from_specs.py`](../scripts/build_detections_from_specs.py).
+Imported tiers are populated by the importers under
+[`tools/detection_import/`](../tools/detection_import/) and remain empty in this
+checkout until you run them — see [`tools/detection_import/README.md`](../tools/detection_import/README.md)
+for the SigmaHQ, Splunk, Chronicle, and CAR pipelines and their pinned upstream
+commits.
+
+## Native tier (`detections/<category>/`)
+
+The strict-quality, AiSOC-authored layer. Every rule has:
+
+- A positive fixture under `detections/fixtures/positive/<slug>.json` (a
+ synthetic event that should fire it).
+- A negative fixture under `detections/fixtures/negative/<slug>.json` (a
+ near-miss event that should not fire it).
+- A MITRE ATT&CK mapping in its tag list.
+
+CI replays both fixtures on every PR using the canonical runtime matcher in
+[`scripts/generate_detections.py`](../scripts/generate_detections.py).
+
+### Native distribution
+
+| Category | Rules | Focus |
+| -------------- | ----- | ---------------------------------------------------------------- |
+| `cloud/` | 40 | AWS / GCP / Azure misconfig, IAM, key-rotation, S3, CloudTrail |
+| `identity/` | 40 | Auth, MFA, SSO, IdP federation, session abuse, OAuth grants |
+| `endpoint/` | 40 | Process exec, persistence, LOLBAS, credential theft, ransomware |
+| `network/` | 30 | C2, scanning, beaconing, DNS abuse, Tor, lateral movement |
+| `application/` | 30 | Web, API, DB, secrets, supply chain, dependency abuse |
+| `data-exfil/` | 20 | DLP, large transfers, archive uploads, tunneling, off-corp dest |
+| **Total** | **200** | |
+
+### Native rule format
```yaml
-id: det-<unique-id> # Stable identifier; prefix matches category
+id: det-<unique-id> # Stable identifier; native rules use det- prefix
name: Human-readable title
description: >
What this rule detects and why it matters.
@@ -63,7 +74,7 @@ created: "YYYY-MM-DD"
modified: "YYYY-MM-DD"
```
-## Source of truth
+### Native source of truth
The Python specs in [`scripts/detection_specs.py`](../scripts/detection_specs.py)
and [`scripts/detection_specs_part2.py`](../scripts/detection_specs_part2.py)
@@ -72,14 +83,14 @@ artifacts produced by [`scripts/generate_detections.py`](../scripts/generate_det
Edit specs, regenerate, then commit both.
```bash
-# Regenerate all 200 rules + fixtures from specs
+# Regenerate all native rules + fixtures from specs (currently 800)
python3 scripts/generate_detections.py
# Validate (matches what CI runs)
python3 scripts/validate_detections.py --strict-fixtures
```
-## Adding a new rule
+### Adding a new native rule
1. Add a new spec dict to the appropriate list in `scripts/detection_specs.py`
or `scripts/detection_specs_part2.py`.
@@ -90,18 +101,134 @@ python3 scripts/validate_detections.py --strict-fixtures
4. Run `python3 scripts/validate_detections.py --strict-fixtures` to confirm
the fixtures replay correctly.
-## CI validation
-
-The [`Validate Detection Rules`](../.github/workflows/validate-detections.yml)
-workflow runs on every push or PR touching `detections/**` or the spec/generator
-scripts. It enforces:
-
-- Valid YAML syntax
-- Required fields present (`id`, `name`, `severity`, `detection`)
-- Severity ∈ `{low, medium, high, critical}`
-- Category ∈ `{network, endpoint, cloud, identity, application, data-exfil}`
-- No duplicate `id` values across all rules
-- `id` prefix matches the category directory
-- Both positive and negative fixtures exist
-- Fixture replay: positive fixture matches, negative does not, using the same
- `matches()` runtime function as the engine
+## Imported tiers (`detections/<source>-imports/`)
+
+Imported rules are normalized into the AiSOC schema by the source-specific
+importers under [`tools/detection_import/`](../tools/detection_import/). Each
+imported rule carries a populated `provenance` block so we can prove the
+redistribution chain.
+
+```yaml
+id: <source>-<slug>-<short-sha>
+name: Human-readable title (from upstream)
+description: |
+ Description preserved verbatim from upstream where present.
+severity: low | medium | high | critical
+category: network | endpoint | cloud | identity | application | data-exfil
+enabled: true | false # see "Quarantine" below
+quarantine_reason: > # required when enabled: false on import
+ short reason — usually "requires manual translation to AiSOC engine"
+detection:
+ # tier-specific block: condition+fields for Sigma, splunk_spl for Splunk,
+ # chronicle_yaral for Chronicle, native fields for CAR.
+ ...
+provenance:
+ source: SigmaHQ/sigma | splunk/security_content | chronicle/detection-rules | mitre-attack/car
+ source_id: <upstream UUID or rule key>
+ source_commit: <pinned upstream sha>
+ license: DRL-1.1 | Apache-2.0 | ...
+ license_url: https://...
+ imported_at: YYYY-MM-DD
+ imported_by: tools.detection_import.<importer module>
+ upstream_path: relative path to the source file in the upstream repo
+```
+
+`provenance.license` and `provenance.license_url` cover the legal redistribution
+story; the canonical attribution table for every redistributed corpus lives in
+[`LICENSES.md`](../LICENSES.md). Without that file we cannot legally redistribute
+imported content.
+
+### Quarantine
+
+A rule lives under `detections/<source>-imports/_quarantine/<category>/` when:
+
+- It parses cleanly into the AiSOC schema, **but**
+- The engine cannot execute the upstream query as-is (Splunk SPL, Chronicle
+ YARA-L, MITRE CAR pseudocode).
+
+These rules ship with `enabled: false` and a `quarantine_reason`. They are
+indexed for coverage accounting and surfaced in the UI as "imported, requires
+translation" — never silently activated.
+
+### Importing rules
+
+Each importer is invoked through the orchestrator with a pinned upstream SHA:
+
+```bash
+# Run all four importers
+python3 -m tools.detection_import.import_orchestrator
+
+# Run a single source
+python3 -m tools.detection_import.import_orchestrator --source sigmahq
+```
+
+See [`tools/detection_import/README.md`](../tools/detection_import/README.md)
+for per-source notes on yield, dedup strategy, and what cannot be auto-translated.
+
+## Community tier (`detections/community/`)
+
+External contributions live here. Validation is permissive — `det-`/`<source>-`
+prefixes are not required and the provenance block is encouraged but not
+enforced. Community rules ship with `enabled: false` by default; operators
+opt in per-tenant.
+
+## Validation
+
+The validator at [`scripts/validate_detections.py`](../scripts/validate_detections.py)
+classifies every rule by tier from its on-disk path and applies the right rules:
+
+- **Native**: `det-` ID prefix, fixture replay (positive must match, negative
+ must not), category match against the directory name. CI runs with
+ `--strict-fixtures`, which promotes missing-fixture warnings into hard fails.
+- **Imported**: source-specific ID prefix (`sigmahq-sigma-`, `mitre-car-`,
+ `splunk-security-content-`, `chronicle-detection-rules-`), required
+ `provenance` block, no fixtures required.
+- **Community**: schema check only.
+
+The validator's summary line includes a per-tier count and a
+quarantine count, so a green CI run looks like:
+
+```
+Validated 6913 rules — 6913 passed, 0 failed, 0 fixture warnings
+ Tiers: native=800 imported=6113 (quarantined=5937)
+```
+
+Counts shift as importers refresh upstream sources; the line above is a
+sample from the November 2026 pull, not a hard target.
+
+CI integration lives in [`.github/workflows/validate-detections.yml`](../.github/workflows/validate-detections.yml).
+
+## MITRE coverage
+
+The marketplace builder at
+[`scripts/build_marketplace.py`](../scripts/build_marketplace.py) walks every
+tier and emits per-technique coverage counts to
+`marketplace/index.json::mitre_coverage`. The web UI at
+[`apps/web/src/app/(app)/detection/coverage/`](../apps/web/src/app/(app)/detection/coverage/)
+renders this as a tactic × technique matrix so operators can see exactly which
+techniques are covered today and at what tier (native vs imported vs
+quarantined).
+
+## File layout
+
+```
+detections/
+├── cloud/ # native, 40 rules
+├── identity/ # native, 40 rules
+├── endpoint/ # native, 40 rules
+├── network/ # native, 30 rules
+├── application/ # native, 30 rules
+├── data-exfil/ # native, 20 rules
+├── fixtures/
+│ ├── positive/ # one .json per native rule — should match
+│ └── negative/ # one .json per native rule — should NOT match
+├── sigma-imports/ # populated by tools/detection_import/sigma_importer
+│ └── _quarantine/ # imported but not auto-translatable
+├── splunk-imports/ # populated by splunk_importer (SPL)
+│ └── _quarantine/ # always: SPL needs manual translation
+├── chronicle-imports/ # populated by chronicle_importer (YARA-L)
+│ └── _quarantine/ # always: YARA-L needs manual translation
+├── car-imports/ # populated by car_importer (CAR pseudocode)
+│ └── _quarantine/ # always: pseudocode → engine syntax
+└── community/ # third-party / contributed rules
+```
diff --git a/infra/helm/README.md b/infra/helm/README.md
new file mode 100644
index 000000000..327c31383
--- /dev/null
+++ b/infra/helm/README.md
@@ -0,0 +1,111 @@
+# AiSOC Helm chart
+
+This directory ships a Helm chart that deploys AiSOC onto a Kubernetes cluster.
+It is the deployment path the production docs (`apps/docs/docs/deployment/kubernetes.md`)
+point at.
+
+```
+infra/helm/
+├── aisoc/ # The chart itself
+│ ├── Chart.yaml # appVersion tracks the AiSOC release
+│ ├── values.yaml # All knobs live here
+│ ├── templates/ # Service deployments, HPA, PDB, ingress, etc.
+│ └── charts/ # Reserved for vendored sub-charts (currently empty)
+└── charts/ # Reserved for additional umbrella charts (currently empty)
+```
+
+## What it deploys
+
+`templates/` renders one `Deployment` per entry in `values.yaml::services` plus
+matching `Service`, `HorizontalPodAutoscaler`, `PodDisruptionBudget`, and a
+shared `Ingress`. The default `services` map covers:
+
+- `api` — FastAPI core API (`ghcr.io/beenuar/aisoc-core-api`)
+- `ingest` — Go ingest service (`ghcr.io/beenuar/aisoc-ingest`)
+- `enrichment` — Go enrichment service (`ghcr.io/beenuar/aisoc-enrichment`)
+- `agents` — Python AI agents (`ghcr.io/beenuar/aisoc-agents`)
+- `web` — Next.js UI (`ghcr.io/beenuar/aisoc-web`)
+- `realtime` — WebSocket service (`ghcr.io/beenuar/aisoc-realtime`)
+
+Three feature services have their own templates rather than the generic
+deployment because their pod specs differ:
+
+- `honeytokens-deployment.yaml`
+- `purple-team-deployment.yaml`
+- `ueba-deployment.yaml`
+
+## Data plane assumptions
+
+The chart **does not** install Postgres, Redis, Kafka, OpenSearch, or
+ClickHouse by default. `postgresql.enabled` and `redis.enabled` in
+`values.yaml` are off. Production deployments are expected to point at managed
+services (RDS, ElastiCache, MSK, Opensearch Service) — the Terraform module
+under `infra/terraform/` provisions those on AWS.
+
+For local clusters or evaluation deployments, set `postgresql.enabled=true`
+and `redis.enabled=true` to bring up the bundled Bitnami sub-charts.
+
+## Quick install
+
+```bash
+# 1. Add Bitnami (only needed if you turn the bundled deps on)
+helm repo add bitnami https://charts.bitnami.com/bitnami
+helm dependency update infra/helm/aisoc
+
+# 2. Render the chart
+helm template aisoc infra/helm/aisoc -n aisoc --create-namespace
+
+# 3. Install (production layout: managed data plane, no bundled deps)
+helm install aisoc infra/helm/aisoc \
+ -n aisoc --create-namespace \
+ --set ingress.hosts[0].host=aisoc.your-domain.com \
+ --set global.environment=production \
+ --set global.otelEndpoint=http://otel-collector:4317
+
+# 4. Upgrade
+helm upgrade aisoc infra/helm/aisoc -n aisoc -f your-overrides.yaml
+```
+
+## Common overrides
+
+Every service has the same shape under `services.<name>`. The most-changed
+fields:
+
+```yaml
+services:
+ api:
+ replicaCount: 4 # explicit replicas (HPA still applies)
+ image:
+ repository: my-registry/aisoc-core-api
+ tag: "5.2.0"
+ env: # extra env vars merged into the pod
+ LOG_LEVEL: debug
+ hpa:
+ enabled: true
+ minReplicas: 2
+ maxReplicas: 20
+ pdb:
+ enabled: true
+ minAvailable: 1
+```
+
+Connection strings (Postgres DSN, Redis URL, Kafka brokers, etc.) come in via
+`global.extraConfig` or per-service `env`, and from a `Secret` you create out
+of band. See `apps/docs/docs/deployment/env-vars.md` for the canonical list of
+environment variables — note in particular that `KAFKA_BOOTSTRAP_SERVERS` is
+the canonical broker variable; `KAFKA_BROKERS` is honored as a backward-compat
+alias.
+
+## Releasing a new chart version
+
+1. Bump `Chart.yaml::version` (chart version) and `Chart.yaml::appVersion`
+ (AiSOC release) in lockstep with the Git tag.
+2. `helm lint infra/helm/aisoc`
+3. `helm template ...` and diff against the previous render before publishing.
+
+## Related docs
+
+- `apps/docs/docs/deployment/kubernetes.md` — end-to-end production guide.
+- `apps/docs/docs/deployment/env-vars.md` — environment variable reference.
+- `infra/terraform/README.md` — provisions the EKS cluster + managed data plane
+ this chart deploys onto.
diff --git a/infra/terraform/README.md b/infra/terraform/README.md
new file mode 100644
index 000000000..58e6e6d0a
--- /dev/null
+++ b/infra/terraform/README.md
@@ -0,0 +1,148 @@
+# AiSOC Terraform — AWS infrastructure
+
+This directory provisions the AWS infrastructure that the AiSOC Helm chart
+(`infra/helm/aisoc/`) deploys onto. It is the path the production deployment
+docs (`apps/docs/docs/deployment/kubernetes.md`) reference.
+
+```
+infra/terraform/
+├── main.tf # Wires the modules together + outputs
+├── variables.tf # Inputs (region, env, instance sizes, CIDRs)
+└── modules/
+ ├── vpc/ # 3-AZ VPC: public, private, db subnets
+ ├── eks/ # EKS cluster + general & compute node groups
+ ├── rds/ # PostgreSQL RDS
+ ├── elasticache/ # Redis (sharded)
+ ├── kafka/ # MSK
+ ├── opensearch/ # OpenSearch (optional)
+ ├── clickhouse/ # Self-managed ClickHouse on EC2 (optional)
+ ├── databases/ # Helper module that wires DSNs into k8s secrets
+ ├── kubernetes/ # In-cluster bootstrap (CRDs, namespaces, addons)
+ ├── network/ # Extra security groups + private endpoints
+ └── vault/ # HashiCorp Vault (optional)
+```
+
+`main.tf` deploys the **core** stack: `vpc`, `eks`, `rds`, `elasticache`,
+`kafka`. The other modules under `modules/` are optional add-ons — wire them
+in by extending `main.tf` if you need OpenSearch, ClickHouse, or Vault.
+
+## What you get
+
+A 3-AZ deployment in a single AWS region with:
+
+- VPC: 10.0.0.0/16 by default (public, private, db subnet tiers per AZ).
+- EKS 1.28 with two managed node groups:
+ - `general` — `m6i.xlarge`, 2–10 nodes, runs the bulk of AiSOC services.
+ - `compute` — `c6i.2xlarge`, 0–5 nodes, taint `workload=compute:NO_SCHEDULE`
+ for ML/agent workloads.
+- RDS PostgreSQL on `db.r6g.large` (override via `rds_instance_class`).
+- ElastiCache Redis with 2 shards × 1 replica on `cache.r6g.large`.
+- MSK Kafka with 3 brokers on `kafka.m5.large`.
+
+All data services restrict ingress to the EKS node security group.
+
+## Backend state
+
+State is stored in S3 with DynamoDB locking. Before the first `terraform init`
+you must create:
+
+```hcl
+# main.tf:29
+backend "s3" {
+ bucket = "aisoc-terraform-state"
+ key = "infra/terraform.tfstate"
+ region = "us-east-1"
+ encrypt = true
+ dynamodb_table = "aisoc-terraform-locks"
+}
+```
+
+Bootstrap once per AWS account:
+
+```bash
+aws s3 mb s3://aisoc-terraform-state --region us-east-1
+aws s3api put-bucket-versioning \
+ --bucket aisoc-terraform-state \
+ --versioning-configuration Status=Enabled
+
+aws dynamodb create-table \
+ --table-name aisoc-terraform-locks \
+ --attribute-definitions AttributeName=LockID,AttributeType=S \
+ --key-schema AttributeName=LockID,KeyType=HASH \
+ --billing-mode PAY_PER_REQUEST \
+ --region us-east-1
+```
+
+If you want a different bucket/table/region, edit the `backend "s3"` block
+**before** the first `terraform init` — moving state after the fact is
+operationally painful.
+
+## Deploy
+
+```bash
+cd infra/terraform
+
+# 1. Provider plugins + module init
+terraform init
+
+# 2. Plan against an environment
+terraform plan \
+ -var="environment=prod" \
+ -var="aws_region=us-east-1" \
+ -out=tfplan
+
+# 3. Apply (15–25 min on a clean account; EKS + MSK dominate)
+terraform apply tfplan
+
+# 4. Wire kubectl up to the new cluster
+aws eks update-kubeconfig \
+ --name "$(terraform output -raw eks_cluster_name)" \
+ --region us-east-1
+```
+
+The endpoints needed by the Helm chart are emitted as outputs:
+
+```bash
+terraform output -raw rds_endpoint
+terraform output -raw redis_endpoint
+terraform output -raw kafka_bootstrap_servers # canonical name; matches KAFKA_BOOTSTRAP_SERVERS
+terraform output -raw eks_cluster_endpoint
+```
+
+Feed these into a Kubernetes `Secret` consumed by the AiSOC chart — see
+`apps/docs/docs/deployment/env-vars.md` for the canonical environment-variable
+contract.
+
+## Common overrides
+
+| Variable | Default | Notes |
+|---|---|---|
+| `aws_region` | `us-east-1` | Single-region deployment. |
+| `environment` | `prod` | One of `dev`, `staging`, `prod`. Drives the `aisoc-${environment}` name prefix. |
+| `vpc_cidr` | `10.0.0.0/16` | Pick something that doesn't collide with your peering. |
+| `eks_cluster_version` | `1.28` | Bump in lockstep with addon compatibility. |
+| `rds_instance_class` | `db.r6g.large` | Down-size to `db.t4g.medium` for dev. |
+| `redis_node_type` | `cache.r6g.large` | `cache.t4g.medium` for dev. |
+| `kafka_instance_type` | `kafka.m5.large` | `kafka.t3.small` for dev (3 brokers minimum). |
+| `db_username` | `aisoc_admin` | Marked `sensitive`; the password is generated and stored in Secrets Manager by the `rds` module. |
+
+For a dev/eval install, drop the instance sizes and consider not provisioning
+MSK at all (run the in-cluster Kafka from the Helm bundle instead).
+
+## Destroy
+
+```bash
+terraform destroy -var="environment=prod"
+```
+
+RDS and OpenSearch take a final snapshot before deletion (set explicitly in
+the modules). The S3 state bucket and DynamoDB lock table are **not** managed
+by this configuration and survive `destroy`.
+
+## Related docs
+
+- `apps/docs/docs/deployment/kubernetes.md` — production deployment guide.
+- `apps/docs/docs/deployment/env-vars.md` — env-var contract; note that
+ `KAFKA_BOOTSTRAP_SERVERS` is canonical (`KAFKA_BROKERS` is honored as a
+ back-compat alias).
+- `infra/helm/README.md` — the chart that runs on top of this infra.