Configure SRBAC policies
Manage service resource access with secure role-based access control (SRBAC) policies. Use these policies to define fine-grained administrative, member, and reader roles within your environment.
RHOSO 18.0 uses Secure role-based access control (SRBAC) by default. SRBAC replaces the legacy admin or owner model from Red Hat OpenStack Platform (RHOSP) 17.1 with a structured system of admin, member, and reader roles operating within project or system scopes. The default services policies enforce this model. There are no deprecated fallback policies.
SRBAC roles and scopes Copy linkLink copied!
In Red Hat OpenStack Platform (RHOSP) 17.1, the default authorization model relied on two implicit roles and policies defined as combinations of admin or owner checks. This model was inconsistent across services and made it difficult to grant fine-grained access without custom policy overrides.
Red Hat OpenStack Services on OpenShift (RHOSO) 18.0 enforces SRBAC uniformly. The Identity service (keystone) implements secure roles by using personas, which are scope-specific role assignments.
- Roles
-
Three roles are available: admin, member, and reader. They imply one another hierarchically: admin implies member, and member implies reader. The roles have the following permissions:
- Admin has full create, read, update, and delete (CRUD) operations on all resources within the assigned scope.
- Member has CRUD operations on resources owned by the scope in which the user is a member, but cannot perform administrative operations.
- Reader has read-only operations and cannot create, update, or delete resources, regardless of scope.
Note The legacymember,swiftoperator,ResellerAdmin, andheat_stack_userroles from RHOSP 17.1 are replaced by the three SRBAC roles. If your environment has users assigned to legacy roles, consider reviewing and reassigning them to admin, member, or reader within the appropriate scope. - Scopes
-
Each role is assigned within one of two scopes: project or system.
- In the project scope, the role applies to resources within a specific OpenStack project. This is the scope used by cloud users and project administrators. Use the following command to assign a project-scoped member role to a user:
$ openstack role add --user user1 --user-domain Default \ --project demo --project-domain Default member - In the system scope, the role applies to system-wide operations that are not owned by any project, such as managing endpoints, hypervisors, or service catalogs. System-scoped reader is useful for auditors or support team members who need read-only visibility across the entire deployment. Use the following command to assign a system-scoped member role to a user:
$ openstack role add --user auditor1 --user-domain Default \ --system all reader
- In the project scope, the role applies to resources within a specific OpenStack project. This is the scope used by cloud users and project administrators. Use the following command to assign a project-scoped member role to a user:
Review existing policies Copy linkLink copied!
To view existing policies, you generate the policy inside the services pod. There are no policy files on disk. Any policy overrides are injected with customServiceConfig in the OpenStackControlPlane CR.
Procedure Copy linkLink copied!
Policy syntax Copy linkLink copied!
Policy rules follow the format "<target>": "<check_string>". The target identifies the API action and the check string defines who can perform the API action.
| Operator | Definition |
|---|---|
|
|
No user can perform this action, including admin. |
|
|
Any authenticated user can perform this action. |
|
|
The user must have the specified role. |
|
|
Evaluates a named alias rule that is defined elsewhere in the policy. |
|
|
Standard boolean operators for composing complex rules. |
- Scope types in SRBAC policies
-
SRBAC policies include a
scope_typesattribute that restricts which token scope can call the API. For example, a policy withscope_types: ["system"]can only be called by a user with a system-scoped token. A policy withscope_types: ["project"]requires a project-scoped token. In Red Hat OpenStack Services on OpenShift (RHOSO) 18.0, scope enforcement is enabled by default, denoted byenforce_scope = trueandenforce_new_defaults = trueinoslo.policy. Attempting to call a system-scoped API with a project-scoped token will return a 403 Forbidden error.The following is an example SRBAC policy rule for listing hypervisors such as system-scoped or reader role:
"os_compute_api:os-hypervisors:list": "role:reader" # scope_types: ["system"]This policy rule only allows users with a system-scoped reader or higher role to list hypervisors. A project-admin cannot list hypervisors because their token is project-scoped.
SRBAC implementation planning Copy linkLink copied!
Before you deploy Red Hat OpenStack Services on OpenShift (RHOSO) 18.0 with default SRBAC policies, audit your existing user base and role assignments to ensure users are mapped correctly to the new model.
- Migration from legacy roles
-
If you are migrating from Red Hat OpenStack Platform (RHOSP) 17.1, note the following considerations:
- Users with the legacy
adminrole should retain theadminrole in the appropriate scope, either project or system. - Reassign users with
memberto thememberrole in project scope. - Assign read-only users, such as monitoring tools or auditors, to the
readerin the appropriate scope. - Service accounts such as nova, neutron, glance, and others are managed by the OpenStack Operator and do not require manual role assignment.
- Users with the legacy
- Principle of least privilege
-
Note the following considerations when implementing least privilege in SRBAC:
- Assign the
readerrole to users who only need to view resources such as dashboards, monitoring, or auditing. - Assign the
memberrole to users who create and manage their own resources within a project. - Reserve the
adminrole for project administrators or system operators who need full CRUD and administrative operations. - Use system scope sparingly. Most cloud users should have project-scoped roles only. System-scoped admin is for infrastructure operators.
- Assign the
- Custom roles
- RHOSO 18.0 supports creating custom roles, but these roles default to the same access policies as the member role, unless you create explicit policy overrides. The three roles and two scopes present in the SRBAC model covers most access patterns cleanly, so you might not need to create a custom role.
RHOSP 17.1 to RHOSO 18.0 SRBAC comparison Copy linkLink copied!
If you are already familiar with SRBAC in Red Hat OpenStack Platform (RHOSP) 17.1, it can be useful to note some of the differences between RHOSP 17.1 and Red Hat OpenStack Services on OpenShift (RHOSO) 18.0.
The following table outlines some of the differences between RHOSP 17.1 and RHOSO 18.0:
| RHOSP 17.1 mechanism | RHOSO 18.0 equivalent | Notes |
|---|---|---|
|
admin and member roles with implicit owner checks |
SRBAC: admin, member, reader roles with project or system scope |
Scope enforcement is on by default and cannot be disabled |
|
policy.json stored at /var/lib/config-data/… |
Defaults in code and policy.yaml overrides with |
Use YAML format instead of deprecated JSON policy files |
|
podman exec oslopolicy-policy-generator |
oc exec -n openstack <pod> — oslopolicy-policy-generator |
Same tool but different container runtime access |
|
Heat policy parameters such as NovaApiPolicies, KeystonePolicies, and others |
customServiceConfig in OpenStackControlPlane CR per service |
All heat params removed and replaced by single delivery mechanism |
|
podman cp policy.json into container which is immediate and non-persistent |
ConfigMap and operator reconciliation which are persistent and auditable) |
Changes require operator reconciliation and are not instant |
|
SSH to controller and tripleo-admin for policy inspection |
$ oc rsh or $ oc exec into service pods |
Auditable in RHOCP API audit log |
|
Custom roles such as PowerUsers with per-action policy overrides |
SRBAC admin, member, or reader covers most patterns so custom roles are supported but discouraged |
Custom roles default to member permissions without overrides |