Since v12.15 the LDAP server's certificate is verified by default, and
Node.js verified it only against the Mozilla list it is built with. A
company root CA installed on the server with update-ca-certificates was
unknown to WeKan, so after upgrading from v12.14 the snap refused LDAPS
logins with UNABLE_TO_VERIFY_LEAF_SIGNATURE.
server/main.js now adds the operating system's CAs to Node's own before any
application code runs: tls.getCACertificates('system'), and the distribution
CA bundle files Go's crypto/x509 reads. The bundle file matters in the snap:
on Debian and Ubuntu snapd keeps the host's /etc/ssl, but the per-CA links
update-ca-certificates makes point into /usr/local/share/ca-certificates,
which the snap sees from its base. Verification is not relaxed - a CA the
system does not have is still refused - and --use-bundled-ca keeps Node's
list only. It covers LDAPS, mail, webhooks and OAuth2 in every launcher.
A refused LDAP certificate now says what to do, in the log and in Admin
Panel's Test connection: install the CA on the server, or set LDAP_CA_CERT.
No hint suggests turning verification off.
tests/systemCaCertificates6762.test.cjs runs a TLS server with a certificate
from a test private CA (its key is not kept) and checks the reported error
without the CA, verification with it in the system bundle, refusal without
it, --use-bundled-ca, and the hints. Two LDAP guards follow the extended
error handling; prune-unreachable-npm.mjs leaves the regex guard's reviewed
list, as it no longer builds a RegExp.
Thanks to fvb-sb and xet7 !
Fixes #6762.
32 KiB
LDAP info
- LDAP sync script, that also correctly removes users
- LDAP AD Simple Auth 2021-07-24 and related Search Filter Settings:
- LDAP_USER_SEARCH_FILTER=(objectClass=user)
- LDAP_EMAIL_FIELD=mail
- MS AD with Windows 2012 server
- Additional info about LDAP docs here
- LDAP issues
- Univention LDAP related issues
- Teams/Organizations feature related LDAP plans. Needs info from LDAP experts to describe how LDAP works.
- Wekan LDAP code
LDAP transport encryption
Set LDAP_ENCRYPTION to one of these values:
true— connect with TLS immediately, normally on port 636 (LDAPS).starttls— connect normally, then negotiate TLS with STARTTLS, normally on port 389.false— use an unencrypted connection. Avoid this outside a trusted local network.
The legacy values ssl (LDAPS) and tls (STARTTLS) still work so existing
deployments do not break, but WeKan logs a deprecation warning naming the value
above that should replace them. An unknown value logs a warning and does not
silently enable encryption. LDAPS and STARTTLS can negotiate the same modern
TLS protocols; STARTTLS is not inherently more secure than LDAPS.
A private or company certificate authority
The LDAP server's certificate is verified (LDAP_REJECT_UNAUTHORIZED defaults
to true). WeKan trusts the certificate authorities Node.js ships with and,
since #6762, also those installed on the server. So a company root CA works
the same way it does for every other program:
sudo cp company-root-ca.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates
sudo snap restart wekan # or restart the Docker container / service
The file must end in .crt. If the LDAP server sends only its own certificate,
install the intermediate CA the same way. Fedora and RHEL use
/etc/pki/ca-trust/source/anchors/ and update-ca-trust. Instead, the CA can
be given to WeKan alone in LDAP_CA_CERT (snap:
sudo snap set wekan ldap-ca-cert="$(cat company-root-ca.pem)"). Either is
better than turning verification off.
Snap
LDAP is available on Snap Stable channel. Settings can be seen with command wekan.help and from repo https://github.com/wekan/wekan-ldap . More settings at https://github.com/wekan/wekan-snap/wiki/Supported-settings-keys
You see all settings with:
wekan.help | less
For root-url, see Settings
For Caddy/Wekan/RocketChat Snap settings, see Snap install page, OAuth2 page and Caddy page. Instead of Caddy you can also use Nginx or Apache.
LDAP Filter settings
For better working LDAP filter setting than those below, settings info here: https://github.com/wekan/univention/issues/5
Active Directory LDAP part
sudo snap set wekan ldap-enable='true'
sudo snap set wekan default-authentication-method='ldap'
sudo snap set wekan ldap-port='389'
sudo snap set wekan ldap-host='192.168.1.100'
sudo snap set wekan ldap-basedn='OU=Domain Users,DC=sub,DC=domain,DC=tld'
sudo snap set wekan ldap-login-fallback='false'
sudo snap set wekan ldap-reconnect='true'
sudo snap set wekan ldap-timeout='10000'
sudo snap set wekan ldap-idle-timeout='10000'
sudo snap set wekan ldap-connect-timeout='10000'
sudo snap set wekan ldap-authentication='true'
sudo snap set wekan ldap-authentication-userdn='CN=LDAP-User,OU=Service Accounts,DC=sub,DC=domain,DC=tld'
sudo snap set wekan ldap-authentication-password='<password>'
sudo snap set wekan ldap-log-enabled='true'
sudo snap set wekan ldap-background-sync='true'
# LDAP_BACKGROUND_SYNC_INTERVAL : At which interval does the background task sync in milliseconds
# The format must be as specified in:
# https://bunkat.github.io/later/parsers.html#text
#sudo snap set wekan ldap-background-sync-interval='every 1 hours'
# At which interval does the background task sync in milliseconds.
# If not in use, Leave this unset, so it uses default, and does not crash.
# https://github.com/wekan/wekan/issues/2354#issuecomment-515305722
#sudo snap set wekan ldap-background-sync-interval=''
sudo snap set wekan ldap-background-sync-interval='every 1 hours'
sudo snap set wekan ldap-background-sync-keep-existant-users-updated='true'
sudo snap set wekan ldap-background-sync-import-new-users='true'
sudo snap set wekan ldap-encryption='false'
sudo snap set wekan ldap-user-search-field='sAMAccountName'
sudo snap set wekan ldap-username-field='sAMAccountName'
sudo snap set wekan ldap-fullname-field='cn'
FreeIPA v4.6.6
snap set wekan ldap-enable='true'
snap set wekan ldap-host='ldap.example.com'
# Use 'starttls' and port 389 to negotiate TLS with STARTTLS.
snap set wekan ldap-port='389'
snap set wekan ldap-encryption='starttls'
snap set wekan ldap-timeout='10000'
snap set wekan ldap-idle-timeout='10000'
snap set wekan ldap-connect-timeout='10000'
snap set wekan ldap-authentication='true'
snap set wekan ldap-authentication-userdn='uid=ldapuser,cn=users,cn=accounts,dc=example, dc=com'
snap set wekan ldap-authentication-password='password'
# This must be set to "false" for self-signed certificates to work - enable it
# for better security if you are using a certificate verified by a commercial
# Certificate Authority (like DigiCert, Let's Encrypt, etc.)
snap set wekan ldap-reject-unauthorized='false'
# This must be the plaintext certificate data, which you can get by running the
# follwing command:
# cat ca.example.com.pem | tr -d '\n'
# This removes the hidden newline characters, and allows you to copy it
# straight from your terminal and past it into the snap set command.
#
# Pointing it to a file doesn't work - I tried.
snap set wekan ldap-ca-cert='-----BEGIN CERTIFICATE-----[blahblahblah]-----END CERTIFICATE-----'
snap set wekan ldap-log-enabled='true'
snap set wekan ldap-basedn='dc=example,dc=com'
snap set wekan ldap-background-sync='true'
snap set wekan ldap-background-sync-keep-existant-users-updated='true'
snap set wekan ldap-background-sync-import-new-users='true'
# LDAP_BACKGROUND_SYNC_INTERVAL : At which interval does the background task sync in milliseconds
# The format must be as specified in:
# https://bunkat.github.io/later/parsers.html#text
#sudo snap set wekan ldap-background-sync-interval='every 1 hours'
# At which interval does the background task sync in milliseconds.
# If not in use, Leave this unset, so it uses default, and does not crash.
# https://github.com/wekan/wekan/issues/2354#issuecomment-515305722
#sudo snap set wekan ldap-background-sync-interval=''
snap set wekan ldap-background-sync-interval='every 1 hours'
snap set wekan ldap-merge-existing-users='true'
snap set wekan ldap-user-search-field='uid'
snap set wekan ldap-user-search-filter='(&(objectclass=person))'
snap set wekan ldap-user-search-scope='sub'
snap set wekan ldap-username-field='uid'
snap set wekan ldap-fullname-field='displayName'
snap set wekan ldap-email-field='mail'
snap set wekan ldap-sync-user-data='true'
snap set wekan ldap-sync-user-data-fieldmap='{"displayName":"name", "mail":"email", "initials":"initials"}'
OpenLDAP
sudo snap set wekan default-authentication-method='ldap'
sudo snap set wekan ldap-authentication='true'
sudo snap set wekan ldap-authentication-password='********'
sudo snap set wekan ldap-authentication-userdn='cn=admin,dc=*******,dc=lan'
sudo snap set wekan ldap-background-sync='true'
sudo snap set wekan ldap-background-sync-import-new-users='true'
# LDAP_BACKGROUND_SYNC_INTERVAL : At which interval does the background task sync in milliseconds
# The format must be as specified in:
# https://bunkat.github.io/later/parsers.html#text
#sudo snap set wekan ldap-background-sync-interval='every 1 hours'
# At which interval does the background task sync in milliseconds.
# If not in use, Leave this unset, so it uses default, and does not crash.
# https://github.com/wekan/wekan/issues/2354#issuecomment-515305722
#sudo snap set wekan ldap-background-sync-interval=''
sudo snap set wekan ldap-background-sync-interval='every 1 hours'
sudo snap set wekan ldap-basedn='dc=*****,dc=lan'
sudo snap set wekan ldap-email-field='mail'
sudo snap set wekan ldap-enable='true'
sudo snap set wekan ldap-fullname-field='cn'
sudo snap set wekan ldap-group-filter-enable='false'
sudo snap set wekan ldap-group-filter-id-attribute='cn'
sudo snap set wekan ldap-group-filter-objectclass='groupOfUniqueNames'
sudo snap set wekan ldap-host='192.168.100.7'
sudo snap set wekan ldap-log-enabled='false'
sudo snap set wekan ldap-login-fallback='true'
sudo snap set wekan ldap-merge-existing-users='true'
sudo snap set wekan ldap-port='389'
sudo snap set wekan ldap-sync-admin-groups='administrator'
sudo snap set wekan ldap-user-search-field='uid'
sudo snap set wekan ldap-user-search-filter='(&(objectclass=inetOrgPerson))'
sudo snap set wekan ldap-user-search-scope='sub'
sudo snap set wekan ldap-username-field='uid'
LDAP background sync, Organizations and Teams sync
These settings extend LDAP background sync and let LDAP groups be mirrored into
Wekan Organizations and Teams. They are read as environment variables (Docker /
Source). On Snap use the lower-case dash-separated equivalent (for example
ldap-sync-organizations).
When the user base DN also contains LDAP groups, set
LDAP_USER_SEARCH_FILTER to the directory's user class, for example
(objectClass=user) for Active Directory or (objectClass=inetOrgPerson) for
OpenLDAP. WeKan also refuses known group object classes returned by an
over-broad search, so they cannot be imported as user accounts.
LDAP_BACKGROUND_SYNC_DISABLE_NONEXISTANT_USERS(defaultfalse) — whentrue, background sync disables Wekan users that a successful LDAP search confirms are no longer present, and re-enables them if they reappear. This makes LDAP authoritative for active/inactive status and requiresLDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED=true. Lookup errors, missing identifier settings and ambiguous matches abort the run instead of disabling accounts.LDAP_SYNC_ORGANIZATIONS(defaultfalse) — whentrue, a user's LDAP groups are synced into that user's Wekan Organizations.LDAP_SYNC_ORGANIZATIONS_GROUPS(default empty) — comma-separated list of LDAP group names/patterns to sync as Organizations. Leave empty to sync all of the user's groups. Supports wildcards:*(any number of characters) and?(single character).LDAP_SYNC_TEAMS(defaultfalse) — whentrue, a user's LDAP groups are synced into that user's Wekan Teams.LDAP_SYNC_TEAMS_GROUPS(default empty) — comma-separated list of LDAP group names/patterns to sync as Teams. Leave empty to sync all of the user's groups. Supports wildcards:*(any number of characters) and?(single character).
Notes:
- LDAP admin status (
LDAP_SYNC_ADMIN_STATUS/LDAP_SYNC_ADMIN_GROUPS) is now also kept up to date during background sync, not only at sign-in. - LDAP group-filter values are now escaped, so a DN or
cnthat contains parentheses no longer breaks sign-in.
Docker
LDAP login works now by using this docker-compose.yml file: https://raw.githubusercontent.com/wekan/wekan/edge/docker-compose.yml adding ROOT_URL, LDAP settings etc to that file.
Using this docker-compose: https://docs.docker.com/compose/install/
With this command:
docker-compose up -d --no-build
Bugs and Feature Requests
LDAP Bugs and Feature Requests
Example LDAP settings for Docker
Note: Some newer settings could be missing from example below. Someone could copy newest missing settings from docker-compose.yml above to example below. Some examples are also at closed and open issues at https://github.com/wekan/wekan-ldap/issues
version: '2'
services:
wekandb:
# All Wekan data is stored in MongoDB. For backup and restore, see:
# [Export Docker Mongo Data](../../Platforms/FOSS/Container/Docker/Export-Docker-Mongo-Data.md)
image: mongo:4.0.3
container_name: wekan-db
restart: always
command: mongod --smallfiles --oplogSize 128
networks:
- wekan-tier
expose:
- 27017
volumes:
- wekan-db:/data/db
- wekan-db-dump:/dump
wekan:
# Wekan container only has Node.js and related code,
# there is no data stored here.
#
# Docker Hub, usually broken:
#image: wekanteam/wekan:latest
#
# Quay, usually works, updates faster:
image: quay.io/wekan/wekan:meteor-1.8
container_name: wekan-app
restart: always
networks:
- wekan-tier
#---------------------------------------------------------------
# For running Wekan in different port like 3000, use: 3000:80
ports:
- 3000:3000
environment:
#---------------------------------------------------------------
# == ROOT_URL SETTING ==
# Change ROOT_URL to your real Wekan URL, for example:
# http://example.com
# http://example.com/wekan
# http://192.168.1.100
#---------------------------------------------------------------
- ROOT_URL=
#---------------------------------------------------------------
# == PORT SETTING ==
# Not needed on Docker, but if you had installed from source,
# you could also have setup Wekan Node.js port at localhost
# with setting: PORT=3001
# and have Nginx proxy to port 3001, see Wekan wiki.
#---------------------------------------------------------------
- PORT=3000
#---------------------------------------------------------------
# == MONGO URL AND OPLOG SETTINGS ==
# https://github.com/wekan/wekan-mongodb/issues/2#issuecomment-378343587
# We've fixed our CPU usage problem today with an environment
# change around Wekan. I wasn't aware during implementation
# that if you're using more than 1 instance of Wekan
# (or any MeteorJS based tool) you're supposed to set
# MONGO_OPLOG_URL as an environment variable.
# Without setting it, Meteor will perform a pull-and-diff
# update of it's dataset. With it, Meteor will update from
# the OPLOG. See here
# https://blog.meteor.com/tuning-meteor-mongo-livedata-for-scalability-13fe9deb8908
# After setting
# MONGO_OPLOG_URL=mongodb://<username>:<password>@<mongoDbURL>/local?authSource=admin&replicaSet=rsWekan
# the CPU usage for all Wekan instances dropped to an average
# of less than 10% with only occasional spikes to high usage
# (I guess when someone is doing a lot of work)
#---------------------------------------------------------------
- MONGO_URL=mongodb://wekandb:27017/wekan
#---------------------------------------------------------------
# - MONGO_OPLOG_URL=mongodb://<username>:<password>@<mongoDbURL>/local?authSource=admin&replicaSet=rsWekan
#---------------------------------------------------------------
# == EMAIL SETTINGS ==
# Email settings are required in both MAIL_URL and Admin Panel,
# see [Troubleshooting Mail](../Email/Troubleshooting-Mail.md)
# For SSL in email, change smtp:// to smtps://
# NOTE: Special characters need to be url-encoded in MAIL_URL.
#---------------------------------------------------------------
- MAIL_URL='smtp://<mail_url>:25/?ignoreTLS=true&tls={rejectUnauthorized:false}'
- MAIL_FROM='Wekan Notifications <noreply.wekan@mydomain.com>'
#---------------------------------------------------------------
# == WEKAN API ==
# Wekan Export Board works when WITH_API='true'.
# If you disable Wekan API, Export Board does not work.
- WITH_API=true
#---------------------------------------------------------------
## Optional: Integration with Matomo https://matomo.org that is installed to your server
## The address of the server where Matomo is hosted:
# - MATOMO_ADDRESS=https://example.com/matomo
## The value of the site ID given in Matomo server for Wekan
# - MATOMO_SITE_ID=123456789
## The option do not track which enables users to not be tracked by matomo"
# - MATOMO_DO_NOT_TRACK=false
## The option that allows matomo to retrieve the username:
# - MATOMO_WITH_USERNAME=true
#---------------------------------------------------------------
# Enable browser policy and allow one trusted URL that can have iframe that has Wekan embedded inside.
# Setting this to false is not recommended, it also disables all other browser policy protections
# and allows all iframing etc. See wekan/server/policy.js
- BROWSER_POLICY_ENABLED=true
# When browser policy is enabled, HTML code at this Trusted URL can have iframe that embeds Wekan inside.
- TRUSTED_URL=''
#---------------------------------------------------------------
# What to send to Outgoing Webhook, or leave out. Example, that includes all that are default: cardId,listId,oldListId,boardId,comment,user,card,commentId .
# example: WEBHOOKS_ATTRIBUTES=cardId,listId,oldListId,boardId,comment,user,card,commentId
- WEBHOOKS_ATTRIBUTES=''
#---------------------------------------------------------------
# LDAP_ENABLE : Enable or not the connection by the LDAP
# example : LDAP_ENABLE=true
- LDAP_ENABLE=true
# LDAP_PORT : The port of the LDAP server
# example : LDAP_PORT=389
- LDAP_PORT=389
# LDAP_HOST : The host server for the LDAP server
# example : LDAP_HOST=localhost
- LDAP_HOST=<ldap_host_fqdn>
# LDAP_BASEDN : The base DN for the LDAP Tree
# example : LDAP_BASEDN=ou=user,dc=example,dc=org
- LDAP_BASEDN=ou=prod,dc=mydomain,dc=com
# LDAP_GROUP_BASEDN : Where the GROUPS are, when they are not under
# LDAP_BASEDN. Leave unset when users and groups share one subtree - then
# the group searches use LDAP_BASEDN, exactly as before. Set it when the
# directory keeps them apart (ou=groups beside ou=people), or the group
# searches find nothing and LDAP_GROUP_FILTER_ENABLE refuses every login.
# example : LDAP_GROUP_BASEDN=ou=groups,dc=example,dc=org
#- LDAP_GROUP_BASEDN=ou=groups,dc=mydomain,dc=com
# LDAP_LOGIN_FALLBACK : Fallback on the default authentication method
# example : LDAP_LOGIN_FALLBACK=true
- LDAP_LOGIN_FALLBACK=false
# LDAP_RECONNECT : Reconnect to the server if the connection is lost
# example : LDAP_RECONNECT=false
- LDAP_RECONNECT=true
# LDAP_TIMEOUT : Overall timeout, in milliseconds
# example : LDAP_TIMEOUT=12345
- LDAP_TIMEOUT=10000
# LDAP_IDLE_TIMEOUT : Specifies the timeout for idle LDAP connections in milliseconds
# example : LDAP_IDLE_TIMEOUT=12345
- LDAP_IDLE_TIMEOUT=10000
# LDAP_CONNECT_TIMEOUT : Connection timeout, in milliseconds
# example : LDAP_CONNECT_TIMEOUT=12345
- LDAP_CONNECT_TIMEOUT=10000
# LDAP_AUTHENTIFICATION : If the LDAP needs a user account to search
# example : LDAP_AUTHENTIFICATION=true
- LDAP_AUTHENTIFICATION=true
# LDAP_AUTHENTIFICATION_USERDN : The search user DN
# example : LDAP_AUTHENTIFICATION_USERDN=cn=admin,dc=example,dc=org
- LDAP_AUTHENTIFICATION_USERDN=cn=wekan_adm,ou=serviceaccounts,ou=admin,ou=prod,dc=mydomain,dc=com
# LDAP_AUTHENTIFICATION_PASSWORD : The password for the search user
# example : AUTHENTIFICATION_PASSWORD=admin
- LDAP_AUTHENTIFICATION_PASSWORD=pwd
# LDAP_LOG_ENABLED : Enable logs for the module
# example : LDAP_LOG_ENABLED=true
- LDAP_LOG_ENABLED=true
# LDAP_BACKGROUND_SYNC : If the sync of the users should be done in the background
# example : LDAP_BACKGROUND_SYNC=true
- LDAP_BACKGROUND_SYNC=false
# LDAP_BACKGROUND_SYNC_INTERVAL : At which interval does the background task sync in milliseconds
# The format must be as specified in:
# https://bunkat.github.io/later/parsers.html#text
#- LDAP_BACKGROUND_SYNC_INTERVAL=every 1 hours
# At which interval does the background task sync in milliseconds.
# Leave this unset, so it uses default, and does not crash.
# https://github.com/wekan/wekan/issues/2354#issuecomment-515305722
- LDAP_BACKGROUND_SYNC_INTERVAL=''
# LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED :
# example : LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED=true
- LDAP_BACKGROUND_SYNC_KEEP_EXISTANT_USERS_UPDATED=false
# LDAP_BACKGROUND_SYNC_IMPORT_NEW_USERS :
# example : LDAP_BACKGROUND_SYNC_IMPORT_NEW_USERS=true
- LDAP_BACKGROUND_SYNC_IMPORT_NEW_USERS=false
# LDAP_ENCRYPTION : Connection encryption. Accepted values:
# 'true' : LDAPS, TLS from the first byte (usually port 636)
# 'starttls' : connect unencrypted (usually port 389), then upgrade with STARTTLS
# 'false' : no encryption (default; strongly advised against)
# Deprecated but still working: 'ssl' (same as 'true'), 'tls' (same as 'starttls').
# Any other value logs a warning and means no encryption.
# example : LDAP_ENCRYPTION=true
- LDAP_ENCRYPTION=false
# LDAP_CA_CERT : The certification for the LDAPS server
# example : LDAP_CA_CERT=-----BEGIN CERTIFICATE-----MIIE+zCCA+OgAwIBAgIkAhwR/6TVLmdRY6hHxvUFWc0+Enmu/Hu6cj+G2FIdAgIC...-----END CERTIFICATE-----
#- LDAP_CA_CERT=''
# LDAP_REJECT_UNAUTHORIZED : Reject Unauthorized Certificate. Default true:
# the LDAPS / StartTLS server certificate is verified. For a self-signed
# or private CA, put the CA in LDAP_CA_CERT rather than turning this off.
# Only the exact value false disables verification.
- LDAP_REJECT_UNAUTHORIZED=true
# LDAP_USER_SEARCH_FILTER : Optional extra LDAP filters. Don't forget the outmost enclosing parentheses if needed
# example : LDAP_USER_SEARCH_FILTER=
- LDAP_USER_SEARCH_FILTER=
# LDAP_USER_SEARCH_SCOPE : Base (search only in the provided DN), one (search only in the provided DN and one level deep), or subtree (search the whole subtree)
# example : LDAP_USER_SEARCH_SCOPE=one
- LDAP_USER_SEARCH_SCOPE=
# LDAP_USER_SEARCH_FIELD : Which field is used to find the user
# example : LDAP_USER_SEARCH_FIELD=uid
- LDAP_USER_SEARCH_FIELD=sAMAccountName
# LDAP_SEARCH_PAGE_SIZE : Used for pagination (0=unlimited)
# example : LDAP_SEARCH_PAGE_SIZE=12345
- LDAP_SEARCH_PAGE_SIZE=0
# LDAP_SEARCH_SIZE_LIMIT : The limit number of entries (0=unlimited)
# example : LDAP_SEARCH_SIZE_LIMIT=12345
- LDAP_SEARCH_SIZE_LIMIT=0
# LDAP_GROUP_FILTER_ENABLE : Enable the login restriction group filter.
# When true, only members of LDAP_GROUP_FILTER_GROUP_NAME are allowed to log in.
# NOTE: This flag ONLY controls the login restriction. Admin status sync
# (LDAP_SYNC_ADMIN_STATUS / LDAP_SYNC_ADMIN_GROUPS) and group->role sync
# (LDAP_SYNC_GROUP_ROLES) query LDAP groups independently and do NOT require
# this flag to be true. The group filter metadata below
# (LDAP_GROUP_FILTER_OBJECTCLASS, LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE,
# LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT, LDAP_GROUP_FILTER_GROUP_ID_ATTRIBUTE)
# must still be configured for any group search to work.
# example : LDAP_GROUP_FILTER_ENABLE=true
- LDAP_GROUP_FILTER_ENABLE=false
# LDAP_GROUP_FILTER_OBJECTCLASS : The object class for filtering
# example : LDAP_GROUP_FILTER_OBJECTCLASS=group
- LDAP_GROUP_FILTER_OBJECTCLASS=
# LDAP_GROUP_FILTER_GROUP_ID_ATTRIBUTE :
# example :
- LDAP_GROUP_FILTER_GROUP_ID_ATTRIBUTE=
# LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE :
# example :
- LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE=
# LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT :
# example :
- LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT=
# LDAP_GROUP_FILTER_NESTED : Active Directory nested groups (#6744). When true, a user who is a member of
# LDAP_GROUP_FILTER_GROUP_NAME through another group (team group -> access
# group) is a member too: the group searches use AD's
# LDAP_MATCHING_RULE_IN_CHAIN (1.2.840.113556.1.4.1941). Needs a DN-valued
# member attribute (member, with LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT=dn).
# Also applies to admin status, group->role and org/team sync. Default: false.
# example : LDAP_GROUP_FILTER_NESTED=true
- LDAP_GROUP_FILTER_NESTED=false
# LDAP_GROUP_FILTER_GROUP_NAME :
# example :
- LDAP_GROUP_FILTER_GROUP_NAME=
# LDAP_UNIQUE_IDENTIFIER_FIELD : This field is sometimes class GUID (Globally Unique Identifier)
# example : LDAP_UNIQUE_IDENTIFIER_FIELD=guid
- LDAP_UNIQUE_IDENTIFIER_FIELD=
# LDAP_UTF8_NAMES_SLUGIFY : Convert the username to utf8
# example : LDAP_UTF8_NAMES_SLUGIFY=false
- LDAP_UTF8_NAMES_SLUGIFY=true
# LDAP_USERNAME_FIELD : Which field contains the ldap username
# example : LDAP_USERNAME_FIELD=username
- LDAP_USERNAME_FIELD=sAMAccountName
# LDAP_MERGE_EXISTING_USERS :
# example : LDAP_MERGE_EXISTING_USERS=true
- LDAP_MERGE_EXISTING_USERS=false
# LDAP_SYNC_USER_DATA :
# example : LDAP_SYNC_USER_DATA=true
- LDAP_SYNC_USER_DATA=false
# LDAP_SYNC_USER_DATA_FIELDMAP :
# example : LDAP_SYNC_USER_DATA_FIELDMAP={"cn":"name", "mail":"email"}
# LDAP_SYNC_GROUP_ROLES :
# example :
- LDAP_SYNC_GROUP_ROLES=''
# LDAP_DEFAULT_DOMAIN : The default domain of the ldap it is used to create email if the field is not map correctly with the LDAP_SYNC_USER_DATA_FIELDMAP
# example :
- LDAP_DEFAULT_DOMAIN=mydomain.com
#---------------------------------------------------------------
depends_on:
- wekandb
- wekanproxy
wekanproxy:
image: nginx:1.12
container_name: wekan-proxy
restart: always
networks:
- wekan-tier
ports:
- 443:443
- 80:80
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/ssl/ssl.conf:/etc/nginx/conf.d/ssl/ssl.conf:ro
- ./nginx/ssl/testvm-ehu.crt:/etc/nginx/conf.d/ssl/certs/mycert.crt:ro
- ./nginx/ssl/testvm-ehu.key:/etc/nginx/conf.d/ssl/certs/mykey.key:ro
- ./nginx/ssl/pphrase:/etc/nginx/conf.d/ssl/pphrase:ro
#------------------------------------------------------------------
# When using Wekan both at office LAN and remote VPN:
# 1) Have above Wekan docker container config with LAN IP address
# 2) Copy all of above Wekan config below, change name to different
# like wekan2 or wekanvpn, and change ROOT_URL to server VPN IP
# address.
# 3) This way both Wekan containers can use same MongoDB database
# and see the same Wekan boards.
# 4) You could also add 3rd Wekan container for 3rd network etc.
#------------------------------------------------------------------
# wekan2:
# ....COPY CONFIG FROM ABOVE TO HERE...
# environment:
# - ROOT_URL='http://10.10.10.10'
# ...COPY CONFIG FROM ABOVE TO HERE...
volumes:
wekan-db:
driver: local
wekan-db-dump:
driver: local
networks:
wekan-tier:
driver: bridge
Integration tests
See local login protocol tests for example identities, actual request/response checks, failure cases and deployment limitations.
Authentication boundary checks
Both LDAP login modes require non-empty string credentials; empty passwords cannot request an unauthenticated bind through the user login flow. Passwords are never trimmed. Intentional anonymous service searches remain supported. Both modes require exactly one user entry and enforce configured login-group restrictions. Group refusal cannot fall back to a cached local password. Service-search mode checks membership before rebinding as the user.
Blocked credential and group-policy attempts are summarized in Admin Panel / Problems. See the authentication boundary audit for validation coverage and deployment limitations.
Admin Panel overrides
Every LDAP_* setting above can also be set in Admin Panel / People / LDAP
(/admin/people/ldap). A value saved there wins over the environment variable;
an empty field, or Default, gives the environment variable back. The page
says for each setting which one is in effect, and Test connection tries the
settings in effect. The bind password is never sent to the browser - the page
shows only whether one is set and where it comes from. Changes apply to the
next login; background sync is rescheduled at once.
Before this, the LDAP page offered only eight settings, and none of them applied: the server read them with a call Meteor 3 refuses, and fell back to the environment variables without saying so.
Bind password from a file
LDAP_AUTHENTIFICATION_PASSWORD_FILE names a file that holds the search user's
password - a Docker or Kubernetes secret mounted as a file, for example
/run/secrets/ldap_auth_password. WeKan reads it at each login, so the password
is never an environment variable, and a rotated file applies to the next
login. One trailing line break is ignored. LDAP_AUTHENTIFICATION_PASSWORD, when
set, wins over the file, and a password saved in Admin Panel / People / LDAP
wins over both; the page shows which one is used, and when the file cannot be
read. On the snap: snap set wekan ldap-authentication-password-file='/var/snap/wekan/common/secrets/ldap_auth_password'.
Active Directory nested groups
LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE=member matches only DIRECT members of
LDAP_GROUP_FILTER_GROUP_NAME. In Active Directory, access is usually granted
through nested groups: a user is in a team group, and the team group is a member
of the application access group. To accept those users, set:
LDAP_GROUP_FILTER_NESTED=true
LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE=member
LDAP_GROUP_FILTER_GROUP_MEMBER_FORMAT=dn
The group searches then use Active Directory's LDAP_MATCHING_RULE_IN_CHAIN,
(member:1.2.840.113556.1.4.1941:=<user DN>), which follows group-in-group
membership to any depth. The same searches feed admin status sync, group->role
sync and Organizations/Teams sync, so those see nested groups too: a user who
is in an LDAP_SYNC_ADMIN_GROUPS group through another group becomes an admin.
This matching rule is an Active Directory feature. OpenLDAP, FreeIPA and Samba
directories without it keep LDAP_GROUP_FILTER_NESTED=false, the default.
Writing the rule into the attribute itself,
LDAP_GROUP_FILTER_GROUP_MEMBER_ATTRIBUTE=member:1.2.840.113556.1.4.1941:,
also works and is used as written; LDAP_GROUP_FILTER_NESTED=true is the
documented way.
Upgrading from before v12.08: with LDAP_USER_AUTHENTICATION=true, versions
before v12.08 did not check LDAP_GROUP_FILTER_ENABLE at all, so every directory
user could log in - including members of nested groups, and also users in no
allowed group. v12.08 enforces the group filter (DirectoryGroupBleed). An Active
Directory deployment that grants access through nested groups needs
LDAP_GROUP_FILTER_NESTED=true after upgrading, or those users are refused and
appear in Admin Panel / Problems as ldap.group-denied
(#6744).