Sign inSign up

goldsam/openldap

By goldsam

Updated almost 6 years ago

OpenLDAP server w/TLS + Replication Support, S6 Overlay and Zabbix Monitoring Support

Image
0

10K+

goldsam/openldap repository overview

hub.docker.com/r/tiredofit/openldap

Build Status Docker Pulls Docker Stars Docker Layers

Introduction

This as a Dockerfile to build a OpenLDAP server for maintaining a directory. Upon starting this image it will give you a ready to run server with many configurable options.

  • Tracks latest release

  • Compiles from source

  • Multiple backends (bdb, hdb, mdb, sql)

  • All overlays compiled

  • Supports TLS encryption

  • Supports Replication

  • Scheduled Backups of Data

  • Ability to choose NIS or rfc2307bis Schema

  • Additional Password Modules (Argon, SHA2, PBKDF2)

  • Two Password Checking Modules - check_password.so and ppm.so

  • Zabbix Monitoring templates included

  • This Container uses a customized Alpine Linux base which includes s6 overlay enabled for PID 1 Init capabilities, zabbix-agent for individual container monitoring, Cron also installed along with other tools (bash,curl, less, logrotate, mariadb-client, nano, vim) for easier management. It also supports sending to external SMTP servers..

Changelog

Authors
Table of Contents

Prerequisites

This image has the capability to take advantage of getting TLS certificates autogenerated via the jwilder/nginx-proxy and the Let's Encrypt Proxy Companion @ https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion. However, it will run just fine on it's own without it.

Dependencies

None.

Installation

Automated builds of the image are available on Docker Hub and is the recommended method of installation.

docker pull tiredofit/openldap
Quick Start

Start openldap using:

docker-compose up

NOTE: Please allow up to 2 minutes for the application to start for the first time if you are generating self signed TLS certificates.

Configuration

Data-Volumes

The following directories are used for configuration and can be mapped for persistent storage.

DirectoryDescription
/var/lib/openldapData Directory
/etc/openldap/slapd.dConfiguration Directory
/assets/custom-scripts/If you'd like to execute a script during the initialization process drop it here (Useful for using this image as a base)
/certs/Drop TLS Certificates here (or use your own path)
/data/backupBackup Directory
Environment Varables

Along with the Environment Variables from the Base image, below is the complete list of available options that can be used to customize your installation.

Required for new setup
VariableDescriptionDefault
DOMAINLDAP domain.example.org
BASE_DNLDAP base DN. If empty automatically set from DOMAIN value.(empty)
ADMIN_PASSLdap Admin password.admin
CONFIG_PASSLdap Config password.config
ORGANIZATIONOrganization NameExample Organization
ENABLE_READONLY_USERAdd a read only/Simple Security Object/DSAfalse
READONLY_USER_USERRead only user username.readonly
READONLY_USER_PASSRead only user password.readonly
SCHEMA_TYPEUse nis or rfc2307bis core schema.nis
Logging Options
VariableDescriptionDefault
LOG_FILEFilename for loggingopenldap.log
LOG_LEVELSet LDAP Log Level256
LOG_PATHPath for Logs/logs/
LOG_TYPEOutput to CONSOLE or FILECONSOLE
Backup Options:
ParameterDescription
ENABLE_BACKUPEnable Backup System
BACKUP_LOCATIONBackup to FILESYSTEM or S3 compatible services like S3, Minio, Wasabi
BACKUP_COMPRESSIONUse either Gzip GZ, Bzip2 BZ, XZip XZ, ZSTD ZSTD or none NONE
BACKUP_COMPRESSION_LEVELNumberical value of what level of compression to use, most allow 1 to 9 except for ZSTD which allows for 1 to 19
BACKUP_INTERVALHow often to do a dump, in minutes. Defaults to 1440 minutes, or once per day.
BACKUP_BEGINWhat time to do the first dump. Defaults to immediate. Must be in one of two formats
Absolute HHMM, e.g. 2330 or 0415
Relative +MM, i.e. how many minutes after starting the container, e.g. +0 (immediate), +10 (in 10 minutes), or +90 in an hour and a half
BACKUP_RETENTIONValue in minutes to delete old backups (only fired when dump freqency fires). 1440 would delete anything above 1 day old. You don't need to set this variable if you want to hold onto everything.
BACKUP_MD5Generate MD5 Sum in Directory, TRUE or FALSE
BACKUP_PARALLEL_COMPRESSIONUse multiple cores when compressing backups TRUE or FALSE
BACKUP_PATHFilesystem path on where to place backups
Backing Up to S3 Compatible Services

If BACKUP_LOCATION = S3 then the following options are used.

ParameterDescription
BACKUP_S3_BUCKETS3 Bucket name e.g. 'mybucket'
BACKUP_S3_HOSTNAMEHostname of S3 Server e.g "s3.amazonaws.com" - You can also include a port if necessary
BACKUP_S3_KEY_IDS3 Key ID
BACKUP_S3_KEY_SECRETS3 Key Secret
BACKUP_S3_PATHS3 Pathname to save to e.g. 'backup'
BACKUP_S3_PROTOCOLUse either http or https to access service
BACKUP_S3_URI_STYLEChoose either VIRTUALHOST or PATH style
Password Policy Options

If you already have a check_password.conf or ppm.conf in /etc/openldap/ the following environment variables will not be applied

VariableDescriptionDefault
ENABLE_PPOLICYEnable PPolicy Module utilizationTRUE
PPOLICY_CHECK_RDNCheck RDN Parameter (ppm.so)0
PPOLICY_FORBIDDEN_CHARACTERSForbidden Characters (ppm.so)``
PPOLICY_MAX_CONSECMaximum Consective Character Pattern0
PPOLICY_MIN_DIGITMinimum Digit Characters0
PPOLICY_MIN_LOWERMinimum Lowercase Characters0
PPOLICY_MIN_POINTSMinimum Points required to pass checker3
PPOLICY_MIN_PUNCTMinimum Punctuation Characters0
PPOLICY_MIN_UPPERMinimum Uppercase Characters0
PPOLICY_USE_CRACKLIBUse Cracklib for verifying words (ppm.so)1
TLS options
VariableDescriptionDefault
ENABLE_TLSAdd TLS capabilities. Can't be removed once set to TRUE.true
TLS_CA_NAMESelfsigned CA Nameldap-selfsigned-ca
TLS_CA_SUBJECTSelfsigned CA Subject/C=XX/ST=LDAP/L=LDAP/O=LDAP/CN=
TLS_CA_CRT_SUBJECTSelfSigned CA Cert Sujbject${TLS_CA_SUBJECT}${TLS_CA_NAME}
TLS_CA_CRT_FILENAMECA Cert filename${TLS_CA_AME}.crt
TLS_CA_KEY_FILENAMECA Key filename${TLS_CA_NAME}.key
TLS_CA_CRT_PATHCA Certificates path/certs/${TLS_CA_NAME}/
TLS_CIPHER_SUITECipher Suite to useECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:-DHE-DSS:-RSA:!aNULL:!MD5:!DSS:!SHA
TLS_CREATE_CAAutomatically create CA when generating certificatesTRUE
TLS_CRT_FILENAMETLS cert filenamecert.pem
TLS_CRT_PATHTLS cert path/certs/
TLS_DH_PARAM_FILENAMEDH Param filenamedhparam.pem
TLS_DH_PARAM_KEYSIZEKeysize for DH Param2048
TLS_DH_PARAM_PATHDH Param path/certs/
TLS_ENFORCEEnforce TLS UsageFALSE
TLS_KEY_FILENAMETLS Key filenamekey.pem
TLS_KEY_PATHTLS Key path/certs/
TLS_RESET_PERMISSIONSChange permissions on certificate directories for OpenLDAP to readTRUE
TLS_VERIFY_CLIENTTLS verify client.try
Help: http://www.openldap.org/doc/admin24/tls.html
Replication options
VariableDescriptionDefault
ENABLE_REPLICATIONAdd replication capabilities. Multimaster only at present.false
REPLICATION_CONFIG_SYNCPROVolcSyncRepl options used for the config database. Without rid and provider which are automatically added based on REPLICATION_HOSTS.binddn="cn=config" bindmethod=simple credentials=$CONFIG_PASS searchbase="cn=config" type=refreshAndPersist retry="5 5 60 +" timeout=1 filter="(!(objectclass=olcGlobal))"
REPLICATION_DB_SYNCPROVolcSyncRepl options used for the database. Without rid and provider which are automatically added based on REPLICATION_HOSTS.binddn="cn=admin,$BASE_DN" bindmethod=simple credentials=$ADMIN_PASS searchbase="$BASE_DN" type=refreshAndPersist interval=00:00:00:10 retry="5 5 60 +" timeout=1
REPLICATION_HOSTSlist of replication hosts seperated by a space, must contain the current container hostname set by --hostname on docker run command. If replicating all hosts must be set in the same order. Example - ldap://ldap1.example.com ldap://ldap2.example.com ldap://ldap3.example.com
WAIT_FOR_REPLICASshould we wait for configured replicas to come online (respond to ping) before startup?false
Other environment variables
VariableDescriptionDefault
CONFIG_PATHConfiguration files path/etc/openldap
DB_PATHData Files path/var/lib/openldap
REMOVE_CONFIG_AFTER_SETUPDelete config folder after setup.true
SLAPD_ARGSIf you want to override slapd runtime arguments place here . Default (null)
SLAPD_HOSTSAllow overriding the default listen parametersldap://$HOSTNAME ldaps://$HOSTNAME ldapi:///
ULIMIT_NSet Open File Descriptor Limit1024
Networking

The following ports are exposed and available to public interfaces

PortDescription
389LDAP
636TLS Encrypted LDAP

Maintenance

Shell Access

For debugging and maintenance purposes you may want access the containers shell.

docker exec -it openldap bash
References

Tag summary

Content type

Image

Digest

Size

55.5 MB

Last updated

almost 6 years ago

docker pull goldsam/openldap