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

serviceaccount password on command line #30

Closed
arthurblake opened this issue Jan 30, 2014 · 14 comments · Fixed by #589
Closed

serviceaccount password on command line #30

arthurblake opened this issue Jan 30, 2014 · 14 comments · Fixed by #589

Comments

@arthurblake
Copy link

I am struggling with the security problems of passing logon credentials in clear text in the xml (under serviceaccount element) and would prefer a way to pass the credentials directly on the command line... (when installing service.)

I saw that issue #19 may address this, but cannot find exact usage information on that. Could you document basic usage of that feature?

@arthurblake
Copy link
Author

Looks like from the code, maybe all I have to do is supply /p and then type the password on stdin. Will experiment with that, but still; updating the readme to document this would be nice!

@slide
Copy link

slide commented Feb 13, 2014

Are you thinking something like just an AES encryption?

@arthurblake
Copy link
Author

No I wasn't. I was really just thinking about passing the credentials on the command line so they are just around transiently (as opposed to stored in the XML.) That was before I saw there was a /p option, although it's a bit clunky and undocumented.

@slide
Copy link

slide commented Feb 13, 2014

Adding documentation is easy, but what is clunky about it?

@arthurblake
Copy link
Author

It's just clunky for me to implement correctly that's all - everything else is fine about it. (I'm coming from the context of wrapping winsw with a nodejs program (See https://github.com/arthurblake/node-windows) that invokes winsw to do what it needs-- it can invoke it in several different ways, and it's clunky for me to have to grab stdin and pass the password in that way as opposed to just passing it as a command line arg, (not impossible, just clunky.) I would prefer if it was implemented like other MS commands (like net use, etc.) where your can pass /u /p right on command line although I can understand others might consider that less secure.

@oleg-nenashev
Copy link
Member

I think it's actually and still reasonable for some cases

@waffel
Copy link

waffel commented Apr 5, 2017

Interesting. I had also searched for a option to give the login password for the service accont on cmd while installing the service. /p helped me out (but also asked for username and logon behaviour).

It would be nice to have this information in the install guide (or how to get those "hidden" flags on cmd /? or --help does not print out the option).

@vsspt
Copy link

vsspt commented Jul 14, 2017

Can you please inform me what is the state of this issue?
Is this implemented in the 2.X version?

@nxtn nxtn changed the title serviceaccount password in clear text serviceaccount password on command line Apr 17, 2020
@nxtn
Copy link
Contributor

nxtn commented Apr 17, 2020

The /p argument was added in 1.14 and documented (only) in the installation guide since 2.0.

The Installer can be also started with the `/p` option.
In such case it will prompt for an account name and password, which should be used as a service account.

Bear in mind that /p reads password from the keyboard, not from STDIN.

More arguments can be implemented as part of #433.

@nxtn nxtn added this to the 3.Next milestone Apr 17, 2020
@nxtn nxtn linked a pull request Jul 27, 2020 that will close this issue
@nxtn nxtn closed this as completed Jul 27, 2020
@HackerBaloo
Copy link

I did't like the /p option, I made a little workaround, by writing the service config twice, first one time with password, I use that for installing the service, then I let my installer write the config file again without the password. It works fine for start, stop, status and uninstall

@waffel
Copy link

waffel commented Apr 13, 2021

@HackerBaloo I have done the same.

The ugly thing about this solution: You really should ensure to not leave the password for the service account in the configuration file. Then a "hacker" or ugly user can read the password of your service account.
We have managed to get rid of this by limiting read access to the files ... but all of this is a workaround just to not be able to provide the password on install per command line parameter. So for an "automatic" and easy way of installing services, a command-line switch would be helpful.

@billbarni
Copy link

I'm having this problem today. When delivering a package I have to make sure to remove the xml file or limit read, or some other absurd stuff. I can't have a password in text laying around.
Please, just give us the ability to use CLI to do everything.

@HackerBaloo
Copy link

I'm having this problem today. When delivering a package I have to make sure to remove the xml file or limit read, or some other absurd stuff. I can't have a password in text laying around.
Please, just give us the ability to use CLI to do everything.

If you are prepared to use the development version, I think it is possible already.

@billbarni
Copy link

The only thing holding me back in using the 'dev' version, is it's release in Maven/Jenkings Repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants