Skip to content
SHC Docs

Should an ldap socket exist?

Status: RULED: NO, NOT NOW. Design only; nothing was enabled, no compose and no Dockerfile was changed in the lane that produced this document. One question inside it (§6) is the owner’s and is deliberately left open.

Date: 2026-08-05. Measured against shc origin/main @ 367003bf1, ce origin/main @ 224a4be, and the Keycloak base repo (~/selfhosted-cloud/keycloak) origin/main @ 5331c5a, all in fresh worktrees, plus one read-only probe of the live bitspur estate.


Do not build an ldap socket. Do not re-enable MyVD. The ldap capability name stays reserved with no provider, exactly as it is today.

Five findings drive that, in order of weight:

  1. Demand is measurably ZERO, and it is zero in the strongest available sense. Across all 75 catalogue apps, exactly one file contains the string ldap (apps/mailcow/sso.plug.yaml), and every occurrence in it is inside a # comment. Not one plug, not one socket, not one var, not one compose key, not one test. kerberos appears zero times. (§4, with the mutation test that proves the grep is not lying.)

  2. This was already ruled, deliberately, 12 days ago, and the reason still holds. shc a765b630f (2026-07-23): “refactor(keycloak): PAT wiring: prune the ldap/kerberos surface, clean break”, deleted apps/keycloak/ldap.socket.yaml along with the ldap/kerberos vars, the LDAP_*/MYVD_*/KERBEROS_* env, the 389/636/88 exposes and the live LDAP/Kerberos bats suites. Its stated reason: “zero catalog consumers, and the system keycloak always disabled them anyway.” Nothing has changed since. Rebuilding it now would be re-litigating a clean break against the same evidence that produced it. (§3)

  3. ★ The prune record does NOT cite the two facts that actually matter, so re-enabling would walk into both unknowingly. Reading the MyVD source rather than the prune commit turns up:

    • server.listener.authRequired=false on port 389 (keycloak docker/keycloak/config/myvd.conf:3), and KeycloakInsert.search() never consults the bound identity; zero access-control identifiers in the whole 1688-line class. A subtree search from the base DN walks getRealms(), every realm on the box, and emits every user. So an enabled MyVD is anonymous, cross-tenant identity enumeration on the public docker network. (§5.1)
    • The deleted socket published the Keycloak master-admin password as the LDAP bind credential, and said so in its own description. (§5.2) Neither appears in the prune commit. The prune was a demand ruling that happened to also be the safe one.
  4. Every LDAP-capable app in the catalogue is already served, by OIDC. nextcloud, gitea, wazuh, defectdojo-classic, matrix, gitlab, paperless, peertube, mailcow all ship an sso.plug.yaml today. LDAP would be a second, weaker path to a capability they already have. mailcow is explicit: its only ldap mentions name ldap as one of three legal authsource values in mailcow’s API, and note the LDAP door is “unreachable from here”; SHC configures authsource: keycloak. (§4)

  5. SocketLDAP is not a reservation for this. The design doc calls it “the no-provider precedent”; read in place, it is the Cloudron adapter’s env-rename map for an addon SHC cannot satisfy, and its own note says why: “generic ldap socket (no catalog provider; keycloak’s bundled MyVD face was pruned)” (ce modules/adapter/adapterplug.go:231). It is a name plus an env contract for a socket known to have no provider, a record of the prune, not a placeholder for its reversal. (§7)

Against that: MyVD is genuinely capable, not vestigial (§5). Capability was never the question. Demand was, and demand is zero.


2. ★ Three distinct things get called “LDAP”

Section titled “2. ★ Three distinct things get called “LDAP””

Conflating these is how this gets built wrong. They are independent, they point in opposite directions, and only one of them is what a socket provides.

What it isDirectionStatus in SHC today
(a) Keycloak consumes an external LDAP/AD as user federationinbound: SHC’s own users come from someone else’s directoryinto KeycloakSupported, entitlement-gated in principle, UNENFORCED in practice
(b) Keycloak serves LDAP via MyVDoutbound: SHC’s users projected as a directoryout of KeycloakHard-disabled, and the socket that consumed it was deleted
(c) An app binds to LDAP to authenticate its usersan app is an LDAP clientapp → directoryNo consumer exists. Requires (b).

(a) Keycloak consumes external LDAP/AD: inbound federation

Section titled “(a) Keycloak consumes external LDAP/AD: inbound federation”

shc keycloak/docker/Dockerfile:4-8, verbatim:

WHY A CUSTOM IMAGE AT ALL. SSO / LDAP federation for logging into SHC ITSELF is the Pro->Enterprise boundary, and enforcing that needs Keycloak-side code: nothing outside Keycloak can see an admin creating an identity provider.

The enforcing code is keycloak/spi/.../events/FederationGuard.java. It watches the admin event stream for ResourceType.IDENTITY_PROVIDER and ResourceType.COMPONENT CREATE, and for components it matches USER_STORAGE_PROVIDER_TYPE = "org.keycloak.storage.UserStorageProvider", described in its own comment as “the component providerType for LDAP / Kerberos user federation” (:57-62). It gates on gate.decide(Entitlements.FEATURE_SSO) (:89), i.e. the same sso entitlement key, Pro+ (shc modules/license/license.go:90, FeatureSSO = "sso" // external IdP / SSO (Pro+)).

Three honesty caveats, all self-documented, all load-bearing for §6:

  • It is POST-HOC. FederationGuard:21: “Keycloak has NO supported pre-commit admin-API interceptor.” It disables or removes what it finds after the create returned 201.
  • It is OFF BY DEFAULT, by owner ruling. :41-45: “Owner ruling: do NOT neuter yet. The mechanism ships complete and switched off (SHC_KC_FEDERATION_GUARD unset or false).” Verified live: the running bitspur Keycloak container’s env carries SHC_LICENSE_FILE and SHC_LICENSE_HOST and no SHC_KC_FEDERATION_GUARD at all.
  • The admin-theme half is cosmetic only: :27-29, “anyone can bypass it with the admin REST API or kcadm.”

So (a) is a stated Pro→Enterprise boundary that is not enforced on either live estate today. That matters in §6: the answer cannot lean on “(a) is already a paid boundary, so (b) should be too”; (a) is a paid boundary on paper.

(b) Keycloak serves LDAP via MyVD: outbound

Section titled “(b) Keycloak serves LDAP via MyVD: outbound”

shc keycloak/docker/Dockerfile:89-91, verbatim:

Everything else (entrypoint, exposed ports, the MyVD/vKDC faces SHC hard-disables via compose env) is inherited unchanged from the base.

The base image really does ship both, defaulted ON (keycloak docker/keycloak/Dockerfile:232-234: ENABLE_MYVD=true, ENABLE_VKDC=true; :246: EXPOSE 8080 8443 389 636 9000 88 88/udp). What switches them off is two literal strings in ce’s compose, and nothing else:

# ce builtin/keycloak/compose.yaml:131-132
ENABLE_MYVD: "false"
ENABLE_VKDC: "false"

Not templated, not var-driven; literal, deliberately, because the vars were pruned (tests/builtin/keycloak/tests.bats:478-482 pins the literal). §5 covers what MyVD serves when it is on.

(c) An app binds to LDAP to authenticate its users

Section titled “(c) An app binds to LDAP to authenticate its users”

This is what a socket would provide, and it requires (b). It is also the thing with zero demand (§4). Worth noting what MyVD’s own reference client is: the base repo ships docker/sssd/, an SSSD integration whose sssd.conf configures id_provider = ldap against ldap://keycloak:389 for nss, pam, sudo. MyVD’s design target is POSIX/host login on Linux machines, not web-app authentication. A catalogue-app socket is not the use case the face was built for.


3. ★ Why SHC disabled them: the full history

Section titled “3. ★ Why SHC disabled them: the full history”

Three commits, in order. The middle one is a trap for anyone reading only the tests.

DateCommitWhat happened
2026-06-03shc fb3f62cdc”fix(keycloak): bound JVM heap instead of disabling MyVD/vKDC for the OOM”; an earlier attempt to disable them via --var ldap.enabled=false left the container unhealthy (“the image’s health path depends on them”), regressing e2e deploys that had passed every prior run. Reverted. The fix was --var javaOpts=-Xmx640m instead, keeping all three JVMs alive.
2026-07-16docs/handoff/2026-07-16-…:377The capability-socket rename explicitly kept ldap: “keycloak/ldap.socket STAYS ldap; VERIFIED it SERVES LDAP (bundled MyVD virtual directory, vars.ldap.enabled), not just federates.” Peak commitment: keycloak was to provide two sockets, oidc + ldap.
2026-07-23shc a765b630fPruned. “zero catalog consumers, and the system keycloak always disabled them anyway.” Deleted ldap.socket.yaml, the vars, the env, the ports, the bats suites. Hard-pinned both faces "false".

The decision record behind the prune is docs/internal/pat-mcp-design.md:113, which scored MyVD/vKDC as “DROPPABLE” in an image-consolidation delta table: “system keycloak sets ldap/kerberos enabled=false; no catalog app plugs the ldap socket. Prune ldap.socket.yaml + ENABLE_ env + 389/636/88 ports on swap; 3-JVM memory rationale shrinks.”*

So the stated reason is: unused, plus one resident JVM per face. It is not attack surface and not an unauthenticated port; neither is mentioned anywhere in the prune. §5 is the part nobody wrote down.

★ The 2026-06-03 rationale is DEAD, and three test comments still assert it

Section titled “★ The 2026-06-03 rationale is DEAD, and three test comments still assert it”

tests/proxmox/test_multinode.bats carries, in three places:

  • :2333: “Keeps MyVD/vKDC enabled (disabling them leaves Keycloak unhealthy).”
  • :3859: “MyVD/vKDC stay enabled (disabling them leaves Keycloak unhealthy).”
  • :4043: “Heap-capped (-Xmx640m) to avoid the OOM the 4 GB VMs hit; MyVD/vKDC stay on.”

All three blame to fb3f62cdc (2026-06-03), 50 days before the prune, and all three are false at HEAD:

  • The compose pins ENABLE_MYVD: "false" unconditionally, and the vars that could have overridden it no longer exist. The installs those comments annotate cannot possibly keep MyVD enabled.
  • Those same tests then wait_for_stack_running successfully, which is the proof: Keycloak is healthy with MyVD off. The comment is refuted by the test it annotates.
  • The underlying cause was fixed in the base image, not worked around: keycloak docker/keycloak/s6-rc.d/myvd/run:2-8 now keeps the longrun alive and idle (exec sleep infinity) when disabled, and .../myvd/finish:3-4 early-exits so a SIGTERM during shutdown “doesn’t trip the halt logic”. That is exactly the halt-on-finish cascade that made the June attempt look like a health dependency.
  • The “3-JVM image” phrasing is also stale; there is one resident JVM now.

This is a live trap. Anyone re-deriving this decision from the test comments would conclude that disabling MyVD breaks Keycloak, which is an argument for re-enabling it, and it is wrong. Recorded as D2 in §8.


Method: grep -rlin over every file under apps/ in the shc worktree, all 75 app directories.

TermFilesVerdict
postgres262control; the method finds things
ldap1apps/mailcow/sso.plug.yaml, comments only
kerberos0none

Mutation test. The 262-file postgres control proves the pattern, path and recursion are live, so the ldap count of 1 is a measurement rather than a broken command. Re-filtering the single mailcow hit to exclude # comment lines returns nothing, which is what makes “prose only” a finding and not an impression.

What the mailcow comments actually say (apps/mailcow/sso.plug.yaml:285, :305):

  • :285: “authsource must be one of: ldap, keycloak, generic-oidc.” An enum in mailcow’s own API, of which SHC uses keycloak.
  • :305: “(:688 is the same bug on the ldap door, unreachable from here.)” An explicit note that SHC’s configuration cannot reach mailcow’s LDAP path.

No catalogue app is LDAP-only. No catalogue app is LDAP-preferring. Every app whose upstream supports LDAP is already wired through sso.plug.yaml: mailcow, nextcloud, gitea, wazuh, defectdojo-classic, matrix, gitlab, paperless, peertube. Apps with an LDAP-capable upstream and no identity plug at all (sonarqube, greenbone, fusionpbx, jellyfin, pmm) are unwired for identity in general; their gap is an OIDC plug, which is cheaper, already-patterned, and does not require standing up a directory.

The one adjacent demand signal is the Cloudron adapter (§7): a Cloudron package declaring the ldap addon resolves to SocketLDAP and then finds no provider. That is a real, bounded gap (for imported foreign packages, not for the SHC catalogue), and §8/D1 shows the mapping is wrong anyway.


5. What MyVD actually serves, and the two things nobody wrote down

Section titled “5. What MyVD actually serves, and the two things nobody wrote down”

MyVD is not vestigial. It projects Keycloak into a real, richly-attributed LDAP tree, it is realm-aware, and user binds genuinely authenticate. Everything below is from keycloak myvd/src/main/java/com/bitspur/myvd/inserts/.

DN layout: realm-scoped, four subtrees per realm

Section titled “DN layout: realm-scoped, four subtrees per realm”

From KeycloakInsert.java:176-196 (the DN patterns) and :921-925 (the constructors), corroborated by the base repo’s own SSSD reference config (docker/sssd/sssd.conf):

<LDAP_BASE_DN> top, domain
└── ou=<realm>,<base> top, organizationalUnit
├── ou=people,ou=<realm>,<base>
│ └── uid=<username>,… top, person, organizationalPerson,
│ inetOrgPerson, posixAccount, shadowAccount
├── ou=groups,ou=<realm>,<base>
│ └── cn=<group>,… top, groupOfNames, posixGroup
├── ou=organizations,ou=<realm>,<base>
│ └── o=<org>,… top, organization
└── ou=sudoers,ou=<realm>,<base>
└── cn=<role>,… top, sudoRole

Defaults are placeholders: LDAP_BASE_DN=dc=example,dc=org, LDAP_ADMIN_DN=cn=admin,dc=example,dc=org, MYVD_TLS_KEY_PASSWORD=changeit (keycloak docker/keycloak/Dockerfile:219-226; the deleted apps/keycloak/vars.yaml block carried the same dc=example,dc=org).

Schema. Users get uid, cn, sn, givenName, mail, displayName, entryUUID, plus full POSIX (uidNumber, gidNumber, homeDirectory, loginShell, gecos, the shadow* set) and AD-compatibility (sAMAccountName, userPrincipalName, objectGUID, memberOf) (:1176-1229). ldap_schema = rfc2307bis per the SSSD config. This is a serious directory projection, not a stub.

Binds work. KeycloakInsert.bind() (:868-891) matches uid=<u>,ou=people,ou=<realm>,<base> and validates by ROPC: grant_type=password, client_id=admin-cli against /realms/<realm>/protocol/openid-connect/token (:493-506), returning INVALID_CREDENTIALS on failure. Password changes work too (PasswordModifyInsert). Note the dependency this creates: LDAP auth would ride ROPC / direct access grants, which cannot carry MFA and which Keycloak discourages.

5.1 ★ Anonymous, cross-tenant enumeration

Section titled “5.1 ★ Anonymous, cross-tenant enumeration”

Two facts compose into one:

  1. The listener does not require authentication. keycloak docker/keycloak/config/myvd.conf:3: server.listener.authRequired=false, on server.listener.port=389, host=0.0.0.0.
  2. The search path has no access control at all. KeycloakInsert.search() (:893+) never consults the bound identity. Mutation test: grepping KeycloakInsert.java for bindDN|isAnonymous|INSUFFICIENT_ACCESS|getBoundDN|Anonymous returns 0, while the identical pattern on AdminBindInsert.java returns 1; the pattern works, and the absence is real.

And the scope is every realm. In search(), extractRealmFromBase(reqBaseDn) returns null when the request base is the root, so realmsToWalk = getRealms(), which is GET /admin/realms with the master-admin token (:639-673), i.e. all realms on the box. wantUsers is true whenever baseEqualsRoot && scopeValue != 0 (:985), so a subtree search from the base DN emits every user of every realm.

So an enabled MyVD means: any client that can open TCP 389 can dump every user of every tenant, unauthenticated. Keycloak sits on networks: [public], and per this project’s own finding that the fabric is not a tenant boundary co-located containers can reach it. In a multi-tenant platform where realms are the tenant boundary, that is a tenant-boundary violation, and it is the single strongest technical argument in this document.

It is also why the deleted socket’s default was dangerous rather than merely sloppy: it published baseDn defaulting to vars.ldap.baseDn, the root, so every consumer would have been handed the cross-realm view by default.

5.2 ★ The bind credential was the Keycloak master-admin password

Section titled “5.2 ★ The bind credential was the Keycloak master-admin password”

The deleted apps/keycloak/ldap.socket.yaml said so in its own description (shc a765b630f^:apps/keycloak/ldap.socket.yaml:8-19):

Trust model: this socket hands the consuming app the shared Keycloak/MyVD admin bind credentials. MyVD’s AdminBindInsert validates an LDAP bind to the admin DN by reposting the submitted password to Keycloak’s admin-cli token endpoint as vars.adminUser, so the LDAP admin password IS the Keycloak master-admin password (no separate credential). Operator-gated trust: consumers granted this plug effectively get the Keycloak admin bind.

For deployments where per-consumer credential isolation matters, swap this socket out for one that provisions a dedicated read-only service account…

data.bindPassword was literally "{{ vars.adminPassword }}" (:44). Confirmed in the base image: AdminBindInsert.validateAgainstKeycloak() ROPCs client_id=admin-cli as KEYCLOAK_ADMIN_USERNAME and returns true on HTTP 200 (:84-109).

This is the same disease as the in-flight credential-scope lane, in a worse form. That lane is removing adminUrl/adminUser/adminPassword from the sso socket’s published data because 29 of 32 consumers receive them without needing them. An ldap socket would put the master-admin password back, not as an over-broad extra, but as the socket’s primary published credential, by design. Rebuilding it now would reintroduce, deliberately, exactly what a concurrent lane is removing.

5.3 Live state: verified read-only on bitspur

Section titled “5.3 Live state: verified read-only on bitspur”

master_default_keycloak-keycloak-1, image registry.gitlab.com/bitspur/selfhosted-cloud/shc/keycloak:2f319aef@sha256:e3a0c60c…:

ProbeResult
ENABLE_MYVD / ENABLE_VKDCfalse / false; the compose pin is in effect
listening ports in-container (/proc/net/tcp{,6})0x1F90=8080, 0x20FB=8443, 0x1E78=7800 (JGroups). 0x0185=389, 0x027C=636, 0x0058=88 all ABSENT.
Config.ExposedPorts★ 389/tcp 636/tcp 88/tcp 88/udp still present
SHC_KC_FEDERATION_GUARDnot set; the (a) guard is inert in production
inherited dead envLDAP_BASE_DN, LDAP_ADMIN_DN, MYVD_VENDOR_*, MYVD_INDEX_CACHE_SECONDS, MYVD_RUNDIR, MYVD_TLS_KEY_PASSWORD=changeit, KERBEROS_REALM, KERBEROS_SERVICE_HOST

The faces are genuinely off. Good. Two riders:

  • The ExposedPorts row is a guard that is green while guarding nothing (D3, §8). tests/builtin/keycloak/tests.bats:504-507 asserts “compose exposes no ldap/kerberos ports” by grepping the compose file (which passes), while the container still declares 389/636/88, because Docker unions the image’s EXPOSE with compose’s expose: and cannot subtract. Inert today (nothing listens) and EXPOSE never publishes to the host, but it already has one real consequence on record: SHC’s host-port resolver counts them as candidates; tests/proxmox/test_multinode.bats:3851 names them outright, “keycloak’s raw compose ports (8080/8443/389/636/88; X400937HSTAMB, since it never guesses which one is ‘the’ web port)”, and :4042 repeats “keycloak exposes 5 candidate container ports”. So the pruned ports are still shaping live behaviour.
  • Safety rests on one env var. ENABLE_MYVD: "false" is the only thing standing between the estate and §5.1. There is no second layer: no port removal, no bind-address restriction, no authRequired=true. That is acceptable for a face nobody wants; it is not a foundation to build a product surface on.

6. ★ The entitlement question: SURFACED, NOT DECIDED

Section titled “6. ★ The entitlement question: SURFACED, NOT DECIDED”

This is the owner’s call. This document does not answer it, and no implementation should be started until it is answered, because the answer changes what gets built, not merely what it costs.

Inbound federation (a) is a stated Pro→Enterprise boundary (Dockerfile:4-8), enforced by FederationGuard on the sso entitlement (FEATURE_SSO). Is outbound serving (b)/(c) also a paid boundary?

The two readings, stated as fairly as I can:

“Yes, it is identity-edge, gate it.” (a) and (b) are the same capability in two directions; both are “SHC’s identity plane talks to something outside itself.” A tenant that projects its whole user directory to arbitrary consumers is doing something structurally larger than logging into one app. And the existing gate already keys on the socket, so the machinery is free.

“No, it is an internal app-wiring capability, like postgres.” No socket is entitlement-gated today for existing, and (b) does not reach an external IdP at all; it serves SHC’s own users to SHC’s own apps. Gating it would make ldap the first paid capability socket and put a licence check on the ordinary -i path.

A third framing the owner may prefer: the two directions are asymmetric in a way that cuts against a single answer. (a) imports trust (an external IdP becomes authoritative for SHC logins), clearly an identity-edge event. (b) exports data (SHC’s users leave the platform’s control). Those are different risks, and “both are federation, so both are Pro+” may be a false symmetry.

What is NOT in question: if an ldap socket is ever built, it must be added to the identity-edge gate regardless of which way the entitlement question goes, because leaving it out is an unlicensed bypass of a gate that already exists. See §7 and §9.

Also relevant to whichever way this goes, and easy to miss: (a) is currently unenforced on both live estates (SHC_KC_FEDERATION_GUARD unset; owner ruling “do NOT neuter yet”). So an argument of the form “(a) is already paid, therefore (b)” is leaning on a boundary that is presently declarative.


ce modules/adapter/adapterplug.go:37: SocketLDAP = "ldap", one of nine capability names. It has exactly two reference sites: the declaration, and :217 in the Cloudron addon table.

// ce modules/adapter/adapterplug.go:215-231
"ldap": {
Disposition: DispositionPlug,
Socket: SocketLDAP,
EnvRename: map[string]string{
"socket.hostname": "CLOUDRON_LDAP_SERVER",
"socket.port": "CLOUDRON_LDAP_PORT",
"socket.bindDn": "CLOUDRON_LDAP_BIND_DN",
"socket.bindPassword": "CLOUDRON_LDAP_BIND_PASSWORD",
},
EnvSynth: map[string]string{
// MyVD serves users and groups under the one search base; both
// Cloudron base-DN names resolve to it.
"CLOUDRON_LDAP_USERS_BASE_DN": "{socket.baseDn}",
"CLOUDRON_LDAP_GROUPS_BASE_DN": "{socket.baseDn}",
"CLOUDRON_LDAP_URL": "ldap://{socket.hostname}:{socket.port}",
},
Note: "generic ldap socket (no catalog provider; keycloak's bundled MyVD face was pruned)",
},

Was it “meant for this”? No. It is the adapter’s completeness table for foreign-package import, and its Note exists because of the prune. Two consequences worth having written down:

  1. It pins five socket field names. hostname, port, bindDn, bindPassword, baseDn, the same five the deleted socket published. Any future ldap socket inherits that schema whether it likes it or not, or the Cloudron path breaks.
  2. The mapping is wrong (D1, §8). The comment claims “MyVD serves users and groups under the one search base”; §5 shows users live under ou=people,ou=<realm>,<base> and groups under ou=groups,ou=<realm>,<base>, two distinct subtrees, exactly as the base repo’s own sssd.conf configures them. Mapping both Cloudron base DNs to the root {socket.baseDn} also hands the app the cross-realm view of §5.1. It is inert (no provider, so it never renders), but tests/unit/modules/adapter/adapterplug_test.go:144 asserts the falsehood, with the comment “Users + groups base DNs both derive from the one MyVD search base.” A guard pinning a wrong fact.

Confirmed at both sites the sibling design names:

  • ce modules/app/integration_service.go:164: if socket.Name == adapter.SocketSSO {
  • ce modules/app/sso_edge_gate.go:41: if ic.SocketName != adapter.SocketSSO { continue }

Both gate the identity-edge product hook on exact equality with SocketSSO. An ldap socket would therefore wire a live identity edge with no licence consulted, the precise failure sso_edge_gate.go:8-16 was written to close (“Gating only Connect therefore gated nothing an operator can actually reach; an unlicensed estate wired a live external OIDC issuer with no licence consulted”). Whatever §6 decides, ldap must join that predicate.


Real, all pre-existing, none fixed in this lane (design only). None is a reason to build the socket; D2 and D3 are reasons not to trust the current test comments about it.

#DefectWhereSeverity
D1Cloudron ldap addon maps users and groups base DN to the root {socket.baseDn}, on a comment that misstates MyVD’s layout; the root view is also cross-realm. A unit test asserts the wrong behaviour.ce modules/adapter/adapterplug.go:225-229; shc tests/unit/modules/adapter/adapterplug_test.go:144inert (no provider) but wrong; fix the comment + test with §5’s layout
D2Three test comments assert “MyVD/vKDC stay enabled” and “disabling them leaves Keycloak unhealthy”, false at HEAD, 50 days stale, refuted by the very tests they annotate, and fixed upstream in the base image’s s6 scripts. Reads as an argument against the prune.shc tests/proxmox/test_multinode.bats:2333, 3859, 4043trap: corrects a future re-derivation
D3”compose exposes no ldap/kerberos ports” greps the compose file and passes, while the live container declares 389/tcp 636/tcp 88/tcp 88/udp in ExposedPorts (image EXPOSE unions; compose cannot subtract). Already implicated in X400937HSTAMB; tests/proxmox/test_multinode.bats:3851 still lists 8080/8443/389/636/88 as keycloak’s candidate ports.shc tests/builtin/keycloak/tests.bats:504-507 vs live inspectguard green while guarding nothing; assert the container, not the file
D4Dead inherited env in production, incl. MYVD_TLS_KEY_PASSWORD=changeit, a dev-default password in plaintext container env. Already catalogued at docs/internal/secret-surface-audit.md:121.live container envcosmetic while MyVD is off; delete on the next base bump
D5Identity-edge gate keys on == SocketSSO; any new identity socket bypasses licensing.ce modules/app/integration_service.go:164, sso_edge_gate.go:41★ already named in the oidc/saml design; confirmed, and it extends to ldap

9. Design-if-ever: gated, recorded so it is not got wrong later

Section titled “9. Design-if-ever: gated, recorded so it is not got wrong later”

Not a proposal. Do not implement any of this without a ruling on §6 and a named consumer. It is recorded because the deleted socket got three things wrong and the next person should not rediscover them.

Preconditions, all required:

  1. §6 answered by the owner.
  2. A named, real consumer: an app that is LDAP-only or LDAP-preferring and not already served by OIDC. None exists today (§4).
  3. The credential-scope lane landed, so per-consumer service accounts exist as a pattern to copy.
  4. ldap added to the identity-edge gate predicate (§7).

Corrections the old design needs:

Old designRequired changeWhy
bindPassword: "{{ vars.adminPassword }}"a per-consumer, read-only Keycloak service account, minted by the socket’s jobs.integration and deleted by jobs.unintegration§5.2. The old shape publishes the master-admin password. MyVD’s AdminBindInsert only knows the one admin DN, so this requires a MyVD change; it cannot be fixed socket-side.
baseDn defaults to the rootbaseDn must be ou=<realm>,<base>, realm-pinned, never operator-overridable upward§5.1. The root is the cross-realm view; realm-pinning is what makes extractRealmFromBase return non-null and confine the walk to one realm.
port: 636 if useTls else 389636 only. Delete the plain-text option.§5.1: 389 carries authRequired=false. A socket must not publish it.
authRequired=false inheritedserver.listener.authRequired=true, and the search path must refuse anonymous§5.1. This is a MyVD source change, not a config change; KeycloakInsert.search() has no access control to switch on.
enabled by a per-app varper-deployment enablement must not leave an unauthenticated directory reachable: bind MyVD to the stack’s own network, never public; 636 only; anonymous refusedthe current posture has exactly one layer (§5.3)
discovery: check-ldap-port-open (TCP open only)keep the shape, but a TCP open is not proof; assert a real authenticated bind returning the expected ou=people subtreethe old job’s own comment admits it does no bind; that is the false-success shape this project keeps finding

Published data (socket): hostname, port (636), bindDn (per-consumer service account DN), bindPassword@secret (that account’s credential), baseDn (ou=<realm>,<base>), useTls (always true). The five names are already fixed by the Cloudron adapter (§7); do not invent new ones.

Plug schema: realm@string! (so the socket can realm-pin baseDn), userFilter@string (consumer-specific, e.g. (uid={0})), groupFilter@string. Drop baseDn from the plug; a consumer-supplied base DN is how the cross-realm view leaks; the socket must own it. Drop useTls; there is no choice to offer.

Sequencing note: this touches the sso-socket family and the Keycloak image. Per the sibling design and builtin/keycloak/vars.yaml:31-35 (“an estate-wide SSO outage”, “mvn test green is not a boot”), it must not be coupled to an image rebuild of its own, and it must land after the oidc/saml split rather than alongside it.


Concrete, checkable triggers. Any one of the first three reopens it:

  1. A named LDAP-only consumer enters the catalogue: an app whose upstream has no OIDC/SAML path at all. Today the count is zero and every LDAP-capable app is already OIDC-wired (§4). Note that an app merely supporting LDAP is not this; it must be LDAP-only.
  2. A Cloudron (or other foreign) package that declares the ldap addon becomes a real import target. Then SocketLDAP stops being a completeness entry and becomes a gap with a consumer, and D1 must be fixed first.
  3. Host/POSIX identity becomes a product surface: SSSD/PAM/sudo against the platform directory, which is what MyVD was actually built for (keycloak docker/sssd/sssd.conf). That is a fleet feature, not an app socket, and it would want its own design.
  4. MyVD gains real access control upstream: authRequired=true honoured, a search path that consults the bound identity, and per-consumer bind accounts. That does not create demand, but it removes the §5.1/§5.2 objections, so the decision would then rest on demand alone.

Explicitly not triggers: that MyVD is capable (it is; §5); that ldap is already a declared socket name (it is a Cloudron env map; §7); that the base image ships the face for free (the cost is the directory contract and §5.1, not the JVM).


  1. Should an ldap socket exist? No, not now. Zero measured demand, already ruled 12 days ago on the same evidence, and re-enabling would reintroduce a master-admin-password credential the concurrent lane is removing plus anonymous cross-tenant enumeration.
  2. The three-way distinction. §2, with citations. (a) inbound federation: supported, FEATURE_SSO-gated on paper, unenforced live. (b) outbound MyVD: hard-off via two literal compose strings, socket deleted. (c) an app binding: no consumer, requires (b).
  3. Env vars, ports, what MyVD serves. ENABLE_MYVD: "false" / ENABLE_VKDC: "false" at ce builtin/keycloak/compose.yaml:131-132; ports 389/636 (LDAP/LDAPS) and 88 TCP+UDP (Kerberos). MyVD does project Keycloak users into a real LDAP tree, realm-scoped ou=<realm> with ou=people/ou=groups/ou=organizations/ou=sudoers, inetOrgPerson+posixAccount+shadowAccount+AD-compat attributes, rfc2307bis, working ROPC-backed binds and password changes (§5).
  4. Why disabled. “Zero catalog consumers” + one resident JVM per face; shc a765b630f, backed by docs/internal/pat-mcp-design.md:113. Not security. The June “disabling leaves Keycloak unhealthy” rationale is dead and three test comments still assert it (§3, D2).
  5. Demand. 1 of 75 apps mentions ldap, comments only; kerberos zero; control postgres 262 (§4).
  6. SocketLDAP precedent. The Cloudron adapter’s env map for a socket whose own Note records the prune. Not a placeholder for reversal, but it does pin the five field names, and its base-DN mapping is wrong (§7, D1).
  7. Entitlement question. Surfaced in §6, not decided. Both readings stated, plus the asymmetry (import-trust vs export-data) and the fact that (a) is presently unenforced.
  8. Design. Recorded in §9 as gated-if-ever with the four preconditions and six corrections the deleted socket needs, including that two of them (per-consumer bind accounts, anonymous refusal) are MyVD source changes, not config.

12. Re-verified 2026-08-05 (later the same day): the answer holds, and the socket-model half of it deserves saying plainly

Section titled “12. Re-verified 2026-08-05 (later the same day): the answer holds, and the socket-model half of it deserves saying plainly”

The owner asked it again, in the form “What about the LDAP socket? Did you make that inside of Keycloak? I hope you did.” This section re-measures the load-bearing claims above against a later tree and states the direction answer in the vocabulary of the thing being asked for (a socket) because that is what settles it before any question of demand, security or tier.

12.1 A socket is what a PROVIDER serves. That single fact decides the two directions.

Section titled “12.1 A socket is what a PROVIDER serves. That single fact decides the two directions.”

Read ce builtin/keycloak/oidc.socket.yaml and saml.socket.yaml and the shape is unambiguous. A *.socket.yaml declares schema.socket (the keys the PROVIDER publishes about itself (hostname, port, publicUrl, basePath, adminUrl, adminUser, adminPassword)), plus schema.plug, the keys a CONSUMER supplies, plus jobs, which the provider runs against its own admin API to provision something for that consumer (create-oidc-client, create-saml-client). The provider is the thing that already listens; the consumer plugs into it.

So:

  • Outbound: Keycloak exposed AS an LDAP directory. This is the direction that FITS the model, exactly and without strain. Keycloak would be the provider, publishing hostname/port/baseDn/bindDn/bindPassword, and a consumer app would plug in with a bind account. It is the direction the deleted apps/keycloak/ldap.socket.yaml was written in, and it is the direction §2(b)/(c) describes. Upstream Keycloak does not do this natively (there is no LDAP listener in Keycloak) which is why it takes the bundled MyVD face, and why the whole question reduces to whether to re-enable MyVD (§5) rather than to whether to write some YAML.

  • Inbound: Keycloak federating an EXTERNAL LDAP/AD as a user store. This direction cannot be a socket at all, and not because of demand or policy: it points the wrong way. Here Keycloak is the CONSUMER of somebody else’s directory, so the artifact it would need is a keycloak/ldap.plug.yaml (the same shape as the existing keycloak/postgres.plug.yaml), plugged into an ldap socket served by a directory app. SHC’s catalogue has no such app: across all 77 apps there is no openldap, lldap, 389ds, glauth, authelia, authentik or zitadel. And the external directory in this scenario is by definition not an SHC deployment, so nothing in the catalogue could serve the socket even in principle; an integration edge binds two SHC deployments. Inbound federation is configured in Keycloak’s own User Federation UI/REST, gated (on paper) by FederationGuard on FEATURE_SSO; it is not, and cannot be, a plug/socket edge.

Answer to the question as asked: no, it does not exist, and only one of the two things called “the LDAP socket” could ever have been one. The outbound one is the socket-shaped one, and it is deliberately switched off.

12.2 Demand, re-measured on the grown catalogue

Section titled “12.2 Demand, re-measured on the grown catalogue”

§4 measured 75 apps. Today there are 77, and the answer did not move:

measurement§4 (75 apps)now (77 apps)
app files containing ldap11
…and every occurrence is inside a # commentyesyes
app files containing kerberos00
control: app files containing postgres262264

The one file was apps/mailcow/sso.plug.yaml and is now apps/mailcow/oidc.plug.yaml; the sso → oidc socket rename landed, so the citation moved but the content did not. Its two hits are at :285 (authsource must be one of: ldap, keycloak, generic-oidc) and :305 (a note that the same bug affects the ldap door), both comments, both naming a mailcow API enum SHC does not use. The postgres control moving 262 → 264 in step with the catalogue is what shows the grep still works.

12.3 The switch is still a switch, and it is still off

Section titled “12.3 The switch is still a switch, and it is still off”

ENABLE_MYVD: "false" / ENABLE_VKDC: "false" remain two literal, untemplated strings in ce builtin/keycloak/compose.yaml, and ce builtin/keycloak/ still ships exactly two sockets: oidc.socket.yaml and saml.socket.yaml. Nothing in this lane changed either. SocketLDAP still exists in ce modules/adapter/adapterplug.go as the Cloudron env map whose own note records the prune (§7).

§6 stays open and nothing here narrows it: if inbound federation is a Pro→Enterprise boundary, is outbound serving also a paid boundary? That is catalog Q7 and it is not an engineering call. What §12.1 adds to it is only that the question can only ever be about the OUTBOUND direction, because the inbound one is not a socket and so cannot be gated as one.