Skip to content

fix(rbac): move basic auth out of ee#2160

Merged
topher-lo merged 2 commits intomainfrom
fix/move-basic-rbac-from-ee
Feb 23, 2026
Merged

fix(rbac): move basic auth out of ee#2160
topher-lo merged 2 commits intomainfrom
fix/move-basic-rbac-from-ee

Conversation

@jordan-umusu
Copy link
Collaborator

@jordan-umusu jordan-umusu commented Feb 23, 2026

Summary by cubic

Expose basic RBAC in OSS by moving role listing and user role assignments (CRUD) from EE to the core API. Keep advanced RBAC in EE; role listing is open to authenticated org members, while user assignment CRUD requires org:rbac scopes.

  • New Features

    • /rbac/roles GET in OSS for org role listing (auth required).
    • /rbac/user-assignments CRUD in OSS; gated by org:rbac:* scopes.
  • Refactors

    • Registered OSS routers in app; removed EE equivalents for role listing and user assignments.
    • RBACService now raises validation for duplicate assignments; OSS returns 409.
    • Regenerated frontend client/types for moved endpoints; no URL or payload changes.

Written for commit b397158. Summary will update on new commits.

@jordan-umusu jordan-umusu marked this pull request as ready for review February 23, 2026 20:02
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0927b2ed42

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 6 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="tracecat/authz/rbac/router.py">

<violation number="1" location="tracecat/authz/rbac/router.py:129">
P0: Privilege escalation vulnerability: the user-assignments mutation endpoints (create, update, delete) have no authorization scope checks. Any authenticated organization member can call these endpoints to assign themselves a high-privilege role (e.g., `organization-owner`). The previous EE implementation guarded these with `@require_scope("org:rbac:create")`, `@require_scope("org:rbac:update")`, and `@require_scope("org:rbac:delete")` plus a `_require_rbac_entitlement` dependency on the router. All of these were dropped in this move to OSS, and the `@require_scope` decorators were also removed from the corresponding service methods. At minimum, mutation operations should require an admin/owner role check to prevent any member from escalating their own privileges.</violation>

<violation number="2" location="tracecat/authz/rbac/router.py:179">
P2: The `UserRoleAssignmentReadWithDetails(...)` construction block is duplicated four times across the new endpoints. Extract a private helper function (e.g., `_assignment_to_read`) to avoid drift when the schema changes.</violation>

<violation number="3" location="tracecat/authz/rbac/router.py:233">
P2: `IntegrityError` should be caught and translated in the service layer, not the router. Catch it inside `RBACService.create_user_assignment`, roll back the session, and raise a `ValueError` with a clear message. The router should then catch `ValueError` and return HTTP 409 — consistent with the team's error-handling convention.

(Based on your team's feedback about IntegrityError handling.) [FEEDBACK_USED]</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/tracecat-ee/tracecat_ee/rbac/service.py">

<violation number="1" location="packages/tracecat-ee/tracecat_ee/rbac/service.py:706">
P2: Translate IntegrityError to ValueError so routers map this duplicate-assignment constraint to the 409 conflict path instead of a generic validation error.

(Based on your team's feedback about error handling posture.) [FEEDBACK_USED]</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@topher-lo topher-lo merged commit 1045e73 into main Feb 23, 2026
19 checks passed
@topher-lo topher-lo deleted the fix/move-basic-rbac-from-ee branch February 23, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants