Set-OPS-Public/roles/serveur_grafana/templates/setops.conf.j2
Daniel Allaire c5df8fac4a RBAC via SSO : rôle de realm Keycloak → niveau Grafana (authZ)
Machinerie additive/idempotente dans serveur_keycloak (rbac-oidc.yml) :
rôles de realm + mapper 'roles' sur les clients choisis + assignations
rôle→utilisateur. kcadm à chaud (zéro coupure SSO). Grafana :
role_attribute_path (grafana-admin→Admin, grafana-editor→Editor, sinon
Viewer). Prouvé sur id-sso-01 (idempotence) : testmail = grafana-editor.

Complète le dashboard logs (Viewer-friendly) : les deux volets de la
question « testmail peut-il voir les logs ? ».

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 16:58:15 -04:00

20 lines
1.2 KiB
Django/Jinja

[Service]
Environment=GF_SERVER_DOMAIN={{ serveur_grafana_hostname }}
Environment=GF_SERVER_ROOT_URL={{ serveur_grafana_root_url }}
Environment=GF_SECURITY_ADMIN_PASSWORD={{ serveur_grafana_admin_password }}
Environment=GF_USERS_ALLOW_SIGN_UP=false
{% if serveur_grafana_oidc_actif %}
Environment=GF_AUTH_GENERIC_OAUTH_ENABLED=true
Environment=GF_AUTH_GENERIC_OAUTH_NAME={{ serveur_grafana_oidc_nom }}
Environment=GF_AUTH_GENERIC_OAUTH_CLIENT_ID={{ serveur_grafana_oidc_client_id }}
Environment=GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET={{ serveur_grafana_oidc_client_secret }}
Environment="GF_AUTH_GENERIC_OAUTH_SCOPES={{ serveur_grafana_oidc_scopes }}"
Environment=GF_AUTH_GENERIC_OAUTH_AUTH_URL={{ serveur_grafana_oidc_base }}/auth
Environment=GF_AUTH_GENERIC_OAUTH_TOKEN_URL={{ serveur_grafana_oidc_base }}/token
Environment=GF_AUTH_GENERIC_OAUTH_API_URL={{ serveur_grafana_oidc_base }}/userinfo
Environment=GF_AUTH_GENERIC_OAUTH_LOGIN_ATTRIBUTE_PATH=preferred_username
{% if serveur_grafana_oidc_role_path %}
Environment="GF_AUTH_GENERIC_OAUTH_ROLE_ATTRIBUTE_PATH={{ serveur_grafana_oidc_role_path }}"
Environment=GF_AUTH_GENERIC_OAUTH_ROLE_ATTRIBUTE_STRICT=false
{% endif %}
{% endif %}