Repository navigation
fix(factory-reset): scrub inherited USB and Thunderbolt trust - #74
Merged
mark-groves merged 2 commits intoOct 14, 2026
Merged
mark-groves merged 2 commits into
mark-groves merged 2 commits into
Conversation
A snapshot from the approval window still enables USBGuard and keeps Bolt enrollments after stage_full_reset. Co-authored-by: ai <ai@id.grovr.au>
The removal migration edits the running root only, so a reset of an approval-era snapshot was booting the previous owner's allowlist and Bolt enrollments. Co-authored-by: ai <ai@id.grovr.au>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Factory reset boots a clone of the install snapshot. After USB and Thunderbolt approval was removed, that clone still started the previous owner's USBGuard allowlist and still held their Bolt enrollments. The removal migration edits the running system only.
What changed
disable_factory_usbguarddisables USBGuard in the booted clone and the retained baseline when the snapshot still has the unit.reset_factory_thunderboltremoves authorization markers, the journal, and Bolt device, key, and domain records in both roots, then setsAuthModetoenabled.test/shell.d/factory-reset-accessory-trust-test.shrunsstage_full_resetagainst a snapshot that still carries that trust.Scope
Covers a factory snapshot that still has the approval-era USBGuard unit or Thunderbolt authorization state. The USBGuard rules file stays on disk. The daemon is disabled, so the allowlist is not enforced. The live removal migration is unchanged, and device approval is not restored.
Tradeoffs
USBGuard stays installed and disabled. The snapshot is offline, so the reset cannot drop the package the way an update of the running system can. Bolt's mode becomes
enabledafter its enrollments are deleted. An empty store does not authorize the previous owner's devices.Blast Radius
This runs only during factory reset, and only when the snapshot still has the USBGuard unit or Thunderbolt authorization markers. A snapshot without them is unchanged. A Bolt directory that is a symlink aborts the reset before the new root is activated.
Verification
bash test/shell.d/factory-reset-accessory-trust-test.shfailed withnot ok - the booted factory system still enables USBGuard.factory-reset-accounts-test.sh,factory-reset-dispatch-test.sh, andfactory-reset-elevation-test.shpassed.