Teams and enterprise sign-in: users, roles, groups and SSO (OIDC, SAML, LDAP/AD, SCIM)

Open
#790 3 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
go

Research direction

Start with server/auth.go and the route registration points; phase 1 proposes a route registry, JWT hardening, and a shared 401/403 handler without changing behavior. Review the routes and existing auth tests to define coverage. Done for phase 1 means every route is registered as authenticated, tokens include the proposed checks, and the web client handles 401/403 responses; the maintainer’s design questions remain open.

Written by the indexing model from the issue text.

Description

feature

Why

ARTEX has one account. Login accepts only the username ARTEX (server/auth.go), every session is a 7-day JWT whose subject is always "ARTEX", and none of the ~300 API routes checks who is calling. Everyone who uses an install shares one password, one identity and full admin power.

That works for one operator on a laptop. It does not work for the teams ARTEX is built for:

  • A pentest team shares one install. Juniors should run tasks but not approve egress or change tools. A client should be able to read findings for their own company and nothing else.
  • Approvals need a name. An intercept decision or a target-pin approval is the platform's safety gate. Today the audit trail records ARTEX for every one of them.
  • Enterprises sign in through their identity provider. Security teams expect SSO with Entra ID, Okta, Google or Keycloak, sign-in with on-prem Active Directory, and automatic deprovisioning when someone leaves. A shared local password fails most security reviews before the tool is even tried.
  • Access must be revocable per person. Today the only way to cut off one person is to rotate the password for everyone.

The roadmap (#440) lists Microsoft AD integration as planned. This issue proposes the full identity layer that makes it possible, for AD and for every other enterprise identity source.

What it should do

Users and sessions

  • Real user accounts. The current ARTEX account is migrated as the first admin, so an upgrade locks no one out.
  • Server-side sessions with logout, per-user revocation and a shorter TTL with refresh. A global "sign everyone out" stays available.
  • Personal access tokens with limited scopes for the browser extension and scripts, replacing the full session JWT the extension uses today.
  • A break-glass local admin that can always sign in, plus a host CLI to recover from a broken identity provider.

Roles, groups and per-company access

  • Fixed roles defined in code:

    Role Can
    viewer read tasks, findings, assets and traffic
    operator viewer, plus run and steer tasks, chat, replay traffic, use the shared browser
    approver add-on: decide intercepts, target pins and scope approvals
    admin everything, including anything that can execute code or loosen a gate (tools, MCP, hooks, skills, LLM keys, settings, users)

    Approval is a separate role on purpose: being able to run tasks must not imply being able to approve egress.

  • Groups. Effective permissions are the union of a user's own role bindings and those of their groups.

  • Every role binding is either global or scoped to a company. A company-scoped user sees and acts only on that company's tasks, findings, assets and scope. Tasks with no company are visible only through global bindings.

Enterprise sign-in

  • OIDC (Entra ID, Okta, Google, Keycloak, Auth0): authorization code with PKCE, issuer, audience and nonce checks, users created on first sign-in (optional, with a domain allowlist), and group mapping from the ID token.
  • SAML 2.0: SP-initiated, signed assertions required, strict audience and recipient checks.
  • LDAP / Active Directory: bind with a service account to find the user, then bind as the user. LDAPS or StartTLS is required. AD groups are resolved with nested membership.
  • SCIM 2.0: the identity provider creates, updates and deactivates users and groups. Deactivation revokes sessions and tokens immediately.
  • IdP groups map to ARTEX groups. An SSO identity is never linked to an existing local account just because the email matches.
  • An admin can require SSO for everyone except the break-glass account.

Accountability

  • An auth audit log: sign-ins and failures, logouts, token changes, and role, group and IdP changes.
  • Intercept decisions, target pins, scope approvals and similar records store the user ID next to the existing text fields.
  • Chat-bridge users are linked to ARTEX users and need the approver role to approve.

UI

  • Sign-in with provider buttons, a profile and session page, and admin pages for users, groups, role bindings, identity providers and tokens.
  • The navigation and actions follow the user's permissions, and a 403 is explained, not silent.

How it is enforced

  • A route registry: every API route is registered with the permission it needs. A route without one returns 403, and a test fails the build if any route has no permission.
  • Company-scoped routes resolve the company from the resource (task, finding, asset), and list endpoints filter by the caller's companies.
  • Live streams (SSE) check permissions when they connect and again on their existing periodic re-check, so removing a role cuts off an open stream.
  • The JWT is pinned to HS256 with iss, aud and jti. A session row backs every token.

Delivery

Small, focused PRs. Each one keeps the single-operator install working and says what it depends on.

  1. Groundwork, no behaviour change: route registry with every route marked "authenticated", JWT hardening, and one 401/403 handler in the web client.
  2. Users and sessions: users and user_sessions tables with the ARTEX migration, principal in the request context, me, logout and refresh, the reset-password script and CLI with --user, and the multi-user sign-in UI.
  3. Roles and groups: groups and role bindings (global and per-company), real permissions on every route, company filtering on list endpoints, the IAM admin API and pages, the audit log, user IDs on approvals, and chat-bridge linking.
  4. Tokens and OIDC: personal access tokens, with the extension switched to them; OIDC providers, group mapping and the sign-in flow; SSO enforcement with break-glass.
  5. LDAP / AD, SAML, SCIM: each as its own PR, built on the same identity and group-mapping model.

Each phase is tested with unit tests, a fake identity provider in Go tests, and end-to-end runs against a real Keycloak (OIDC and SAML) and an LDAP server.

Questions for the maintainer

  1. Is this direction welcome, and does "Microsoft AD integration" on the roadmap mean LDAP bind to on-prem AD, Entra ID through OIDC, or both?
  2. Dependencies: OIDC would use github.com/coreos/go-oidc/v3 and golang.org/x/oauth2, LDAP github.com/go-ldap/ldap/v3. For SAML, crewjam/saml and russellhaering/gosaml2 both have a history of XML-signature issues. Is either acceptable, or should SAML wait?
  3. Should one global active task and active LLM profile stay shared by all users, or become per-user?
  4. Upgrade: one forced re-login when users are introduced, or a grace period for existing tokens?
  5. Should the session token stay a bearer token in local storage (the current marker-cookie design), or move to an HttpOnly cookie with a CSRF token?
  6. Chat bridges on upgraded installs: keep approvals from unlinked bridge users working behind a legacy flag, or require linking?

I plan to start with phase 1, which changes no behaviour, while these are discussed.

Dominant language
Go
Stars
18.7k
Forks
7k
Avg merge
10h 57m
Merged PRs (30d)
494

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from BaaRai/ARTEX

All issues in BaaRai/ARTEX

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.