Skip to content

[PM-30770] Kerberos auth support to LDAP directory - #971

Open
karlg100 wants to merge 4 commits into
bitwarden:mainfrom
karlg100:krbsupport-clean
Open

[PM-30770] Kerberos auth support to LDAP directory#971
karlg100 wants to merge 4 commits into
bitwarden:mainfrom
karlg100:krbsupport-clean

Conversation

@karlg100

Copy link
Copy Markdown

🎟️ Tracking

None

📔 Objective

Add support for kerberos authentication for LDAP directory connections. This allows the hosting endpoint's crednetials (or a user's crednetials) to authenticate to an LDAP server with kerberos. This sidesteps many increasingly difficult security policies forbidding the use of password secrets and password rotation. (if the endpoints krb credentials are managed by sssd, they are auto rotated every 30 days)

📸 Screenshots

no UI. CLI changes only.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

fixed missing config options
tested

example to test
# setup env
export BITWARDENCLI_CONNECTOR_APPDATA_DIR="$PWD/.bwdc-test"
rm -rf "$BITWARDENCLI_CONNECTOR_APPDATA_DIR"
unset HTTP_PROXY
unset HTTPS_PROXY
unset https_proxy
unset http_proxy
export BW_CLIENTID=‘organization.<ORGID>'
export BW_CLIENTSECRET=‘<SECRET>'

node ./build-cli/bwdc.js config server https://bitwarden.example.com
node ./build-cli/bwdc.js login

# check if we are logged in
DATA="$(node ./build-cli/bwdc.js data-file)"
jq '.activeUserId, .authenticatedAccounts' "$DATA"
jq '{activeUserId, authenticatedAccounts, hasAccounts: (.accounts|type)}' "$DATA"

# get krb creds
export KRB5CCNAME=FILE:/tmp/krb5cc_bwdc
kinit -k -t /etc/krb5.keytab HOSTNAME\$@EXAMPLE.COM
klist

# configure bwdc for krb
node ./build-cli/bwdc.js config ldap.auth kerberos
node ./build-cli/bwdc.js config ldap.kerberos.ccache FILE:/tmp/krb5cc_bwdc
node ./build-cli/bwdc.js config ldap.kerberos.mechanism GSSAPI
node ./build-cli/bwdc.js config ldap.ldapsearch.path ldapsearch
node ./build-cli/bwdc.js config sync.groupPath ""
node ./build-cli/bwdc.js config sync.userPath ""
node ./build-cli/bwdc.js config sync.userFilter "(&(memberOf:1.2.840.113556.1.4.1941:=CN=bitwarden-users,OU=Administrative,OU=Users,DC=example,DC=com)(mail=*))"
node ./build-cli/bwdc.js config sync.groupFilter "(memberOf:1.2.840.113556.1.4.1941:=CN=bitwarden-groups,OU=Administrative,OU=Groups,DC=example,DC=com)"

node ./build-cli/bwdc.js config directory 0
node ./build-cli/bwdc.js config ldap.hostname addc.example.com
node ./build-cli/bwdc.js config ldap.port 389
node ./build-cli/bwdc.js config ldap.rootPath “dc=example,dc=com"

# verify
jq ".\"$BWUID\".directoryConfigurations.ldap | {hostname,port,rootPath,auth,kerberosMechanism,kerberosCcache,ldapsearchPath}" "$DATA"

# test
node ./build-cli/bwdc.js test

# check for settings
DATA="$(node ./build-cli/bwdc.js data-file)"
BWUID="$(jq -r '.activeUserId' "$DATA")"
echo "$DATA $BWUID"

# sync
node ./build-cli/bwdc.js sync --response --pretty
@karlg100
karlg100 requested a review from a team as a code owner January 13, 2026 19:57
@karlg100
karlg100 requested a review from jrmccannon January 13, 2026 19:57
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Karl A. Grindley seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Karl A. Grindley seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@bitwarden-bot

Copy link
Copy Markdown

Thank you for your contribution! We've added this to our internal tracking system for review.
ID: PM-30770
Link: https://bitwarden.atlassian.net/browse/PM-30770

Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process.

@bitwarden-bot bitwarden-bot changed the title Kerberos auth support to LDAP directory [PM-30770] Kerberos auth support to LDAP directory Jan 13, 2026
fix for LoginCommand() bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants