Runas any user even when shell is limited like winrm - #47621
Conversation
c112b6a to
34608cb
Compare
da7506f to
92e93b7
Compare
|
Seems like a good idea. Please use a class for constants like in modules/reg.py |
|
This should fix |
There was a problem hiding this comment.
Shouldn't this be salt.winutil now?
There was a problem hiding this comment.
Can we remove these comments?
And the salt.winutil thing
|
Some random thoughts. There are also a few win_*.py in salt.utils For example we have salt.utils.pkg.win What I would like to see is a With a platform independent set of high level class methods where possible, with specific platform overrides. |
|
@damon-atkins, thanks so much for reviewing this. :)
|
There was a problem hiding this comment.
Why warning?
Also, switch to log.warning, log.warn is deprecated in Py3.
There was a problem hiding this comment.
I agree warning is overkill. Should these 'logon user' log statements go away completely?
There was a problem hiding this comment.
If you think these will make sense when trying to debug an issue, leave then, but perhaps, at debug log level? Info?
There was a problem hiding this comment.
Windows creates an event log for the logons so I've just removed these log statements.
There was a problem hiding this comment.
If this is a utilities module it should be moved to salt.utils.
94c3a62 to
2a1da92
Compare
I've read this and it looks good so far as I can tell, but I simply don't know enough about the Windows ecosystem to be able to review this in any real depth.
|
I'm getting the following error on Py3 when I do a |
77ef5cb to
8626bef
Compare
There was a problem hiding this comment.
As I recall, password is only needed if it's under a non-admin account AND it's requesting priv escalation, right? If so, I think that should be called out specifically.
There was a problem hiding this comment.
@cachedout If the minion happens to be running under a non admin. They will need to use a password anytime the use the runas argument to cmd.run. Maybe this is better?
A password is no longer required with ``runas`` under normal circumstances.
The password option is only needed if the minion process is run under a
restricted (non-administrator) account. In the aforementioned case, a password
is only required when using the ``runas`` argument to run command as a different
user.
There was a problem hiding this comment.
Is the intention here just to pass groups? I'm wary of passing all kwargs unless that's truly needed.
There was a problem hiding this comment.
@cachedout Yes, this is to pass groups. I'll change it to be more specific.
There was a problem hiding this comment.
Actually, looking at this again. We are making the kwargs dictionary for the sole purpose of passing it to user.add. It is being used to pass timeout, groups, and password.
|
@dwoz This has a merge conflict with the release notes. Can you fix that up? |
- Fix runas when running under powershell remoting - Support for LOCAL SERVICE and NETWORK SERVICE system accounts. - Runas can now use system accounts from salt-call. (SYSTEM, LOCAL SERVICE and NETWORK SERVICE) - Runas can launch processes on behalf of users without a password. - Integration tests for win_runas module
|
@rallytime fixed. |
What does this PR do?
(SYSTEM, LOCAL SERVICE and NETWORK SERVICE)
What issues does this PR fix or reference?
Tests written?
No
Commits signed with GPG?
Yes