ldap.toml 3.1 KB

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