RBAC (Role-Based Access Control)
Status: Experimental Notes- Available only when using S3 storage (not in-memory).
- Current enforcement is evolving; shapes are subject to change.
Overview
The RBAC system consists of three main components:- Permissions - Define what actions are allowed on what resources
- Roles - Collections of permissions that can be assigned to users
- Users - Individuals who are assigned roles
Key Features
- Resource-specific permissions - Use wildcards like
dev/*
to limit access to specific directories - Permission-based access control - Create reusable permissions with specific rules
- Permission testing - Test what users can do without executing operations
- Email-based user management - Use email addresses for user-friendly role assignments
- Wildcard support - Use
*
for actions or resources to grant broad permissions - Deny rules - Explicitly deny access with
deny
effect rules
Quick Start
1. Initialize RBAC
2. Create Permissions
3. Create Roles
4. Assign Permissions to Roles
5. Assign Roles to Users
6. Test Permissions
Permission Rules
Permissions define access rights using rules in the format:effect:actions:resources
Effects
allow
- Grant permissiondeny
- Explicitly deny permission (overrides allow rules)
Actions
unit.read
- Read unit tfstate dataunit.write
- Write unit tfstate dataunit.lock
- Lock/unlock unitsunit.delete
- Delete unitsrbac.manage
- Manage RBAC (roles, policies, users)*
- All actions
Resources
*
- All resourcesmyapp/prod
- Specific unitdev/*
- All units under dev/ directorymyapp/*
- All units under myapp/ directory
Examples
Complete Example Workflow
Managing Role-Permission Relationships
Assign Additional Permissions to a Role
Revoke Permissions from Roles
List Roles to See Assigned Permissions
Unit Management with RBAC
When RBAC is enabled, theunit ls
command automatically filters results based on your read permissions:
Troubleshooting
RBAC Not Available
If you get errors about RBAC not being available:- Ensure you’re using S3 storage (not in-memory)
- Make sure you’ve run
./taco rbac init
- Check that you’re logged in with
./taco whoami
Permission Denied
If you get permission denied errors:- Check your roles with
./taco rbac me
- Test permissions with
./taco rbac test <email> <operation>
- Verify permissions are assigned to your roles
- Check that the permissions have the correct rules for the resource you’re trying to access
User Not Found
If you get “user not found” errors when testing permissions:- Make sure the user has been assigned at least one role
- Check user assignments with
./taco rbac user list
- Ensure the email address is correct and matches what was used during login