Skip to main content
Version: 0.11.0

Security & Authorization

Orisun authenticates every gRPC call and authorizes a subset of them by role. This page describes both layers and the exact permission each RPC requires.

Authentication​

Every EventStore and Admin call must carry credentials. Two forms are accepted:

  • HTTP Basic, as the authorization metadata header:

    AUTH='Authorization: Basic YWRtaW46Y2hhbmdlaXQ='
    grpcurl -H "$AUTH" localhost:5005 orisun.EventStore/Ping
  • A session token in the x-auth-token header. Every authenticated response sets x-auth-token; a client can send that token on later calls instead of re-sending Basic credentials. The token is validated first, then Basic is used as the fallback.

A missing or malformed header returns UNAUTHENTICATED. Invalid credentials also return UNAUTHENTICATED.

Session tokens expire after ORISUN_AUTH_SESSION_TTL of inactivity, which defaults to 24h. Each successful use renews that deadline. Orisun retains at most 16 live sessions per user and evicts the earliest-expiring session when that limit is reached. Because successful use renews expiry, this removes the least recently used session in normal operation. A password change or user deletion revokes every session for the affected user; the client must authenticate with Basic credentials again. Tokens are held by the server process that issued them, so clustered deployments should either route a client consistently to one node or keep Basic credentials available for fallback authentication.

The default account is admin:changeit.

warning

Change ORISUN_ADMIN_PASSWORD before exposing the server, and enable TLS for any non-local deployment. Basic credentials are only as safe as the transport.

Roles​

There are exactly two roles, and they are case-sensitive:

RoleValue
AdministratorADMIN
OperationsOPERATIONS

Role values are validated and compared exactly. A user-creation request with admin (lowercase) or another unsupported value returns INVALID_ARGUMENT.

Permission matrix​

RPCAuthenticationRole required
EventStore/SaveEventsV2YesADMIN or OPERATIONS
EventStore/SaveEvents (deprecated)YesADMIN or OPERATIONS
EventStore/CreateIndexYesADMIN
EventStore/DropIndexYesADMIN
EventStore/ListIndexesYesADMIN or OPERATIONS
EventStore/GetIndexYesADMIN or OPERATIONS
EventStore/GetEventsYesAny authenticated user
EventStore/GetLatestByCriteriaYesAny authenticated user
EventStore/CatchUpSubscribeToEventsYesAny authenticated user
EventStore/PingYesAny authenticated user
EventStore/GetServerInfoYesAny authenticated user
Admin/CreateBoundaryYesADMIN
Admin/ListBoundariesYesADMIN or OPERATIONS
Admin/GetBoundaryYesADMIN or OPERATIONS
Admin/CreateUserYesADMIN
Admin/DeleteUserYesADMIN
Admin/ChangePasswordYesAny authenticated user, for their own account
Admin/ListUsersYesADMIN
Admin/ValidateCredentialsYesADMIN
Admin/GetUserCountYesADMIN
Admin/GetEventCountYesADMIN or OPERATIONS

Two points are worth calling out:

  • Event reads and subscriptions are not boundary-scoped. Any authenticated user can currently read or subscribe to any active boundary. Use separate credentials and network controls when applications must not share event data.
  • Administrative mutations require ADMIN. OPERATIONS can inspect boundary state and event counts, but cannot provision storage or manage users. ChangePassword remains self-service and only changes the caller's own account.
  • Set a strong ORISUN_ADMIN_PASSWORD and create per-application users with the narrowest role they need: OPERATIONS for services that only save and read events, ADMIN only where index management is required.
  • Set ORISUN_AUTH_SESSION_TTL to the shortest inactivity window your clients can tolerate.
  • Enable gRPC TLS and, where mutual auth is needed, ORISUN_GRPC_TLS_CLIENT_AUTH_REQUIRED.
  • Put PostgreSQL, the gRPC port, and NATS cluster routes behind network policy. See the Deployment security checklist.
  • Monitor the event-backed boundary catalog. Treat unexpected definitions or placement changes as privileged configuration changes.