Password Changing Scripts Logging the Password
Hey All,
I am making this post specifically with Labtech/Automate in mind as that is what I have deployed, however my concern would remain, regardless of which RMM I was using to accomplish this task, so all input is welcome!
I know the topic of scripts to automate local user password changes has been discussed more than its fair share of times, however I was curious on everyone's thoughts regarding the logs that are kept of these scripts, both in LT and on the workstations themselves. I have been tasked with creating a local user (or changing its password where it already exists) for about 1000 workstations, however I am worried about the existence of this password in plaintext in various logs if I simply script out the net user command.
Do other companies out there use LT scripts to mass change local passwords? If so what steps do you take to prevent it from existing in plain text anywhere? Is there a completely different direction I should be looking? The devices are mostly windows 10 (a few 7s) and I am using LT/Automate 2020 on premise.
Posted Feb 10, 2021, 2:58 PM UTC
I do this with datto rmm. But i store the variables in ITGlue. The script runs locally on the client and uses a https api call to retrieve it.
Are you able to share more details on how you have this setup? We too use ITGlue and honestly I would much prefer this to the way I was approaching it. How is the API key handled? Is it stored on the RMM or on the local workstation? Is there any concern with anyone getting access to the API key if the machine were to experience an unauthorized access?
There is a user here that I don't remember their name exactly, but they run this blog and have all kinds of cool stuff including what you are asking for.
https://www.cyberdrain.com/documenting-with-powershell-chapter-3-local-administrator-passwords-solution/
As for the security concern with the API key, there is a checkbox in ITGlue to disable or enable password access via the API key. My suggestion would be to enable access while your script runs and then disable it. Cyberdrain also has an article on using Azure as an intermediary so you can limit access to the ITGlue API key but I have not tested it.
Tagging u/Lime-TeGek as the author of the aforementioned blog.
Thanks for the mention u/gpshift and thanks for tagging me u/HappyDadOfFourJesus.
u/JustTechIt We just keep bumping into each other! handling credentials is something you need to be careful of in scripts, each RMM handles credentials differently; N-Central encrypts passwords, DattoRMM keeps the scripts in memory and logs nothing to console, others work completely different. One method of making it more secure is using a proxy for APIs that allows more granular control.
u/gavsto would know the details on how to handle credentials in Automate. Always make sure when you handle scripts that show credentials to check for script block logging and end the script if it's enabled.
This is awesome, thanks for the help!