masterzen/winrm

winrm-cli please setproctitle

Opened this issue · 1 comments

Currently the username and password is exposed through ps. It would be good if this is hidden via setproctitle.

Something like:

diff --git a/winrm.go b/winrm.go
index a1707ca..cd7b4d3 100644
--- a/winrm.go
+++ b/winrm.go
@@ -25,9 +25,11 @@ import (
        "time"
 
        "github.com/masterzen/winrm"
+       "github.com/erikdubbelboer/gspt"
 )
 
 func main() {
+       gspt.SetProcTitle("winrm <REDACTED>)
        var (
                hostname string
                user     string

Thanks for the idea. Unfortunately I'm afraid this won't work on Windows (I can be wrong I didn't check), and I know some of the users of this tool are Windows shop.

Actually I have plans for a better winrm-cli that would allow to use environment variables and/or a config file like what awscli is doing. This would solve this specific issue.
You can see what I'm trying to do in this preview branch.

Unfortunately based on my inability to find spare time for hacking on those projects, I'm afraid it will take a bit of time before it lands into master and become available.