fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Add automation for Android wipe on personally-owned (BYOD) hosts

Open terry-kwok-code opened this issue 1 month ago • 0 comments

Context: #53471

Wipe is now allowed for all Android hosts, including personally-owned (BYOD) hosts, on Fleet Free and Premium. On BYOD, wipe removes only the work profile; on company-owned it wipes the whole device.

Add automation (Playwright UI + API) for the following, using simulated Android hosts (one BYOD "On (personal)", one company-owned "On (automatic)"):

UI — Host details > Actions (Free and Premium)

  • BYOD Android host: shows Unenroll, no Wipe.
  • Company-owned Android host: shows Wipe, no Unenroll.

API — wipe on BYOD (Free and Premium)

  • POST /api/v1/fleet/hosts/{id}/wipe on a BYOD host → 200 with pending_action: "wipe" (regression: was 400). Same on /api/latest.
  • POST /api/v1/fleet/commands/run with base64 {"type":"WIPE","wipeParams":{}} → 200, request_type: "WIPE".
  • Second wipe while one is pending → 422 "Host has pending wipe request".
  • Host with MDM off → 422 "doesn't have MDM turned on" (wipe endpoint) / 412 (/commands/run).

API — company-owned regression (Free and Premium)

  • POST /api/v1/fleet/hosts/{id}/wipe → 200; GET /hosts/{id} shows pending_action: "wipe" (not hidden).

API — Premium gating (Free)

  • Wipe on macOS / Windows / Linux hosts still returns 402 "Requires Fleet Premium license".

API — permissions (Premium)

  • Global/fleet admin and maintainer: allowed.
  • Observer, technician, GitOps: 403.
  • Host in another fleet: 404 (wipe endpoint) / 403 (/commands/run).

Out of scope (real-device only): work profile removal on the device, offline/airplane-mode behavior, wipeReason text on the device.

terry-kwok-code avatar Oct 20 '26 19:10 terry-kwok-code