fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Manually enroll personal (BYOD) Apple (macOS, iPhones, iPads) w/ IT admin permissions equivalent to Account-driven User Enrollment

Open noahtalerman opened this issue 2 years ago • 28 comments

Goal

User story
As an IT admin who enrolls personal (BYOD) Macs, iPhones, or iPads via a manual enrollment profile,
I want my end users to download/install an enrollment profile that gives IT admin permissions equivalent to BYOD devices that enroll via Account-driven User Enrollment
so that my end users know their personal data won't get deleted and they won't get locked out when they enroll to Fleet.

Changes

Product

  • [x] UI changes: Figma
  • [x] CLI (fleetctl) usage changes: No changes
  • [x] YAML changes: No changes
  • [x] REST API changes: https://github.com/fleetdm/fleet/pull/46835
    • Personal (BYOD): mdm.enrollment_status: On (manual - personal)
    • Company-owned: mdm.enrollment_status: On (manual)
      • use existing "On (manual)" as the default today is "company-owned"
  • [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: No changes
  • [x] Permissions changes: No changes
  • [x] Changes to paid features or tiers:
    • Showing the access rights on the Host details page is Fleet Free and Fleet Premium
    • Showing the disabled menu action is Fleet Premium only
  • [x] My device and fleetdm.com/better changes:
    • https://github.com/fleetdm/fleet/pull/46088
    • update BYO to BYOD: https://github.com/fleetdm/fleet/pull/46761
  • [x] Usage statistics: No changes
  • [x] Other reference documentation changes: No changes
  • [x] First draft of test plan added
  • [ ] Once shipped, requester has been notified
  • [ ] Once shipped, dogfooding issue has been filed

Engineering

  • [ ] Test plan is finalized
  • [ ] Contributor API changes: None
  • [ ] Feature guide changes: Add a new sub-section to "Advanced" section on the "Enroll hosts" guide that describes how "Access rights" work (Fleet passes them through to the manual enrollment profile) and how to figure out permissions based on the code: https://developer.apple.com/documentation/devicemanagement/mdm
  • [ ] Database schema migrations: https://github.com/fleetdm/fleet/pull/46125
  • [ ] Load testing: This should not trigger any load events
  • [ ] Pre-QA load test: None
  • [ ] Load testing/osquery-perf improvements: None
  • [ ] This is a premium only feature: No

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

Risk assessment

  • Requires load testing: No
  • Risk level: Low

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.

Core flow

Host

  • [x] Enroll iOS/iPadOS/macOS via manual profile with "Personal (BYOD)" selected. Verify API returns mdm.enrollment_status: On (manual - personal).
  • [x] Enroll via manual profile with "Company-owned" selected. Verify API returns mdm.enrollment_status: On (manual).
  • [x] DEP enrollment: Verify API returns mdm.enrollment_status: On (automatic).

Add Host modal (macOS, iOS, & iPadOS)

  • [x] Radio button displays "Personal (BYOD)" and "Company-owned" options
  • [x] Selecting each option serves the correct enrollment page with appropriate download button
  • [x] Default selection state to "Personal (BYOD)"
  • [x] Keyboard accessibility for radio buttons

Add Host modal (Android)

  • [x] Radio button displays "Personal (BYOD)" and "Company-owned (fully-managed)" options

Enrollment page

  • [x] "Personal (BYOD)" tab: download button enrolls with restricted access rights (no wipe, lock, clear passcode)
  • [x] "Company-owned" tab: download button enrolls with full access rights (wipe, lock, clear passcode allowed)

Host details page > MDM status modal

  • [x] Personal (BYOD): shows "On (manual - personal)" with tooltip: "Enrolled with a manual enrollment profile as a personal (BYOD) device. IT admins cannot wipe this device or lock the end user out."
  • [x] Company-owned: shows "On (manual)" with tooltip: "Enrolled with a manual enrollment profile as a company-owned device. IT admins can wipe this device and enforce all MDM restrictions."

Paid tiers

  • [x] Verify radio button availability on Free and Premium

Platforms

  • [x] macOS, iOS, iPadOS

API

  • [x] Personal (byod): Test wipe, lock, clear passcode fail with forbidden/shouldn't send commands on macOS, iOS, and iPadOS

  • [x] Company-owned: Test wipe, lock, clear passcode allowed to send commands on macOS, iOS, and iPadOS

  • [x] Upgrade from prior version with manually enrolled hosts. Verify proper enrollment status shows. Wipe, lock, clear passcode succeed.

  • [ ] SCEP renewal for manually enrolled hosts (byod and company owned) and DEP hosts.

Supplemental testing

Testing notes

Confirmation

  1. [ ] Engineer: Added comment to user story confirming successful completion of test plan (include any special setup, test data, or configuration used during development/testing if applicable).
  2. [x] QA: Added comment to user story confirming successful completion of test plan.
  3. [ ] QA: Determined whether this story needs Playwright automation.
    • Needs automation: Yes / No
    • If yes, filed a follow-up issue in the :help-qa project with status "Needs automation":

noahtalerman avatar Oct 25 '24 15:10 noahtalerman

Heads up that this story overlaps with this request: https://github.com/fleetdm/fleet/issues/19329 as user initiated enrollment comes with the inability to lock/wipe. @noahtalerman

mostlikelee avatar Nov 13 '24 19:11 mostlikelee

Looked at Apple docs and whether a device can be wiped depends on whether the AllowDeviceErase access right was conferred for the MDM profile (traced back from the endpoint).

Currently we set that flag across all Apple platforms, so BYOD iOS/iPadOS devices are wipeable. Based on discussions today during estimation, macOS BYOD devices should remain wipeable.

@noahtalerman are profile tweaks based on target device platform in scope here (so admins can't do an end-run around no-wipe by issuing a custom MDM command), or is blocking the wipe command at the endpoint level sufficient? From a quick look at our profile delivery code, we don't take device type into account at all right now, so building that in will require a nonotrivial amount of work (given that macOS still needs the existing set of access rights).

iansltx avatar Nov 13 '24 20:11 iansltx

@iansltx when an end user downloads the profile what do they see when they try to install it? Is there any messaging around the organization having wipe permissions?

If yes, then I think we want to tweak the profile.

Now that I'm thinking about it, I think it makes sense to also remove wipe for macOS. Contractors w/ BYOD Macs don't want Fleet to be able to wipe their device.

@rachaelshaw what do you think? Probably requires some UI changes for turning MDM on macOS flow and user story updates.

noahtalerman avatar Nov 15 '24 17:11 noahtalerman

@rachaelshaw bringing this one to the next Endpoint ops design review for expedited drafting.

noahtalerman avatar Nov 15 '24 17:11 noahtalerman

FYI @sharon-fdm ^

noahtalerman avatar Nov 15 '24 17:11 noahtalerman

FWIW Apple treats device profiles differently between macOS and iOS: BYOD profiles on Macs mark the machine as Supervised (which gives more control), while iOS/iPadOS BYOD profile installs do not. Maybe we want to be pickier on this and say "if you want a Mac wipeable you have to go through the steps to enroll that Mac in ABM" but at least Apple is more permissive on what sideloaded profiles can do when we aren't talking about a phone/tablet.

I don't know off the top of my head what a profile shows when enrolling via iOS. Will check on macOS with our existing profile shortly.

iansltx avatar Nov 15 '24 18:11 iansltx

Checked with macOS (15.0.1) and it actually doesn't show which permissions the MDM profile gives anywhere in the installation process, including when clicking into various verification/details screens. So it's effectively a case of "do you trust whoever gave you this profile" rather than actually showing the permissions the profile gives.

@PezHub Is there any permissions detail list you can get to on iOS/iPadOS?

This is a little surprising to me as I recently backed out of an MDM profile install process on Android because it explicitly called out that the profile would've given permission to wipe my device, but this may be a case that too many MDM profiles are out there that confer way more permissions than they need, and Apple didn't want to freak everyone out?

iansltx avatar Nov 16 '24 00:11 iansltx

Hi @iansltx , yes there is but the user cannot see them until AFTER they install the profile. We do however present them with a warning prior to install which they have to "accept" by clicking install again. Once the profile is loaded they can navigate to More Details > mobile device management > then scroll down to see the rights that fleet has:

Warning message - IMG_0001

Profile Details - IMG_0002

Rights - IMG_0003

PezHub avatar Nov 21 '24 04:11 PezHub

@rachaelshaw, this was already estimated. Could you please give a TL;DR so I'll consider if we need to re-spec / re-estimate?

Meaning: Any dramatic change here or some additions that the engineers can pick up?

sharon-fdm avatar Nov 25 '24 16:11 sharon-fdm

@sharon-fdm changed this to include BYOD macOS as well, so might affect the estimation

rachaelshaw avatar Nov 25 '24 17:11 rachaelshaw

While preventing device wipe is important, it's not the only concern when it comes to enrolling personally-owned devices (BYOD) via profile-driven enrollment, which is the enrollment method we currently support. Admins should not be able to:

  • list all apps installed on a device
  • get device location information
  • turn on lost mode
  • manage activation lock
  • access roaming status
  • require complex passcodes or passwords
  • take over management of personal apps or remove apps not marked as "managed"

Given that profile-driven enrollment is an outdated method for BYOD scenarios, it creates user privacy concerns, and it deviates from Apple’s best practices, could you share the rationale behind prioritizing this feature? Prioritizing user enrollment not only better aligns with privacy expectations but also significantly reduces admin complexity -- as well as our own engineering efforts. User enrollment inherently separates personal and corporate data, eliminating the need for admins to manage multiple profile types and us creating a UI or functionality for managing this pseudo-BYOD management method.

Trying to manipulate profile driven enrollment into a solution for BYOD is like forcing a square peg in a round hole. The three methods of enrollment that we need to support is ABM/DEP-driven (company-owned devices), profile-based enrollment (company-owned devices not part of an automatic enrollment program), and user-enrolled devices (BYO). The work being done here is introducing a 4th and, in my opinion, unnecessary enrollment method that is going to have lasting tech debt and create customer overhead.

allenhouchins avatar Jan 10 '25 15:01 allenhouchins

@georgekarrv @ghernandez345 Please make sure to add a test plan before bringing this into a sprint. Thanks!

lukeheath avatar Feb 13 '25 00:02 lukeheath

After reviewing the sub-tasks, they are missing the :product label so they were not included in the estimation when pulling in out available capacity so they will have to kick something else out to fit in. I'll review with Noah on priorities

georgekarrv avatar Mar 03 '25 17:03 georgekarrv

FYI @marko-lisica decided to keep this story prioritized because we want to enroll our iPhones in dogfood ASAP.

noahtalerman avatar Mar 04 '25 18:03 noahtalerman

We didn't have room to build this user story in the upcoming 4.70 sprint. De-prioritizing and removing it from the drafting board to make room for other stories.

FYI @allenhouchins, since this is a user story, I also added customer-sarahwu to the feature request issue here: #22882

noahtalerman avatar May 29 '25 13:05 noahtalerman

FYI @georgekarrv ^

noahtalerman avatar May 29 '25 13:05 noahtalerman

Moved the old issue description here:

Changes

Product

  • [x] UI changes: Figma
  • [x] CLI (fleetctl) usage changes: Figma
  • [x] YAML changes: No changes
  • [x] REST API changes: No documented changes; there is a new validation error when attempting to wipe an iOS/iPadOS host with a BYOD profile.
  • [x] Fleet's agent (fleetd) changes: No changes
  • [x] Activity changes: No changes
  • [x] Permissions changes: No changes
  • [x] Changes to paid features or tiers: No changes
  • [x] Other reference documentation changes: No changes
  • [ ] Once shipped, requester has been notified

Engineering

  • [x] Feature guide changes: No changes
  • [ ] Database schema migrations: If there is no existing field to determine a BYOD device, we will need to add it with a proper migration.
  • [ ] Load testing: If adding a new field to the DB, consider load test. (I do not think it's a big change but will leave it to the developer descrition.)
  • [ ] Specification: See sub_tasks
  • [ ] Test-plan - To be created by the DRI engineer and approved by QA person

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

QA

Risk assessment

  • Requires load testing: TBD, likely NO
  • Risk level: Low
  • Risk description:

Manual testing steps

  1. Confirm new BYOD radio button appears and shows URL
  2. Confirm Company-owned radio button matches Figma and Learn more Link resolves
  3. Make sure updated Enrollment landing page has updated text
  4. On Host's detail page, ensure wipe command is greyed out and tooltip is accurate
  5. Make sure GitOps workflow is prohibited and displays correct error
  6. Make sure error displays when attempting to wipe via API
  7. Once the profile is installed on the device, check the details to ensure the rights are accurate
  8. Test macOS, iOS, and iPadOS

noahtalerman avatar May 21 '26 13:05 noahtalerman

@JordanMontgomery for enrolled devices, would we be able to enable this config or does it need to be unenrolled and re-enrolled to receive this update?

zayhanlon avatar May 26 '26 18:05 zayhanlon

Is this not in-progress and should be assigned to @georgekarrv and moved to the MDM sprint board?

MagnusHJensen avatar May 27 '26 12:05 MagnusHJensen

Yup fair

georgekarrv avatar May 27 '26 13:05 georgekarrv