-
Notifications
You must be signed in to change notification settings - Fork 289
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
Windows: Fails to create sensu user #586
Comments
I'm also having this issue. I currently use my own manifest to setup windows clients and have sensu running as a local system service. The module should support this. If I have time I'll dig through the code and see about a pull request. |
Would be appreciated, I don't use windows so no idea how to fix. |
@jaxxstorm @dschaaff We wrote our own to at least get this POCd on windows. I can post up some of the code if that helps but in order to shorten dev time we took some shortcuts on things like the client and transport json files, they are built with erb templates. We also use DSC to install sensu via the msi from our internal repo which does require a system reboot. Depending on timing I could help as well but we are mid sprint right now for a fairly major effort :/ |
Dug a bit deeper here: in init.pp (https://github.com/sensu/sensu-puppet/blob/master/manifests/init.pp#L541):
Looks like the service is installed using the system service: https://github.com/sensu/sensu-puppet/blob/master/manifests/client/service.pp#L41 But then the conf dirs are being set as the sensu user and group from the above case (https://github.com/sensu/sensu-puppet/blob/master/manifests/package.pp#L104)
Since this is a local service we should actually just be able to leave the file permissions as default (I think), or we can restrict it to the local system user itself, but either way this shouldn't be THAT hard to fix. Ill see if I can spare some time today to pull this and make that fix. @jaxxstorm Thoughts on adding logic to support other users other then the local system service in case people do want a dedicated sensu user? It would require windows specific params for the client in init.pp Edit: looks like we can set the user to NT Authority\SYSTEM and the group to Administrators. I still think an override for both is appropriate, but maybe we just say in the docs if you want to use another account its up to you to create it on the system? |
Sorry for spamming: This is specifically what is not compatible with windows(https://github.com/sensu/sensu-puppet/blob/master/manifests/package.pp#L165):
|
Ok created a pull for this: #588 @jaxxstorm @dschaaff Let me know your thoughts and if you can test I would appreciate it. |
I'll see if I can give it a go tomorrow. Thanks! |
@dzeleski Can I ask why this was done exactly? |
Sure:
This wouldnt fly for any enterprise environment that cared about security. The local system account is the safest option to get admin rights and not open any doors. Most windows services that only need access to the system itself run as a local service, there is usually no reason to not use it unless you needed access to things outside of the system (ie UNC paths). When you install the Windows MSI from Sensu themselves it installs as Local System, which is also why I did that as it keeps the install consistent from what Sensu does/expects. |
@jaxxstorm Issue found after resolving this issue: #569
Not getting that error after a restart but now its failing on either creating the sensu user, or if I disable manage user it cannot find the sensu user or use the built in administrator user.
With manage_user set to false:
true:
The biggest issue is that I cannot find any documentation on how to setup a windows client via the sensu puppet module, I also dug through some of the code and I dont see any parameters on setting the sensu user/password for the service account. I can obviously create a sensu user but I feel like the sensu module should be able to handle that no?
Also my module that I wrote to get around this issue registers the sensu service as local system, is there any reason why this shouldnt be done? Most solutions I see on windows should be totally happy as a local system service.
The text was updated successfully, but these errors were encountered: