-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
jenkins/jenkins2-ha-agents Does not work with LDAP authentication #290
Comments
Hi @serverhorror Can you tell me a little bit more about how you enabled LDAP in your Jenkins? |
Hi, Sorry for the late reply. I didn't do anything special. Just the Jenkins native LDAP authentication, authorization set to "logged in users can do anything" and to test "anyone can do anything". What happens is that as soon as this is configured the original "admin" user is not a valid user any more and therefore some information in the template is invalidated. See here:
Hope this helps. |
After some research I believe that it is not possible to have LDAP enabled and keep a technical user that we can use to talk with the Jenkins API. One possible workaround is to create a technical user in your LDAP and replace the username admin in the template with the username of the new LDAP user. |
How about something like this: https://stackoverflow.com/a/55349021/116973
(supposedly) produces:
If the tokens stay valid, or maybe there are "system tokens", then it would be possible to get rid of relying on the auth method in all scripts? I am by no means experienced with scripting Jenkins and everything I know about using Jenkins without the GUI is from your stacks :) |
I also looked at the new token mechanism and as far as I understand they are coupled to a user: "Jenkins API tokens are an authentication mechanism that allows a tool (script, application, etc.) to impersonate a user without providing the actual password for use with the Jenkins API or CLI." I haven not found a "system token" feature that we could use. But I will talk to some people who know Jenkins better than me if there is an option. |
I ran into this same issue trying to integrate SAML. I was already using a heavily modified version of this template. I decided to migrate to Terraform and use the SWARM plugin. The API token is tied to the user, but is still used, even if user authentication changes. https://github.com/neiman-marcus/terraform-aws-jenkins-ha-agents In this repo, you can look at the cloud-init user-data and see that I generate an API key, publish it to systems manager, and then instruct the agent to pull it for authentication. This might be helpful for this project. Generating API key: Agent fetching master information and API key: Agent connecting via swarm plugin: Hth, CRD |
TemplateID: jenkins/jenkins2-ha-agents
Region: eu-west-1
The admin username and password are hardcoded in several places. If you change the username, password or authentication method (in our case to LDAP) the setup of the ASG breaks since no data can be sent to the CloudWatch any more.
A workaround would be nice or maybe mentioning this in the limitations?
Thanks,
/M
The text was updated successfully, but these errors were encountered: