ldap.toml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. # Search user bind dn
  18. bind_dn = "cn=admin,dc=grafana,dc=org"
  19. # Search user bind password
  20. # If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
  21. bind_password = 'grafana'
  22. # User search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" or "(uid=%s)"
  23. search_filter = "(cn=%s)"
  24. # An array of base dns to search through
  25. search_base_dns = ["dc=grafana,dc=org"]
  26. # In POSIX LDAP schemas, without memberOf attribute a secondary query must be made for groups.
  27. # This is done by enabling group_search_filter below. You must also set member_of= "cn"
  28. # in [servers.attributes] below.
  29. # Users with nested/recursive group membership and an LDAP server that supports LDAP_MATCHING_RULE_IN_CHAIN
  30. # can set group_search_filter, group_search_filter_user_attribute, group_search_base_dns and member_of
  31. # below in such a way that the user's recursive group membership is considered.
  32. #
  33. # Nested Groups + Active Directory (AD) Example:
  34. #
  35. # AD groups store the Distinguished Names (DNs) of members, so your filter must
  36. # recursively search your groups for the authenticating user's DN. For example:
  37. #
  38. # group_search_filter = "(member:1.2.840.113556.1.4.1941:=%s)"
  39. # group_search_filter_user_attribute = "distinguishedName"
  40. # group_search_base_dns = ["ou=groups,dc=grafana,dc=org"]
  41. #
  42. # [servers.attributes]
  43. # ...
  44. # member_of = "distinguishedName"
  45. ## Group search filter, to retrieve the groups of which the user is a member (only set if memberOf attribute is not available)
  46. # group_search_filter = "(&(objectClass=posixGroup)(memberUid=%s))"
  47. ## Group search filter user attribute defines what user attribute gets substituted for %s in group_search_filter.
  48. ## Defaults to the value of username in [server.attributes]
  49. ## Valid options are any of your values in [servers.attributes]
  50. ## If you are using nested groups you probably want to set this and member_of in
  51. ## [servers.attributes] to "distinguishedName"
  52. # group_search_filter_user_attribute = "distinguishedName"
  53. ## An array of the base DNs to search through for groups. Typically uses ou=groups
  54. # group_search_base_dns = ["ou=groups,dc=grafana,dc=org"]
  55. # Specify names of the ldap attributes your ldap uses
  56. [servers.attributes]
  57. name = "givenName"
  58. surname = "sn"
  59. username = "cn"
  60. member_of = "memberOf"
  61. email = "email"
  62. # Map ldap groups to grafana org roles
  63. [[servers.group_mappings]]
  64. group_dn = "cn=admins,dc=grafana,dc=org"
  65. org_role = "Admin"
  66. # The Grafana organization database id, optional, if left out the default org (id 1) will be used
  67. # org_id = 1
  68. [[servers.group_mappings]]
  69. group_dn = "cn=users,dc=grafana,dc=org"
  70. org_role = "Editor"
  71. [[servers.group_mappings]]
  72. # If you want to match all (or no ldap groups) then you can use wildcard
  73. group_dn = "*"
  74. org_role = "Viewer"