Skip to content

Add clear passcode action for iOS/iPadOS devices - #41539

Closed
kc9wwh wants to merge 10 commits into
mainfrom
27646-ios-clear-passcode
Closed

Add clear passcode action for iOS/iPadOS devices#41539
kc9wwh wants to merge 10 commits into
mainfrom
27646-ios-clear-passcode

Conversation

@kc9wwh

@kc9wwh kc9wwh commented Mar 12, 2026

Copy link
Copy Markdown
Member

Related issue: Resolves #27646, Resolves #39570

Summary

Adds a "Clear passcode" action for ADE-enrolled iOS/iPadOS devices in the host details actions dropdown. When an enrolled device sends its unlock token during MDM check-in, an admin or maintainer can remotely clear the device passcode without erasing the device. Fleet enqueues an MDM ClearPasscode command using the UnlockToken stored in nano_devices.

  • New POST /api/v1/fleet/hosts/:id/clear_passcode endpoint (EE only)
  • "Clear passcode" option appears in the host actions dropdown for ADE-enrolled iOS/iPadOS hosts connected to Fleet MDM
  • Option is disabled (greyed out with tooltip) until the device has sent its unlock token
  • Confirmation modal with checkbox before sending the command
  • Activity log entry on success

Checklist for submitter

  • Changes file added for user-visible changes in changes/27646-ios-clear-passcode
  • Input data is properly validated, SELECT * is avoided, SQL injection is prevented (using placeholders for values in statements), JS inline code is prevented especially for url redirects
  • If paths of existing endpoints are modified without backwards compatibility, checked the frontend/CLI for any necessary changes

Testing

@codecov

codecov Bot commented Mar 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.19178% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.42%. Comparing base (902b4af) to head (40bdf0c).
⚠️ Report is 688 commits behind head on main.

Files with missing lines Patch % Lines
.../hosts/details/HostDetailsPage/HostDetailsPage.tsx 0.00% 8 Missing ⚠️
server/service/client_mdm.go 0.00% 5 Missing ⚠️
server/datastore/mysql/nanomdm_storage.go 0.00% 4 Missing ⚠️
ee/server/service/hosts.go 95.34% 1 Missing and 1 partial ⚠️
server/datastore/mysql/apple_mdm.go 75.00% 2 Missing ⚠️
server/mdm/apple/commander.go 91.66% 1 Missing and 1 partial ⚠️
server/service/hosts.go 60.00% 1 Missing and 1 partial ⚠️
server/service/scripts.go 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #41539      +/-   ##
==========================================
+ Coverage   66.41%   66.42%   +0.01%     
==========================================
  Files        2504     2505       +1     
  Lines      200412   200558     +146     
  Branches     9047     9022      -25     
==========================================
+ Hits       133099   133224     +125     
- Misses      55280    55300      +20     
- Partials    12033    12034       +1     
Flag Coverage Δ
backend 68.21% <81.81%> (+<0.01%) ⬆️
frontend 54.46% <82.97%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kc9wwh
kc9wwh force-pushed the 27646-ios-clear-passcode branch from 407d265 to 42b3a91 Compare March 12, 2026 14:53
@kc9wwh
kc9wwh force-pushed the 27646-ios-clear-passcode branch from 42b3a91 to 04bc85c Compare March 12, 2026 15:03
@MagnusHJensen

MagnusHJensen commented Apr 7, 2026

Copy link
Copy Markdown
Member

@kc9wwh Just noticed this, which is my bad.

Feature is already made in other PR's, with the backend piece merged and frontend soon.
#43072 #43084
This PR also has merge conflicts, and the way it's done is not aligned with the API spec etc. So I'll close it out on that note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS/iPadOS: Clear passcode iOS/iPadOS: Clear passcode

3 participants