You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operator is not setting the Vault LDAP bindDN/password with content of LdapAuthEngineConfig.spec.bindCredentials.secret (always setting an empty string)
#256
Open
dabelenda opened this issue
Dec 31, 2024
· 0 comments
But the resulting Vault configuration always has the bindDN value empty. When setting the spec.bindDN field of the CR to the expected string, I still cannot use ldap authentication successfully on the vault ui. After setting the spec.bindDN field, if I manually set the password in Vault, then I can authenticate. This means that the password was also not set from the secret.
The logs of the vault-config-operator show no error:
From the code, I can see some inconsistencies with the documentation.
In the documentation it is stated that the Secret must be of type kubernetes.io/basic-auth but in the reconciliation code I cannot see such constraint (at least here: https://github.com/redhat-cop/vault-config-operator/blob/main/api/v1alpha1/ldapauthengineconfig_types.go#L131-L147 ).
Moreover if the type of the Secret must be kubernetes.io/basic-auth, bindCredentials.usernameKey and bindCredentials.passwordKey having an effect on the retrieval of the data is weird since these should always be username and password for this Secret type.
In the code, there seem to be missing input checking, and feedback for the user to understand what is happening and why. Particularly, if bindCredentials.usernameKey or bindCredentials.passwordKey do not exist in the Secret, the corresponding value the operator will get will always be an empty string. I guess the operator should, check if the secret contains these keys, and output a warning if it does not, properly telling which keys it is searching for in the secret.
The text was updated successfully, but these errors were encountered:
I create a secret named
vault-ldap-access
in the namespace of the vault-config-operator with following contents:Then, in the same namespace, I create an LdapAuthEngineConfig CR:
But the resulting Vault configuration always has the bindDN value empty. When setting the
spec.bindDN
field of the CR to the expected string, I still cannot use ldap authentication successfully on the vault ui. After setting thespec.bindDN
field, if I manually set the password in Vault, then I can authenticate. This means that the password was also not set from the secret.The logs of the vault-config-operator show no error:
From the code, I can see some inconsistencies with the documentation.
In the documentation it is stated that the Secret must be of type
kubernetes.io/basic-auth
but in the reconciliation code I cannot see such constraint (at least here: https://github.com/redhat-cop/vault-config-operator/blob/main/api/v1alpha1/ldapauthengineconfig_types.go#L131-L147 ).Moreover if the type of the Secret must be
kubernetes.io/basic-auth
,bindCredentials.usernameKey
andbindCredentials.passwordKey
having an effect on the retrieval of the data is weird since these should always beusername
andpassword
for this Secret type.In the code, there seem to be missing input checking, and feedback for the user to understand what is happening and why. Particularly, if
bindCredentials.usernameKey
orbindCredentials.passwordKey
do not exist in the Secret, the corresponding value the operator will get will always be an empty string. I guess the operator should, check if the secret contains these keys, and output a warning if it does not, properly telling which keys it is searching for in the secret.The text was updated successfully, but these errors were encountered: