feat(devices): add remote platform erase support#846
Draft
Conversation
ab3a5ce to
2a3c9f3
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #846 +/- ##
===========================================
+ Coverage 40.25% 59.45% +19.19%
===========================================
Files 114 101 -13
Lines 10866 8190 -2676
===========================================
+ Hits 4374 4869 +495
+ Misses 6091 2921 -3170
+ Partials 401 400 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9963ea5 to
3fb92dc
Compare
c155e51 to
a51bd01
Compare
4 tasks
89a3df2 to
ed07d81
Compare
7 tasks
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.
NOTE: Requires real AMT 16.0+ hardware with RPE BIOS support for end-to-end testing.
Related PRs
NewUint32Parameter)Description
Adds support for Intel Remote Platform Erase (RPE), a CSME 16.0+ feature that allows remote administrators to securely erase platform storage components (SSDs, TPM, BIOS NVM, etc.) on the next system boot.
What's New
API Endpoints
GET/api/v1/amt/boot/capabilities/:guidAMT_BootCapabilitiesincluding thePlatformErasebitmask indicating which erase components the device BIOS supportsPOST/api/v1/amt/boot/rpe/:guidAMT_BootSettingDataPUT)POST/api/v1/amt/remoteErase/:guidErase Component Bitmask (
AMT_BootCapabilities.PlatformErase)Per the Intel AMT spec:
0x010x040x080x100x400x100000x20000000x4000000RPE Trigger Flow (
SendRemoteErase)GET AMT_BootSettingData— read current state and verifyRPEEnabled=trueCIM_BootConfigSetting.ChangeBootOrder("")— clear any active boot source override before setting CSME reset flags (equivalent toClearBootOptionsin the Intel AMT C# SDK). Skipped for hardware-only targets (TPM, SSDs, BIOS NVM, …) to avoid undefined BIOS boot-order behaviorCIM_BootService.RequestStateChange(32770)— switch firmware to RPE mode (required when boot service is in OCR mode 32769; omitting it causesActionNotSupported)eraseMaskcontains hardware targets: encodetlvMask(eraseMask with the CSME sentinel bit stripped) as a TLV buffer (ParameterTypeID=1, uint32 LE) and base64-encode it intoUefiBootParametersArrayPUT AMT_BootSettingDatawithPlatformErase=true(if hardware targets present),ConfigurationDataReset=true(if CSME sentinel bit set),UefiBootParametersArray=<TLV>(if hardware targets present)PlatformEraselatched via a follow-up GET — abort if notCIM_BootService.SetBootConfigRole— activate the boot configurationRequestPowerStateChange(PowerCycleOffHard)— full S5→S0 power cycle to execute erase on next bootCIM_BootService.EnabledStateConstants (clarified)SetFeaturescorrectly computes the required state when OCR and RPE are set together, andsetRPEruns before the OCR state change to avoid the OCR state blocking the RPE PUT.DTO / Feature Surface
AMTFeaturesRequestandFeaturesDTOs (v1 + v2) updated with:rperpeSupportedPlatformErasecapabilities)rpeCapsPlatformErasebitmask fromAMT_BootCapabilitiesrpeSecureEraserpeTPMClearrpeClearBIOSNVMrpeBIOSReloadTesting
GetBootCapabilities,SetRPEEnabled,SendRemoteEraseuse-case functions and HTTP controller handlersSetFeaturestests extended to cover RPE + OCR state combinationsNotes
0x10000(rpeCSMEBit) doubles as the rawAMT_BootCapabilities.PlatformErasebit for OEM Custom Action and as the UI-level sentinel for "Unconfigure Intel CSME Firmware". When set in the request mask it setsConfigurationDataReset=truein the PUT and is stripped from the TLV hardware bitmask —PlatformEraseandConfigurationDataResetare independent flags and are never both set from the same bitUefiBootParametersArraymust be non-empty whenPlatformErase=true— the firmware returnsInvalidRepresentationif the element is present but empty or absent. The TLV device bitmask (ParameterTypeID=1) is mandatory per the Intel RPE specPowerCycleOffHard(S5→S0) is required for erase execution;MasterBusReset(warm reset) keeps ME power rails energised so the BIOS never gets the opportunity to execute the CSME/platform eraseRequestStateChange(32770)must be called before the PUT when the boot service is in OCR mode (32769); omitting it causesActionNotSupportedPlatformErase == 0) return a validation error rather than attempting the operation