Files
Homelabv4/infrastructure/authentik/grafana-blueprint.yaml
T
2026-03-09 20:21:35 -05:00

100 lines
3.8 KiB
YAML

---
apiVersion: v1
kind: ConfigMap
metadata:
name: authentik-blueprints-grafana
namespace: authentik
labels:
goauthentik.io/blueprint: "true"
data:
grafana.yaml: |-
version: 1
metadata:
name: grafana-oidc
entries:
# ============================================================================
# AUTO-CREATE GRAFANA GROUPS
# ============================================================================
# These groups control access levels in Grafana via OAuth role mapping:
# - Grafana Admins → Admin role (full access)
# - Grafana Editors → Editor role (can edit dashboards)
# - Grafana Viewers → Viewer role (read-only)
#
# AUTOMATIC ADMIN ACCESS:
# - Anyone in "authentik Admins" automatically gets Grafana Admin access
# - No manual configuration needed!
# ============================================================================
- model: authentik_core.group
id: grafana-admins-group
state: present
identifiers:
name: Grafana Admins
attrs:
name: Grafana Admins
is_superuser: false
# Note: authentik Admins are automatically granted access via role_attribute_path
# in Grafana configuration (see grafana/values.yaml)
- model: authentik_core.group
id: grafana-editors-group
state: present
identifiers:
name: Grafana Editors
attrs:
name: Grafana Editors
is_superuser: false
- model: authentik_core.group
id: grafana-viewers-group
state: present
identifiers:
name: Grafana Viewers
attrs:
name: Grafana Viewers
is_superuser: false
# ============================================================================
# GRAFANA OAUTH2 PROVIDER
# ============================================================================
- model: authentik_providers_oauth2.oauth2provider
id: grafana-provider
state: present
identifiers:
name: Grafana
attrs:
name: Grafana
client_id: bd03e9139dd2063c6c44c4d2f65f51d69de3ba0b6d6b1b9b41c255d2376d2dcc
client_secret: 6b6f2deecfe8fd56cae9c512cc71eedd463d67ff08f24c816b15b15e78ce36bc4f06a2276c5ffe3f67799d935994a32ed32cdc02ec674f279c82d7cfe3ca05d5
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]]
authentication_flow: !Find [authentik_flows.flow, [slug, default-authentication-flow]]
invalidation_flow: !Find [authentik_flows.flow, [slug, default-provider-invalidation-flow]]
redirect_uris:
- url: "https://grafana.kube.huskypup.net/login/generic_oauth"
matching_mode: strict
property_mappings:
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, openid]]
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, email]]
- !Find [authentik_providers_oauth2.scopemapping, [scope_name, profile]]
client_type: confidential
access_code_validity: "minutes=10"
access_token_validity: "hours=1"
refresh_token_validity: "days=30"
signing_key: !Find [authentik_crypto.certificatekeypair, [name, default]]
# ============================================================================
# GRAFANA APPLICATION
# ============================================================================
- model: authentik_core.application
id: grafana-application
state: present
identifiers:
slug: grafana
attrs:
name: Grafana
slug: grafana
policy_engine_mode: any
provider: !KeyOf grafana-provider