-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(rbac): add group hierarchy support information
- Loading branch information
Showing
2 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |