Skip to content

Commit aa9a3d0

Browse files
committed
OBSDOCS-781: Improve RBAC LokiStack permission docs
1 parent fabe365 commit aa9a3d0

File tree

3 files changed

+68
-29
lines changed

3 files changed

+68
-29
lines changed

logging/logging_alerts/custom-logging-alerts.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Administrators can configure log-based alerts or recorded metrics for `applicati
1717
Application, audit, and infrastructure alerts are sent by default to the {product-title} monitoring stack Alertmanager in the `openshift-monitoring` namespace, unless you have disabled the local Alertmanager instance. If the Alertmanager that is used to monitor user-defined projects in the `openshift-user-workload-monitoring` namespace is enabled, application alerts are sent to the Alertmanager in this namespace by default.
1818

1919
include::modules/configuring-logging-loki-ruler.adoc[leveloffset=+1]
20-
include::modules/loki-rbac-permissions.adoc[leveloffset=+1]
20+
include::modules/loki-rbac-rules-permissions.adoc[leveloffset=+1]
2121

2222
ifdef::openshift-enterprise[]
2323
[role="_additional-resources"]

modules/loki-rbac-permissions.adoc

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * logging/logging_alerts/custom-logging-alerts.adoc
4+
5+
:_mod-docs-content-type: REFERENCE
6+
[id="loki-rbac-rules-permissions_{context}"]
7+
= Authorizing LokiStack rules RBAC permissions
8+
9+
Administrators can allow users to create and manage their own alerting and recording rules by binding cluster roles to usernames.
10+
Cluster roles are defined as `ClusterRole` objects that contain necessary role-based access control (RBAC) permissions for users.
11+
12+
In logging 5.8 and later, the following cluster roles for alerting and recording rules are available for LokiStack:
13+
14+
[options="header"]
15+
|===
16+
|Rule name |Description
17+
18+
|`alertingrules.loki.grafana.com-v1-admin`
19+
|Users with this role have administrative-level access to manage alerting rules. This cluster role grants permissions to create, read, update, delete, list, and watch `AlertingRule` resources within the `loki.grafana.com/v1` API group.
20+
21+
|`alertingrules.loki.grafana.com-v1-crdview`
22+
|Users with this role can view the definitions of Custom Resource Definitions (CRDs) related to `AlertingRule` resources within the `loki.grafana.com/v1` API group, but do not have permissions for modifying or managing these resources.
23+
24+
|`alertingrules.loki.grafana.com-v1-edit`
25+
|Users with this role have permission to create, update, and delete `AlertingRule` resources.
26+
27+
|`alertingrules.loki.grafana.com-v1-view`
28+
|Users with this role can read `AlertingRule` resources within the `loki.grafana.com/v1` API group. They can inspect configurations, labels, and annotations for existing alerting rules but cannot make any modifications to them.
29+
30+
|`recordingrules.loki.grafana.com-v1-admin`
31+
|Users with this role have administrative-level access to manage recording rules. This cluster role grants permissions to create, read, update, delete, list, and watch `RecordingRule` resources within the `loki.grafana.com/v1` API group.
32+
33+
|`recordingrules.loki.grafana.com-v1-crdview`
34+
|Users with this role can view the definitions of Custom Resource Definitions (CRDs) related to `RecordingRule` resources within the `loki.grafana.com/v1` API group, but do not have permissions for modifying or managing these resources.
35+
36+
|`recordingrules.loki.grafana.com-v1-edit`
37+
|Users with this role have permission to create, update, and delete `RecordingRule` resources.
38+
39+
|`recordingrules.loki.grafana.com-v1-view`
40+
|Users with this role can read `RecordingRule` resources within the `loki.grafana.com/v1` API group. They can inspect configurations, labels, and annotations for existing alerting rules but cannot make any modifications to them.
41+
42+
|===
43+
44+
[id="loki-rbac-rules-permissions-examples"]
45+
== Examples
46+
47+
To apply cluster roles for a user, you must bind an existing cluster role to a specific username.
48+
49+
Cluster roles can be cluster or namespace scoped, depending on which type of role binding you use.
50+
When a `RoleBinding` object is used, as when using the `oc adm policy add-role-to-user` command, the cluster role only applies to the specified namespace.
51+
When a `ClusterRoleBinding` object is used, as when using the `oc adm policy add-cluster-role-to-user` command, the cluster role applies to all namespaces in the cluster.
52+
53+
The following example command gives the specified user create, read, update and delete (CRUD) permissions for alerting rules in a specific namespace in the cluster:
54+
55+
.Example cluster role binding command for alerting rule CRUD permissions in a specific namespace
56+
[source,terminal]
57+
----
58+
$ oc adm policy add-role-to-user alertingrules.loki.grafana.com-v1-admin -n <namespace> <username>
59+
----
60+
61+
The following command gives the specified user administrator permissions for alerting rules in all namespaces:
62+
63+
.Example cluster role binding command for administrator permissions
64+
[source,terminal]
65+
----
66+
$ oc adm policy add-cluster-role-to-user alertingrules.loki.grafana.com-v1-admin <username>
67+
----

0 commit comments

Comments
 (0)