Skip to content

Commit

Permalink
docs(rbac): add group hierarchy support information
Browse files Browse the repository at this point in the history
  • Loading branch information
dzemanov committed Sep 2, 2024
1 parent ffa3fbb commit fb903a9
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/rbac-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ With the RBAC plugin, you'll have the means to efficiently administer permission

Before you dive into utilizing the RBAC plugin for Backstage, there are a few essential prerequisites to ensure a seamless experience. Please review the following requirements to make sure your environment is properly set up

### Setup Permision Framework
### Setup Permission Framework

To effectively utilize the RBAC plugin, you must have the Backstage permission framework in place. If you're using the Red Hat Developer Hub, some of these steps may have already been completed for you. However, for other Backstage application instances, please verify that the following prerequisites are satisfied:

Expand Down Expand Up @@ -264,6 +264,8 @@ permission:

The maxDepth must be greater than 0 to ensure that the graphs are built correctly. Also the graph will be built with a hierarchy of 1 + maxDepth.

More information about group hierarchy can be found in the doc: [Group hierarchy](./docs/group-hierarchy.md).

### Optional RBAC provider module support

We also include the ability to create and load in RBAC backend plugin modules that can be used to make connections to third part access management tools. For more information, consult the [RBAC Providers documentation](./docs/providers.md).
57 changes: 57 additions & 0 deletions plugins/rbac-backend/docs/group-hierarchy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Group Hierarchy

RBAC access control is configured by defining roles and their associated permission policies, which are then assigned to users or groups. Leveraging group hierarchy can greatly simplify RBAC management, making it more scalable and flexible.

## Group-Based Role Assignment

Role can be assigned to a specific group. If a user is a member of that group, or a member of any of its child groups, the role (and its associated permissions) will automatically be applied to that user. You need to make sure that assigned groups actually exist in the catalog.

- Example:

Sam will inherit `role:default/test`, `subteam-group` must have explicitly defined `team-group` as parent.

```yaml
# catalog-entity.yaml
apiVersion: backstage.io/v1alpha1
kind: Group
metadata:
name: team-group
spec:
type: team
children: [subteam-group]
---
apiVersion: backstage.io/v1alpha1
kind: Group
metadata:
name: subteam-group
spec:
type: team
children: []
parent: team-group
---
apiVersion: backstage.io/v1alpha1
kind: User
metadata:
name: sam
spec:
memberOf:
- subteam-group
```
```CSV
g, group:default/team-group, role:default/test
p, role:default/test, catalog-entity, read, allow
```

## Managing Group Hierarchy Depth

While group hierarchy provides powerful inheritance features, it can have performance implications. Organizations with potentially complex group hierarchy can specify `maxDepth` configuration value, that will ensure that the RBAC plugin will stop at a certain depth when building user graphs.

```YAML
permission:
enabled: true
rbac:
maxDepth: 1
```

The `maxDepth` must be greater than 0 to ensure that the graphs are built correctly. Also the graph will be built with a hierarchy of 1 + maxDepth.

0 comments on commit fb903a9

Please sign in to comment.