-
Notifications
You must be signed in to change notification settings - Fork 2k
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
raw_exec windows: add support for setting the task user #9424
Comments
Thanks for opening this @rgl. Copying over a recommendation from golang/go#42773 (comment)
attrs := &os.ProcAttr{
Sys: &syscall.SysProcAttr{
Token: syscall.Token(theTokenThatYouJustMade),
},
}
|
BTW, In the mean time I've found out about damon from https://www.hashicorp.com/resources/running-windows-microservices-on-nomad-at-jet-com and I'm trying to fiddle with it. It has some interesting features (e.g. limit the cpu usage, run the application inside a job object) that should be integrated into nomad somehow. So far I was able to run-as-another-user (using a password thou), but I'm still having problems running applications like |
I also have this requirement, and am considering the best way to approach it. The immediate requirement is to support running as another user. In Windows you can launch processes as another user without a password, they just don't have network credentials. I have GO code do do that, and can successfully run "whoami" and get it to return the correct result. My ideal would be to end up with code in Nomad to do this. Second choice is to use a wrapper along the lines of "daemon" referenced above. What I don't really want to do is maintain a long term fork of Nomad containing the code, so what is the likelyhood of getting a PR accepted that would contain suitable code? Would it be better if there was a separate github project to do the S4U impersonation code, and then a PR on Nomad to make the Executor make use of that, or would it be better if all of the code was within the hashicorp estate as it were? Short term I'm going to solve this by using something like daemon. It introduces an extra layer though. So already there is an instance of raw-exec plugin wrapping each process, there would then also be an instance of "daemon" as well. But it's the quickest short term solution. |
We're also interested in this. As we onboard more Windows Console/Service applications onto Nomad we've run into some that rely on using network credentials to access file shares. It would be great to be able to run these applications as an AD user. Even using a password would be fine because we could retrieve that from Vault. |
For info, what I ended up doing here was writing a replacement nomad task driver. The task driver (well the process monitor it spawns) then handles interfacing to windows to perform logon or impersonation before launching the requested workload. We're also adding interfacing to Windows for resource constraints and so on. So we use this in place of raw_exec. Once I worked out how task drivers worked, and particularly how the execution monitoring worked (which wasn't at all obvious, it's all handled by another process launched by the task driver to monitor that particular workload), it was reasonably straightforward to implement. |
@tomqwpl |
@antineutrino Right now nothing that I can share. |
I would like to set the user that will execute a task command in windows (like its already supported in linux); e.g.:
It would also be pretty interesting to support Group Managed Service Accounts and Local Service Accounts (these do not have a user managed password, as such, are more convenient to use). Please note these require the application to run (or be wrapped) as a Windows service.
Please note that in Windows, you also need to define the password; which is something that is not yet supported by go exec.Command; I'm trying to figure out how can this be done in golang/go#42773.
The text was updated successfully, but these errors were encountered: