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

Add the option to configure the bind password using an environment variable for the LDAP connector. #1797

Closed
wants to merge 3 commits into from

Conversation

onkarbhat
Copy link
Contributor

@onkarbhat onkarbhat commented Sep 13, 2020

In a k8s deployment that uses Dex, this will allow us to define an environment variable using a k8s secret that contains the bind password instead of showing it in plaintext in a configmap.

This partially meets requirements in #1099.

Related issue - #1158

cc: @sagikazarmark @bonifaido @danilina-wsib

…riable for the LDAP connector.

Signed-off-by: Onkar Bhat <[email protected]>
connector/ldap/ldap.go Outdated Show resolved Hide resolved
@heidemn
Copy link

heidemn commented Mar 9, 2021

@onkarbhat have you seen the new config templating feature, coming in the next release?
This should solve your problem already.
examples/config-tmpl.yaml

Note that above config file is just an example. You can define your own, using all the templating logic you need.

@sagikazarmark
Copy link
Member

Yeah, I don't think we'll be accepting this one. @onkarbhat please try the new templating feature.

@onkarbhat
Copy link
Contributor Author

Thank you @heidemn @sagikazarmark 👍🏼 . I believe these are the steps that a user would have to execute in order to configure a password in the LDAP connector config in Dex in a K8s cluster.

  • Create a secret that contains the password.
  • Mount the secret's entry as an environment variable in the Dex Pod. Lets call this env as LDAP_BIND_PW_ENV.
  • Prepare a config.docker.yaml with the bindPW set like this: {{ getenv "LDAP_BIND_PW_ENV" "" }}
  • Store config.docker.yaml in a config map, and mount it at /etc/dex/config.docker.yaml .

@sagikazarmark
Copy link
Member

That sounds about right. I'd probably consider using bank-vaults or kube-secrets-init instead of Kubernetes secrets though.

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