Customer Driven RBAC
This article will explore our journey toward implementing customer-oriented, role-based access control to ShiftLeft CORE.
Some background
ShiftLeft is a very opinionated service when it comes to our core. We bring to the table our expertise and know-how in Next Gen SAST and that shapes our product. We offer only what we know we can achieve with excellence. However, our UX tells a completely different story.
Since the beginning,we have tried to implement the UX with a blank canvas approach in mind. When we present a new way to interact with our product, we begin with a minimalistic approach. We want to help you with your security concerns, not tell you how to shape your company’s workflow. Every customer knows best how they need to manage their work.
A blank canvas approach
We present a very minimal, but functional, feature and encourage customers to join that conversation. They tell us what they expected and give us their impression after using what we gave them. Sometimes they discover they prefer our approach to their expectations. Other times they generate a new set of expectations. Of course, there are also times where our approach is not the best and they would prefer those original expectations fulfilled.
The case for RBAC
In the early days of developing RBAC, we did not know what kind of profiles within a company would be using our service and how. After some thinking, we decided to provide just two roles: Admin and Collaborator. Our roles were simple: Admins can make changes, Collaborators can only view things. We then waited and we listened.
One thing that became clear over time was that we needed to be able to define our entities. Our service began its life with a very dense Dashboard displaying data useful to a wide range of profiles. As our customer interactions got defined, so did our understanding of what data we wanted to show to each profile. With this clarity came the ability to shape our API into a more RESTful one. Resources like applications, findings, users and teams emerged out of our customer’s need to organize the data and display it to the relevant roles in their organization.
A natural way of limiting access was derived from this usage. We would divide actions into one of the following: Create, Read, Update or Delete. Of course, there are a few exceptions, such as interacting with services like GitHub and Jira that must also be accounted for.
Thinking about resources
During the process of shaping our service, we began thinking of everything as a resource. Each concept or entity we present in our Dashboard is a resource. Our integrations are thought of in terms of the configuration required for it to work as the resource. And so, we can define a very fine list of actions that can be performed by a user, which we call these scopes. Each RESTful endpoint now can be classified by two characteristics: The resources that need to be loaded for it to function and the actions to be performed on them. For each endpoint we specify which scopes are to be exercised.
The combination of scopes and resources is called permissions and each action to be performed requires one to be the bearer of the appropriate permission.
Determining scope groups
The next challenge was how to determine who has what scopes. Fortunately, our customers were very good at answering this question too. Over the course of our product’s life we had the chance to see the shape of many different organizations. By seeing the profiles of people that accessed our services and listening to the people in charge of these organizations, we could design a list of the most common profiles each company has and what they can do. After a lot of iteration, we decided to create a set of distinct scopes groups called roles. Our choice of roles is likely larger than what can be found in most organizations. We settled on a larger list so that customers could pick the ones that best fit them.
Respect your history
One of the important parts of successfully implementing new, customer-driven features is to respect the accrued experience of your existing users. Some of our customers were happy and even had created processes around our existing access rules, so it was important to avoid disrupting their experience. For some, we had to provide an enhanced experience.
With this in mind, we set a very simple rule at the beginning of the project: Our new implementation should support expanding our existing access rules. This single rule helped us limit our reshaping of the access system so that we addednew flexibility, but we also respected what had been successful and been the basis for the new idea.
Very fine grained
Another very important aspect of our customer feedback was the need for users to act in different capacities depending on context. A user might be a manager in the context of one project but a guest in another. To meet this need, we created teams. A team includes role settings for a subset of users within a subset of applications.
When accessing a resource, if it belongs to a team and the user is in that team, we compile the permissions based on the capacity that user has for that team. The users also have a role in the general organization.
We designed the list of roles to be additive. On the root of the site, users would have a role representing the minimum common denominator of their expected access level. They can be assigned more access on a per-team case.
Conclusion
It took us some time to get to where we are now, where we are sure our experience mimics what most customers need for their own organization. We are sure that this will suit our existing users that are currently happy, while exciting others that want to embrace more of our product and invite newcomers. We’ve set the base for adding future resources and roles, including depending on our customer’s habits. We have found a good balance between our security expertise and customer knowledge of their own organization.
Customer Driven RBAC was originally published in ShiftLeft Blog on Medium, where people are continuing the conversation by highlighting and responding to this story.

