Skip to content

Add LDAP-based git identity and SSSD config for immediate git config setup#274

Merged
cmyers-mieweb merged 4 commits intomainfrom
cmyers_wazuh-int
Apr 10, 2026
Merged

Add LDAP-based git identity and SSSD config for immediate git config setup#274
cmyers-mieweb merged 4 commits intomainfrom
cmyers_wazuh-int

Conversation

@cmyers-mieweb
Copy link
Copy Markdown
Collaborator

Resolves: #256

Installs ldap-utils and adds LDAP client/config and a profile script to auto-configure git user.name/email from LDAP on first interactive login.

Copies ldap.conf to /etc/ldap, adds /etc/profile.d/git-identity.sh which uses ldapsearch and NSS (sssd) gecos to set global git config, and adjusts sssd.conf to map cn -> gecos (ldap_user_gecos = cn).

Also updates Dockerfile to install ldap-utils and include the new files.

This should allow for any user logging into any container to have git config preset and ready to go. This should work on any template derived from the base image.

Install ldap-utils and add LDAP client/config and a profile script to auto-configure git user.name/email from LDAP on first interactive login. Copies ldap.conf to /etc/ldap, adds /etc/profile.d/git-identity.sh which uses ldapsearch and NSS (sssd) gecos to set global git config, and adjusts sssd.conf to map cn -> gecos (ldap_user_gecos = cn). Also updates Dockerfile to install ldap-utils and include the new files.
Install ldap-utils and add LDAP client/config and a profile script to auto-configure git user.name/email from LDAP on first interactive login. Copies ldap.conf to /etc/ldap, adds /etc/profile.d/git-identity.sh which uses ldapsearch and NSS (sssd) gecos to set global git config, and adjusts sssd.conf to map cn -> gecos (ldap_user_gecos = cn). Also updates Dockerfile to install ldap-utils and include the new files.
Enhance git-identity.sh to be more robust: only skip when both global user.name and user.email are set, ignore root, resolve LDAP baseDN via RootDSE (namingContexts / defaultNamingContext) when LDAP_BASE_DN isn't provided, and set user.name (from NSS gecos) and user.email (from LDAP) independently. Clean up temporary variables. Also remove the explicit ldap_user_gecos = cn mapping from sssd.conf since SSSD reads gecos by default; aligns git identity logic with SSSD behavior and handles multi-entry namingContexts.
@cmyers-mieweb cmyers-mieweb merged commit 2340eb0 into main Apr 10, 2026
11 checks passed
@cmyers-mieweb cmyers-mieweb deleted the cmyers_wazuh-int branch April 10, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Containers should have git pre-configured

2 participants