Categorygithub.com/treydock/subid-ldap
module
0.5.0
Repository: https://github.com/treydock/subid-ldap.git
Documentation: pkg.go.dev

# README

CI Status GitHub release GitHub All Releases Go Report Card codecov

subid-ldap

The subid-ldap tool is intended to generate /etc/subuid and /etc/subgid based on LDAP data.

The entries in /etc/subuid and /etc/subgid are merged with new data so that existing entries keep their designated ID when new entries are added or old entries are removed.

The LDAP user UID is used by default for improved performance with tools using the subuid/subgid entries.

The contents of /etc/subuid are copied to /etc/subgid when changes are made.

Install

Install from archive

wget -O /tmp/subid-ldap.tar.gz https://github.com/treydock/subid-ldap/releases/download/v0.2.0/subid-ldap_0.2.0_linux_amd64.tar.gz
mkdir /usr/local/share/subid-ldap
tar xf /tmp/subid-ldap.tar.gz -C /usr/local/share/subid-ldap
ln -s /usr/local/share/subid-ldap/subid-ldap /usr/local/sbin/subid-ldap

If running subid-ldap as a daemon, install the systemd unit file:

cp /usr/local/share/subid-ldap/subid-ldap.service /etc/systemd/system/subid-ldap.service

The environment file /etc/sysconfig/subid-ldap would need to contain necessary configurations or directly edit /etc/systemd/system/subid-ldap.service to add the necessary flag.

Docker

Add additional flags either via additional environment variables or passing the flags after the image name.

docker run --detach --rm --name subid-ldap \
  -v /etc/subuid:/host/subuid -v /etc/subgid:/host/subgid \
  -e SUBID_SUBUID=/host/subuid -e SUBID_SUBGID=/host/subgid \
  -e LDAP_URL=ldap://example.com -e DAEMON=true quay.io/treydock/subid-ldap:latest

Configuration

The subid-ldap can be run as daemon with --daemon flag or executed via cron.

For Active Directory it's likely paged searches are required so at minimum the --ldap-paged-search flag would be required.

The following flags and environment variables can modify the behavior of the subid-ldap:

FlagEnvironment VariableDescriptionDefault/Required
--subid.subuidSUBID_SUBUIDPath to subuid file/etc/subuid
--subid.subgidSUBID_SUBGIDPath to subgid file/etc/subgid
--subid.startSUBID_STARTStart ID of subuid/subgid65537
--subid.rangeSUBID_RANGERange for each entry65536
--ldap.urlLDAP_URLLDAP URL to query, example: ldap://ldap.example.com:389Required
--ldap.tlsLDAP_TLSEnable TLS when connecting to LDAPfalse
--no-ldap.tls-verifyLDAP_TLS_VERIFY=falseDisable TLS verification when connecting to LDAPtrue
--ldap.tls-ca-certLDAP_TLS_CA_CERTThe contents of TLS CA cert when the certificate needs to be verified and not in global trust storeNone
--ldap.user-base-dnLDAP_USER_BASE_DNBase DN of the Users OU in LDAPRequired
--ldap.bind-dnLDAP_BIND_DNBind DN when connecting to LDAPNone (anonymous binds)
--ldap.bind-passwordLDAP_BIND_PASSWORDBind password when connecting to LDAPNone (anonymous binds)
--ldap.user-filterLDAP_USER_FILTERUser LDAP filter(objectClass=posixAccount)
--ldap.user-uid-attrLDAP_USER_UID_ATTRLDAP user UID attributeuidNumber
--ldap.paged-searchLDAP_PAGED_SEARCHEnable paged searches against LDAPfalse
--ldap.paged-search-sizeLDAP_PAGED_SEARCH_SIZESize of searches when using paged searches1000
--daemonDAEMONRun as daemonfalse
--daemon.update-intervalDAEMON_UPDATE_INTERVALUpdate interval in daemon mode5m
--metrics.listen-addressMETRICS_LISTEN_ADDRESSThe address to listen on for metrics when running as daemon:8085
--metrics.pathMETRICS_PATHThe path to store metrics that can be scraped by node_exporter

# Packages

No description provided by the author