ldap.toml 3.3 KB

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