Harden destructive modules: reparse-safe cache cleanup + BitLocker enable confirm (v1.121.8)#76
Merged
Merged
Conversation
…able confirm (v1.121.8) Fixes from a deep audit of the destructive/data-affecting modules. Disk Cleanup (20-DiskCleanup.ps1): the Chrome, Firefox, and full-cleanup browser-cache sweeps now skip reparse points during recursion, matching the Edge and temp-file sweeps. A junction planted inside a browser profile could otherwise redirect an admin-context Remove-Item to files elsewhere on disk. BitLocker (31-BitLocker.ps1): enabling BitLocker now asks a final confirmation naming the exact volume and method before the one-way encryption begins, mirroring the gate the Disable path already has. Audit also confirmed Deduplication, Storage Migration, and Debloat, plus BitLocker recovery-key handling, are already correct. Tests: Section 195 (7 asserts); 5291/5291 passing. Monolithic + version stamps bumped to 1.121.8.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Fixes from a deep audit of the destructive/data-affecting modules (BitLocker, Deduplication, Storage Migration, Disk Cleanup, Debloat).
Disk Cleanup — reparse-safe browser-cache sweeps (high)
The Chrome, Firefox, and full-cleanup (
Invoke-FullEnhancedCleanup) browser-cache sweeps now skip reparse points during recursion — the same protection the Edge and temp-file sweeps already had. Without it, a junction/symlink planted inside a browser profile under%LOCALAPPDATA%could redirect an admin-contextRemove-Itemto files elsewhere on disk (local file-deletion / privilege-escalation vector).Clear-BrowserCaches: ChromeCache+Code Cache, and Firefoxcache2recursions now carryWhere-Object { -not ($_.Attributes -band $reparseAttr) }.Invoke-FullEnhancedCleanup: the shared$browserPathsdelete loop gets the same filter.BitLocker — final confirm before enable (medium)
Enabling BitLocker now asks a final
Confirm-UserActionnaming the exact volume and method (TPM / TPM+PIN / Password) before the one-way, hours-long encryption begins — mirroring the confirmation the Disable path already had. A mistyped volume number is caught here instead of after encryption starts. The Dry-Run queue path is its own gate and is unchanged.Verified clean (no changes needed)
The audit confirmed Deduplication, Storage Migration, and Debloat — and BitLocker's recovery-key handling — are already correct.
Tests