Skip to content

Commit 32ca4d6

Browse files
authored
fix: complete medium hardening updates for auth, RBAC, OAuth/SSO, secrets, and admin UI defaults (m-batch-1) (#3129)
* fix: request logging hardening and behavior consistency Refs: A-04 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: token scoping hardening and behavior consistency Refs: C-06, C-26 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: llm chat config hardening and behavior consistency Refs: C-31 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: permission model hardening and behavior consistency Refs: C-34, L-13 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: server team assignment hardening and behavior consistency Refs: C-36 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: import visibility defaults hardening and behavior consistency Refs: C-37 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: llm provider config hardening and behavior consistency Refs: C-40 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: tool header protection hardening and behavior consistency Refs: C-41 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: sso identity checks hardening and behavior consistency Refs: O-08, O-13 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: oauth state handling hardening and behavior consistency Refs: O-12 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: admin ui hardening and behavior consistency Refs: U-02, U-03, U-04 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * docs: rc2 hardening release notes and behavior consistency Refs: A-04, C-06, C-26, C-31, C-34, C-36, C-37, C-40, C-41, L-13, O-08, O-12, O-13, U-02, U-03, U-04 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * lint Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: harden medium security defaults and UI regression paths A-04 C-34 L-13 O-12 U-02 U-04 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: escape pagination query params inside Alpine attributes U-03 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * chore: resolve migration and oauth lint warnings C-34 O-12 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix tests Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix cdn Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * test: harden playwright admin auth and entity timing stability Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * test: stabilize localhost admin auth flow in playwright Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * fix: align admin auth-form csrf token issuance and submission Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> * test: close remaining diff coverage gaps to 100 percent Signed-off-by: Mihai Criveti <crivetimihai@gmail.com> --------- Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
1 parent f8f0575 commit 32ca4d6

File tree

65 files changed

+3459
-602
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+3459
-602
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,13 @@ This release **tightens production defaults** and adds **defense-in-depth contro
212212
* **C-20**: Gateway sync endpoints now enforce explicit RBAC and scoped ownership checks with normalized token-team semantics
213213
* **C-35**: Server usage SSE now validates server existence and fails closed for missing IDs in scoped checks
214214
* **C-39**: Import flow strips untrusted ownership/team/visibility fields for scoped entities
215+
* **A-04**: Request logging masking now covers normalized key variants (snake/camel/kebab/case changes) while preserving non-sensitive metadata fields
216+
* **C-06 / C-26**: Token scoping now applies consistently for cookie and header auth paths, and normalizes `APP_ROOT_PATH` prefixes before route permission matching
217+
* **C-31 / C-40 / C-41**: LLM chat config, provider config secrets, and sensitive tool headers now use at-rest protection with response-time masking and backward-compatible read handling
218+
* **C-34 / L-13**: Permission fallback paths now rely on explicit constants and canonical permission mappings across decorators, validation, and role checks, with default non-admin roles receiving explicit `teams.read` and token self-management permissions
219+
* **C-36 / C-37**: Server team reassignment now validates target-team ownership membership, and import defaults prefer scoped visibility for safer tenant defaults
220+
* **O-08 / O-12 / O-13**: SSO/OAuth flows now require `email_verified: true` claims for login acceptance (including existing users), enforce trusted-domain policy consistently, and use opaque server-side OAuth state mapping
221+
* **U-02 / U-03 / U-04**: Admin UI now enforces CSRF tokens/origin checks for state-changing flows, sanitizes dynamic DOM insertions, and uses pinned integrity-checked external assets
215222
* **Token helpers**: Rich-token generation now distinguishes omitted teams from explicit `teams: null` to preserve intended scope semantics
216223
* Health diagnostics endpoint now follows standard bearer-token validation.
217224
* JSON-RPC and REST logging controls now use aligned permission checks.

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ services:
360360
- JSON_SCHEMA_VALIDATION_STRICT=true
361361
- CORRELATION_ID_ENABLED=false
362362
- LLMCHAT_ENABLED=true
363-
- OBSERVABILITY_ENABLED=false
363+
- OBSERVABILITY_ENABLED=true
364364
# ═══════════════════════════════════════════════════════════════════════════
365365
# Database Connection Pool Configuration
366366
# ═══════════════════════════════════════════════════════════════════════════

docs/docs/manage/rbac.md

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ Logical groups that:
6363
| Role | Scope | Permissions |
6464
|------|-------|-------------|
6565
| `platform_admin` | global | `["*"]` (all permissions) |
66-
| `team_admin` | team | admin.dashboard, gateways.read, gateways.create, gateways.update, gateways.delete, servers.read, servers.create, servers.update, servers.delete, teams.read, teams.update, teams.join, teams.delete, teams.manage_members, tools.read, tools.create, tools.update, tools.delete, tools.execute, resources.read, resources.create, resources.update, resources.delete, prompts.read, prompts.create, prompts.update, prompts.delete, a2a.read, a2a.create, a2a.update, a2a.delete, a2a.invoke, llm.read, llm.invoke |
67-
| `developer` | team | admin.dashboard, gateways.read, gateways.create, gateways.update, gateways.delete, servers.read, servers.create, servers.update, servers.delete, teams.join, tools.read, tools.create, tools.update, tools.delete, tools.execute, resources.read, resources.create, resources.update, resources.delete, prompts.read, prompts.create, prompts.update, prompts.delete, a2a.read, a2a.create, a2a.update, a2a.delete, a2a.invoke, llm.read, llm.invoke |
68-
| `viewer` | team | admin.dashboard, gateways.read, servers.read, teams.join, tools.read, resources.read, prompts.read, a2a.read, llm.read |
69-
| `platform_viewer` | global | admin.dashboard, gateways.read, servers.read, teams.join, tools.read, resources.read, prompts.read, a2a.read, llm.read |
66+
| `team_admin` | team | admin.dashboard, gateways.read, gateways.create, gateways.update, gateways.delete, servers.read, servers.create, servers.update, servers.delete, teams.read, teams.update, teams.join, teams.delete, teams.manage_members, tools.read, tools.create, tools.update, tools.delete, tools.execute, resources.read, resources.create, resources.update, resources.delete, prompts.read, prompts.create, prompts.update, prompts.delete, a2a.read, a2a.create, a2a.update, a2a.delete, a2a.invoke, llm.read, llm.invoke, tokens.create, tokens.read, tokens.update, tokens.revoke |
67+
| `developer` | team | admin.dashboard, gateways.read, gateways.create, gateways.update, gateways.delete, servers.read, servers.create, servers.update, servers.delete, teams.read, teams.join, tools.read, tools.create, tools.update, tools.delete, tools.execute, resources.read, resources.create, resources.update, resources.delete, prompts.read, prompts.create, prompts.update, prompts.delete, a2a.read, a2a.create, a2a.update, a2a.delete, a2a.invoke, llm.read, llm.invoke, tokens.create, tokens.read, tokens.update, tokens.revoke |
68+
| `viewer` | team | admin.dashboard, gateways.read, servers.read, teams.read, teams.join, tools.read, resources.read, prompts.read, a2a.read, llm.read, tokens.create, tokens.read, tokens.update, tokens.revoke |
69+
| `platform_viewer` | global | admin.dashboard, gateways.read, servers.read, teams.read, teams.join, tools.read, resources.read, prompts.read, a2a.read, llm.read, tokens.create, tokens.read, tokens.update, tokens.revoke |
7070

7171
!!! info "Default Role Assignment"
7272
**New users automatically receive up to two roles upon creation:**
@@ -458,34 +458,24 @@ Permissions are defined in the `Permissions` class and control what actions user
458458
│ Permission Aggregation │ ← Collect permissions from roles
459459
│ - Include inherited perms │ (role inheritance supported)
460460
│ - Check for wildcard (*) │
461-
└─────────────────────────────┘
462-
463-
464-
┌─────────────────────────────┐
465-
│ Fallback Permission Check │ ← Implicit permissions (see below)
466461
└─────────────────────────────┘
467462
468463
469464
GRANT or DENY
470465
```
471466

472-
### Fallback Permissions
473-
474-
The system grants implicit permissions without explicit role assignment. These are **not** shown in `/rbac/my/permissions` but are effective:
467+
### Explicit Team/Token Defaults
475468

476-
| User Context | Implicit Permissions |
477-
|--------------|---------------------|
478-
| Any authenticated user | teams.create, teams.read |
479-
| Team member | teams.read (for their teams) |
480-
| Team owner | teams.read, teams.update, teams.delete, teams.manage_members |
481-
| Any authenticated user | tokens.* (for own tokens only) |
469+
Team and token management behavior is now controlled through explicit role permissions, not implicit fallback checks.
482470

483-
!!! info "Why Fallback Permissions Exist"
484-
Fallback permissions enable basic functionality without requiring explicit role assignment:
471+
| Role | Explicit Baseline Grants |
472+
|------|--------------------------|
473+
| `team_admin` | `teams.read`, `tokens.create`, `tokens.read`, `tokens.update`, `tokens.revoke` |
474+
| `developer` | `teams.read`, `tokens.create`, `tokens.read`, `tokens.update`, `tokens.revoke` |
475+
| `viewer` | `teams.read`, `tokens.create`, `tokens.read`, `tokens.update`, `tokens.revoke` |
476+
| `platform_viewer` | `teams.read`, `tokens.create`, `tokens.read`, `tokens.update`, `tokens.revoke` |
485477

486-
- Users can always create and view teams they belong to
487-
- Team owners automatically have management rights
488-
- Users can always manage their own API tokens
478+
Users without role assignments do not receive implicit team/token permissions.
489479

490480
### Admin API RBAC
491481

0 commit comments

Comments
 (0)