Start Restrictive
Begin with Viewer role and upgrade only when needed. It’s easier to add permissions than to remove them.
This guide covers recommended patterns for managing roles and permissions in Rack Gateway.
Start Restrictive
Begin with Viewer role and upgrade only when needed. It’s easier to add permissions than to remove them.
Just-In-Time Access
Grant elevated access temporarily when needed, then revoke. Use API tokens with limited scope for automation.
| User Type | Recommended Role | Rationale |
|---|---|---|
| New team member | Viewer | Observe first, learn the system |
| Developer (feature work) | Deployer | Deploy but not delete |
| On-call engineer | Ops | Debug without deploy access |
| CI/CD pipeline | CI/CD (token) | Minimal automation scope |
| Platform admin | Admin | Full access when needed |
| External auditor | Viewer | Read-only compliance review |
Rack Gateway’s role hierarchy naturally separates concerns:
Anti-patterns to avoid:
| Use Case | Recommended Role | Why |
|---|---|---|
| CI/CD deployment | CI/CD | Limited scope, requires approval |
| Monitoring/alerting | Viewer | Read-only access to status |
| Automated testing | Viewer | Just needs to list/read |
| Emergency scripts | Ops | Restart capability only |
Create with specific purpose
Name tokens descriptively: ci-production-deploy, monitoring-datadog, emergency-restart
rack-gateway api-token create --name "ci-production-deploy" --role cicdSet appropriate role
Always use the minimum required role. CI/CD tokens should use the cicd role, not deployer.
Store securely
Monitor usage
Review token activity in audit logs. Investigate tokens that haven’t been used in 90+ days.
Revoke when no longer needed
Delete tokens immediately when pipelines are decommissioned. Give short-lived tokens an expiry
(--expires-at).
| Do | Don’t |
|---|---|
| Use CI/CD role for pipelines | Use Deployer role for automation |
| Name tokens descriptively | Use generic names like “token-1” |
| Rotate tokens quarterly | Keep tokens indefinitely |
| Use separate tokens per environment | Share tokens across staging/production |
| Audit unused tokens monthly | Ignore token activity |
Deploy separate gateway instances for each environment:
Production Gateway → Production RackStaging Gateway → Staging RackDevelopment Gateway → Dev RackBenefits:
| Environment | Admin Count | Deployer Scope |
|---|---|---|
| Production | 2-3 only | Experienced devs |
| Staging | 3-5 | All developers |
| Development | 5+ | All developers |
Keep MFA required everywhere: every gateway requires it for all users by default (mfa_require_all_users), and
the CLI requires every user to be enrolled whatever that setting says.
Monthly: Token audit
Quarterly: Role review
Annually: Full access audit
Use the Audit Logs page (admins) to find access patterns. It filters by user, status (for example denied
for refused requests), action type, resource type, free text and time range, and exports the results as CSV. The
same filters work on the API:
# Requests refused in the last 30 dayscurl -b "session_token=$TOKEN" \ "https://gateway.example.com/api/v1/audit-logs?status=denied&range=30d"
# Everything one user did since July 1, as CSVcurl -b "session_token=$TOKEN" \ "https://gateway.example.com/api/v1/audit-logs/export?user=developer@example.com&start=2026-07-01T00:00:00Z"range takes 15m, 1h, 24h (the default), 7d, 30d or all; start and end set a custom range.
MFA requirements belong to permissions, not roles: the same action needs the same MFA whoever performs it. Writes such as restarts, exec and env changes need a recent step-up; deleting apps, changing users or API tokens and approving deploys need MFA on the request itself. See MFA Requirements for the full list. API tokens can’t do MFA, so give them only the permissions their pipeline needs.
Immediate: Lock the user account (web UI: Users → the user → Lock). Locking signs them out of every session, and their API tokens stop working while they’re locked
Check sessions: Confirm on the user’s page that no sessions remain
Audit: Review all actions by the user in last 30 days
Remediate: Change any secrets the user had access to
Investigate: Determine how the compromise occurred
Restore: Unlock account after re-verification
Immediate: Delete the token
# In web UI: API Tokens → Select Token → DeleteAudit: Review all actions by the token
Update: Generate new token with fresh credentials
Rotate: Update all systems using the old token
Investigate: Determine how the token was exposed
Implementation:
Different teams may need different access levels:
| Team | Base Role | Notes |
|---|---|---|
| Platform | Admin | Manages infrastructure |
| Backend | Deployer | Full deploy access |
| Frontend | Deployer | Full deploy access |
| QA | Viewer | Read-only for testing |
| Security | Admin | Audit and review |
For external contractors:
Before going to production: