mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Fixing issue with Orbit not sending bitlocker error (#14547)
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>
This commit is contained in:
parent
7350e1e420
commit
4edab240ff
2 changed files with 13 additions and 6 deletions
1
orbit/changes/14546-orbit-not-reporting-bitlocker-errors
Normal file
1
orbit/changes/14546-orbit-not-reporting-bitlocker-errors
Normal file
|
|
@ -0,0 +1 @@
|
|||
* Orbit is now properly reporting Bitlocker encryption errors to Fleet server
|
||||
|
|
@ -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()
|
||||
|
|
@ -501,16 +505,18 @@ func (w *windowsMDMBitlockerConfigFetcher) attemptBitlockerEncryption(notifs fle
|
|||
ClientError: bitlockerError,
|
||||
}
|
||||
|
||||
errServerUpdate := w.EncryptionResult.SetOrUpdateDiskEncryptionKey(payload)
|
||||
if errServerUpdate != nil {
|
||||
log.Error().Err(errServerUpdate).Msg("failed to send encryption result to Fleet Server")
|
||||
return
|
||||
}
|
||||
|
||||
// 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 encrypt the volume")
|
||||
return
|
||||
}
|
||||
|
||||
err = w.EncryptionResult.SetOrUpdateDiskEncryptionKey(payload)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("failed to send encryption result to Fleet Server")
|
||||
return
|
||||
}
|
||||
|
||||
w.lastEnrollRun = time.Now()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue