Skip to content

Commit

Permalink
Fixing issue with Orbit not sending bitlocker error (#14547)
Browse files Browse the repository at this point in the history
This is related to #14546 

- [X] Changes file added for user-visible changes in `changes/` or
`orbit/changes/`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [X] Manual QA for all new/changed functionality

---------

Co-authored-by: Martin Angers <martin.n.angers@gmail.com>
  • Loading branch information
marcosd4h and mna authored Oct 16, 2023
1 parent 7350e1e commit 4edab24
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions orbit/changes/14546-orbit-not-reporting-bitlocker-errors
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Orbit is now properly reporting Bitlocker encryption errors to Fleet server
14 changes: 10 additions & 4 deletions orbit/pkg/update/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,13 @@ func (w *windowsMDMBitlockerConfigFetcher) attemptBitlockerEncryption(notifs fle
// Otherwise, using the real one
fn = bitlocker.EncryptVolume
}

// Encryption operation is performed here, err will be captured if any
// Error will be returned if the encryption operation failed after sending it to Fleet Server
recoveryKey, err := fn(targetVolume)

// Getting Bitlocker encryption operation error message if any
// This is going to be sent to Fleet Server
bitlockerError := ""
if err != nil {
bitlockerError = err.Error()
Expand All @@ -501,14 +505,16 @@ func (w *windowsMDMBitlockerConfigFetcher) attemptBitlockerEncryption(notifs fle
ClientError: bitlockerError,
}

if err != nil {
log.Error().Err(err).Msg("failed to encrypt the volume")
errServerUpdate := w.EncryptionResult.SetOrUpdateDiskEncryptionKey(payload)
if errServerUpdate != nil {
log.Error().Err(errServerUpdate).Msg("failed to send encryption result to Fleet Server")
return
}

err = w.EncryptionResult.SetOrUpdateDiskEncryptionKey(payload)
// This is the error status of the Bitlocker encryption operation
// it is returned here after sending the result to Fleet Server
if err != nil {
log.Error().Err(err).Msg("failed to send encryption result to Fleet Server")
log.Error().Err(err).Msg("failed to encrypt the volume")
return
}

Expand Down

0 comments on commit 4edab24

Please sign in to comment.