Skip to content

fix(team): enforce per-team coordinator authz#219

Merged
yairfalse merged 1 commit into
mainfrom
feature/monster-c2-team-authz
May 26, 2026
Merged

fix(team): enforce per-team coordinator authz#219
yairfalse merged 1 commit into
mainfrom
feature/monster-c2-team-authz

Conversation

@yairfalse
Copy link
Copy Markdown
Collaborator

Summary

  • keep SYKLI_COORDINATOR_TOKEN as the admin/owner bootstrap token and add stateless HMAC-signed team tokens carrying org, team, and role claims
  • add sykli coordinator mint-token --org --team --role for owner/member/approver team tokens
  • make Auth.authorize/2 return a principal and enforce tenant scope across coordinator lists, reads, writes, daemon sessions, work items, runs, and gates
  • require owner/approver/admin for gate decisions and reject member decisions with coordinator.forbidden
  • document the auth model, forbidden error code, and current no-expiry/rotation limitation

Audit note

Verified the old S2 finding was real: Auth.authorize/2 accepted only one global bearer token and returned :ok, while router list filters trusted client-supplied team IDs. This PR closes that by resolving signed team-token principals to concrete org/team IDs and intersecting or rejecting client filters instead of widening access.

Verification

  • cd core && mix test
  • cd core && mix credo
  • cd core && mix escript.build
  • test/blackbox/run.sh

Blackbox result: 168 passed, 0 expected-red, 0 failed.

Follow-up

  • Team tokens are stateless and currently have no expiry claim. Rotation is by changing the coordinator signing/admin token; explicit expiry/revocation can be added separately.

Keep the coordinator bootstrap token as admin access, add stateless signed team tokens with org/team/role claims, and enforce those scopes across coordinator reads and writes.

Add mint-token CLI support, gate decision role checks, docs, and black-box coverage for query widening.

Co-Authored-By: Codex <codex@openai.com>
@yairfalse yairfalse merged commit 9c5b7dc into main May 26, 2026
12 checks passed
@yairfalse yairfalse deleted the feature/monster-c2-team-authz branch May 26, 2026 21:04
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.

1 participant