Skip to content

OBSDOCS-1814: Docs for Tempo query RBAC #93417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions modules/distr-tracing-tempo-config-query-rbac.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Module included in the following assemblies:
//
// * observability/distr_tracing/distr-tracing-tempo-configuring.adoc

:_mod-docs-content-type: REFERENCE
[id="distr-tracing-tempo-config-query-rbac_{context}"]
= Query RBAC

Query Role-Based Access Control (RBAC) allows users to see attributes only for spans that originate from the namespaces that the users have access to.
Although a user can see traces from all namespaces, the attributes are filtered by the namespaces accessible to the user. The `service.name` and `k8s.namespace.name` attributes are filtered for all users.

.Example `TempoStack` custom resource with enabled multitenancy and query RBAC
[source,yaml]
----
apiVersion: tempo.grafana.com/v1alpha1
kind: TempoStack
metadata:
name: simplest
namespace: chainsaw-multitenancy
spec:
storage:
secret:
name: minio
type: s3
storageSize: 1Gi
resources:
total:
limits:
memory: 2Gi
cpu: 2000m
tenants:
mode: openshift
authentication:
- tenantName: dev
tenantId: "1610b0c3-c509-4592-a256-a1871353dbfb"
template:
gateway:
enabled: true # <1>
rbac:
enabled: true # <2>
queryFrontend:
jaegerQuery:
enabled: false # <3>
----
<1> Always set to `true`.
<2> Always set to `true`.
<3> Always set to `false`.

:_mod-docs-content-type: REFERENCE
[id="distr-tracing-tempo-config-query-rbac-configure_{context}"]
== Configuration

The following example gives OpenShift authenticated users access to the Tempo `dev` tenant and read attributes from the project `project1`.

.ClusterRole and ClusterRoleBinding to give authenticated users access to the `dev` tenant.
[source,yaml]
----
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: tempo-dev-read
rules:
- apiGroups: [tempo.grafana.com]
resources: [dev] # <1>
resourceNames: [traces]
verbs: [get]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tempo-dev-read
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: tempo-dev-read
subjects:
subjects:
- kind: Group
apiGroup: rbac.authorization.k8s.io
name: system:authenticated # <2>
----

<1> Refers to the tenant name defined in the `TempoStack` custom resource.
<2> Refers to all authenticated OpenShift users.

The second step is to give authenticated users access to the project `project1`.

.Command to give authenticated users access to the project `project1`.
[source,bash]
----
oc adm policy add-role-to-group view system:authenticated -n tutorial-application-backend2 # <1>
----

<1> Alternatively the access can be granted by creating a `Role` in the `project1` with `get` verb on `namespace` resource and assigning it to the `system:authenticated` group.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ include::modules/distr-tracing-tempo-config-receiver-tls-for-tempomonolithic.ado
* xref:../../security/certificates/service-serving-certificate.adoc#understanding-service-serving_service-serving-certificate[Understanding service serving certificates]
* xref:../../security/certificate_types_descriptions/service-ca-certificates.adoc#cert-types-service-ca-certificates[Service CA certificates]

include::modules/distr-tracing-tempo-config-query-rbac.adoc[leveloffset=+1]

[id="taints-and-tolerations_{context}"]
== Using taints and tolerations

Expand Down