ldap.toml 3.3 KB

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