Cannot fill the LDAP parameters (binary and docker) #1328
Replies: 3 comments
-
does your LDAP string have spaces in it? |
Beta Was this translation helpful? Give feedback.
-
Hi Lafayette. Yes, I have spaces in LDAP string. Was your solution building a new image with the configs in the dockerfile or a volume bind in docker-compose.yaml ? |
Beta Was this translation helpful? Give feedback.
-
So, what i did to circunvent this issue was:
{
"bolt":{
"host": "semaphore.bolt"
},
"dialect":"bolt",
"tmp_path": "/tmp/semaphore",
"access_key_encryption": "ENCRYPTION_KEY",
"ldap_enable": true,
"ldap_needtls": false,
"ldap_binddn": "CN=semaphore,OU=Administrative Accounts,OU=Users,DC=example,DC=com",
"ldap_bindpassword": "ACCOUNT_PASSWORD",
"ldap_server": "dc1.example.com:389",
"ldap_searchdn": "OU=Users,DC=example,DC=com",
"ldap_searchfilter": "(&(sAMAccountName=%s)(memberOf=CN=Domain Admins,CN=Users,DC=example,DC=com))",
"ldap_mappings": {
"dn": "dn",
"mail": "mail",
"uid": "sAMAccountName",
"cn": "cn"
},
"email_sender": "[email protected]",
"email_host": "mail.example.com",
"email_port": "25",
"email_alert": true
} PS; Im using Active directory to authenticate users. note the spaces in the CN in ldap_binddn, and ldap_searchfilter
the important bit here is the bind volume. nevermind the host networking, privileged bits . and the custom dockerfile referenced in build. After confirming it works you will probably ask yourself why the heck is this working? the code bit that seems to cause this issue is discussed in #419 it seems that, when using the fmt.Sscanln function, the presence of a space is a boundary char that makes the reading stop. since the space in the OU breaks the reading done by fmt.Sscanln, the config file generation process generates the input file with the wrong number of lines, resulting in a wrong config.json file. I am part of a group o people that helps each other on devops stuff on discord. we scheduled a meeting today to try to debug this issue and make a PR with a fix if all goes well. Hope this helps you figure it out. |
Beta Was this translation helpful? Give feedback.
-
I got a problem to inform the LDAP parameters, even using the binary (semaphore setup) and docker image (using ENV):
I tried:
CN=svc.semaphore,OU=XXXX,DC=XXXX,DC=XXX,DC=XX -> raw
(CN=svc.semaphore,OU=XXXX,DC=XXXX,DC=XXX,DC=XX) -> With ( )
'CN=svc.semaphore,OU=XXXX,DC=XXXX,DC=XXX,DC=XX' -> With ' '
"CN=svc.semaphore,OU=XXXX,DC=XXXX,DC=XXX,DC=XX" -> With " "
I got always the same error:
An input error occurred: expected newline
LDAP DN for bind (default cn=user,ou=users,dc=example): CN=svc.semaphore,OU=XXXX,DC=XXXX,DC=XXX,DC=XX
WARN[0015] An input error occurred: expected newline
Password for LDAP bind user (default pa55w0rd): WARN[0015] An input error occurred: expected newline
LDAP DN for bind (default cn=user,ou=users,dc=example): (CN=svc.semaphore,OU=XXXX,DC=XXXX,DC=XXX,DC=XX)
WARN[0025] An input error occurred: expected newline
Password for LDAP bind user (default pa55w0rd): WARN[0025] An input error occurred: expected newline
LDAP DN for bind (default cn=user,ou=users,dc=example): 'CN=svc.semaphore,OU=XXXX,DC=XXXX,DC=XXX,DC=XX'
WARN[0021] An input error occurred: expected newline
Password for LDAP bind user (default pa55w0rd): WARN[0021] An input error occurred: expected newline
LDAP DN for bind (default cn=user,ou=users,dc=example): "CN=svc.semaphore,OU=XXXX,DC=XXXX,DC=XXX,DC=XX"
WARN[0019] An input error occurred: expected newline
Password for LDAP bind user (default pa55w0rd): WARN[0019] An input error occurred: expected newline
In docker image I got only:
An input error occurred: expected newline (but i think that is the same problem as the binary).
Beta Was this translation helpful? Give feedback.
All reactions