Skip to main content

Worklet: Install BitLocker and store keys in device tag


Show first post

38 replies

Forum|alt.badge.img
  • Author
  • Pro
  • 27 replies
  • May 17, 2021

That would be the Remediation code. For Evaluation you could do can do something has simple as:
exit 1
or if you want to verify the machine is encrypted you could try something like this for the Evaluation:

$BLinfo = Get-Bitlockervolume

if($blinfo.ProtectionStatus -eq 'On' -and $blinfo.EncryptionPercentage -eq '100'){
    Write-Output "'$env:computername - '$($blinfo.MountPoint)' is encrypted."
    exit 1
} else {
	Write-Output "'$env:computername - '$($blinfo.MountPoint)' is not encrypted."
    exit 0
}

You should also test this on a test group before running it on any production machines.


Forum|alt.badge.img
  • Novice
  • 16 replies
  • June 9, 2021

Sorry…just getting back to testing this as I have been testing other scripts. I put this remediation code in and just put {exit 1} for the evaluation, input our API and tested on a device that has bit locker configured. The activity log shows the device name but the details section is BLANK and there are no tags added in the device info. Is there something i am missing?


  • Novice
  • 8 replies
  • July 12, 2021

Just wanted to say I’m in the same boat.


Forum|alt.badge.img
  • Power User
  • 58 replies
  • July 13, 2021

Initial testing shows that maybe Automox changed the way they accept arguments in their API for this call. Looks like it broke in our environment as well. Using the API docs listed here; we are getting a “400 Bad request”


LaurieL-Automox
Forum|alt.badge.img

I did some testing earlier and it looks like there’s some issues with the $body parameter in the worklet. The string prefix and terminator characters are missing, and there are some backticks in there that probably shouldn’t be. The $body parameter should look something like this:

$body = @"
{
    "server_group_id": $server_group_id,
    "tags": [
			    "RecoveryID: $recID",
			    "RecoveryKey: $recKey"
	 ]
}
@"

Forum|alt.badge.img
  • Power User
  • 58 replies
  • July 16, 2021

I have been doing a ton of work on this as well, and agree the issue lies within the body parameter. However, I think the issue we are seeing is that “groupID” is a required parameter, instead of optional as the docs list (my hunch is that it used to be optional, but must have been changed on the backend of the API).


LaurieL-Automox
Forum|alt.badge.img

Yes, the server_group_id is a required parameter. I’m not sure exactly when this might have changed, however it is called out in the yaml file as required. I’ll go ahead and update the docs page.


Forum|alt.badge.img
  • Power User
  • 58 replies
  • July 16, 2021

Is there any way we can request GroupID to be investigated to go back to optional? Refactoring our scripts to include this would be another layer of complexity that isn’t desired, or required.


LaurieL-Automox
Forum|alt.badge.img

I’m looking into that. Will get back to you as soon as I have more information.


LaurieL-Automox
Forum|alt.badge.img

@Mrichards I ran it by our engineers, and it looks like the server_group_id has been a required body parameter for a long time. I’m not sure whether it would be possible in the future to make it optional, but they’re looking into it. It was only marked as optional on the docs page due to an oversight.

Currently, passing the PUT /servers/{id} API call without that parameter will result in a 400 error, as you’ve described.


Forum|alt.badge.img
  • Novice
  • 7 replies
  • February 24, 2023

Is this still working/resolved, or broken due to the server_group_ID at this point?


Bumping this old thread to recommend a  modification.

Instead of $env:COMPUTERNAME, use [System.Net.Dns]::GetHostName().

$env returns the BIOS name, whereas Automox stores the full hostname.  If your full hostname is over 15 characters in length, the matching could fail.


Forum|alt.badge.img
  • Rookie
  • 1 reply
  • July 25, 2024

This worklet is awesome, I am testing it on some of our devices and was wondering if you could help me with one thing? The worklet works as expected and stores the ID and Key as tags, but it also wipes away any tags already set for the machine. Is there a way to alter this so it doesn’t wipe away the other tags that already exist? Thanks!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings