fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Android commands: Lock, wipe, & clear passcode

Open noahtalerman opened this issue 8 months ago • 18 comments

Goal

User story
As an IT admin looking at an Android host on the Host details page,
I want to see buttons for lock, wipe, and clear passcode
so that I can run these commands.

Video demo: https://www.youtube.com/watch?v=OK2K5EII0sA Unenroll/wipe Android on Fleet Free: https://www.youtube.com/watch?v=JvsD3WBcDgE

Changes

Product

  • [x] UI changes: Figma
  • [x] CLI (fleetctl) usage changes:
    • fleetctl mdm lock, and fleetctl mdm wipe should support Android hosts (no new subcommands needed). Add a new fleetctl mdm clear-passcode --host $HOST.
  • [x] YAML changes: No changes
  • [x] REST API changes: #45516
  • [x] Fleet's agent (fleetd) changes: No changes
  • [x] Fleet server configuration changes: No changes
  • [x] Exposed, public API endpoint changes: No changes
  • [x] fleetdm.com changes: No changes
  • [x] GitOps mode UI changes: No changes
  • [x] GitOps generation changes: No changes
  • [x] Activity changes:
    • Confirm that wipe, lock, and clear passcode activities also show up for Android activities.
  • [x] Permissions changes: No changes
  • [x] Changes to paid features or tiers: No changes
  • [x] My device and fleetdm.com/better changes: No changes
  • [x] Usage statistics: No changes
  • [x] Other reference documentation changes: No changes.
  • [x] First draft of test plan added
  • [x] Once shipped, requester has been notified
  • [x] Once shipped, dogfooding issue has been filed https://github.com/fleetdm/fleet/issues/48097

Engineering

  • [ ] Test plan is finalized
  • [ ] Contributor API changes: No changes
  • [ ] Feature guide changes: Update https://fleetdm.com/guides/lock-wipe-hosts
  • [ ] Database schema migrations: Yes
  • [ ] Load testing: Yes
  • [ ] Pre-QA load test: TODO
  • [ ] Load testing/osquery-perf improvements: TODO
  • [ ] This is a premium only feature: Yes / No

ℹ️  Please read this issue carefully and understand it. Pay special attention to UI wireframes, especially "dev notes".

Risk assessment

  • Requires testing in a hosted environment: TODO
  • Requires load testing: TODO
  • Risk level: Low / High TODO
  • Risk description: TODO

Test plan

Make sure to go through the list and consider all events that might be related to this story, so we catch edge cases earlier.

Host details > Actions

  • [ ] If "Lock", "Unenroll", "Wipe", or "Clear passcode" is pending, hide options in menu ("Lock", "Unenroll", "Wipe", or "Clear passcode" ).
  • [ ] If BYO or company-owned/fully managed has MDM disabled, hide options from menu ("Lock", "Unenroll", "Wipe", or "Clear passcode" ).

For BYO Android hosts:

  • [ ] Confirm options for "Clear passcode" and "Lock" appear in actions menu.
  • [ ] Modal "Clear passcode" or "Lock" button is disabled until checkbox is clicked.
  • [ ] Confirm "Clear passcode" removes current passcode on work profile.
  • [ ] Confirm "Lock" locks the host screen and user's passcode can unlock host.

For company-owned/fully managed Android hosts:

  • [ ] Confirm options for "Clear passcode", "Wipe", and "Lock" appear in actions menu.
  • [ ] Modal "Clear passcode", "Wipe", or "Lock" button is disabled until checkbox is clicked.
  • [ ] Confirm "Clear passcode" removes current passcode on host.
  • [ ] Confirm "Wipe" removes everything (usually goes into a factory reset).
  • [ ] Confirm "Lock" locks the host screen and user's passcode can unlock host.

Global activity

  • [ ] Confirm new type: Clear passcode
  • [ ] Confirm activities logged for: locked, wiped (for company-owned/fully managed), unenrolled (for BYOD), clear passcode.

Host activity

  • [ ] Confirm activities logged for: locked, wiped (for company-owned/fully managed), unenrolled (for BYOD) clear passcode.

Testing notes

Confirmation

  1. [ ] Engineer: Added comment to user story confirming successful completion of test plan.
  2. [ ] QA: Added comment to user story confirming successful completion of test plan.

noahtalerman avatar Mar 13 '26 20:03 noahtalerman

@melpike just chatted w/ Allen and Dale and they brought up a good point: we already do a good job handling wipe v. unenroll w/ iOS: BYO iOS is "Unenroll" and company-owned is "Wipe"

We think it makes sense to say the same for Android.

noahtalerman avatar Apr 02 '26 18:04 noahtalerman

BYO iOS is "Unenroll" and company-owned is "Wipe"

@noahtalerman It looks like company-owned has both "Unenroll" and "Wipe"—do want that for android as well?

Image

melpike avatar Apr 02 '26 19:04 melpike

TODO @melpike update issue description/Figma to not include any iOS changes.

lukeheath avatar Apr 13 '26 14:04 lukeheath

This went through drafting, and is ready to be implemented.

marko-lisica avatar May 14 '26 19:05 marko-lisica

Host details

  • [ ] If host is pending wipe, show "Wipe pending" badge next to host name until out of pending (like we do for iOS/iPadOS)
  • [ ] If host wipe command is successful, show "Wiped" badge next to host name (like we do for iOS/iPadOS).

@getvictor and I decided to cut the badges. FYI @AndreyKizimenko @marko-lisica

noahtalerman avatar May 20 '26 14:05 noahtalerman

Global activity

  • [ ] Confirm new type: Clear passcode
  • [ ] Confirm activities logged for: locked, wiped (for company-owned/fully managed), unenrolled (for BYOD), clear passcode.

Host activity

  • [ ] Confirm activities logged for: locked, wiped (for company-owned/fully managed), unenrolled (for BYOD) clear passcode.

FYI @marko-lisica added the bit about "unenrolled"

noahtalerman avatar May 20 '26 14:05 noahtalerman

Host details

  • [ ] If host is pending wipe, show "Wipe pending" badge next to host name until out of pending (like we do for iOS/iPadOS)[ ] If host wipe command is successful, show "Wiped" badge next to host name (like we do for iOS/iPadOS).

@getvictor and I decided to cut the badges. FYI @AndreyKizimenko @marko-lisica

I'm reversing the "cut badges" decision and also modifying badges. Why? Because this is the standard way we show IT admin what's happening with the device (and why some device actions are not available).

Cut: Locked (because Android can't tell when device is unlocked)

Implement (matching other platforms): Lock pending, Wipe pending, Wiped

Add (only for Android): Unenroll pending (Wipe pending but for BYO devices), Clear passcode pending (because this blocks other menu actions)

FYI: @lukeheath

getvictor avatar May 26 '26 16:05 getvictor

Another design change.

I'm changing the destructive red color of Lock modal options to the default black/green color to match the Lock modals of other platforms. Noting here since it is taking me too long to figure out how to do this change in Figma.

cc: @AndreyKizimenko @lukeheath

getvictor avatar May 26 '26 18:05 getvictor

We are replacing Android corporate-own Unenroll with Wipe. However, Unenroll is Free tier, while Wipe is Premium. So, this is a regression for Free users. This is probably fine. Free users can still call the old unenroll using the API, just not via the UI.

cc: @marko-lisica @lukeheath

EDIT: Android Free users see "Unenroll" today, so removing "Unenroll" from Android BYOD dropdown is also inconsistent.

getvictor avatar May 27 '26 19:05 getvictor

Other design changes.

Figma states this:

Image

However, I will use the existing messages we use for other platforms, which are almost identical:

  • Successfully sent request to clear passcode on this host.
  • Couldn't send request to clear passcode on this host. Please try again.

I will add the Clear passcode confirm checkbox to other platforms, and not just Android.

getvictor avatar May 27 '26 22:05 getvictor

@marko-lisica Please review design decisions made by Victor and team while you were out. Victor added comments with decisions.

lukeheath avatar Jun 01 '26 14:06 lukeheath

@getvictor feedback on the changes above:

Add (only for Android): Unenroll pending (Wipe pending but for BYO devices), Clear passcode pending (because this blocks other menu actions)

I think we should do this the same way as on iOS. When the user selects "unenroll", Fleet sends a command and flips MDM status to "off" and disables relevant actions. The host might not receive the command, but as soon as it gets online, it will wipe the work profile.

I'm changing the destructive red color of Lock modal options to the default black/green color to match the Lock modals of other platforms. Noting here since it is taking me too long to figure out how to do this change in Figma.

Sounds good to me.

We are replacing Android corporate-own Unenroll with Wipe. However, Unenroll is Free tier, while Wipe is Premium. So, this is a regression for Free users. This is probably fine. Free users can still call the old unenroll using the API, just not via the UI.

Can we keep "unenroll" for Fleet free only?

The comment regarding the copy changes for flash messages

Sounds good to me.

marko-lisica avatar Jun 01 '26 18:06 marko-lisica

@marko-lisica I have follow up questions, and we can discuss at standup. The iOS unenroll behavior sounds like a bug to me. unenroll=wipe for Android, so we need a matrix for unenroll/wipe vs BYOD/COBO vs what it actually does under the hood vs Free/Premium.

getvictor avatar Jun 01 '26 19:06 getvictor

From standup:

Marko: While there are some difference under the hood between wipe/unenroll based on Android/iOS and corporated owned vs BYOD, we want to abstract away those differences from the user because we don't think it will matter to them. We'd rather have a simple and consistent UX across platforms and devices, even if that means given up some fidelity on exactly what's happening under the hood.

Luke: If we're going to abstract that away, we should document somewhere simple (like in the guide) that there are subtle differences just so it's documented somewhere.

Victor: Right now the badges we display are correct and match the commands, and it seems like worse UX to change them to be wrong.

Next steps:

  • [ ] Remove "Unenroll pending" from the UI and API for Android BYOD so it is consistent with iOS BYOD.

@marko-lisica Please add a list with any additional changes that need to be made.

lukeheath avatar Jun 02 '26 15:06 lukeheath

QA Pass

Host details > Actions

  • [x] If "Lock", "Unenroll", "Wipe", or "Clear passcode" is pending, hide options in menu ("Lock", "Unenroll", "Wipe", or "Clear passcode" ).
  • [x] If BYO or company-owned/fully managed has MDM disabled, hide options from menu ("Lock", "Unenroll", "Wipe", or "Clear passcode" ).

For BYO Android hosts:

  • [x] Confirm options for "Clear passcode" and "Lock" appear in actions menu.
  • [x] Modal "Clear passcode" or "Lock" button is disabled until checkbox is clicked.
  • [x] Confirm "Clear passcode" removes current passcode on work profile.
  • [x] Confirm "Lock" locks the host screen and user's passcode can unlock host.

For company-owned/fully managed Android hosts:

  • [x] Confirm options for "Clear passcode", "Wipe", and "Lock" appear in actions menu.
  • [x] Modal "Clear passcode", "Wipe", or "Lock" button is disabled until checkbox is clicked.
  • [x] Confirm "Clear passcode" removes current passcode on host.
  • [x] Confirm "Wipe" removes everything (usually goes into a factory reset).
  • [x] Confirm "Lock" locks the host screen and user's passcode can unlock host.

Global activity

  • [x] Confirm new type: Clear passcode
  • [x] Confirm activities logged for: locked, wiped (for company-owned/fully managed), unenrolled (for BYOD), clear passcode.

Host activity

  • [x] Confirm activities logged for: locked, wiped (for company-owned/fully managed), unenrolled (for BYOD) clear passcode.

AndreyKizimenko avatar Jun 09 '26 22:06 AndreyKizimenko

Notified customer-rosner

pintomi1989 avatar Jun 24 '26 16:06 pintomi1989

notified customer-vesta

kellykroening avatar Jun 25 '26 16:06 kellykroening

Admins touch three keys Android devices respond control finds its way

fleet-release avatar Oct 12 '26 12:10 fleet-release