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.
| 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 | MFA Required |
|---|---|---|---|
| Production | 2-3 only | Experienced devs | Yes |
| Staging | 3-5 | All developers | Optional |
| Development | 5+ | All developers | No |
Monthly: Token audit
Quarterly: Role review
Annually: Full access audit
Query audit logs to identify access patterns:
# Find all admin actions in the last 7 daysrack-gateway audit search --role admin --days 7
# Find failed permission checksrack-gateway audit search --decision deny --days 30
# Find all actions by a specific userrack-gateway audit search --user developer@example.com --days 90Configure MFA requirements based on role privileges:
| Role | MFA Recommendation | Step-Up Auth |
|---|---|---|
| Admin | Required always | Yes, for all actions |
| Deployer | Required always | Yes, for env changes |
| Ops | Recommended | Yes, for exec |
| Viewer | Optional | No |
| CI/CD (token) | N/A (token auth) | N/A |
For sensitive operations, require re-authentication even within an active session:
Immediate: Lock the user account
# In web UI: Users → Select User → Lock AccountRevoke sessions: Force logout all active sessions
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: