|Alex 851573e28f||1 year ago|
|ldapserver||1 year ago|
|.gitignore||1 year ago|
|Dockerfile||1 year ago|
|LICENSE||1 year ago|
|Makefile||1 year ago|
|README.md||1 year ago|
|TODO.md||1 year ago|
|acl.go||1 year ago|
|bottin.hcl.example||1 year ago|
|bottin.png||1 year ago|
|config.json.example||1 year ago|
|go.mod||1 year ago|
|go.sum||1 year ago|
|main.go||1 year ago|
|read.go||1 year ago|
|ssha.go||1 year ago|
|util.go||1 year ago|
|write.go||1 year ago|
Bottin is a LDAP server that uses Consul's key-value store as a storage backend, in order to provide a redundant (high-availability) LDAP server on a Nomad+Consul cluster. It is a reimplementation of superboum's Bottin using the Go programming language.
A Docker image is provided on the Docker hub.
An example for running Bottin on a Nomad cluster can be found in
Bottin takes a single command line argument,
-config <filename>, which is the
path to its config file (defaults to
The configuration file is a JSON file whose contents is described in the following section.
Bottin is licensed under the terms of the GPLv3.
Bottin requires go 1.13 or later.
To build Bottin, clone this repository outside of your
make in the root of the repo.
When Bottin is launched on an empty database,
it creates a special admin entity with the name
It will have a randomly generated password that is printed out by the server.
Check your logs to retrieve the password.
The admin entity has no powers other than those granted by the ACL rules, so unless you don't want to use it, make sure to keep rules that allow to bind to the admin entity and that allows the admin entity to do everything.
Bottin supports all of the log levels of logrus.
The log level can be specified in the key
log_level of the json config file,
or in the environment variable
By default, the log level is set to
Bottin only handles LDAP entries under a given path, which is typically of
sld.tld is your domain name. Specify this
suffix in the
suffix key of the json config file.
By default, Bottin connects to the Consul server on localhost.
Change this by specifying the
consul_host key in the json config file.
By default, Bottin listens on all interfaces on port 389 for standard
non-TLS connections. Change the value of the
bind key in the json config
file to change this behaviour (default value:
0.0.0.0:389). An empty string
will disable this port and Bottin will not listen for non-TLS connections.
If a TLS configuration is provided (see next section), Bottin also listens
on all interfaces on port 636 for TLS connections. Change the value of the
bind_secure key in the json config file to change this behaviour (default
0.0.0.0:636). An empty string will disable this port and Bottin
will not listen for TLS connections.
Bottin supports TLS connections using either fully secure connections or using the STARTLS functionnality of the LDAP protocol to upgrade from an insecure connection. To use it, specify the following three keys in the json config file:
tls_server_name: the host name that clients will use to reach your LDAP server
tls_cert_file: path to your TLS certificate (a
tls_key_file: path to your TLS key (a
If a TLS configuration is provided, the
STARTTLS mechanism may be used on the
insecure port, independently of whether the secure port is enabled or not.
The secure port is disabled and a warning is shown if the
is set (non-empty) and no valid TLS configuration is provided.
Bottin supports a flexible syntax to specify access rights to items in the database. The ACL is specified as a list of rules. A request will be allowed if there exists a rule that allows it. Otherwise an insufficient permission error will be returned.
The list of ACL rules are specified in the
acl key of the json config file, as a list of strings whose structure is defined in the next paragraph.
A rule is a string composed of five fields separated by
:. The fields are the following:
*(see the format used by Go's
path.Match). The special name
ANONYMOUSapplies to clients before they bind to an LDAP entity.
modifyseparated by spaces.
SELFis replaced by the entity name of the bound user before trying to match.
!is an exclude pattern, otherwise it is an include pattern. To read/write an attribute, it has to match at least one include pattern and not match any exclude pattern. Delete operations do not check for any attribute, thus as soon as
deleteis included in the allowed actions, the right to delete entities is granted.
Anybody (before binding) can bind to an entity under
Anybody (before binding) can bind to the specific admin entity:
Anybody who is logged in can read anything that is not a userpassword attribute:
Anybody can read and modify anything from their own entry:
The admin can read, add, modify, delete anything:
cn=admin,dc=bottin,dc=eu::read add modify delete:*:*
Members of the admin group can read, add, modify, delete anything:
*:cn=admin,ou=groups,dc=bottin,dc=eu:read add modify delete:*:*