Repository navigation
feat(mdm): require BitLocker per Windows host on Fleet Free CU-17tkuw6a8db - #293
Tests and mutation: every lane passed, 2 gaps
🧪 Tests and mutation
Tests per lane
| Language | Project | Command | Status | Counts | Time |
|---|---|---|---|---|---|
| Go (go test) | . | go vet ./server/datastore/mysql ./server/datastore/mysql/migrations/openframe ./server/fleet ./server/mock ./server/mock/service ./server/service && go test -cover ./orbit/... |
✅ passed | 273.2 s | |
| Shell (bash -n) | . | bash -n openframe/scripts/verify.sh |
✅ passed | 0 s |
Checks
| Check | Kind | Language | Project | Status | Time |
|---|---|---|---|---|---|
| OpenGrep | security | Go (OpenGrep) | . | ✅ passed | 18.4 s |
The test services of flamingo-stack/fleetmdm (server/mdm/nanodep/storage/mysql/docker-compose-test.yml) did not come up: the integration tests may fail for that reason.
The Go lane vets the changed packages and runs the orbit tests; the datastore tests need MySQL, so TestOpenframeDiskEncryption*, TestDiskEncryption and the encryption tests of server/service were run by hand on a disposable MySQL 8.0.44 and passed (the last commit's later edits there are wording only).
Concurrent require, lift, record, re-enrollment and team change on 12 hosts, 240 operations in all, gave no error and no deadlock on MySQL; not checked on a real Windows PC.
2 gaps (not tested here):
- Go (go test) .: no mutation testing (no mutation tool for Go is configured: read the coverage of the changed packages instead)
- Shell (bash -n) .: no mutation testing (no tool configured)
Annotations
Check warning on line 321 in server/datastore/mysql/disk_encryption.go
flamingo / Flamingo Code Review / tests and mutation
A host that is deleted and enrolls again loses access to its archived recovery key
The archived key is found only by host_id in OpenFrame mode. A PC whose Fleet host was deleted enrolls as a new host: the new host has no requirement row and GetHostArchivedDiskEncryptionKey answers NotFound, although the archive still has the key under the old host_id. Reproduced on MySQL with the same tenant and serial; upstream returns the key there.
Risk: The PC stays encrypted with a key nobody can read until it is required again and fleetd rotates the key. If it locks before that, the drive can't be unlocked.
Fix: Keep the lookup off (a serial can be another machine's), but record it under Known limits in openframe/docs/windows-disk-encryption.md: a new host must be required again, which makes fleetd escrow a new key. The OpenFrame caller has to do that on a new host id.
Check notice on line 60 in server/datastore/mysql/openframe_windows_disk_encryption.go
flamingo / Flamingo Code Review / tests and mutation
A host id repeated across batches is counted twice in the answer
IN drops duplicates inside one batch of 1000, not across batches: one host id sent 1500 times answers hosts = 2 (reproduced on MySQL).
Risk: The caller can't compare the count with the number of hosts it sent.
Fix: Remove duplicates from hostIDs before splitting them into batches.