fleet/orbit/pkg/update
Victor Lyuboslavsky 58563852f0
Bitlocker: do not decrypt already encrypted drive. (#43130)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #40809

**Orbit agent: key rotation replaces decrypt-then-re-encrypt:**
- When the disk is already encrypted, orbit now adds a new Fleet-managed
recovery key protector, removes old ones, and escrows the new key. The
disk is never decrypted.
- If key escrow fails, the rotated key is cached in memory and retried
on subsequent ticks without rotating again.
- Removes `DecryptVolume` and `decrypt()` (no longer called from
production code).

**Server: osquery query returns both protection_status and
conversion_status:**
- The `disk_encryption_windows` query now returns both columns instead
of just checking `protection_status = 1`. This lets the server correctly
identify a disk as encrypted via `conversion_status = 1` even when
`protection_status = 0`.
- New `directIngestDiskEncryptionWindows` function parses both values,
handles parse errors, and normalizes `protection_status = 2` (unknown)
to NULL.

**Server: new `bitlocker_protection_status` column and status logic:**
- Adds `bitlocker_protection_status` column to `host_disks` (DB
migration).
- When a disk is encrypted and key is escrowed but protection is off,
the host shows "Action required" with a detail message explaining the
issue, instead of misleadingly showing "Verified."
- `protection_status = 2` (unknown) and `NULL` (older orbit hosts) are
treated as protection on for backward compatibility.
- The `profiles_verified` and `profiles_verifying` branches in the
combined profiles+BitLocker summary now handle
`bitlocker_action_required`, counting those hosts as "pending".

Contributor docs updates: https://github.com/fleetdm/fleet/pull/43241
Public docs updates: https://github.com/fleetdm/fleet/pull/43243/changes

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually

## Database migrations

- [x] Checked schema for all modified table for columns that will
auto-update timestamps during migration.

## fleetd/orbit/Fleet Desktop

- [x] Verified compatibility with the latest released version of Fleet
(see [Must
rule](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/workflows/fleetd-development-and-release-strategy.md))
- [x] If the change applies to only one platform, confirmed that
`runtime.GOOS` is used as needed to isolate changes
- [x] Verified that fleetd runs on macOS, Linux and Windows
- [x] Verified auto-update works from the released version of component
to the new version (see [tools/tuf/test](../tools/tuf/test/README.md))


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **Bug Fixes**
* Fixed Windows BitLocker encryption/decryption request loop on systems
with secondary drives and auto-unlock.

* **New Features**
* Added BitLocker recovery key rotation capability, allowing safe key
updates without full disk re-encryption.
* Enhanced BitLocker protection status tracking to correctly display
"Action required" when protection is disabled.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-09 18:33:03 -04:00
..
badgerstore Update go-tuf dependency (#3837) 2022-02-10 08:16:36 -08:00
filestore Update golangci-lint to v2.4.0 (#33251) 2025-09-22 13:17:11 -05:00
config_fetcher.go Enable installation and auto-updates of Nudge via Orbit (#9605) 2023-02-10 17:03:43 -03:00
disk_encryption.go fix issue with disk encryption banner (#21385) 2024-08-19 12:02:43 -03:00
escrow_buddy.go Revert "Always install Escrowbuddy and Swift Dialog (#28742)" (#29264) 2025-05-19 13:23:05 -04:00
escrow_buddy_test.go Revert "Always install Escrowbuddy and Swift Dialog (#28742)" (#29264) 2025-05-19 13:23:05 -04:00
execcmd.go Kickstart sofwareupdated periodically from fleetd/orbit to work around a macOS bug (#9465) 2023-01-24 10:14:17 -05:00
execcmd_darwin.go Fix bug where MDM migration fails when attempting to renew enrollment profiles on macOS Sonoma devices (#19726) 2024-06-13 14:13:43 -05:00
execcmd_stub.go don't automatically kickstart softwareupdated in Orbit (#12072) 2023-06-02 12:33:40 -03:00
execwinapi.go use OrbitNodeKey for windows mdm enrollment authentication instead of HostUUID (#13503) 2023-08-29 14:50:13 +01:00
execwinapi_stub.go Merging Bitlocker feature branch (#14350) 2023-10-06 19:04:33 -03:00
execwinapi_windows.go Update golangci-lint to v2.4.0 (#33251) 2025-09-22 13:17:11 -05:00
file.go Add 'orbit/' from commit 'ab3047bb39f1e2be331d1ff18b4eb768619033c4' 2021-08-04 16:58:25 -03:00
flag_runner.go Add arm64 support for fleetd extensions and fixes on test scripts (#31084) 2025-07-21 15:47:59 -03:00
flag_runner_test.go Update golangci-lint to v2.4.0 (#33251) 2025-09-22 13:17:11 -05:00
hash.go Fix auto-update of .tar.gz components in orbit (#37741) 2025-12-30 11:17:32 -03:00
hash_test.go chore: remove refs to deprecated io/ioutil (#14485) 2023-10-27 15:28:54 -03:00
notifications.go Bitlocker: do not decrypt already encrypted drive. (#43130) 2026-04-09 18:33:03 -04:00
notifications_test.go Bitlocker: do not decrypt already encrypted drive. (#43130) 2026-04-09 18:33:03 -04:00
nudge.go Adding telemetry for specific Fleet Desktop errors (#23349) 2024-10-31 14:24:42 -05:00
nudge_test.go Add gosimple linter (#23250) 2024-10-29 14:17:51 -05:00
options.go Orbit for Windows ARM64 (#27882) 2025-04-11 10:18:28 -04:00
options_darwin.go Changes to migrate to new TUF repository (#23588) 2025-01-10 14:27:30 -03:00
options_linux_amd64.go Changes to migrate to new TUF repository (#23588) 2025-01-10 14:27:30 -03:00
options_linux_arm64.go Changes to migrate to new TUF repository (#23588) 2025-01-10 14:27:30 -03:00
options_windows_amd64.go Orbit for Windows ARM64 (#27882) 2025-04-11 10:18:28 -04:00
options_windows_arm64.go Orbit for Windows ARM64 (#27882) 2025-04-11 10:18:28 -04:00
runner.go Fleetd: Update the Registry DisplayVersion when fleetd auto-updates (#28183) 2025-04-17 11:04:02 -07:00
runner_test.go Fleetd: Update the Registry DisplayVersion when fleetd auto-updates (#28183) 2025-04-17 11:04:02 -07:00
swift_dialog.go Revert "Always install Escrowbuddy and Swift Dialog (#28742)" (#29264) 2025-05-19 13:23:05 -04:00
swift_dialog_test.go Orbit config receiver (#18518) 2024-05-09 15:22:56 -04:00
testing_utils.go use Escrow Buddy to rotate FileVault keys on macOS (#20842) 2024-07-31 16:59:30 -03:00
update.go Fix auto-update of .tar.gz components in orbit (#37741) 2025-12-30 11:17:32 -03:00
update_test.go Add support for Linux ARM64 (#19931) 2024-07-17 16:07:59 -04:00
windows_registry.go Fix Windows lint issues and enable linting on Windows (#28704) 2025-05-02 16:11:26 -04:00
windows_registry_stub.go Fleetd: Update the Registry DisplayVersion when fleetd auto-updates (#28183) 2025-04-17 11:04:02 -07:00