Product RBACs allow teams to control and manage user permissions and access to their product. Incident.io, an incident response software for site reliability engineers, uses an RBAC to ensure a systematic approach to assigning roles, defining permissions, and granting access based on users' roles or responsibilities within their user base.
The document outlines a preferred solution of using predefined roles that are consistent across customers. Each role builds upon the previous one, with three default roles: Regular User, Administrator, and Owner. The RBAC also discusses permissions that organizations may want to move between roles, such as creating workflows and approving private workflows.
With a focus on clear implementation steps, including modeling individual permissions as 'scopes' and tagging users with predefined roles, Incident.io's RBAC framework enables organizations to control user access and permissions within their product efficiently and securely.
Incident.io Product RBAC
We want to restrict what users can do inside of the product, so that:
RBAC can be complex, and is trickier than most features due to the serious consequences of error, that there are users with motivations to break it, and the difficulty in reversing decisions (it is easy to take one-way doors).
Any solution should be:
The last aim is a reflection on Hyrum’s Law, which implies any possible RBAC configuration will be used by at least one customer, who is unlikely to cheer if we remove it.
This author has a preferred solution, which is where we can start this discussion:
We’ll model RBAC using predefined roles that are consistent across our customers.
Roles will have an order, where each successive role will include and build on (be a proper superset of) the previous role.
We would launch with three default roles:
Each organisation has a different opinion on how roles should work, and we’ve identified a few permissions that people will want to move between roles.
These permissions are:
This is not an exhaustive list of contentious permissions, but illustrate a class of problem.
For these permissions, we allow organisations to relax the restriction (perhaps better expressed as delegating the ability to?) lower roles.
As an example, an organisation owner could delegate authority to admins for approving private incident workflows. In a similar fashion, an admin could permit regular users to create workflows.
This is a bad UX, but sketches how this might appear:
When organisations first sign up, the default roles would match our opinion on how incident.io is best configured, with all users being able to create announcement rules and workflows, while owners are the only role that can approve private workflows (TBC).
Most of our requirements around RBAC focus on maintainability for us, ensuring we can implement a viable MVP while preserving our ability to extend it.
Before we discuss implementation, it’s worth evaluating this proposal against those trade-offs:
In mature RBAC systems, you normally have:
Our system rejects the one-to-many relationship of users to roles (and thereby scopes) in favour of users having just one role.
Things to note:
The last point is important.
There are roles, such as a billing manager, which would break this system as the billing manager role should be exclusively for managing billing.
With the constraint of one role per user, we could not grant the ability to manage billing to an existing user without putting them in a role that removes their other abilities.
It seems unlikely we’ll need this within 12 months, which makes it an acceptable trade-off.
While we expose pre-packaged roles to our customers, we’ll model roles internally as a collection of scopes.
We really want to do this, as it provides a layer of abstraction between our users and how we model the scopes, but is only acceptable with us permitting delegation of the tricky scopes.
In summary bullet form:
As a sketch, here is a basic rbac
package:
At the API layer, we would tag endpoints with required scopes in the API design DSL, which allows us to solve this generically for each endpoint.
Slack would be harder, but a similar check for scopes would be applied wherever we implement restricted actions.
When we offer an API, we are likely to provide organisation access tokens.
This provides another opportunity for privilege escalation, in that a user could create a token that gains permissions they lack.
If we implement RBAC as above with scopes, we should be able to guard against this by preventing users from creating tokens with scopes they do not themselves possess. This is a common prevention mechanism in RBAC systems, one example being Kubernetes.
That we can do this simply and securely is a positive indication of this system.
When we first release RBAC, we’ll be forced to categorise existing users into roles.
We can categorise by:
This isn’t perfect, but should be approximately workable. We can notify owners and admins to explain their new role, and allows anyone to see the list of owners and admins in the dashboard so it’s easy to request a role bump.
The API to change a role should target a user and specify the new role name.
This is a permitted action only if:
It would look like this:
Product RBACs allow teams to control and manage user permissions and access to their product. Incident.io, an incident response software for site reliability engineers, uses an RBAC to ensure a systematic approach to assigning roles, defining permissions, and granting access based on users' roles or responsibilities within their user base.
The document outlines a preferred solution of using predefined roles that are consistent across customers. Each role builds upon the previous one, with three default roles: Regular User, Administrator, and Owner. The RBAC also discusses permissions that organizations may want to move between roles, such as creating workflows and approving private workflows.
With a focus on clear implementation steps, including modeling individual permissions as 'scopes' and tagging users with predefined roles, Incident.io's RBAC framework enables organizations to control user access and permissions within their product efficiently and securely.