LDAP
This section shows you how to use LDAP as an authentication backend for AxoConsole. In the examples we used the public demo service of FreeIPA as an LDAP server. It is assumed that you already have an LDAP server in place. Complete the following steps.
-
Configure authentication by editing the
spec.dex.configsection of the/var/lib/rancher/k3s/server/manifests/axoflow.yamlfile.-
(Optional) If you’ve used our earlier example, delete the
spec.dex.config.staticPasswordssection. -
Add the
spec.dex.config.connectorssection to the file, like this:CAUTION:
This example shows a simple configuration suitable for testing. In production environments, make sure to:
- configure TLS encryption to access your LDAP server - retrieve the bind password from a vault or environment variable. Note that if the bind password contains the `$` character, you must set it in an environment variable and pass it like `bindPW: $LDAP_BINDPW`.dex: enabled: true localIP: $VM_IP_ADDRESS config: create: true connectors: - type: ldap name: OpenLDAP id: ldap config: host: ipa.demo1.freeipa.org insecureNoSSL: true # This would normally be a read-only user. bindDN: uid=admin,cn=users,cn=accounts,dc=demo1,dc=freeipa,dc=org bindPW: Secret123 usernamePrompt: Email Address userSearch: baseDN: dc=demo1,dc=freeipa,dc=org filter: "(objectClass=person)" username: mail # "DN" (case sensitive) is a special attribute name. It indicates that # this value should be taken from the entity's DN not an attribute on # the entity. idAttr: uid emailAttr: mail nameAttr: cn groupSearch: baseDN: dc=demo1,dc=freeipa,dc=org filter: "(objectClass=groupOfNames)" userMatchers: # A user is a member of a group when their DN matches # the value of a "member" attribute on the group entity. - userAttr: DN groupAttr: member # The group name should be the "cn" value. nameAttr: cn -
Edit the following fields. For details on the configuration parameters, see the Dex LDAP connector documentation.
connectors.config.host: The hostname and optionally the port of the LDAP server in “host:port” format.connectors.config.bindDNandconnectors.config.bindPW: The DN and password for an application service account that the connector uses to search for users and groups.connectors.config.userSearch.bindDNandconnectors.config.groupSearch.bindDN: The base DN for the user and group search.
-
-
Configure authorization in the
spec.pomerium.policysection of the/var/lib/rancher/k3s/server/manifests/axoflow.yamlfile.- List the names of the LDAP groups whose members have read and write access to AxoConsole under
claim/groups. (Groupmanagersin the example.) - List the names of the LDAP groups whose members have read-only access to AxoConsole under
readOnly.claim/groups. (Groupemployeein the example.)
policy: emails: [] domains: [] groups: [] claim/groups: - managers readOnly: emails: [] domains: [] groups: [] claim/groups: - employeeFor details on authorization settings, see Authorization.
- List the names of the LDAP groups whose members have read and write access to AxoConsole under
-
Save the file.
-
Restart the dex deployment after changing the connector:
kubectl rollout restart deployment/dex -n axoflowExpected output:
deployment.apps/dex restarted
Getting help
You can troubleshoot common errors by running kubectl logs -n axoflow <dex-container-name>
If you run into problems setting up the authentication or authorization, contact our support team.