Skip to content

Commit 9d00385

Browse files
author
Jens Plüddemann
committed
added example grafana.ini and ldap.toml for exemplary ldap setup
1 parent 20ec938 commit 9d00385

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

docker-compose.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
services:
22
grafana:
3-
image: grafana/grafana:11.2.2
3+
image: grafana/grafana:11.5.2
44
restart: unless-stopped
55
volumes:
66
- grafana-storage:/var/lib/grafana
7+
- ./grafana.ini:/etc/grafana/grafana.ini:ro
8+
- ./ldap.toml:/etc/grafana/ldap.toml:ro
9+
environment:
10+
- GF_SECURITY_ADMIN_USER=admin
11+
- GF_SECURITY_ADMIN_PASSWORD=admin
712
healthcheck:
813
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
914
interval: 1m

grafana.ini

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
; enable ldap auth
2+
[auth.ldap]
3+
enabled = true
4+
; set to true to allow users to sign up
5+
; with the ldap sync script users are created and don't need to sign up
6+
; without the ldap sync script users need to sign up with their first login and so this would need to be set to true
7+
allow_sign_up = false
8+
9+
; enable debug logging for ldap
10+
[log]
11+
filters = ldap:debug

ldap.toml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[[servers]]
2+
host = "ldap.forumsys.com"
3+
port = 389
4+
use_ssl = false
5+
start_tls = false
6+
ssl_skip_verify = false
7+
8+
# Search user bind dn
9+
bind_dn = "cn=read-only-admin,dc=example,dc=com"
10+
bind_password = "password"
11+
12+
# Search filter to find users
13+
search_filter = "(|(uid=%s)(mail=%s))"
14+
15+
# The search base for users
16+
search_base_dns = ["dc=example,dc=com"]
17+
18+
# Group search configuration
19+
group_search_filter = "(&(objectClass=groupOfUniqueNames)(uniqueMember=%s))"
20+
group_search_filter_user_attribute = "dn"
21+
group_search_base_dns = ["dc=example,dc=com"]
22+
23+
# Attribute mapping
24+
[servers.attributes]
25+
name = "cn"
26+
surname = "sn"
27+
username = "uid"
28+
email = "mail"
29+
30+
# Scientists group -> Admin role in Org 1 and grafana admin
31+
[[servers.group_mappings]]
32+
group_dn = "ou=scientists,dc=example,dc=com"
33+
org_role = "Admin"
34+
grafana_admin = true
35+
36+
# Everyone else -> Viewer
37+
[[servers.group_mappings]]
38+
group_dn = "*"
39+
org_role = "Viewer"
40+
grafana_admin = false

0 commit comments

Comments
 (0)