-
Notifications
You must be signed in to change notification settings - Fork 98
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 a passwordFile option #66
Conversation
989732e
to
59b4d00
Compare
Jenkins displays the command line as well as environment variables in the node's "systemInfo" page. This makes both of the current password options very readily available in the jenkins UI.
59b4d00
to
86896c4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It helps a bit, but generally the plugin should not be using passwords at all
Cool. IMO, being able to register as a build node is a rather privileged operation, to ensure the code is being handed off to a trusted party, and to ensure that the build artifacts are indeed the correct build artifacts. Curious how you would recommend securing the privilege to register new build nodes without a password? |
By application tokens. In such case it will limit the exposure of credentials only to the agent creation. Should be fine enough |
Update swarm client to 3.9. maybe plan to switch to "–passwordFile" option as implemented in jenkinsci/swarm-plugin#66
@oleg-nenashev Is there any documentation anywhere on how to use application tokens to register a new build node? |
@pvandervelde same as passwords actually. You can take an API token from user profile and then use it as a password in Swarm parameters. It should work in the most of Security Realms |
Ah right, that makes total sense, why didn't I think of that one! Thanks! |
Ok, shouldn't this be as simple as adding your api token as the only line in a text file in linux (say /mydir/pswd), and replace -password myapitoken with -passwordFile /mydir/pswd ? I am using both "-master" and "-tunnel". My plan was to use a slave startup script configured in the master to remove the password file on connection. |
@xjg6yzl You exception means that the client cannot retrieve the data from the endpoint: swarm-plugin/client/src/main/java/hudson/plugins/swarm/SwarmClient.java Lines 218 to 235 in 8c7e7e1
Error 401 means "Unauthorized". Please check the Master System logs, they should contain more details |
Hi @oleg-nenashev, I'm having the same problem as @xjg6yzl - both I've tried:
Nothing seems to work. |
Hi @oleg-nenashev and @xjg6yzl, I have it. The reading of the passwordFile adds a new line to the password value rendering it incorrect. Here is a quick example to explain what I mean:
And here is the correction needed in the code:
Should I create a PR? It would be really good to get this in soon. I don't like having passwords in plain sight. Cheers, |
It should not, but maybe it is encoding-specific (e.g. you have a non-UTF-8 password file encoding). |
Thanks |
Thank you for addressing this. I had intended to set up a wireshark test to see what was going on but hadn't had time yet. |
Any idea how soon this change will be available as an update to the swarm plugin? |
Sorry, releasing #68 |
Jenkins displays the command line as well as environment variables in
the node's "systemInfo" page. This makes both of the current password
options very readily available in the jenkins UI.