ldap.toml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # To troubleshoot and get more log info enable ldap debug logging in grafana.ini
  2. # [log]
  3. # filters = ldap:debug
  4. [[servers]]
  5. # Ldap server host (specify multiple hosts space separated)
  6. host = "127.0.0.1"
  7. # Default port is 389 or 636 if use_ssl = true
  8. port = 389
  9. # Set to true if ldap server supports TLS
  10. use_ssl = false
  11. # Set to true if connect ldap server with STARTTLS pattern (create connection in insecure, then upgrade to secure connection with TLS)
  12. start_tls = false
  13. # set to true if you want to skip ssl cert validation
  14. ssl_skip_verify = false
  15. # set to the path to your root CA certificate or leave unset to use system defaults
  16. # root_ca_cert = "/path/to/certificate.crt"
  17. # Authentication against LDAP servers requiring client certificates
  18. # client_cert = "/path/to/client.crt"
  19. # client_key = "/path/to/client.key"
  20. # Search user bind dn
  21. bind_dn = "cn=admin,dc=grafana,dc=org"
  22. # Search user bind password
  23. # If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
  24. bind_password = 'grafana'
  25. # User search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" or "(uid=%s)"
  26. search_filter = "(cn=%s)"
  27. # An array of base dns to search through
  28. search_base_dns = ["dc=grafana,dc=org"]
  29. # In POSIX LDAP schemas, without memberOf attribute a secondary query must be made for groups.
  30. # This is done by enabling group_search_filter below. You must also set member_of= "cn"
  31. # in [servers.attributes] below.
  32. # Users with nested/recursive group membership and an LDAP server that supports LDAP_MATCHING_RULE_IN_CHAIN
  33. # can set group_search_filter, group_search_filter_user_attribute, group_search_base_dns and member_of
  34. # below in such a way that the user's recursive group membership is considered.
  35. #
  36. # Nested Groups + Active Directory (AD) Example:
  37. #
  38. # AD groups store the Distinguished Names (DNs) of members, so your filter must
  39. # recursively search your groups for the authenticating user's DN. For example:
  40. #
  41. # group_search_filter = "(member:1.2.840.113556.1.4.1941:=%s)"
  42. # group_search_filter_user_attribute = "distinguishedName"
  43. # group_search_base_dns = ["ou=groups,dc=grafana,dc=org"]
  44. #
  45. # [servers.attributes]
  46. # ...
  47. # member_of = "distinguishedName"
  48. ## Group search filter, to retrieve the groups of which the user is a member (only set if memberOf attribute is not available)
  49. # group_search_filter = "(&(objectClass=posixGroup)(memberUid=%s))"
  50. ## Group search filter user attribute defines what user attribute gets substituted for %s in group_search_filter.
  51. ## Defaults to the value of username in [server.attributes]
  52. ## Valid options are any of your values in [servers.attributes]
  53. ## If you are using nested groups you probably want to set this and member_of in
  54. ## [servers.attributes] to "distinguishedName"
  55. # group_search_filter_user_attribute = "distinguishedName"
  56. ## An array of the base DNs to search through for groups. Typically uses ou=groups
  57. # group_search_base_dns = ["ou=groups,dc=grafana,dc=org"]
  58. # Specify names of the ldap attributes your ldap uses
  59. [servers.attributes]
  60. name = "givenName"
  61. surname = "sn"
  62. username = "cn"
  63. member_of = "memberOf"
  64. email = "email"
  65. # Map ldap groups to grafana org roles
  66. [[servers.group_mappings]]
  67. group_dn = "cn=admins,dc=grafana,dc=org"
  68. org_role = "Admin"
  69. # To make user an instance admin (Grafana Admin) uncomment line below
  70. # grafana_admin = true
  71. # The Grafana organization database id, optional, if left out the default org (id 1) will be used
  72. # org_id = 1
  73. [[servers.group_mappings]]
  74. group_dn = "cn=users,dc=grafana,dc=org"
  75. org_role = "Editor"
  76. [[servers.group_mappings]]
  77. # If you want to match all (or no ldap groups) then you can use wildcard
  78. group_dn = "*"
  79. org_role = "Viewer"