Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDAPS unsupported when using custom CAs #307

Open
mzervakis opened this issue Feb 7, 2025 · 0 comments
Open

LDAPS unsupported when using custom CAs #307

mzervakis opened this issue Feb 7, 2025 · 0 comments

Comments

@mzervakis
Copy link

mzervakis commented Feb 7, 2025

Setting the mkeconfig.spec.authentication.ldap.rootCA to the path of the custom CA will not configure the authentication correctly. The logic to create a secret for the customCA and mount it as volume in the authentication POD seems to be missing. Setting the rootCA will cause the authentication pod to crash.

kubectl -n mke get pods --selector app.kubernetes.io/instance=authentication
NAME                                  READY   STATUS             RESTARTS         AGE
authentication-dex-5777858c97-6btbc   0/1     CrashLoopBackOff   31 (3m39s ago)   137m

kubectl -n mke logs authentication-dex-5777858c97-6btbc --tail 1
failed to initialize server: server: Failed to open connector ldap: failed to open connector: failed to create connector ldap: ldap: read ca file: open /etc/dex/certs/ldap/ca.crt: no such file or directory

To support LDAPS rootCAData could be used instead of rootCA.

A workaround is to patch the authentication addon after installation.

CADATA=$(cat ca.crt | base64 -w0)
kubectl -n blueprint-system patch addons.blueprint.mirantis.com authentication --type merge --patch-file=/dev/stdin <<-EOF
apiVersion: blueprint.mirantis.com/v1alpha1
kind: Addon
metadata:
  name: authentication
  namespace: blueprint-system
spec:
  chart:
    values:
      config:
        connectors:
        - config:
            rootCAData: $CADATA
            bindDN: uid=serviceaccount,cn=users,dc=example,dc=com
            bindPW: password
            host: ldap.example.com:636
            userSearch:
              baseDN: cn=users,dc=example,dc=com
              emailAttr: mail
              filter: (objectClass=person)
              idAttr: distinguishedName
              nameAttr: cn
              username: uid
            usernamePrompt: ldap
          id: ldap
          name: ldap
          type: ldap
EOF
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

No branches or pull requests

1 participant