Skip to content

RBAC Principles

Role-Based Access Control (RBAC) is a method of regulating access based on the roles of individual users. Instead of assigning permissions directly to users, permissions are grouped into roles, and roles are assigned to users.

Managing permissions directly creates complexity:

Direct Assignment (100 users × 50 permissions = 5,000 relationships):
Alice → can_view_logs, can_deploy, can_manage_users, ...
Bob → can_view_logs, can_deploy, ...
Carol → can_view_logs, ...
(repeat for every user and permission)

RBAC simplifies this:

Role-Based (4 roles + user assignments):
Admin role → all permissions
Operator role → deploy, manage apps
Developer role → view, run commands
Viewer role → read-only
Alice → Admin
Bob → Operator
Carol → Developer

Individuals who need access to the system. In Rack Gateway, users are identified by their email addresses via Google OAuth.

Named collections of permissions. Roles represent job functions or responsibilities:

  • Admin: Full system control
  • Operator: Day-to-day operations
  • Developer: Development activities
  • Viewer: Read-only observation

Specific actions that can be performed. Rack Gateway uses a hierarchical permission system:

convox:* # All Convox permissions
convox:app:* # All app-related permissions
convox:app:list # List applications
convox:app:create # Create applications
convox:release:promote # Promote releases (deploy)

Each role has a defined set of permissions:

Users should have the minimum permissions necessary to perform their job:

RoleShould HaveShould NOT Have
DeveloperRun exec, view logsDeploy to production
OperatorDeploy, scale appsCreate users, modify RBAC
ViewerView dashboardsModify anything

Critical operations should require multiple roles:

Rack Gateway implements this through deploy approvals.

Roles can inherit permissions from other roles:

Admin
└── includes all Operator permissions
└── includes all Developer permissions
└── includes all Viewer permissions

Higher roles automatically have all permissions of lower roles.

Anti-pattern: Creating permissions per user

alice_special_deploy_permission
bob_temp_admin_access

Best practice: Using standard roles

Alice → Operator (has deploy permission)
Bob → Admin (temporary, will revert to Developer)

What needs to be protected?

  • Applications
  • Deployments
  • Logs
  • User accounts
  • Configuration

What actions can be performed on each resource?

ResourceOperations
Applicationslist, create, delete, update
Deploymentscreate, promote, rollback
Logsview, export
Userslist, create, update, delete

Combine resources and operations:

convox:app:list
convox:app:create
convox:app:delete
convox:release:create
convox:release:promote
convox:log:read
gateway:user:create

Group permissions by job function:

viewer:
- convox:app:list
- convox:log:read
developer:
- convox:app:list
- convox:app:update
- convox:log:read
- convox:process:exec
operator:
- convox:app:*
- convox:release:*
- convox:log:*
admin:
- convox:*:*
- gateway:*:*

Map users to appropriate roles:

users:
alice@example.com: admin
bob@example.com: operator
carol@example.com: developer
dan@example.com: viewer
RolePurposeKey Permissions
AdminFull system accessAll permissions including user management
DeployerProduction operationsDeploy, scale, environment management
OpsOperational workRun commands, view logs, manage processes
ViewerRead-only accessView apps, logs, status

Rack Gateway uses a hierarchical permission system:

gateway:* # All gateway permissions
gateway:user:* # User management
gateway:api_token:* # API token management
gateway:deploy_approval_request:* # Deploy approvals
gateway:setting:* # Settings (individual)
convox:* # All Convox permissions
convox:app:* # App management
convox:build:* # Build operations
convox:release:* # Release/deploy operations
convox:env:* # Environment variables
convox:process:* # Process operations

Roles are assigned through:

  1. Admin users list: Users in ADMIN_USERS env var get Admin role
  2. Web UI: Admins can assign roles to users
  3. API tokens: Tokens can have specific roles

Every request is checked against the user’s permissions:

Problem: Too many roles created for edge cases

developer_with_deploy
developer_with_env_access
developer_with_deploy_and_env
senior_developer
junior_developer
...

Solution: Use permission composition or attribute-based rules

Problem: Roles accumulate permissions over time

# Started as:
developer: [read, write]
# After 2 years:
developer: [read, write, deploy, admin, debug, ...]

Solution: Regular role audits and permission reviews

Problem: Permissions that no role uses

Solution: Audit permissions quarterly, remove unused ones

Begin with basic roles and expand as needed:

v1.0: Admin, User
v2.0: Admin, Operator, Developer, Viewer
v3.0: Add specialized roles if truly needed

Each role should have clear documentation:

operator:
description: "Day-to-day production operations"
intended_for: "DevOps team members on rotation"
permissions:
- Deploy applications
- Scale services
- View all logs
does_not_include:
- User management
- RBAC configuration
- Audit log deletion
  1. Monthly: Review user-role assignments
  2. Quarterly: Review role-permission mappings
  3. Annually: Review entire RBAC structure

If your organization has teams, map roles to groups:

engineering-team@example.com → Developer role
devops-team@example.com → Operator role

Require MFA for roles with elevated permissions:

admin:
requires_mfa: true
mfa_frequency: every_action
operator:
requires_mfa: true
mfa_frequency: sensitive_actions
developer:
requires_mfa: false
ModelDescriptionBest For
RBACRoles with permissionsMost organizations
ABACAttribute-based policiesComplex rules (time, location)
DACOwner-controlledFile systems
MACCentral authorityHigh-security environments

Rack Gateway uses RBAC because it provides the right balance of security and usability for infrastructure access control.

  1. RBAC simplifies management by grouping permissions into roles
  2. Least privilege means starting with minimal access
  3. Separation of duties requires multiple roles for critical operations
  4. Regular audits prevent role creep and orphaned permissions
  5. Simple role structures are easier to maintain and understand