DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Low-Code Development: Leverage low and no code to streamline your workflow so that you can focus on higher priorities.

DZone Security Research: Tell us your top security strategies in 2024, influence our research, and enter for a chance to win $!

Launch your software development career: Dive head first into the SDLC and learn how to build high-quality software and teams.

Open Source Migration Practices and Patterns: Explore key traits of migrating open-source software and its impact on software development.

Related

  • Create a Multi-tenancy Application In Nest.js - Part 1
  • Enhancing Security With ZTNA in Hybrid and Multi-Cloud Deployments
  • Strengthening Web Application Security With Predictive Threat Analysis in Node.js
  • Comparing Axios, Fetch, and Angular HttpClient for Data Fetching in JavaScript

Trending

  • Next-Gen Lie Detector: Stack Selection
  • Outsmarting Cyber Threats: How Large Language Models Can Revolutionize Email Security
  • Tenv v2.0: The Importance of Explicit Behavior for Version Manager
  • Operational Excellence Best Practices
  1. DZone
  2. Software Design and Architecture
  3. Security
  4. Is RBAC Still Relevant in 2024?

Is RBAC Still Relevant in 2024?

Explore the state of Role-Based Access Control (RBAC), why and how developers should use it, and what are the best practices to implement it in applications.

By 
Gabriel L. Manor user avatar
Gabriel L. Manor
·
May. 07, 24 · Analysis
Like (2)
Save
Tweet
Share
576 Views

Join the DZone community and get the full member experience.

Join For Free

Over the past few years, role-based access control (RBAC) has been considered synonymous with app-level authorization. It’s so common that developers casually describe their authorization service as an “RBAC service,” and CTOs describe it as “the thing we’ll implement at some point.”

On the other hand, applications are becoming increasingly complex by the pull request, and in most cases, a simple RBAC implementation just isn't enough. So does that mean RBAC is going obsolete? Should you start researching newer models? This blog will cover everything you need to know about using RBAC in 2024.

What Is RBAC?

Before we dive in, let's do a quick recap. RBAC is an authorization model used to determine access based on predefined roles. Permissions are assigned to roles (like “Admin or “User”), and roles are assigned to users. This structure allows you to understand who has access to what easily. The combination of who (which identity, and what role are they assigned?) can do what (what actions are they allowed to perform?) with a resource (on which aspects of the software?) is called a policy.

Simple RBAC model

What Are the Benefits of RBAC?

RBAC’s main advantage comes from its simplicity. By categorizing users into roles and assigning permissions to these roles, RBAC creates a system that is easy and understandable for both developers and users.

For the developer, RBAC decouples the relationship between users and the permissions they need. Instead of explicitly assigning permissions to a user and applying that across different resources in the system, we assign permissions to roles and roles to users. That means that when we want to add more permissions, we can add them to a role instead of manually adding them to individual users. This means easy management and auditing.

For the user, RBAC makes app permissions easy to understand, with users not having to focus on how the app is built but rather on their own roles. Knowing if you are a standard user or an admin is a much more straightforward way of understanding the permissions you have within the app (Unlike ACLs and other, older models that were common before RBAC's popularity).

When Is RBAC Not Enough?

As simple as RBAC might be, that simplicity comes with a price, and RBAC doesn't work when a more fine-grained approach is needed. RBAC's user-centric approach makes the user the only dynamic component in the policy. That means that if we want to get more dynamic and granular policies, like, for example, where attributes of resources constantly change, RBAC proves insufficient. This issue is true for most modern applications, considering their complexity and the amount of data they rely on.

What brought RBAC to fame is the same thing that is now promoting the use of other models — user requirements. Users both have a better understanding of software, and they expect more control over their permissions than ever before. Things like privacy, data, and ownership are becoming very basic requirements that RBAC can no longer satisfy. This makes us ask whether RABC can be relevant at all.

How Can RBAC Be Useful Today?

Two prominent models have emerged in the past few years, threatening RBAC’s dominance of the authorization space: Relationship-Based Access Control (ReBAC) and Attribute-Based Access Control (ABAC).

ReBAC extends on basic RBAC by considering the in-app relationship between objects, users, and roles. If you look at something like a "Google Drive" style authorization system, you’ll quickly notice that it uses the baseline of roles, actions, and resources you already know from RBAC and extends upon them with relationships. The same goes for ABAC—it uses RBAC as a baseline structure and extends it by adding attributes to existing RBAC elements.

The simplicity of RBAC makes it a great baseline for modeling your authorization system, while other models, such as ABAC and ReBAC, are layered on top to cater to more granular requirements.

The Key: Policy-as-Code

As long as you implement RBAC while following the best practices, especially writing policy as code, it will help you cover the basics of your authorization requirements and allow you to extend it using other models if the need arises.

Defining policy as code allows us to create authorization policies that are not only readable but also provide us with the ability to ensure they are consistently enforced across different systems and environments, helping prevent policy violations and reducing the risk of unauthorized access. It allows you to easily manage and update policies, as you do that with the same tools and processes used to manage and deploy software. This makes it easier to track changes to policies over time, roll back changes if necessary, and in general, enjoy the well-thought-through best practices of the code world (e.g., GitOps).

If you embed your authorization by using policy-as-code or policy-as-graph, separating configuration and data, it becomes quite easy to scale from RBAC to more complex models.

RBAC is also great for streamlining your fine-grained authorization with feature-toggling - managing the visibility of resources in your frontend apps, with the frontend authorization layer benefiting from RBAC’s simplified abstraction and simplicity.

So, is RBAC still relevant? Of course, it is, maybe more than ever, because every complex architecture should have a simple baseline. But the challenge doesn't end there. . . 

RBAC Enhanced: Live Data and Policy Updates

As we mentioned before, extending RBAC to other models is made even easier if we follow authorization best practices and base our authorization system on the policy as code. Since the nature of policy-as-code or policy-as-graph systems separates the concern between the configuration (code itself) and the data, it becomes easier to write policies that require less data, allowing us to benefit from RBAC’s simplicity while utilizing any required data with fine-grained models.

However, extensive amounts of data are still required to make most decisions in modern applications, and while using policy engines like OPA and Cedar provides us with a great basis for creating a separate microservice for authorization (allowing for a policy-as-code setup), there’s still the issue of keeping these engines up to date with the most relevant policies and data. Let’s look at a quick example.

Say our policy requires a user to be a subscriber to see parts of our site. To make a policy decision, we need to know the user’s subscription status from our billing service (e.g., PayPal or Stripe) and be immediately aware of any changes to it. A new subscriber expects immediate access to our site, and a churned user should lose access on the spot.

That means our policy engine needs to be updated in real time from outside data sources while all of our policy engines are in sync with each other. 

Open Policy Administration Layer (OPAL) is an OSS project created to aid with Policy Engine management, which keeps them updated in real-time with data and policy updates. Supporting multiple policy engines, OPAL offers two important features:

  • OPAL allows tracking a specific policy repository (like GitHub, GitLab, or Bitbucket) for updates. It does this by either using a webhook or checking for changes every few seconds. This makes the system act as a Policy Administration Point (PAP), which sends the policy changes to your policy engine, ensuring it is always up to date.
  • The ability to track any relevant data source (API, database, external service) for updates via a REST API, and fetch up-to-date data back into your policy engine.

Using these capabilities allows you to take advantage of the full benefits of RBAC and more complex policy models by keeping your policy engines up to date with all the relevant policies and data in real time.

Data (computing) Role-based access control Webhook

Published at DZone with permission of Gabriel L. Manor. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Create a Multi-tenancy Application In Nest.js - Part 1
  • Enhancing Security With ZTNA in Hybrid and Multi-Cloud Deployments
  • Strengthening Web Application Security With Predictive Threat Analysis in Node.js
  • Comparing Axios, Fetch, and Angular HttpClient for Data Fetching in JavaScript

Partner Resources


Comments

ABOUT US

  • About DZone
  • Send feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: