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 44.45% 49.72% +5.27%
==========================================
Files 144 146 +2
Lines 13732 13455 -277
==========================================
+ Hits 6105 6691 +586
+ Misses 7054 6184 -870
- Partials 573 580 +7 ☔ View full report in Codecov by Harness. 🚀 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.
13fe475 to
25c62da
Compare
…TART=5 should be used after RPE
2cf841c to
f49203a
Compare
|
Postman collections not updated — CLAUDE.md requires Gin handler + Fuego declaration + Postman in the same PR. integration-test/collections/console_mps_apis.postman_collection.json still references remoteErase in the features body and has no entries for the two new boot/remoteErase/:guid endpoints. |
|
@nmgaston I checked the AMT SDK documentation, and bit 16 ( This means the current capability check is using an unrelated bit to decide whether CSME unconfigure is supported. CSME unconfigure appears to use the Could we confirm the intended feature here?
It would also be good to replace the two separate |
Removed the bit 16 and using ConfigurationDataReset. We aren't supporting OEM Custom Action at this time. Fixed the magic number. |
ec6ed84 to
746081c
Compare
should be updated now. |
0b82049 to
d3507fe
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 29 out of 32 changed files in this pull request and generated 1 comment.
Files not reviewed (3)
- internal/mocks/devicemanagement_mocks.go: Generated file
- internal/mocks/wsman_mocks.go: Generated file
- internal/mocks/wsv1_mocks.go: Generated file
Suppressed comments (5)
internal/usecase/devices/boot.go:32
uc.log.Debugis printf-style (see pkg/logger/logger.go) and will treat the extra "key/value" arguments as extra formatting args, producing%!(EXTRA ...)in logs because the message has no format verbs. Format the values into the message string instead of passing structured args.
uc.log.Debug("getRemoteEraseCapabilities: PlatformErase capability", "guid", guid, "PlatformErase", capabilities.PlatformErase, "supported", capabilities.PlatformErase != 0, "ConfigurationDataReset", capabilities.ConfigurationDataReset)
internal/entity/dto/v1/getfeatures.go:16
- This changes the v1 response field name from
remoteErasetorpe(and addsrpeSupported). Renaming a JSON field in/api/v1/*is a breaking contract change for existing integrators; consider keepingremoteEraseas a backwards-compatible alias (and mapping it to/from the new RPE fields) rather than removing it outright.
LocalPBABootSupported bool `json:"localPBABootSupported" binding:"required" example:"false"`
RPE bool `json:"rpe" binding:"required" example:"false"`
RPESupported bool `json:"rpeSupported" example:"false"`
internal/entity/dto/v2/features.go:29
- The v2
FeaturesDTO renamesremoteErasetorpeand addsrpeSupported. If/api/v2/amt/features/:guidhas any existing consumers, this is a breaking response shape change; consider keeping the existingremoteErasefield (deprecated) while adding the new RPE fields, or bumping the endpoint/version.
OCR bool `json:"httpBoot" example:"true"`
HTTPSBootSupported bool `json:"httpBootSupported,omitempty" example:"true"`
WinREBootSupported bool `json:"winREBootSupported,omitempty" example:"true"`
LocalPBABootSupported bool `json:"localPBABootSupported,omitempty" example:"true"`
RPE bool `json:"rpe" example:"true"`
RPESupported bool `json:"rpeSupported" example:"true"`
}
internal/controller/httpapi/v1/boot.go:43
- The OpenAPI adapter models this endpoint as
NoContentResponse(HTTP 204), but the Gin handler currently returns200with anullJSON body. Align the runtime response code/body with the OpenAPI contract (or update the OpenAPI declaration/tests if 200 is intended).
if err := r.d.SetRemoteEraseOptions(c.Request.Context(), guid, req); err != nil {
r.l.Error(err, "http - v1 - setRemoteEraseOptions")
ErrorResponse(c, err)
return
}
c.JSON(http.StatusOK, nil)
}
internal/entity/dto/v1/features.go:37
Features/FeaturesRequestin v1 renameremoteErase→rpe. Because/api/v1/amt/features/:guidboth accepts and returns this DTO, this is a breaking request/response shape change. KeepremoteEraseworking (e.g., accept both on input and emit an alias) and treatrpe/rpeSupportedas additive fields.
OCR bool `json:"ocr" example:"true"`
HTTPSBootSupported bool `json:"httpsBootSupported" example:"true"`
WinREBootSupported bool `json:"winREBootSupported" example:"true"`
LocalPBABootSupported bool `json:"localPBABootSupported" example:"true"`
RPE bool `json:"rpe" example:"true"`
RPESupported bool `json:"rpeSupported" example:"true"`
}
type FeaturesRequest struct {
UserConsent string `json:"userConsent" example:"kvm"`
EnableSOL bool `json:"enableSOL" example:"true"`
EnableIDER bool `json:"enableIDER" example:"true"`
EnableKVM bool `json:"enableKVM" example:"true"`
OCR bool `json:"ocr" example:"true"`
RPE bool `json:"rpe" example:"true"`
}
5f9175b to
30a1316
Compare
feat(devices): add remote platform erase support
NOTE: Requires real AMT 16.0+ hardware with RPE BIOS support for end-to-end testing.
Related PRs
Required for RPE TLV parameter types and
NewUint32ParameterFrontend changes for the RPE UI
Summary
This PR adds support for Intel Remote Platform Erase (RPE), a CSME 16.0+ feature that allows remote administrators to securely erase supported platform storage components on the next boot.
The implementation adds new API endpoints, updates feature handling to track RPE state and support, and adds the WS-Man logic needed to trigger erase operations safely.
What’s new
New API endpoints
GET/api/v1/amt/boot/remoteErase/:guidPOST/api/v1/amt/boot/remoteErase/:guidNew DTO fields
The feature and request payloads now use
rpeterminology instead of the olderremoteErasefield.Added/updated fields:
rpe: whether RPE is currently enabledrpeSupported: whether the device BIOS supports RPERPE execution flow
The backend now performs the RPE setup in a firmware-safe sequence:
PlatformErase=trueTLV encoding
When hardware erase targets are selected, the request bitmask is encoded into a single TLV entry and base64-encoded into
UefiBootParametersArray.Boot state handling
SetFeaturesnow understands both OCR and RPE and computes the correct boot-service state for:RPE is configured before the boot-service state change to avoid firmware blocking the erase update.
Implementation updates
HTTP / OpenAPI
Device feature logic
WS-Man support
PowerOnif the device is currently offPowerCycleOffHardotherwiseRefactoring / cleanup
context.ContextTesting
Notes
0x10000is used as a UI-level sentinel for Unconfigure Intel CSME Firmware. It is not sent as a TLV target bit.UefiBootParametersArraymust be present whenPlatformErase=true.PowerCycleOffHardis required for erase execution; warm reset does not fully power-cycle the platform.