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.

chore(release): v17.1.0 (#1184)

Beenu Arora1b8bc2d4afd4
diff --git a/.github/release-packages.yml b/.github/release-packages.yml
index 5f40a97f7..76322e40c 100644
--- a/.github/release-packages.yml
+++ b/.github/release-packages.yml
@@ -78,48 +78,27 @@ packages:
registry: pypi
directory: packages/aisoc-sandbox
install: pip install aisoc-sandbox
- published: false
- reason: >-
- No pending trusted publisher is registered on PyPI and the
- `AISOC_PYPI_TRUSTED_PUBLISHING` repository variable is unset, so the
- upload step does not run. See
- docs/operations/publishing.md#one-time-setup-pypi.
+ published: true
- name: aisoc-cli
registry: pypi
directory: packages/aisoc-cli
install: pip install aisoc-cli
- published: false
- reason: >-
- No pending trusted publisher is registered on PyPI and
- `AISOC_PYPI_TRUSTED_PUBLISHING` is unset. See
- docs/operations/publishing.md#one-time-setup-pypi.
+ published: true
- name: aisoc-sdk
registry: pypi
directory: packages/sdk-py
install: pip install aisoc-sdk
- published: false
- reason: >-
- No pending trusted publisher is registered on PyPI and
- `AISOC_PYPI_TRUSTED_PUBLISHING` is unset. See
- docs/operations/publishing.md#one-time-setup-pypi.
+ published: true
- name: aisoc-plugin-sdk
registry: pypi
directory: packages/plugin-sdk-py
install: pip install aisoc-plugin-sdk
- published: false
- reason: >-
- No pending trusted publisher is registered on PyPI and
- `AISOC_PYPI_TRUSTED_PUBLISHING` is unset. See
- docs/operations/publishing.md#one-time-setup-pypi.
+ published: true
- name: aisoc-detections
registry: pypi
directory: packages/aisoc-detections
- published: false
- reason: >-
- No pending trusted publisher is registered on PyPI and
- `AISOC_PYPI_TRUSTED_PUBLISHING` is unset. See
- docs/operations/publishing.md#one-time-setup-pypi.
+ published: true
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ee8491374..26f158e2f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [17.1.0] - 2026-10-07
+
+### Security
+
+- **GHSA-w4r8-969c-67p2 (High, CWE-347): the audit trail could be forged by
+ an unauthenticated caller.** `AuditMiddleware` decoded the request's Bearer
+ token with signature verification disabled and wrote its claims into the
+ per-tenant tamper-evident audit chain on every mutating request — before
+ authentication ran, and regardless of whether it failed. A self-crafted JWT
+ got 401 from the route and still planted `actor_email` / `tenant_id` of the
+ attacker's choosing into any known tenant's chain, reproduced against a
+ production-mode stack with every migration applied: the forged entry landed
+ at `chain_index` 0 while a no-credential control wrote nothing. The
+ middleware now audits only the verified principal authentication records on
+ `request.state`; a request that fails authentication writes no audit row. A
+ sibling sweep confirmed this was the only live instance of trusting an
+ unverified token. Reported by [@cqliuke](https://github.com/cqliuke) through
+ private vulnerability reporting; affects every release up to and including
+ 17.0.0. See the published advisory:
+ [GHSA-w4r8-969c-67p2](https://github.com/beenuar/AiSOC/security/advisories/GHSA-w4r8-969c-67p2).
+ (#1182)
+- **Dependency floors for a fresh batch of npm advisories, plus multidict.**
+ `compression` ≥ 1.8.2, `shell-quote` ≥ 1.11, `source-map-js` ≥ 1.2.2,
+ `tinypool` ≥ 2.1.2 and `proxy-addr` ≥ 2.0.8 across all four npm install
+ roots (root workspace, `apps/mobile`, `services/mcp/cursor-extension`,
+ `services/realtime`), and `multidict` 6.9.1 in the three Python lockfiles
+ that pin it. These advisories published after v17.0.0 and were failing
+ Trivy and security-audit on every open pull request. (#1180)
+
### Added
- Admin Users administration: a console-only **Settings → Users** screen
(admin nav, hidden entirely for viewer/infosec) with server-side
@@ -33,6 +62,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
(`tests/test_sso_enterprise_policy.py`) locking the least-privilege
vocabulary, the fail-closed gates, and the off-by-default flag.
+Both blocks land the reviewed scope of #1179 by
+[@alexmateescu](https://github.com/alexmateescu), merged via #1183 with the
+author's commits preserved.
### Fixed
@@ -55,6 +87,66 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
and a case-workspace mock missing the `getTimeline`/`reopen` stubs
upstream components now call. Type-check is clean and the full console
suite (838 tests) passes on the branch.
+- **Fresh installs no longer risk a zero-permission administrator.**
+ Migration `091` stops bulk-seeding an `infosec` row into every tenant's
+ `roles` table: a tenant's first `roles` row flips permission resolution
+ from the static map to the database, and a seeded row with no grants
+ resolved every user of that tenant — including break-glass admin — to zero
+ permissions. `093` repairs already-seeded deployments and backfills role
+ labels; the canonical `infosec` definition lives in `ROLE_PERMISSIONS` /
+ `GRANTABLE_ROLES`, which assignment validates against, so nothing in
+ `roles` is needed for it to be assignable. (#1183)
+- **`optional_user` forwarded the wrong argument slot**, turning every
+ anonymous dashboard poll into a 500. (#1183)
+- **Enrichment merges kept only the top-scoring source's WHOIS and dropped
+ DNS records entirely.** `mergeResults` copied `Whois` only inside the
+ max-risk branch, so a source that answered with WHOIS but not the highest
+ risk score lost it whenever two or more sources returned; `DNSRecords`
+ were never merged at all. WHOIS now falls back to the first source that
+ has one (the highest-risk source still wins when it does), and DNS records
+ are union-merged and deduplicated in order. Community contribution. (#1178)
+- **The grading-integrity gate locked itself out after a merge burst.** Its
+ staleness check queried *successful* push runs only and read "none of the
+ newest five is for a recent commit" as a stale API snapshot — but a
+ workflow genuinely failing on 30+ consecutive commits produces the same
+ signature, and for `grading-integrity.yml` itself the condition was
+ self-locking: each push run failing the check was the reason no recent
+ successful run existed. `main` was red on it for two days with no commit
+ able to fix it. Freshness is now proven by push runs of any conclusion
+ (a failed run for a recent commit proves the read is fresh; on a push
+ event the run executing the gate is itself the proof) while only
+ successes are graded; the genuine stale-snapshot refusal is preserved,
+ and four of the five new tests fail on the previous code. (#1181)
+- **Six repairs to what the v17 follow-on landed with**, two of them runtime
+ bugs: the `SSO_LOCAL_ADMIN_ONLY` gate tested membership against a
+ *function object* (`user.role not in wildcard_roles`), so password
+ sign-in answered 500 instead of applying the policy; two `logger.warning`
+ calls in `cases.py` passed a keyword stdlib logging rejects, raising
+ inside their own `except` blocks; plus a dead `StepKind.WARNING` branch,
+ a shadowed duplicate `period` field, a `str` assigned into a `CaseStatus`
+ field, and seven mypy `union-attr` findings. (#1160)
+- **The release step that moves the `stable` Helm chart channel had never
+ once worked.** It read the channel with `helm show chart --version stable`,
+ but `--version` takes a semver *constraint*, so helm rejected the channel
+ name client-side before any network call — in 457 ms, with `2>/dev/null`
+ hiding the message and `pipefail` carrying the failure out. (#1129, #1130)
+
+### Changed
+
+- The four OpenTelemetry modules move to 1.47.0 together. (#1175)
+- Storybook group to 10.6.1 (test-runner 0.26.0); the bump pulls esbuild
+ 0.28.2 alongside the override-pinned 0.28.1, now recorded in the toolchain
+ gate's expected set with the gate's own self-test fixtures updated to
+ match. (#1146)
+- GitHub Actions pins move to their v7 majors, including the last floating
+ tags. (#1149, #1176)
+- Two consolidated Dependabot waves — 19 bumps with the recorded reason
+ fastapi cannot move, then seven more — plus `@types/node` 26.6.4.
+ (#1161, #1174, #1148)
+- The SCIM contract gate now sees derived-role declarations
+ (`ROLE_PERMISSIONS["infosec"] = …` assigned by subscript), so it no longer
+ reports a role that resolves to 18 permissions as granting nothing; the
+ committed OpenAPI spec was regenerated alongside. (6fc5719a)
## [17.0.0] - 2026-10-05
diff --git a/README.md b/README.md
index 6ba257603..00cd0d061 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
**An open-source, self-hostable AI Security Operations Center.** It ingests your security telemetry, detects and correlates threats, investigates them with AI agents whose reasoning is fully auditable, and proposes responses a human approves.
-[![License: MIT](https://img.shields.io/badge/License-MIT-22c55e.svg?style=flat-square)](https://opensource.org/licenses/MIT) [![Version](https://img.shields.io/badge/version-17.0.0-f59e0b?style=flat-square)](CHANGELOG.md) [![CI](https://img.shields.io/github/actions/workflow/status/beenuar/AiSOC/ci.yml?branch=main&label=CI&style=flat-square)](https://github.com/beenuar/AiSOC/actions/workflows/ci.yml)
+[![License: MIT](https://img.shields.io/badge/License-MIT-22c55e.svg?style=flat-square)](https://opensource.org/licenses/MIT) [![Version](https://img.shields.io/badge/version-17.1.0-f59e0b?style=flat-square)](CHANGELOG.md) [![CI](https://img.shields.io/github/actions/workflow/status/beenuar/AiSOC/ci.yml?branch=main&label=CI&style=flat-square)](https://github.com/beenuar/AiSOC/actions/workflows/ci.yml)
[![CodeQL](https://img.shields.io/github/actions/workflow/status/beenuar/AiSOC/codeql.yml?branch=main&label=CodeQL&style=flat-square)](https://github.com/beenuar/AiSOC/actions/workflows/codeql.yml) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/beenuar/AiSOC/badge)](https://securityscorecards.dev/viewer/?uri=github.com/beenuar/AiSOC) [![Technical Guide](https://img.shields.io/badge/Technical%20Guide-22%20page%20PDF-dc2626?style=flat-square)](https://github.com/beenuar/AiSOC/blob/main/apps/web/public/papers/aisoc-technical-guide.pdf)
**[Technical Guide (PDF)](https://github.com/beenuar/AiSOC/blob/main/apps/web/public/papers/aisoc-technical-guide.pdf)** · [Docs](https://beenuar.github.io/AiSOC/) · [Architecture](docs/architecture/README.md) · [What actually works](docs/audit/REPOSITORY_REALITY.md) · [Discussions](https://github.com/beenuar/AiSOC/discussions)
@@ -209,7 +209,7 @@ Agents triage alerts and investigate incidents. What they can and cannot do:
| Per-tenant detection tuning in the live engine | Stable | Live Postgres: tuning written changes what the engine fires, with a negative control | Yes |
| Scheduled connectors | Stable | Live scheduler polls a stub vendor into ingest, with a negative control | Yes |
| UEBA | Stable | Live Postgres: migrations, scoring, persistence, isolation, with a negative control | Yes, `full` profile |
-| Package distribution (npm/PyPI) | Ready, unpublished | `release.yml` builds and packs all eight on every tag | Install from source — the upload is blocked on registry credentials, which is an account action |
+| Package distribution (npm/PyPI) | Beta | The five PyPI packages resolve at the tree's versions, checked against the live registries in both directions with a self-test; the npm half has no registry state to verify | `pip install aisoc-sandbox` (and the other four) works today; the three npm packages still need the first-upload `NPM_TOKEN`, an account action |
## What AiSOC is not
diff --git a/RELEASES.md b/RELEASES.md
index de138d53e..53cbb5af3 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -2,7 +2,9 @@
This file mirrors what used to live in the "What's new" section of [`README.md`](README.md). The complete, machine-readable inventory (with file paths, env-var diffs, and per-release test counts) lives in [`CHANGELOG.md`](CHANGELOG.md).
-> **TL;DR for first-time visitors:** AiSOC is on `v17.0.0`, released 2026-10-05. **One breaking change and one number that changes meaning without erroring** — the second is the one to read twice. `POST /api/v1/detection-loop/suggest` and its two `GET /detection-loop/suggestions` reads are removed with their three schemas; no migration is needed because none of them ever worked, since they queried `aisoc_alerts`, `aisoc_detection_rules` and `alerts.evidence`, none of which any migration creates. The governed equivalent is `POST /api/v1/detection-proposals`. The quieter change: **`alerts.total` on `/metrics/dashboard` now counts open work** — `new`, `triaging`, `in_progress` — rather than every alert ever received, and the severity counts beside it are scoped the same way, because the console labels them *Active Alerts* and *Critical — Require immediate action*. A tenant who had resolved everything was still shown their entire historical intake as outstanding, and the number only ever rose. Closed work is now reported separately as `alerts.resolved`. **Every approval was failing**: the dispatch built its principal from two attributes `CurrentUser` has never defined, so the actions service received an empty permission list and refused, while the approval row recorded the decision — the action never ran, for any role, including platform admin. **You can now choose where the model runs**: `make up` is unchanged (CPU, no account, no key), `make up-gpu` layers an NVIDIA device reservation onto the bundled Ollama, and `make up-host-llm` uses an Ollama you already run — the only route to a GPU on Apple Silicon, since Docker Desktop cannot pass Metal into a Linux container. `GET /api/v1/llm/runtime` reports where the model *actually* is by asking Ollama rather than reading the compose file back, because a reservation is a request and a model can still land on the CPU; it answers `unknown` for an idle instance rather than guessing. `POST /api/v1/llm/credentials/test` places one real one-token call, so a revoked key is found at the moment you save it instead of surfacing later as triage quietly falling back. Closed cases can be reopened through `POST /api/v1/cases/{id}/reopen` with a recorded reason; `PATCH` stays forward-only, which is what makes "this case was closed" mean something. Investigations now reason over the alerts' real `raw_event` payloads instead of a restated title, and the groundedness gate covers that path too — refusing to score an empty evidence set rather than demoting everything and appearing to catch hallucination. A period-over-period delta of `-93.75` rendered as `-9375%`; the global time-window selector drove no fetch at all. The chart publishes as **`7.4.0`**. Everything below describes v16.0.1 and earlier, which this release does not change.
+> **TL;DR for first-time visitors:** AiSOC is on `v17.1.0`, released 2026-10-07. **A security release plus the first community-built console surface; no breaking changes.** It closes **[GHSA-w4r8-969c-67p2](https://github.com/beenuar/AiSOC/security/advisories/GHSA-w4r8-969c-67p2)**, a high-severity audit-trail forgery reported by [cqliuke](https://github.com/cqliuke): the audit middleware decoded the request's Bearer token with signature verification **off** and wrote its claims into the per-tenant tamper-evident audit chain before authentication ran — so an unauthenticated caller with a self-crafted JWT got 401 from the route and still planted any actor and any known tenant id into that tenant's chain. Reproduced against a production-mode stack (forged entry at `chain_index` 0; a no-credential control wrote nothing); the middleware now audits only the verified principal, and a failed authentication writes no row. **If your deployment's audit chain feeds compliance evidence, upgrade** — entries written by unauthenticated requests before this release are indistinguishable from real ones by content alone, so treat chain position and request logs as the tie-breaker. The feature half is the reviewed scope of a community PR by [alexmateescu](https://github.com/alexmateescu): an admin-only **Settings → Users** screen (server-side pagination/search, multi-role assignment with a live effective-permissions preview, enable/disable with session revocation, audited permanent delete guarded against self-delete and last-admin lockout), an editable Roles & Permissions catalog, and a feature-flagged enterprise SSO wave (off by default; JIT lands as `viewer`, admin is unreachable from SSO without an explicit allowlisted group mapping). Migration `091` no longer bulk-seeds a role row into every tenant — the write that could resolve a fresh install's every user, break-glass admin included, to **zero permissions** — and `093` repairs deployments the old seed already touched. Also in: threat-intel enrichment no longer drops WHOIS from non-top-scoring sources and now union-merges DNS records; the grading-integrity gate can no longer lock itself out after a merge burst (it read "no recent successful run" as a stale API read, which its own failures then perpetuated for two days); and the release step that moves the `stable` chart channel ran for the first time ever (`--version` takes a semver constraint, so `--version stable` had failed client-side on every release since the step existed). The chart publishes as **`7.5.0`**. Everything below describes v17.0.0 and earlier, which this release does not change.
+>
+> **Previously:** AiSOC was on `v17.0.0`, released 2026-10-05. **One breaking change and one number that changes meaning without erroring** — the second is the one to read twice. `POST /api/v1/detection-loop/suggest` and its two `GET /detection-loop/suggestions` reads are removed with their three schemas; no migration is needed because none of them ever worked, since they queried `aisoc_alerts`, `aisoc_detection_rules` and `alerts.evidence`, none of which any migration creates. The governed equivalent is `POST /api/v1/detection-proposals`. The quieter change: **`alerts.total` on `/metrics/dashboard` now counts open work** — `new`, `triaging`, `in_progress` — rather than every alert ever received, and the severity counts beside it are scoped the same way, because the console labels them *Active Alerts* and *Critical — Require immediate action*. A tenant who had resolved everything was still shown their entire historical intake as outstanding, and the number only ever rose. Closed work is now reported separately as `alerts.resolved`. **Every approval was failing**: the dispatch built its principal from two attributes `CurrentUser` has never defined, so the actions service received an empty permission list and refused, while the approval row recorded the decision — the action never ran, for any role, including platform admin. **You can now choose where the model runs**: `make up` is unchanged (CPU, no account, no key), `make up-gpu` layers an NVIDIA device reservation onto the bundled Ollama, and `make up-host-llm` uses an Ollama you already run — the only route to a GPU on Apple Silicon, since Docker Desktop cannot pass Metal into a Linux container. `GET /api/v1/llm/runtime` reports where the model *actually* is by asking Ollama rather than reading the compose file back, because a reservation is a request and a model can still land on the CPU; it answers `unknown` for an idle instance rather than guessing. `POST /api/v1/llm/credentials/test` places one real one-token call, so a revoked key is found at the moment you save it instead of surfacing later as triage quietly falling back. Closed cases can be reopened through `POST /api/v1/cases/{id}/reopen` with a recorded reason; `PATCH` stays forward-only, which is what makes "this case was closed" mean something. Investigations now reason over the alerts' real `raw_event` payloads instead of a restated title, and the groundedness gate covers that path too — refusing to score an empty evidence set rather than demoting everything and appearing to catch hallucination. A period-over-period delta of `-93.75` rendered as `-9375%`; the global time-window selector drove no fetch at all. The chart publishes as **`7.4.0`**. Everything below describes v16.0.1 and earlier, which this release does not change.
>
> **Previously:** AiSOC was on `v16.0.1`, released 2026-10-04. **A security release, no breaking changes.** It closes **GHSA-4gx4-x7gm-4xq8**, a high-severity privilege escalation reported by [HaiND](https://github.com/Haind03): the check that decides whether a caller may *confer* authority read the caller's static role, while the check that admits a caller to the route read its database-resolved permissions. Those are two different answers whenever a tenant uses database-backed RBAC — which is the configuration where it matters, since narrowing an account is what those tables are for. A `tenant_admin` deliberately restricted to `users:write` still carried 28 permissions statically and could grant itself the other 27. **If you use the `roles` and `user_roles` tables to restrict accounts, upgrade.** Deployments with no RBAC rows were never exposed, because the static map was already the correct answer for them. The report named one route; the resolver is shared, so five more had it — authoring a role, re-permissioning one, creating a user, delegating to a child tenant, and minting an API key, that last needing no target user and yielding a durable credential. `scripts/check_role_grant_scope.py` gains a direction that fails CI when a grant is measured against the wrong authority; its previous directions passed on the vulnerable tree because they asked only whether a route *reached* the chokepoint, and all six did. Also raises `serialize-javascript` to `>=7.1.2` and `http-cache-semantics` to `>=4.3.0`. The chart publishes as **`7.3.1`**. Everything below describes v16.0.0 and earlier, which this release does not change.
>
@@ -14,10 +16,33 @@ This file mirrors what used to live in the "What's new" section of [`README.md`]
## What's new
-`VERSION` is `17.0.0`. The **v17.0.0** release (2026-10-05) removes three
+`VERSION` is `17.1.0`. The **v17.1.0** release (2026-10-07) is a security
+release plus the first community-built console surface, with no breaking
+changes. The security half closes
+[GHSA-w4r8-969c-67p2](https://github.com/beenuar/AiSOC/security/advisories/GHSA-w4r8-969c-67p2)
+(High, CWE-347): the audit middleware decoded the request's Bearer token
+with signature verification off and wrote its claims into the per-tenant
+tamper-evident audit chain before authentication ran, so an unauthenticated
+caller could plant any actor and any known tenant id into that tenant's
+chain while the route itself answered 401. The middleware now audits only
+the verified principal, and a failed authentication writes nothing. The
+feature half lands the reviewed scope of a community PR: an admin-only
+**Settings → Users** screen with multi-role assignment and a live
+effective-permissions preview, an editable Roles & Permissions catalog, and
+a feature-flagged enterprise SSO wave that is off by default and JIT-lands
+as `viewer`. Migration `091` no longer bulk-seeds a role row into every
+tenant (the write that could resolve a fresh install to zero permissions,
+break-glass admin included) and `093` repairs deployments the old seed
+touched. Enrichment keeps WHOIS from non-top-scoring sources and
+union-merges DNS records; the grading-integrity gate no longer locks itself
+out after a merge burst; and the `stable` Helm chart channel moved for the
+first time ever, because the step that moves it had failed client-side on
+every release since it existed. The chart publishes as `7.5.0`.
+
+Before it, the **v17.0.0** release (2026-10-05) removed three
`/detection-loop/suggest*` routes that never worked — they queried three
relations no migration creates, so every caller was already receiving an
-error — and changes one number's meaning without erroring, which is the
+error — and changed one number's meaning without erroring, which is the
change to read twice: **`alerts.total` on `/metrics/dashboard` now counts
open work rather than every alert ever received**, with the severity counts
beside it scoped the same way. A panel charting cumulative intake from that
diff --git a/VERSION b/VERSION
index aac58983e..d9e58927a 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-17.0.0
+17.1.0
diff --git a/apps/docs/docs/console/users-administration.md b/apps/docs/docs/console/users-administration.md
new file mode 100644
index 000000000..ca2d11bf0
--- /dev/null
+++ b/apps/docs/docs/console/users-administration.md
@@ -0,0 +1,78 @@
+---
+id: users-administration
+title: Users administration
+sidebar_label: Users administration
+---
+
+# Users administration
+
+The **Settings → Users** screen: who is in the tenant, what they hold, and
+every control an administrator has over both. Added in v17.1.0.
+
+Only administrators see it — the navigation entry is hidden entirely for
+`viewer` and `infosec`, and every route behind it enforces `roles:write`
+server-side, so hiding the menu is cosmetics rather than the control.
+
+## The screen
+
+A server-side paginated, searchable, filterable list over
+`GET /api/v1/admin/users`. Each row carries the identity, active state,
+role pills, and last-activity. From a row an administrator can:
+
+- **Assign roles** — a checkbox modal (multi-role) with a **live
+ effective-permissions preview**: it shows the union of permissions the
+ selection resolves to *before* you commit, read from the real catalog
+ (`GET /api/v1/rbac/roles`), so what you grant is what you saw. A `reason`
+ is required and lands verbatim in the audit log. Granting a role you do
+ not hold yourself is refused server-side — a granter can only confer
+ what it has.
+- **Enable / disable** — disabling also revokes the user's sessions, so
+ "disabled" means *now*, not "after their token expires".
+- **Delete permanently** — guarded three ways: a mandatory reason, a typed
+ confirmation of the target's email, and a final confirm. Deleting
+ yourself is refused, and so is any write that would leave the tenant
+ with no active administrator.
+
+## Delete is audit-safe
+
+A user row can actually be deleted — migration `094` rewrote the one
+`RESTRICT` foreign key (`compliance_evidence.collected_by`) to
+`ON DELETE SET NULL`, the same retention model every other actor column
+already used. The audit row for the deletion snapshots the full identity,
+so attribution survives the row: compliance evidence outlives its
+collector as "unknown collector" rather than blocking the deletion.
+
+## The role model
+
+| Role | Label | How it is acquired | What it holds |
+|---|---|---|---|
+| `viewer` | Regular User | SSO JIT default; manual assignment | Read-only across alerts, cases, dashboards, detections, reports. No mutations. |
+| `infosec` | Infosec Analyst | Manual assignment or an explicit IdP group mapping | Viewer plus triage, case work, playbook execution, threat-intel and detection writes, lake queries, investigations. No user/role/SSO/settings/credential doors. |
+| `admin` | Platform Administrator | Local break-glass (`bootstrap_admin`) or assignment by an existing admin | `*` — everything in the tenant. Unreachable from SSO without an explicit allowlisted group mapping. |
+
+All three are system roles: the console labels them `protected ·
+non-deletable` and the API refuses to edit or delete them. The **Roles &
+Permissions** screen beside Users edits custom roles against the same
+catalog.
+
+Deny-by-default: once a tenant has any role rows, permissions resolve
+exclusively from the database (`user_roles → role_permissions →
+permissions`); the static map is consulted only during bootstrap, before a
+tenant has roles at all.
+
+## How SSO interacts with manual assignment
+
+JIT-provisioned users land as `viewer`. With the default
+`group_role_mode: first_login_only`, IdP groups set the role **once**, at
+creation — after that, this screen is the source of truth and a manual
+change survives every subsequent sign-in. See
+[Enterprise SSO](../operations/enterprise-sso.md) for the connection-level
+policy (`allowed_email_domains`, `jit_provisioning`, group mapping rules).
+
+## Audit
+
+Every mutation on this surface — role change, enable/disable, delete —
+writes a hash-chained audit row with the acting credential, the old and new
+state, and the required reason. Since v17.1.0 the audit chain records only
+the **verified** principal: a request that fails authentication writes
+nothing ([GHSA-w4r8-969c-67p2](https://github.com/beenuar/AiSOC/security/advisories/GHSA-w4r8-969c-67p2)).
diff --git a/apps/docs/docs/operations/enterprise-sso.md b/apps/docs/docs/operations/enterprise-sso.md
index 29e4e0167..ac252ee53 100644
--- a/apps/docs/docs/operations/enterprise-sso.md
+++ b/apps/docs/docs/operations/enterprise-sso.md
@@ -9,6 +9,20 @@ sidebar_label: Enterprise SSO
SAML and OIDC sign-in, and the connection record that makes either
work.
+## Off by default
+
+The whole surface sits behind `SSO_ENABLED` (default `false`). The login
+screen asks `GET /api/v1/auth/sso/status` and renders the SSO button only
+when the flag is on and an enabled connection exists, so a deployment that
+has configured nothing shows nothing. After a successful callback the
+browser lands on `/login?next=…` with the tokens in the **fragment** —
+destination guards used to drop the fragment, which is v17.1.0's reason the
+callback lands there and nowhere else.
+
+For a lockout drill there is `SSO_LOCAL_ADMIN_ONLY`: password sign-in stays
+open for wildcard roles only, so a broken IdP cannot strand the break-glass
+administrator, and everyone else keeps going through the IdP.
+
:::warning If you tried this before and it 403'd
You were not doing it wrong. `aisoc_sso_connections` was created by a
migration and **written by nothing** — no API, no console, no script.
@@ -41,9 +55,11 @@ POST /api/v1/sso-connections
"display_name": "Example Corp",
"enabled": false,
"default_role": "viewer",
+ "allowed_email_domains": ["example.com"],
+ "jit_provisioning": true,
+ "group_role_mode": "first_login_only",
"group_role_mapping": {
- "soc-analysts": "soc_analyst",
- "soc-leads": "soc_lead"
+ "soc-analysts": "infosec"
}
}
```
@@ -52,6 +68,33 @@ Create it **disabled**, check the mapping, then enable it. A disabled
connection does not resolve, so sign-ins keep failing the same way
until you are ready.
+### The provisioning policy (v17.1.0)
+
+Three per-connection fields decide who gets created and what they hold:
+
+- **`allowed_email_domains`** is enforced at the provisioning chokepoint —
+ an assertion whose verified email is outside the list authenticates
+ nobody, however valid the token.
+- **`jit_provisioning`** controls whether an unknown identity becomes a
+ user at all. When it does, the account lands as **`viewer`**; nothing an
+ IdP says can mint anything stronger than the mapping below allows.
+- **`group_role_mode`** defaults to **`first_login_only`**: IdP groups set
+ the role once, at creation, and administrators own every change after
+ it. The alternative keeps re-asserting the mapping on each login — pick
+ it only if the IdP is the system of record for roles, because an admin's
+ manual correction will not survive the next sign-in.
+
+SSO logins, provisioning events and admin role changes are all audited;
+role changes additionally require a `reason` and refuse to demote the last
+active administrator.
+
+The example maps to `infosec` — the analyst/hunter role with no
+user/role/settings/credential doors — because it is the strongest role a
+mapping should normally confer. Legacy names like `soc_analyst` or
+`soc_lead` name no catalog row (migration `093` moves users holding one to
+`viewer` and reports the count), so a mapping to them provisions the
+default role, not the role you meant.
+
### What is refused
**A mapping to `admin` or `platform_admin`.** v14.0.0 made those
diff --git a/apps/docs/sidebars.ts b/apps/docs/sidebars.ts
index de7948003..1f8267a74 100644
--- a/apps/docs/sidebars.ts
+++ b/apps/docs/sidebars.ts
@@ -61,6 +61,7 @@ const sidebars: SidebarsConfig = {
"console/public-replay",
"console/tenant-skills",
"console/triage-context",
+ "console/users-administration",
],
},
{
diff --git a/apps/docs/static/data/scoreboard.json b/apps/docs/static/data/scoreboard.json
index 0744e5870..5770a9fbb 100644
--- a/apps/docs/static/data/scoreboard.json
+++ b/apps/docs/static/data/scoreboard.json
@@ -3,9 +3,9 @@
"_readme": "Append-only public benchmark scoreboard. Each row is one eval run. Substrate rows (no LLM, deterministic) are marked substrate:true and MUST NOT be quoted as live agent performance. Wet-eval rows (substrate:false) are appended by the T5.5 weekly CI workflow once it lands. Newest row first.",
"rows": [
{
- "date": "2026-10-04",
- "agent_version": "v17.0.0",
- "commit_sha": "641f1b0f",
+ "date": "2026-10-07",
+ "agent_version": "v17.1.0",
+ "commit_sha": "90ea2fda",
"substrate": true,
"eval_mode": "substrate-only",
"mitre_accuracy": 0.97,
diff --git a/apps/docs/static/llms-full.txt b/apps/docs/static/llms-full.txt
index 794b11521..cad8c0e92 100644
--- a/apps/docs/static/llms-full.txt
+++ b/apps/docs/static/llms-full.txt
@@ -3,7 +3,7 @@
<!-- Generated by scripts/generate_llms_txt.py. Do not edit by hand; run the script and commit the result. -->
> AiSOC is an open-source, self-hostable AI Security Operations Center, MIT
-> licensed and maintained by the AiSOC community. Version 17.0.0.
+> licensed and maintained by the AiSOC community. Version 17.1.0.
> Repository: https://github.com/beenuar/AiSOC. Documentation: https://beenuar.github.io/AiSOC/.
This file exists so an automated reader can answer questions about AiSOC
diff --git a/apps/docs/static/llms.txt b/apps/docs/static/llms.txt
index 4e8698e04..23ffddcfb 100644
--- a/apps/docs/static/llms.txt
+++ b/apps/docs/static/llms.txt
@@ -6,7 +6,7 @@
> security telemetry from 84 first-party connectors, normalises it to OCSF,
> correlates it into alerts, and runs LLM agents that triage and investigate them.
> Every agent decision is written to an investigation ledger, so the reasoning
-> behind a verdict can be replayed step by step. MIT licensed. Current version 17.0.0.
+> behind a verdict can be replayed step by step. MIT licensed. Current version 17.1.0.
AiSOC is built and maintained by the AiSOC community. It is a complete SOC
platform rather than a single tool: ingestion, detection, correlation, agent
diff --git a/apps/web/package.json b/apps/web/package.json
index 2338ddbb7..94ae4f609 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -1,6 +1,6 @@
{
"name": "@aisoc/web",
- "version": "17.0.0",
+ "version": "17.1.0",
"private": true,
"description": "AiSOC SOC Console - Next.js 14 Frontend",
"license": "MIT",
diff --git a/infra/helm/aisoc/Chart.yaml b/infra/helm/aisoc/Chart.yaml
index 93c854e30..a548ec50b 100644
--- a/infra/helm/aisoc/Chart.yaml
+++ b/infra/helm/aisoc/Chart.yaml
@@ -25,13 +25,13 @@ type: application
# the chart refuses grants it used to accept (see the v14.0.0 BREAKING
# section), and the chart's major is the only coordinate a consumer pulling
# `oci://ghcr.io/beenuar/charts/aisoc` sees before they install it.
-version: 7.4.0
+version: 7.5.0
# Used as the image tag wherever a `tag:` in values.yaml is left empty, so
# it has to be a tag the registry actually holds — it read "5.2.0", which
# exists for no image, so every pod of a default install would have gone to
# ImagePullBackOff. scripts/check_published_images.py resolves it the same
# way the templates do and fails when it names nothing.
-appVersion: "v17.0.0"
+appVersion: "v17.1.0"
keywords:
- security
diff --git a/scripts/readme_gates.py b/scripts/readme_gates.py
index 51d9336d8..8c7197873 100644
--- a/scripts/readme_gates.py
+++ b/scripts/readme_gates.py
@@ -57,7 +57,13 @@ README = REPO_ROOT / "README.md"
# carries a "Coming … in v8.0" guard.
KNOWN_UNPUBLISHED = {
"npm": {"@aisoc/mcp", "@aisoc/sdk", "aisoc-cli"},
- "pypi": {"aisoc-cli", "aisoc-plugin-sdk", "aisoc-sdk", "aisoc-sandbox"},
+ # The five PyPI packages left this set on 2026-10-07: pending trusted
+ # publishers were registered, AISOC_PYPI_TRUSTED_PUBLISHING was set, and
+ # the v17.0.0 tag performed the first uploads — all five now resolve at
+ # the tree's versions, enforced both ways by
+ # scripts/check_published_packages.py. The npm three still need the
+ # first-upload NPM_TOKEN (an account action), so they stay.
+ "pypi": set(),
}
# Maximum number of lines we promise to keep the README at.