|
| 1 | +--- |
| 2 | +apiVersion: external-secrets.io/v1beta1 |
| 3 | +kind: ExternalSecret |
| 4 | +metadata: |
| 5 | + name: grafana-ldap |
| 6 | +spec: |
| 7 | + secretStoreRef: |
| 8 | + kind: ClusterSecretStore |
| 9 | + name: onepassword |
| 10 | + target: |
| 11 | + template: |
| 12 | + data: |
| 13 | + ldap-toml: | |
| 14 | + [[servers]] |
| 15 | + host = "{{ .servers }}" |
| 16 | + port = 636 |
| 17 | + use_ssl = true |
| 18 | + start_tls = false |
| 19 | + ssl_skip_verify = true |
| 20 | + bind_dn = "uid={{ .username }},cn=users,cn=accounts,dc=lsst,dc=cloud" |
| 21 | + # If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;""" |
| 22 | + bind_password = """{{ .password }}""" |
| 23 | + # Timeout in seconds. Applies to each host specified in the 'host' entry (space separated). |
| 24 | + timeout = 10 |
| 25 | +
|
| 26 | + # User search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" or "(uid=%s)" |
| 27 | + # Allow login from email or username, example "(|(sAMAccountName=%s)(userPrincipalName=%s))" |
| 28 | + search_filter = "(uid=%s)" |
| 29 | +
|
| 30 | + # An array of base dns to search through |
| 31 | + search_base_dns = ["cn=users,cn=accounts,dc=lsst,dc=cloud"] |
| 32 | +
|
| 33 | + # group_search_filter = "(&(objectClass=posixGroup)(memberUid=%s))" |
| 34 | + # group_search_filter_user_attribute = "distinguishedName" |
| 35 | + # group_search_base_dns = ["ou=groups,dc=grafana,dc=org"] |
| 36 | +
|
| 37 | + # Specify names of the LDAP attributes your LDAP uses |
| 38 | + [servers.attributes] |
| 39 | + name = "givenName" |
| 40 | + surname = "sn" |
| 41 | + username = "cn" |
| 42 | + member_of = "memberOf" |
| 43 | + email = "email" |
| 44 | +
|
| 45 | + # Map ldap groups to grafana org roles |
| 46 | + [[servers.group_mappings]] |
| 47 | + group_dn = "cn=admins,cn=groups,cn=accounts,dc=lsst,dc=cloud" |
| 48 | + org_role = "Admin" |
| 49 | +
|
| 50 | + [[servers.group_mappings]] |
| 51 | + group_dn = "cn=k8s-pillan-admins,cn=groups,cn=accounts,dc=lsst,dc=cloud" |
| 52 | + org_role = "Editor" |
| 53 | +
|
| 54 | + [[servers.group_mappings]] |
| 55 | + # If you want to match all (or no ldap groups) then you can use wildcard |
| 56 | + group_dn = "cn=k8s-pillan,cn=groups,cn=accounts,dc=lsst,dc=cloud" |
| 57 | + org_role = "Viewer" |
| 58 | + data: |
| 59 | + - secretKey: username |
| 60 | + remoteRef: |
| 61 | + key: &item grafana service account |
| 62 | + property: username |
| 63 | + - secretKey: password |
| 64 | + remoteRef: |
| 65 | + key: *item |
| 66 | + property: password |
| 67 | + - secretKey: servers |
| 68 | + remoteRef: |
| 69 | + key: *item |
| 70 | + property: servers |
0 commit comments