feat(devices): add remote platform erase support#846
Conversation
ab3a5ce to
2a3c9f3
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #846 +/- ##
===========================================
+ Coverage 39.92% 58.21% +18.28%
===========================================
Files 123 111 -12
Lines 11355 8561 -2794
===========================================
+ Hits 4534 4984 +450
+ Misses 6424 3174 -3250
- Partials 397 403 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9963ea5 to
3fb92dc
Compare
c155e51 to
a51bd01
Compare
89a3df2 to
ed07d81
Compare
8cb8e8b to
77d98d8
Compare
0b5764e to
fe982f3
Compare
rsdmike
left a comment
There was a problem hiding this comment.
Thanks @nmgaston for doing this. @graikhel-intel and i have taken some time to think through and go through this. Here is our feedback:
- Simplify AMT features request/response to just include
rpeSupportedandrpe:
{
"redirection": true,
"KVM": true,
"SOL": true,
"IDER": true,
"optInState": 0,
"userConsent": "none",
"kvmAvailable": true,
"ocr": false,
"httpsBootSupported": true,
"winREBootSupported": true,
"localPBABootSupported": true,
"rpe": true,
"rpeSupported": true,
<remove>
"rpeCaps": 100728925,
"rpeSecureErase": true,
"rpeTPMClear": true,
"rpeClearBIOSNVM": true,
"rpeBIOSReload": true
</remove>
}Once this is done, can update the UI on the General AMT Info screen change RPE into a checkbox which will enable/disable rpe and grey it out/disable if rpe is not supported.
- Currently you have GET:
boot/capabilities/:guid(where is this used?) , POST:boot/rpe/:guid, and POST:remoteErase/:guidendpoints added. Consolidate this to GETboot/remoteErase/:guid-- which will fetch the supported capabilities
and POSTboot/remoteErase/:guidwhich will perform the desired action
{
"secureEraseAllSSDs": true,
"tpmClear": true,
"restoreBIOSToEOM": true,
"unconfigureCSME": true
}Note important removal of any mask representation of features. This will mean the UI needs to be updated with the new payload.
392e6ed to
f418e9c
Compare
2929555 to
72b55d3
Compare
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("")— clears any active boot source override before setting CSME reset flags (equivalent toClearBootOptionsin the Intel AMT C# SDK). Only called wheneraseMaskcontains no hardware TLV targets (tlvMask == 0); clearing the boot order when hardware targets are also present causes undefined BIOS 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)Testing
GetBootCapabilities,SetRPEEnabled,SendRemoteEraseuse-case functions and HTTP controller handlersSetFeaturestests extended to cover RPE + OCR state combinationsbuildRPETLVParamscovering individual hardware targets, combined masks, and CSME bit strippingNotes
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 bit0x10000) must be requested alone — it cannot be combined with hardware TLV targets (TPM, SSD, BIOS NVM, BIOS Reload) in one call. The UI enforces this; the backend additionally guardsChangeBootOrderfrom firing whentlvMask != 0to prevent silently poisoning hardware targets if the API is called directly with a combined maskUefiBootParametersArraymust 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