Fine-Grained RBAC in OpenShift Using Enterprise Identity Management
Last updated on Sep 2, 2026

The IT ecosystems of modern enterprises usually don’t consist of a single homogenous entity. Organizations speed up their journey of digital transformation by including Red Hat OpenShift Container Platform as a basis for running containers leading to the growth of the surface area for access control significantly. An enterprise cluster now becomes not an isolated environment for running microservices but a multi-tenancy shared site for the daily activity of system platform engineers, infrastructure administrators, software developers, DevOps experts, outside contractors, and security auditors.
If credentials are managed locally or there are multiple authentication sources among clusters, it becomes impossible to manage the process effectively. Credential sprawl can occur, abandoned accounts may increase the chances of a security breach, and it is impossible to revoke the credentials immediately or lately, which leads to serious compliance violations according to such frameworks as SOC 2, HIPAA, and ISO 27001. In this case, the best way to tackle the problem of enterprise identity management and make access to the platform based on corporate directories like Microsoft Active Directory or standard LDAP servers.
Nevertheless, dozens of downstream clusters being tied directly to older LDAP directories tend to create issues related to fragility, high latency, complicated network topologies, and inflexible attribute processing. Keycloak in the form of the commercial Red Hat keycloak or Red Hat Single Sign-On acts as the modern identity broker between business directories and OpenShift clusters.
The combination of OpenShift, Keycloak, Active Directory, and LDAP results in the development of an efficient security channel capable of fine-grained RBAC implementation. The ability to employ these sophisticated identity bridges is one of the elementary abilities of OpenShift training on the administration of the OpenShift platform. This architecture ensures centralized management of user lifecycle, automatic synchronisation of directories, multi-factor authentication, and least privilege principle based governance in hybrid and multi-cloud environments.
The Architectural Terrain of Identity in Hybrid Cloud

To understand how modern access control works, it is essential to examine the different operational layers involved in the process of authentication and determining the correct authorization limits.
Authentication versus Authorization
Authentication deals with the fundamental question: Who are you? Authorization, on the other hand, poses the next question and asks: What is it that you can do?
In a simple Kubernetes installation, authentication leaves much to be desired. Kubernetes does not have its own database for end-user accounts and uses outside means to verify identities, possibly referring to client certificates, bearer tokens, or external webhook authenticators. OpenShift, on the contrary, dramatically changes this situation by incorporating an enterprise-level OAuth server into its control layer.
Once an engineer executes commands in OpenShift CLI or accesses the web console, the built-in OAuth server will intercept the request. The OAuth server processes the redirection process, communicates with upstream identity vendors, and, after successful completion of the authentication, will create an OpenShift internal access token related to the user identity on the platform level.
Authorization is responsible for determining what an authenticated identity is allowed to access. OpenShift utilizes its built-in RBAC mechanism for authorization, which assesses the identity, its corporate groups, and Role bindings.
The Part of Corporate Directories
Corporate enterprises view LDAP and Active Directory as the only reliable sources of true information regarding employee status. Because Active Directory provides a central source of information on account statuses: whether an employee is still working in the company, belongs to any organizational units, resides in any geographical area, or is part of a security group.
When an employee leaves a company, disabling this employee’s account in Active Directory must instantly revoke their access to corporate resources. Otherwise, if access restrictions in a particular container platform are based on static local users or manually configured credentials, their accessing privileges cannot be revoked, and these users will still exist with their high privileges.
The Need for Keycloak as an Identity Broker
Establishing direct links between the Active Directory and OpenShift clusters through conventional LDAP identity provider configurations is technically possible; however, it entails serious architectural limitations for modern enterprises.
Complexity of Networking and Firewall: It would require the presence of secure tunnels of LDAP/LDAPS having low latency and continuity while using different cloud services, dedicated centers for data, and edge locations which would make the surface area for network attacks larger.
Older Technology Not Supporting Modern Security Solutions: The older version of LDAP does not offer the possibility of using new technologies such as OpenID Connect and OAuth 2.0.
Slow Directory Search: The presence of many users as well as automatic systems with the use of Active Directory domain could result in numerous queries.
Keycloak would work successfully in solving these problems by acting as a broker of identity and gateway of federation. Keycloak is going to implement modern OIDC lower and traditional LDAP or Kerberos at the upper level of interaction with the Active Directory.
It is imperative to understand how the OAuth layer processes identities into internal groups while handling enterprise deployments across multiple clusters. Practical modules in an organized RedHat OpenShift training or OpenShift course enables engineers to create an identity provider and implement token exchange in a realistic sandbox process implementation.
Essential Concepts of Authentication in OpenShift

OpenShift manages the interaction with the users through several important abstraction layers connecting external identity with internal actions of the platform.
OpenShift OAuth Server
The integrated OAuth server provides standard endpoints for authorization, token creation, and validation. It is configurable on the cluster level by means of an OAuth custom resource managed by authentication operators in charge of the cluster.
When combined with an upstream service, it is possible to configure an OAuth server with several identity providers at the same time, e.g. an enterprise Keycloak server for common engineers, a secondary Active Directory branch for the systems administrators, and a hardware token system for critical operation.
Identities, Users, and Groups
In the OpenShift etcd database, the identity and authorization part are divided into three main native resources:
Identity: A singular successful authentication entry received from a distinct identity provider. It contains the identity provider’s unique identification (subject UUID in Keycloak or UPN in Active Directory) as well as metadata attributes in the record.
User: A representation of an actor within the cluster. OpenShift generates a User record based on an Identity. Technically, different identities from varied sources can be mapped to a unified User record; nevertheless, according to the enterprise practice, a unique identity translates into a different User.
Group: A set of User records. Groups are the most significant tool for employing RBAC. Instead of adding permissions directly to a person, OpenShift cluster administrators assign necessary access permissions to groups, allowing for swift reflection of any user membership changes in the organization.
OpenID Connect Mechanism
When OpenShift connects with Keycloak, the authentication session will rely on the OIDC authorization code flow defined below:
Later the user initiates access to the OpenShift web console, or directly calls the login command via CLI.
Then OpenShift's OAuth server redirects the browser or terminal to the Keycloak authorization endpoint.
Next, Keycloak provides the user with an enterprise-branded login page where the user will be asked for credentials or redirected to an upstream IdP.
If needed, Keycloak activates the second factor authentication via any of the approved methods i.e. hardware token, WebAuthn or OTP.
Keycloak hashes the password and the token via LDAP and checks it against Active Directory.
Keycloak generates digitally signed JWT identity token that contains standard claims and custom claims such as enterprise security group membership and email address.
The user will be redirected to OpenShift with an authorization code that the OpenShift's OAuth Server will use to receive the identity token.
OpenShift will verify the signature of the token using the public key of Keycloak and will extract the identity and the group claims and create the OpenShift internal bearer token.
Directory Services - Basics of Active Directory and LDAP

In order to create a robust authentication bridge, it is crucial to understand how Active Directory and the LDAP directory are structured and how they provide identity access information.
Tree Structure and Object Types
LDAP uses a special tree structure for organizing data that is called Directory Information Tree. Each of the entries comprises a unique identifier known as Distinguished Name (DN) comprising specific elements.
Domain Component (DC): Represents the root logic of the domain, such as the organization name or the top level domain.
Organizational Unit (OU): is a subdivided portion of the directory that is used for administrative purposes in grouping computers, users and groups according to functions, departments or regions of the company.
Common Name (CN): is an identifier that describes a certain leaf node (object), which can be a user or a security group.
Active Directory uses certain object classes for creating user groups, including user object class, which includes the person and organizationalPerson object classes:
sAMAccountName: Outdated logon identifier that was active pre-Windows 2000 (commonly referred to as a company's short username).
userPrincipalName (UPN): Recent internet-style login name, formatted similar to an email address.
mail: The main email address.
memberOf: A multi-valued attribute on user objects specifying distinguished names of all security groups that the user belongs to.
member: A multi-valued attribute based on group objects that lists the distinguished names of all child user objects.
Challenges Related to Direct Active Directory Integration
Even though OpenShift provides for native LDAP Identity Provider mode which can communicate directly to Active Directory, many large organizations face serious operational challenges while utilizing this mechanism:
Nested Groups in Active Directory: The concept of nested groups is extensively utilized in Active Directory, as nested groups are groups that constitute members of other groups. Furthermore, normal LDAP query searches do not work recursively to confirm the nested memberships without extra search extensions (for example, an Active Directory LDAP matching rule for recursive traversal) being used. To sum up, in the absence of such exclusivity in filtering, the members within sub-groups lose their assigned approval.
Differences between Business Units in Attribute Mapping: Different business units make use of different attributes for the purpose of logging into the platform. It means that one business unit may prefer to use email addresses, another one can require employee ID numbers for logging in, etc. In this regard, difficulties arise in terms of resolving these discrepancies between many clusters, as each cluster has its unique configuration.
Certificate Authority Distribution: To protect LDAP, it is necessary to use LDAPS (LDAP with TLS) or StartTLS to prevent the transmission of sensitive data in clear text. Distributing, rotating, and managing internal root CA certificates across many OpenShift clusters makes it quite complicated from the point of administrative burden.
Keycloak as the Corporate Identity Broker
Keycloak overcomes the issues that arise from direct directory integration by acting as the unique and advanced identity system.
The concept of Realms
A Realm in Keycloak indicates a security management domain. One Keycloak installation is able to host different realms, thus the configurations, users, federations of identities, and client applications will be absolutely separated.
Enterprise systems often have a separate realm for development environments or hybrid cloud infrastructures. This realm contains all connections to the corporate Active Directory servers and establishes common policies of token issuance for OpenShift clusters.
User Federation with Active Directory
Keycloak utilizes its User Federation feature to connect to Active Directory. Instead of going through the long process of user database migration, Keycloak connects to Active Directory domain controllers with the appropriate security technologies using the secure LDAPS protocol directly.
User Federation has various runtime modes of operation within Keycloak:
Read-Only Synchronization Mode: In this mode, Keycloak sends requests to the Active Directory for user authentication and imports non-sensitive data (username, name, group memberships) into its internal transactional repository for fast claims generation. Passwords are not saved in Keycloak, as authentication procedure is done with Active Directory live. This mode defines a standard approach for an enterprise environment.
Writable Synchronization Mode: In this mode, users can update their data or change their passwords via the interface of Keycloak, and all these changes are redirected to Active Directory via LDAPS. This practice is not common in an enterprise setting due to strict limitations in the governance of identities.
LDAP Mappers and Claims Extraction
To provide OpenShift with all necessary data required by RBAC to make proper decision, Keycloak uses LDAP mappers in the user federation configuration:
User Attribute Mapper: This mapper will map certain attributes of the directory that includes such values as employee type, company ID, or even email to the keycloak user model.
Group Mapper: Reads the Active Directory group hierarchy and maps it into the internal group system of Keycloak. This mapper can be configured to retrieve group memberships from the memberOf attribute of the user or the member attribute of the directory group object.
Role Mapper: Converts some of the Active Directory security groups into various group roles in Keycloak realm roles or client roles: this mapper provides an abstraction layer for managing policies downstream.
Integration Architecture in End-to-End Manner
The combination of OpenShift, Keycloak, and Active Directory creates various levels of identity processing.
Traffic Flow and Component Interaction
User Activity: An engineer starts the browser to visit the OpenShift console.
Cluster OAuth Monitoring: The OpenShift OAuth entity detects that the user does not possess a valid session token. The OpenShift interface displays the choice of identity providers or automatically redirects to the existing OIDC provider (Keycloak).
Identity Broker Execution: The user enters Keycloak. Keycloak performs checking against the authentication flows configured. In the case SSO is enabled with the help of Kerberos or workstation integration, the user gets authenticated without direct interaction. Otherwise, the Keycloak interface is displayed.
Active Directory Validation: The Keycloak element collects and saves the user’s password, ensures a secure connection with the respective Active Directory controller, and tries to perform LDAP bind with the user’s credentials.
Multi-Factor Enforcement: If Active Directory verifies the credentials, Keycloak will implement the Multi-Factor Authentication policies defined at the realm level. The user is prompted to use either an authenticator or a push notification.
Group and Claim Construction: Once the user is successfully authenticated by Keycloak, it sends a request to the Active Directory to extract the user groups. Then, the Keycloak performs its own transformation logic to analyze the structure of the directory and transform it into group names.
Token Handshake: After successfully authenticating the user, Keycloak redirects the browser to the redirect URI of OpenShift along with an authorization code. Subsequently, OpenShift’s control plane performs a direct HTTP call to Keycloak’s token endpoint with the authorization code along with the client secret.
Token Validation and Session Creation: Finally, Keycloak sends back the signed identity and access tokens, which OpenShift verifies based on Keycloak’s public key, converts to its own User resource, receives group attributes, and generates a new session.
The Communication of Network and Security Boundaries
OpenShift has to communicate or transfer information with Keycloak by way of the OpenShift master nodes to connect to either its public or private HTTPS endpoints. The connection is completely secured by TLS connection or protocol which, therefore, implies that OpenShift trusts the Certificate Authority that issues Keycloak's SSL certificates.
The Keycloak's connection with Active Directory: the instances of Keycloak have to be associated or communicate with the Active Directory domain controllers via the LDAPS (over TCP port 636) or standard LDAP with StartTLS protocol (over TCP port 389). The use of basic LDAP (port 389 without encryption) is completely forbidden since this would create an avenue for the business passwords and information to be presented or exposed to interference.
In-Cluster Keycloak Deployment: the activities of Keycloak as hosted by OpenShift in a containerized environment are coordinated by the Keycloak Operator that administers the performance of the service, including automated scaling, lifecycle processes without downtimes, and the management of persistent volumes.
OpenShift's Fine-Grained Role-Based Access Control (RBAC)

While authentication establishes identity, Role-Based Access Control outlines what that identity can do within the system. The granular RBAC allows the company to avoid any operational failures and comply with compliance requirements.
Fundamentals of OpenShift RBAC
OpenShift's authorization mechanism comprises four main types of API units:
Rules: Different kinds of API actions allowed for certain resource types. The rule specifies verbs (such as get, list, watch, create, update, delete, patch), API groups (for example, core, apps, networking.k8s.io), and resource types (for example, pods, services, routes, and namespaces).
Roles: The entire collection of rules that apply only to one project/namespace.
Definition of ClusterRoles: these are the permissions assigned to cluster-wide entities. These permissions can either apply to all namespaces at once (an instance is to read persistent volumes or to configure the physical class of storage) or have the regular form of permissions, defined locally and applied through multiple cluster bindings.
Practice of RoleBindings and ClusterRoleBindings: these are the binding mechanisms for the connection of a Role/ClusterRole with a subject. The RoleBinding binds a Role to a specific namespace, and the ClusterRoleBinding does so at the cluster level.
OpenShift Default Roles
OpenShift has a few presets of ClusterRoles for standard operations of the platform:
cluster-admin: The highest level of authority on the platform. All policy checks can be ignored, and all infrastructure objects, nodes, and machine and access policies can be modified.
admin: Developed for leaders of projects/namespaces. Can see and modify any workload resources in a namespace and give permissions to other users with the help of RoleBindings.
edit: Can edit operational resources in a project, like deployments, pods, persistent volume claims, and services, but cannot manage security elements and role bindings.
view: Has access to read all operational workloads and configurations within a namespace. No access to sensitive secrets, workloads' modification, or commands execution inside running containers.
The Role-to-Group Binding Technique
When RoleBindings are assigned to specific individuals, that is not a good practice because it cannot be used in a big company. It adds to the unnecessary administration work. Additionally, it complicates the access controls audit process.
The reliable design is based on the principle of Group-to-Role Binding. As part of this principle:
Clusters form relations between native OpenShift Groups and Roles including ClusterRoles.
The OpenShift Groups are never defined by the administrators manually.
The membership of the group comes from the identity tokens provided by Keycloak which has a connection to the Active Directory structures.
An engineer's move from a frontend team to a security auditing team results in modifications to the Active Directory. Active Directory paths such changes to the Keycloak federation cache. The next time the user logs into the platform, Keycloak sends them a new token with the revised group membership. While doing so, OpenShift makes the necessary changes automatically and gives the user auditor rights while canceling the frontend editing rights so that the administrator does not have to do anything in the system.
Final Note: Importance of Uniform Platform Identity
By using Keycloak to connect Red Hat OpenShift with Active Directory and LDAP, identity apprehension changes from an operational constraint into a centralized protection mechanism. Unlike the way Kubernetes access is a separate world of static keys and different configurations, this solution makes it possible to link the entire cluster access duration to the firm’s authoritative source. Keycloak makes the protocol translation and network routing as well as directory caching a complex but manageable element, while OpenShift turns its focus on workload orchestration and implements correct access policies.
With this approach, developers can get single sign-on capabilities, managers can effectively govern business practices, and security teams can achieve least-privilege compliance. Moreover, this solution helps to bring about the required safety in the management of enterprise workloads.
By undergoing online open shift training at OnlineITGuru, platform engineers, cloud architects, and system administrators can hone their skills in dealing with container orchestration, security modeling, and identity federation, thus ensuring their competence in implementing business-level solutions.
