Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.
Python agentic-aiai-securityalert-triageblue-teamcybersecuritydetection-engineeringincident-responselanggraphllm-agentsmcpmitre-attackmodel-context-protocolpurple-teamsecurity-operationsself-hostedsiemsoarsocthreat-detectionthreat-intelligence
docs: sync project documentation with today's v8.0 wave-1 push (#138)
Beenu Arora3724e933b9fa
diff --git a/AGENTS.md b/AGENTS.mdindex 07f0aca85..3fcdd3425 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -46,3 +46,23 @@- WS-G: Slack Bolt service at `services/slack-bot/` with `/aisoc` ChatOps commands (WS-G1); executive digest with auto-generated PDF + weekly scheduler in `services/api/app/services/digest_pdf.py` and `services/api/app/api/v1/endpoints/reports.py` (WS-G2).- WS-H: LLM cost dashboard (`services/api/app/services/cost_dashboard.py` + `apps/web/src/app/(admin)/costs/page.tsx` — WS-H1); BYOK per-tenant LLM credentials vault-encrypted via `CredentialVault`, model `TenantLlmCredential`, settings UI in `apps/web/src/components/settings/SettingsView.tsx` (WS-H2); compliance audit export CSV + HTML bundles at `services/api/app/services/audit_export.py` (WS-H3); air-gapped / local-LLM mode via Ollama/LiteLLM overlay + zero-external-call demo seed (WS-H4).- Threat actor attribution engine v0 at `services/threatintel/` (rebased, hardened, open as PR #43).+- **v8.0 wave-1 (on `main`, not yet tagged as of 2026-05-14):** Architectural foundation for the v8.0 line. `VERSION` stays at `7.3.1` until wave-2 lands; all v8.0 work is documented under `[Unreleased]` in `CHANGELOG.md`. Tracking doc: `AISOC_V8_PROGRESS.md`. Key shipped pieces:+ - **Graph at ingest (T1.1).** `services/ingest/internal/graph/` writes a Neo4j entity graph (`User`, `Asset`, `Process`, `IP`, `Domain`, `Alert`, 17 node labels / 14 edge types total) inline with Kafka consumption. Batched UNWIND upserts + fire-and-forget retry queue keep the ingest latency budget unchanged. Schema doc: `apps/docs/docs/architecture/graph-schema.md`. Anchor post: `apps/web/content/blog/graph-at-ingest.mdx`.+ - **Four-agent rebrand (T2.1).** `DetectAgent`, `TriageAgent`, `HuntAgent`, `RespondAgent` in `services/agents/app/agents/`. Back-compat aliases preserve existing imports. Each owns one funnel stage; funnel KPI doc at `apps/docs/docs/console/funnel-kpis.md`.+ - **`/hunt` natural-language surface (T2.2).** `apps/web/src/app/(app)/hunt/` + `services/api/app/api/v1/endpoints/saved_hunts.py`. NL prompt → ES|QL / SPL / KQL template (HuntAgent never writes raw queries). Saved hunts have `pivotPath` deep-links into the Investigation Rail.+ - **Sixteen first-party connectors.** Wave-1 fully tested: `tines`, `torq`, `falco`, `pagerduty`, `opsgenie`, `confluence_audit`. Wave-2 with full fixtures + tests: `cloudflare_zt`, `sysdig`, `vault`, `snowflake`. Six more `[wip]` in `AISOC_V8_PROGRESS.md`. All five severity tiers preserved end-to-end.+ - **L0–L4 automation maturity model.** `apps/docs/docs/concepts/automation-maturity.md` + `apps/web/content/papers/l0-l4-automation-maturity.md` (PDF rendered via `pnpm docs:build`). Ladder: L0 manual → L4 fully autonomous closure with human sign-off.+ - **Public weekly benchmark scoreboard.** `apps/docs/docs/benchmark-scoreboard.mdx` reads `apps/docs/static/data/scoreboard.json`, refreshed by `.github/workflows/wet-eval.yml` (weekly). Existing eval-harness transparency rules apply (synthetic vs real labelled explicitly).+- **Security wave shipped before v8.0 cut (PRs #116–#128, May 2026):** Twelve critical/high CVE-class fixes. Patterns to remember:+ - Rule engine no longer uses `eval()` / `compile()` on user input — conditions are parsed into a whitelisted AST in `services/api/app/services/rules_engine.py`.+ - Tenant isolation is enforced at the **query layer** (filter by `tenant_id` in `WHERE`), not via RLS alone, on `/hunts` and `/cases` endpoints. RLS remains as defence-in-depth.+ - CORS: shared `cors.py` is vendored byte-identical into every Python service. It refuses to start when `AISOC_CORS_ORIGINS` contains `*` while credentials are enabled and `AISOC_ENV=production`. TypeScript guard for `services/realtime` enforces the same rule.+ - Playbook outbound traffic: every `http_request` / `notify` step goes through `services/agents/app/playbook/ssrf_guard.py` — scheme allow-list, hostname resolution + IP allow-list, cloud-metadata block list that applies even when private IPs are explicitly allowed.+ - Plugin manager OCI installs verify signed manifests against an allow-list and pin image digests at install time, re-verifying on every load.+ - Dev-mode: one canonical `AISOC_DEV_MODE` env var replaces the per-service patchwork of `DEV_MODE` / `SKIP_AUTH` / `AISOC_DEMO_MODE` flags. `tests/test_security_defaults.py` is a CI gate that asserts no dev-mode shortcut is reachable when the flag is unset.+ - LLM input contract: untrusted enrichment (threat-intel feeds, user-submitted content) runs through `services/api/app/services/llm_safety.py` (boundary markers, control-character stripping, length cap) before any prompt concatenation.+- **Static analysis hygiene (CodeQL):** Python alert count on `main` is zero as of 2026-05-14, enforced as a CI gate. Two patterns drove the cleanup:+ - **`py/log-injection` — sanitise inline at the call site.** The taint tracker doesn't follow `_log_safe(value)` through function boundaries reliably, but it does recognise an inline `str(value).replace("\r", "").replace("\n", " ")[:N]` chain. Canonical example: `services/api/app/api/v1/endpoints/waitlist.py`. Even `uuid.UUID`-typed values are sanitised explicitly so the property is visible to both CodeQL and future readers.+ - **`py/import-and-import-from` — pick one import style per module.** Tests that monkey-patch module-level constants should use `pytest.MonkeyPatch.setattr(module, "_NAME", value)` (with the standard from-import form), not `import app.foo as foo_module` _and_ a from-import for the same names.+ - Docs anchor: `apps/docs/docs/operations/security.md#static-analysis-codeql`.+- **UEBA env-var convention (PR #135, first community contribution, closes Issue #134):** `services/ueba/app/core/config.py` uses Pydantic `BaseSettings` with `populate_by_name=True` and `Field(default=..., validation_alias=AliasChoices("UNPREFIXED", "UEBA_PREFIXED"))` per field. Both forms work; unprefixed wins when both are set. `services/ueba/alembic/env.py` follows the same rule: `os.environ.get("DATABASE_URL") or os.environ.get("UEBA_DATABASE_URL", default)`. Same pattern as `services/fusion/app/core/config.py`. Test coverage: `services/ueba/tests/test_config.py` asserts four cases (unprefixed-only / prefixed-only / both-with-unprefixed-winning / default-fallback). Doc anchor: `apps/docs/docs/deployment/env-vars.md#ueba-service-servicesueba`.diff --git a/AISOC_V8_PROGRESS.md b/AISOC_V8_PROGRESS.mdindex fe1b9ea79..884a15978 100644--- a/AISOC_V8_PROGRESS.md+++ b/AISOC_V8_PROGRESS.md@@ -24,7 +24,12 @@ PR title: `v8.0 wave-1 shipped + wave-2 checkpoint`PR body: see `.pr-body-wave1.md` (gitignored — local working copy). Paste the full contents into the GitHub web UI when opening the PR.-Status (refreshed 2026-05-14, 11:35 IST): wave-2 worker subagents errored mid-task; their checkpoint output is now committed as 11 per-track `(wip)` commits + 2 progress-doc commits on top of the wave-1 base. Branch was renamed to `v8.0/agentic-soc-foundation` mid-session and pushed to fork at HEAD `7c822a5f` (44 commits ahead of `upstream/main`). `gh` CLI is unauthenticated on this workstation, so the PR is **pending — paste the compare URL above into the browser** with the body from `.pr-body-wave1.md`.+Status (refreshed 2026-05-14, 17:20 UTC):++- **Wave-1 SHIPPED** — PR [#125](https://github.com/beenuar/AiSOC/pull/125) merged to `upstream/main` at `b854010e` on 2026-05-14T13:47 UTC. All wave-1 deliverables (graph at ingest, four-agent rebrand, `/hunt`, 6 fully-tested connectors, L0–L4 maturity, public scoreboard) are live on `main`.+- **Post-merge wave** — 12 follow-on PRs landed on `main` after PR #125: critical/high security fixes (#116–#128), CodeQL alert sweep to zero (#133, #136, #137), security smoke + UX cleanup (#132), playbook engine correctness (#129), and the first community contribution (#135 — UEBA env-var alignment, closes #134).+- **Wave-2** — still tracked here as `[~]` (in flight) for the 10 remaining connectors and the cross-track polish items below. `VERSION` stays at `7.3.1` until wave-2 lands; all v8.0 work is documented under `[Unreleased]` in [`CHANGELOG.md`](CHANGELOG.md).+- **Original wave-2 background subagents** — errored mid-task; their checkpoint output landed as the 11 per-track `(wip)` commits below, all of which are now on `main` as part of the PR #125 squash-merge.Wave-2 commits (most recent first, all SSH-signed, attributed Prince Sinha):- `ecf2ffe1` T7.3 three anchor blog posts (graph, latency, L0–L4) (wip)diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 1712367bc..751ae996f 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -182,6 +182,69 @@ emitted on every API/service boot and during every test run.`-W error::DeprecationWarning` (pydantic only) now imports the fullAPI surface clean.+### v8.0 architectural foundation — graph at ingest, four-agent rebrand, `/hunt`, sixteen connectors (PR #125)++The biggest single push of the day. The [`AISOC_V8_PROGRESS.md`](AISOC_V8_PROGRESS.md) doc tracks the wave breakdown; this entry is the user-visible summary.++- **Graph at ingest.** `services/ingest` now writes a Neo4j-backed entity graph (`User`, `Asset`, `Process`, `IP`, `Domain`, `Alert`) as events flow through the normaliser, instead of deferring graph construction to a downstream batch job. The new `services/ingest/internal/graph/` package, the [`architecture/graph-schema`](apps/docs/docs/architecture/graph-schema.md) doc, and the [`Graph at ingest` blog post](apps/web/content/blog/graph-at-ingest.mdx) all describe the schema. Latency budget on the ingest path is unchanged (graph writes are fire-and-forget with a bounded retry queue).+- **Four-agent rebrand.** The legacy `triage_agent` is split into purpose-built agents — `DetectAgent`, `TriageAgent`, `HuntAgent`, `RespondAgent` — each owning a clear stage of the funnel (detect → triage → hunt → respond). The funnel KPI doc ([`console/funnel-kpis`](apps/docs/docs/console/funnel-kpis.md)) explains how each stage is measured and where the agents plug in. Existing playbooks continue to work via a thin compatibility shim on the orchestrator graph.+- **`/hunt` natural-language hunting interface.** A new console route lets analysts ask English questions ("which users authenticated from a country they've never logged in from in the past 90 days?") and get a graph-aware answer with `pivotPath` deep-links into the Investigation Rail. Backed by `HuntAgent` plus a curated set of ES|QL / Cypher templates so the LLM never writes raw queries by itself.+- **Sixteen first-party connectors.** Hardened, marketplace-listed, and individually documented under [`apps/docs/docs/connectors/*`](apps/docs/docs/connectors). All five severity tiers (`info | low | medium | high | critical`) are now preserved end-to-end — see the per-connector docs for the vendor-native → AiSOC severity mapping table.+- **Automation maturity model.** New [`automation-maturity`](apps/docs/docs/concepts/automation-maturity.md) doc and [companion blog post](apps/web/content/blog/automation-maturity.mdx) define the L0–L4 ladder (manual triage → fully autonomous closure with human sign-off) and how each AiSOC capability maps onto it.+- **Public weekly benchmark scoreboard.** Already documented above; this is its anchoring release.++`AISOC_V8_PROGRESS.md` lists wave-2 items that are checkpointed but not yet merged. Until the wave-2 work lands, the `VERSION` file stays at `7.3.1` and v8.0 lives entirely under `[Unreleased]`.++### Security hardening — critical/high severity wave++Eight PRs landing the C-1, C-2, P2-A1, P2-W1, P2-W7, H-3, H-8, and M-9 items from the security hardening plan. Each one is small in diff but plugs a class of bug, so they're grouped here for the changelog:++- **C-1 — rule engine `eval()` RCE removed (PR #116).** The detection rule evaluator no longer compiles user-supplied condition strings via `eval()` / `compile()`. Conditions are parsed into an AST with a whitelisted set of operators, attribute accesses, and constants; everything else is rejected at rule-save time, not at evaluation time. Existing rules that used arithmetic, comparisons, `and`/`or`/`not`, and `event.field` lookups continue to work unchanged.+- **C-2 — hunts tenant isolation (PR #117).** Saved hunts, hunt results, and the `/hunt` natural-language endpoint now all filter by `tenant_id` at the query layer instead of relying on RLS alone, eliminating a class of cross-tenant read bugs that surfaced when service-role keys touched the table directly.+- **P2-A1 — CORS lockdown across all services (PR #119).** Shared `cors.py` helper, vendored byte-identical into every Python service, refuses to start if `AISOC_CORS_ORIGINS` contains `*` while credentials are enabled and `AISOC_ENV=production`. TypeScript guard in `services/realtime/src/index.ts` enforces the same rule for the WebSocket service. Full rationale is in [`operations/security.md` → CORS](apps/docs/docs/operations/security.md#cors).+- **P2-W1 — cases tenant isolation (PR #118).** Same shape as C-2 but for the cases service: `case_id` lookups, attachments, comments, and audit events now all go through tenant-scoped queries.+- **P2-W7 — SSRF guard for playbook `http_request` and `notify` (PR #120).** New `services/agents/app/playbook/ssrf_guard.py` validates every outbound URL: scheme allow-list, no embedded credentials, hostname resolution + IP allow-list with cloud-metadata block list that applies even when private IPs are explicitly allowed. Documented under [`operations/security.md` → Playbook outbound traffic](apps/docs/docs/operations/security.md#playbook-outbound-traffic--ssrf-guard).+- **H-3 — plugin manager OCI install hardening (PR #121).** Plugin manifests fetched from an OCI registry are now verified against a signed-manifest allow-list before any file lands on disk; image digests are pinned at install time and re-verified on every load. Eliminates the "swap-tag-after-review" supply-chain pattern.+- **H-8 / P2-A3 — dev-mode unification (PR #127).** Replaces the per-service patchwork of `if DEV_MODE` / `if SKIP_AUTH` / `if AISOC_DEMO_MODE` branches with one canonical helper that returns the dev-mode posture from a single env var (`AISOC_DEV_MODE`). Production deployments where this flag is unset get exactly zero auth-bypass codepaths compiled in. Tested with a new `tests/test_security_defaults.py` that imports every service and asserts no dev-mode shortcut is reachable when the flag is off.+- **M-9 — LLM input sanitization for untrusted enrichment (PR #128).** Threat-intel enrichment text returned from third-party feeds is run through a prompt-injection filter (boundary markers, control-character stripping, length cap) before being concatenated into any LLM prompt. The filter is centralised in `services/api/app/services/llm_safety.py` and re-used by every prompt builder.++The matching docs under [`apps/docs/docs/operations/security.md`](apps/docs/docs/operations/security.md) were updated as part of each PR so the security model page is the single source of truth.++### Static analysis — Python CodeQL alerts driven to zero on `main` (PRs #133, #136, #137)++A three-PR sweep that resolves every open Python CodeQL alert in the repository and makes the resulting state easy to maintain.++- **PR #133 — 30 alerts in one pass.** Covers `py/log-injection` (alerts #396, #401, #402, #412), `py/uninitialized-local-variable` (#414, #415), `py/side-effect-in-assert` (#435), `py/incomplete-url-substring-sanitization` (#411), `py/ineffectual-statement` for `...`-only `Protocol` stubs and bare `await task` statements (#418–#434, #422, #424, #425, #429), `py/unnecessary-lambda` (#439), `py/mixed-returns` (#438), `py/unused-global-variable` (#408, #416, #417), and `py/unused-import` (#436). Sanitisation, where applied, is now inline at the call site (`.replace("\r", "").replace("\n", " ")[:N]`) so the taint tracker recognises it without needing a `nosec`/`noqa` hint.+- **PR #136 — final two stubborn alerts.** CodeQL flagged `#440` (`py/import-and-import-from` in `services/connectors/tests/connectors/test_confluence_audit.py`) and `#441` (`py/log-injection` in `services/api/app/api/v1/endpoints/waitlist.py`) even after PR #133 because (a) the taint tracker didn't follow our `_log_safe` helper through the call site, and (b) the test file used a module alias _and_ a from-import for the same module. Fix: drop the helper, inline the sanitisation, and use `pytest.MonkeyPatch.setattr` instead of a module alias.+- **PR #137 — newly-introduced alert #442.** Once #441 was resolved, CodeQL surfaced a new log-injection alert on `entry_id` and `user.user_id` in the same waitlist endpoint, even though both are `uuid.UUID`-typed. Made the cleansing explicit at the call site (`str(entry_id).replace("\r", "").replace("\n", " ")[:36]`) so future readers — and CodeQL — see the guarantee, even though the underlying values are safe by type.++After PR #137 merged, the [CodeQL dashboard](https://github.com/beenuar/AiSOC/security/code-scanning) reports zero open Python alerts on `main`. The full sanitisation pattern is documented in [`operations/security.md` → Static analysis (CodeQL)](apps/docs/docs/operations/security.md#static-analysis-codeql).++### UEBA service environment variable alignment (PR #135, first community contribution)++Resolves [Issue #134](https://github.com/beenuar/AiSOC/issues/134) — the `ueba` service was the only Python service that required a `UEBA_` prefix on every env var, which broke the `DATABASE_URL` / `KAFKA_BOOTSTRAP_SERVERS` / `REDIS_URL` exports in `docker-compose.yml` (and silently fell back to defaults).++- **`services/ueba/app/core/config.py`** — `model_config` drops `env_prefix="UEBA_"` and adds `populate_by_name=True`. Every field is now declared with `Field(default=…, validation_alias=AliasChoices("UNPREFIXED", "UEBA_PREFIXED"))`, so both names work and the unprefixed form wins when both are set. Pattern matches the `services/fusion/app/core/config.py` already used elsewhere in the repo.+- **`services/ueba/alembic/env.py`** — `os.environ.get("DATABASE_URL") or os.environ.get("UEBA_DATABASE_URL", default)`, so `alembic upgrade head` picks up the same DSN the running service sees.+- **`services/ueba/tests/test_config.py`** — new test file with a `_clean_env` autouse fixture that scrubs both prefixed and unprefixed names, then asserts the four cases (unprefixed-only / prefixed-only / both-with-unprefixed-winning / neither-with-default-fallback) for both `DATABASE_URL` and `KAFKA_BOOTSTRAP_SERVERS`. All four tests pass under `pytest services/ueba/tests/test_config.py`.++[`deployment/env-vars.md` → UEBA service](apps/docs/docs/deployment/env-vars.md#ueba-service-servicesueba) now documents the dual-alias behaviour and lists the unprefixed names as canonical.++### Issues #131 and #130 — security smoke + UX cleanup (PR #132)++Two reported issues, one combined fix.++- **#131 — security smoke test.** New test in `services/api/tests/test_security_defaults.py` walks every API endpoint and asserts that no dev-mode auth bypass is reachable when `AISOC_DEV_MODE` is unset. Catches regressions from the dev-mode unification (H-8) above.+- **#130 — UX cleanup.** `idempotency_key`, `payload.connector_type`, and `provider` no longer leak unsanitised user input into structured logs; the inline sanitisation pattern (`replace("\r", "").replace("\n", " ")[:N]`) is now used uniformly across the alerts, effective-permissions, and waitlist endpoints. Also fixes the duplicated `[Unreleased]` heading in CHANGELOG that #130 reported.++### Playbook engine — correctness pass (PR #129)++Tightens the playbook engine so failures stay local instead of cascading.++- **Bounded eval / playbook timeouts (H-7).** Already documented above as a separate `[Unreleased]` entry; this PR is the implementation.+- **Saga-style error handling.** `services/agents/app/playbook/runner.py` now wraps each step in an explicit try/except that captures `asyncio.CancelledError` separately from playbook-level errors, so an operator-issued cancel doesn't masquerade as a step failure in the audit log.+- **Tests.** Twelve new tests in `services/agents/tests/test_playbook_runner.py` cover happy path, single-step failure, cascading failure with rollback, cancellation, and the three SSRF guard rejection paths.+## [7.3.1] — 2026-05-14### Smoke-test hotfix — `/api/v1/alerts` works on a fresh clonediff --git a/README.md b/README.mdindex 29a014589..7ded670ac 100644--- a/README.md+++ b/README.md@@ -939,16 +939,26 @@ The public roadmap lives in [ROADMAP.md](ROADMAP.md). All releases through **v7.- **v7.1.0** — Cloud Security Coverage Wave: documentation backfill for Wiz, AWS Security Hub, and Lacework; two new CNAPP connectors (Prisma Cloud, Orca); three native AWS connectors (GuardDuty, CloudTrail, VPC Flow Logs); dual-mode Kubernetes audit log connector (apiserver webhook + file_tail) with a new `k8s-audit` ingest template.- **v7.3.0** — Founder-flow series (PR1–PR7): `docker-compose.dev.yml` alias, `.env.example` cleanup with a pre-filled `AISOC_CREDENTIAL_KEY`, `scripts/run_evals.py --suite` CLI contract, `aisoc serve` / `aisoc db upgrade` / `aisoc mcp serve|install`, the `aisoc submit` CLI command + canonical `examples/alerts/lateral-movement.json` fixture, and the Path C founder-style CLI walkthrough in [`apps/docs/docs/quickstart.md`](apps/docs/docs/quickstart.md). The recorded "fresh-clone to first alert" demo now runs verbatim on `main`.- **v7.3.1** — Smoke-test hotfix: idempotent migrations (`005_compliance.sql`, `025_connectors_click_and_connect.sql`, new `042_alerts_schema_drift_fix.sql` adding eleven missing `alerts` columns), and a new `POST /api/v1/alerts/submit` endpoint that synthesises an `Alert` row directly from a batch of OCSF events. `aisoc submit` now targets the new endpoint, so the web console at `/alerts` lights up immediately on a fresh clone without Kafka / Fusion in the loop.--Next (**v8.0** — see [ROADMAP.md](ROADMAP.md)):--- Mobile responder console (React Native) — triage and acknowledge from phone-- Plugin marketplace v3 (commercial plugins, revenue sharing, signed publishing)-- NL→query: `"show me failed logins from new ASNs last 24h"` → ES|QL / KQL-- AI-generated threat intel briefings from public feeds-- Embedded red-team scoring (live ATT&CK coverage % widget)-- SLA breach predictor (ML on historical MTTR data) and incident cost estimator-- SOC-in-a-box one-click cloud deploy (Terraform module for AWS / GCP)+- **v8.0 wave-1 (on `main`, not yet tagged)** — Architectural foundation for the v8.0 line, landed by [#125](https://github.com/beenuar/AiSOC/pull/125) plus the security and correctness wave that followed:+ - **Graph at ingest** — Neo4j v1.0 schema (17 node labels, 14 edge types), batched UNWIND upserts off the Kafka consumer, `security.graph_updates` topic, and OCSF extractors for AWS Security Hub / GitHub audit / Okta system log / Kubernetes audit (`services/ingest/internal/graph/`).+ - **Four-agent rebrand** — `DetectAgent`, `TriageAgent`, `HuntAgent`, `RespondAgent` are now the public façade in `services/agents/app/agents/`, with back-compat aliases so existing imports keep working.+ - **`/hunt` natural-language surface** — `apps/web/src/app/(app)/hunt/` plus `services/api/app/api/v1/endpoints/saved_hunts.py`. Type a hypothesis in English, get ES|QL / SPL / KQL templates back, save and schedule the hunt.+ - **Sixteen first-party connectors** — wave-1 (6 fully tested: tines, torq, falco, pagerduty, opsgenie, confluence_audit) and wave-2 (10 wip, of which cloudflare_zt / sysdig / vault / snowflake already have full fixtures + tests).+ - **L0–L4 automation maturity** — `apps/web/content/papers/l0-l4-automation-maturity.md` + PDF, plus the marketing surfaces (sovereign one-pager, three anchor blog posts, reference-customer template).+ - **Public weekly benchmark scoreboard** — `apps/docs/docs/benchmark-scoreboard.mdx` + `apps/docs/static/data/scoreboard.json`, fed by the weekly `wet-eval.yml` GitHub Action.+ - **Security wave** — 8 critical/high CVE-class fixes shipped before the v8.0 cut: rule-engine `eval()` RCE elimination ([#116](https://github.com/beenuar/AiSOC/pull/116)), `/hunts` and `/cases` tenant isolation ([#117](https://github.com/beenuar/AiSOC/pull/117), [#118](https://github.com/beenuar/AiSOC/pull/118)), CORS lockdown ([#119](https://github.com/beenuar/AiSOC/pull/119)), playbook SSRF guard ([#120](https://github.com/beenuar/AiSOC/pull/120)), plugin-manager OCI install hardening ([#121](https://github.com/beenuar/AiSOC/pull/121)), audit-log trust-boundary closures ([#122](https://github.com/beenuar/AiSOC/pull/122)), `/alerts/submit` abuse + replay hardening ([#123](https://github.com/beenuar/AiSOC/pull/123)), Pydantic v1 → v2 settings migration ([#124](https://github.com/beenuar/AiSOC/pull/124)), bounded eval + playbook timeouts ([#126](https://github.com/beenuar/AiSOC/pull/126)), dev-mode unification ([#127](https://github.com/beenuar/AiSOC/pull/127)), and untrusted-enrichment sanitisation before LLM ([#128](https://github.com/beenuar/AiSOC/pull/128)).+ - **Static-analysis hygiene** — Python CodeQL alert count on `main` driven to zero by [#133](https://github.com/beenuar/AiSOC/pull/133), [#136](https://github.com/beenuar/AiSOC/pull/136), and [#137](https://github.com/beenuar/AiSOC/pull/137); enforced as a CI gate going forward.+ - **First community contribution** — [#135](https://github.com/beenuar/AiSOC/pull/135) (UEBA service environment-variable alignment, closes [#134](https://github.com/beenuar/AiSOC/issues/134)). Every UEBA variable now accepts both unprefixed (`DATABASE_URL`) and legacy (`UEBA_DATABASE_URL`) forms; unprefixed wins. Documented in [Environment variables](apps/docs/docs/deployment/env-vars.md#ueba-service-servicesueba).++Next (**v8.0 wave-2** — checkpointed with `[~]` in `AISOC_V8_PROGRESS.md`):++- Versioned `:CONFIGURED_AS {ts}` config-snapshot writers for AWS / GitHub / Lacework / Okta (T1.2)+- `LLMInputContract` fail-closed validator coverage across every sub-agent (T2.3)+- Attack-chain ranking + timeline UI hardening (T3.3) and business-context YAML rule engine (T3.5)+- Effective-permissions resolvers for Azure / GCP / Okta / GWS (T3.2)+- ChatOps full coverage: Slack Block Kit approvals, Teams Adaptive Card mirror, signed email approval URLs (T3.6)+- Remaining wave-2 connectors hardened to wave-1 quality (sublime_security, abnormal_security, box, dropbox, oci, datadog)+- Mobile responder console (React Native), plugin marketplace v3, AI-generated threat intel briefings, embedded red-team scoring widget, SLA breach predictor, SOC-in-a-box one-click cloud deploy---diff --git a/apps/docs/docs/deployment/env-vars.md b/apps/docs/docs/deployment/env-vars.mdindex a66f08e87..0a128175b 100644--- a/apps/docs/docs/deployment/env-vars.md+++ b/apps/docs/docs/deployment/env-vars.md@@ -225,23 +225,27 @@ Source: [`services/ingest/internal/config/config.go`](https://github.com/beenuarSource: [`services/ueba/app/core/config.py`](https://github.com/beenuar/AiSOC/blob/main/services/ueba/app/core/config.py)-All variables use the `UEBA_` prefix.--| Variable | Default | Description |-|----------|---------|-------------|-| `UEBA_DATABASE_URL` | `postgresql+asyncpg://aisoc:aisoc@localhost:5432/aisoc` | Postgres DSN for baselines and anomalies |-| `UEBA_KAFKA_BOOTSTRAP_SERVERS` | `localhost:9092` | Kafka brokers |-| `UEBA_KAFKA_INPUT_TOPIC` | `security.events` | Topic the scorer consumes |-| `UEBA_KAFKA_OUTPUT_TOPIC` | `ueba.anomalies` | Topic the scorer emits to |-| `UEBA_KAFKA_CONSUMER_GROUP` | `ueba-service` | Kafka consumer group ID |-| `UEBA_BASELINE_WINDOW_DAYS` | `30` | History window used to compute behavioural baselines |-| `UEBA_ANOMALY_THRESHOLD` | `3.0` | Z-score threshold for flagging an event as anomalous |-| `UEBA_PEER_GROUP_MIN_SIZE` | `3` | Minimum peers required for peer-group analysis |-| `UEBA_SCORING_BATCH_SIZE` | `100` | Events processed per scoring batch |-| `UEBA_OTEL_ENDPOINT` | `http://localhost:4317` | OTLP gRPC endpoint |-| `UEBA_SERVICE_NAME` | `aisoc-ueba` | OTel service name |-| `UEBA_HOST` | `0.0.0.0` | HTTP listener interface |-| `UEBA_PORT` | `8004` | HTTP listener port |+Every variable in this section accepts **both** an unprefixed name (e.g. `DATABASE_URL`, `KAFKA_BOOTSTRAP_SERVERS`) and the legacy `UEBA_`-prefixed name (e.g. `UEBA_DATABASE_URL`, `UEBA_KAFKA_BOOTSTRAP_SERVERS`). When both are set, the **unprefixed form wins** — this matches the convention used by every other Python service in the repo and the `services/ueba` section of `docker-compose.yml`, which exports unprefixed names.++The table below shows the canonical (unprefixed) name first and the legacy alias second. New deployments should prefer the unprefixed form. (See PR [#135](https://github.com/beenuar/AiSOC/pull/135) for the implementation and [Issue #134](https://github.com/beenuar/AiSOC/issues/134) for the original report.)++| Variable | Legacy alias | Default | Description |+|----------|--------------|---------|-------------|+| `DATABASE_URL` | `UEBA_DATABASE_URL` | `postgresql+asyncpg://aisoc:aisoc@localhost:5432/aisoc` | Postgres DSN for baselines and anomalies |+| `KAFKA_BOOTSTRAP_SERVERS` | `UEBA_KAFKA_BOOTSTRAP_SERVERS` | `localhost:9092` | Kafka brokers |+| `KAFKA_INPUT_TOPIC` | `UEBA_KAFKA_INPUT_TOPIC` | `security.events` | Topic the scorer consumes |+| `KAFKA_OUTPUT_TOPIC` | `UEBA_KAFKA_OUTPUT_TOPIC` | `ueba.anomalies` | Topic the scorer emits to |+| `KAFKA_CONSUMER_GROUP` | `UEBA_KAFKA_CONSUMER_GROUP` | `ueba-service` | Kafka consumer group ID |+| `BASELINE_WINDOW_DAYS` | `UEBA_BASELINE_WINDOW_DAYS` | `30` | History window used to compute behavioural baselines |+| `ANOMALY_THRESHOLD` | `UEBA_ANOMALY_THRESHOLD` | `3.0` | Z-score threshold for flagging an event as anomalous |+| `PEER_GROUP_MIN_SIZE` | `UEBA_PEER_GROUP_MIN_SIZE` | `3` | Minimum peers required for peer-group analysis |+| `SCORING_BATCH_SIZE` | `UEBA_SCORING_BATCH_SIZE` | `100` | Events processed per scoring batch |+| `OTEL_ENDPOINT` | `UEBA_OTEL_ENDPOINT` | `http://localhost:4317` | OTLP gRPC endpoint |+| `SERVICE_NAME` | `UEBA_SERVICE_NAME` | `aisoc-ueba` | OTel service name |+| `HOST` | `UEBA_HOST` | `0.0.0.0` | HTTP listener interface |+| `PORT` | `UEBA_PORT` | `8004` | HTTP listener port |++`services/ueba/alembic/env.py` follows the same rule: it reads `DATABASE_URL` first and falls back to `UEBA_DATABASE_URL`, so `alembic upgrade head` and the running service always see the same DSN.---diff --git a/apps/docs/docs/operations/security.md b/apps/docs/docs/operations/security.mdindex c78ba7830..5f8c6f731 100644--- a/apps/docs/docs/operations/security.md+++ b/apps/docs/docs/operations/security.md@@ -283,6 +283,17 @@ When you move from `pnpm aisoc:demo` to a production deployment, walk through th- [ ] Enable mTLS between services if you're running on Kubernetes with a mesh.- [ ] Subscribe to the AiSOC GitHub Security Advisories for vulnerability notifications.+## Static analysis (CodeQL)++GitHub CodeQL runs on every pull request and on a nightly schedule against `main`. As of the v8.0 wave-1 push the Python alert count on `main` is zero, and we treat that as a CI gate — a new alert breaks the security workflow and blocks the next release.++Two patterns are worth documenting because they came up repeatedly during the sweep that drove the alert count to zero:++- **`py/log-injection` — sanitise inline at the call site.** When a user-controlled or DB-derived string lands in a structured log entry, do the cleansing right where the log call happens, not in a helper function. CodeQL's taint tracker doesn't follow `_log_safe(value)` through a function boundary reliably, but it does recognise an inline `.replace("\r", "").replace("\n", " ")[:32]` chain. The canonical example is `services/api/app/api/v1/endpoints/waitlist.py` — `entry_id` and `user.user_id` are `uuid.UUID`-typed so they can't actually contain CR/LF, but we still sanitise them explicitly so the property is visible to both CodeQL and future readers.+- **`py/import-and-import-from` — pick one import style per module.** Tests that need to monkey-patch a module-level constant should use `pytest.MonkeyPatch.setattr(module, "_NAME", value)` (importing the module via the standard `from app.connectors.foo import _NAME` form), not `import app.connectors.foo as foo_module` _and_ a from-import for the same names. The dual style trips CodeQL's import-redundancy check.++The remaining alert categories (`py/uninitialized-local-variable`, `py/side-effect-in-assert`, `py/incomplete-url-substring-sanitization`, `py/ineffectual-statement`, `py/unnecessary-lambda`, `py/mixed-returns`, `py/unused-global-variable`, `py/unused-import`) are all standard Python correctness items and the fixes were uncontroversial — see the `[Unreleased]` section of the [CHANGELOG](../../../CHANGELOG.md) for the per-PR breakdown.+## Reporting a vulnerabilitySecurity issues should be reported privately via [GitHub Security Advisories](https://github.com/beenuar/AiSOC/security/advisories/new), not as public issues. We aim to acknowledge reports within 2 business days and ship a coordinated disclosure with the reporter. The [Contributing guidelines](../contributing/guidelines) cover the full process.