-
Notifications
You must be signed in to change notification settings - Fork 25
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
LAPS 4 All and Bitlocker Keys to ITGlue #6
base: master
Are you sure you want to change the base?
Conversation
Added script to save bitlocker keys to ITGlue as well.
Changed script logic a bit to always set a new password if there is not a password already saved in ITGlue for the device and admin account. Added section to deactivate incorrect admin account various that may have been created over time. "LocalAdmin" vs "Local Admin" vs "Local-Admin" so only the official variation remains after script runs.
Updated exported component to include the recent changes to the script.
@TMG-mmccool Could you please reach out to marketing[at]itglue.com with your contact info? Just need to have all submitters' info. |
It looks like this script requires the IT Glue API key to be stored as an environment variable on each PC. This seems like a security concern. |
This isn't a security concern when using DattoRMM. The API key is provided by DattoRMM as an environmental variable at script runtime. It is not stored on the computer. |
Does the script pass the API key to the powershell and it runs unencrypted / uncompiled on the endpoint? If it's in plain text on the endpoint even just as a variable it can be easily sniffed out. |
It definitely is a security concern. If you intend to use this script, I'd advise using something like this (at the least) as a customer-specific proxy: https://github.com/KelvinTegelaar/AzGlue |
Kelvin's AzGlue gateway is definitely a good option to use. This script was made long before Kelvin's AzGlue gateway was available. Having the API key on the machine at all was always a concern of mine as well which is why I included a test for module logging in the script as this could easily leak the API key. Script block logging does not leak the key. DattoRMM does encrypt the variables passed down through the component. They are available only to the powershell environment created by the DattoRMM agent process for running the script. It is not available to any other powershell environments on the system. That being said, since API key still has to be on the computer, there is always a chance that the key could be extracted from memory or some such process. When I wrote this a couple years ago, this was not one of the security issues considered. I did my best to protect the API key in the environment that this was designed to run in. If I were rewriting this today, I would definitely use Kelvin's AzGlue gateway as that entirely removes the API key from the endpoint. I will point out that while moving the API key to the gateway instead, doesn't entirely remove the ability for malicious use of ITGlue. Depending on what commands you allow through the gateway, it could still be a security concern. Instead of leveraging the API directly, they simply utilize your proxy themselves. As long as a bad actor can extract the token from the local system, they can leverage the AzGlue proxy to run the commands on their behalf. The only secure computer is one that is turned off and locked in a closet. Everything else is a compromise. |
LAPS for All is similar to Microsoft's LAPS product, but can be deployed outside of a domain environment. It creates a unique password for the local admin account on a Windows workstation and saves the password to ITGlue.
This script was designed to be used with DattoRMM/Autotask Endpoint Management, but may be possible to port to other RMM platforms provided the RMM platform assigns a unique ID to the device and that unique ID is saved to the 'asset-tag' or similar field inside of the ITGlue configuration object.
After seeing computers hacked years ago through open RDP ports using admin accounts, we have made a progression of MSP policy changes to mitigate this (RDP only over secure VPN, no Domain Users in local admins group, etc.), as well as implementing other security changes, but we were unable to manually maintain the goal of having a single local MSP admin account on all computers that had a unique secure/complex password per computer. Microsoft had released LAPS to do this, but that was only for domain environments, and many of our clients do not have domains. This script provides the required automatic updating functionality and IT Glue provides the necessary password history in case System Restore or some other restorative function backdates the password to an older version. This allows us to confidently automate changing the password monthly. The script will not run on servers (to protect local service accounts) and will not allow the optional function to disable all other local accounts on non-domain joined computers. We can now finally disable all default/OEM and the previous IT's local user accounts in a single swoop on domain computers--great for onboarding.
Items of note:
*There is no number 6 - ref: https://tvtropes.org/pmwiki/pmwiki.php/Main/ThereIsNoRuleSix -- Apparently GitHub is smarter than I am and automatically renumbered the list to have a number 6.
Added additional script for saving the bitlocker recovery keys to ITGlue. - Bitlocker Readme
**These scripts depend on the DattoRMM GUID being synced to ITGlue as the asset-tag data. In our workflow, this data is synced first from DattoRMM to AutotaskPSA with the DattoRMM GUID being saved at the reference number. AutotaskPSA then syncs this data over to ITGlue with the reference number being saved as the ITGlue asset-tag. If this configuration is not used, other methods of matching DattoRMM device to ITGlue device will need to be implemented.