fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Choose default fleet for iOS/iPadOS hosts that enroll via Account-driven User Enrollment (BYOD)

Open marko-lisica opened this issue 1 year ago • 8 comments

Goal

User story
As an IT admin,
I want to automatically add iOS/iPadOS hosts that enroll via Account-driven User Enrollment (BYOD) to a fleet
so that I can make sure iPhones/iPads automatically get the right configuration profiles and software.

Changes

Product

  • [x] UI changes: Figma
  • [x] CLI (fleetctl) usage changes: No changes
  • [x] YAML changes: https://github.com/fleetdm/fleet/pull/48171
  • [x] REST API changes: https://github.com/fleetdm/fleet/pull/45379
  • [x] Fleet's agent (fleetd) changes: No changes
  • [x] Fleet server configuration changes: No changes
  • [x] Exposed, public API endpoint changes: https://github.com/fleetdm/fleet/pull/45618
  • [x] fleetdm.com changes: No changes
  • [x] GitOps Mode UI changes: The byod_fleet field should appear as read-only in the ABM settings UI when GitOps mode is enabled (same as existing)
  • [x] GitOps generation changes: fleetctl generate-gitops output must include the byod_fleet field
  • [x] Activity changes: No changes
  • [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
  • [ ] Once shipped, requester has been notified
  • [x] Once shipped, dogfooding issue has been filed

Engineering

  • [x] Test plan is finalized
  • [x] Contributor API changes: https://github.com/fleetdm/fleet/pull/45618
  • [x] Feature guide changes: https://github.com/fleetdm/fleet/pull/45375
  • [x] Database schema migrations: See subtasks

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

QA

Risk assessment

  • 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.

Note: Make sure to set the default iOS/iPadOS MDM server to your server while testing. Unset it when done! and drop a note in #help-dogfooding when you're doing it so people know what to expect

Core flow

  • [x] Set a default fleet for BYOD iOS/iPadOS enrollment via the AB settings UI. Verify hosts enrolling via account-based user enrollment land in that fleet
  • [x] Ensure VPP apps and profiles can be pushed to hosts after enrollment
  • [x] Change the byod_fleet to a different fleet. Verify newly enrolling BYOD hosts go to the updated fleet
  • [x] Clear/unset byod_fleet. Verify BYOD-enrolled hosts fall back to expected default behavior (e.g., unassigned)
  • [x] Verify existing AB fields (macos_fleet, ios_fleet, ipados_fleet) are unaffected by the new byod_fleet field
  • [x] With multiple AB tokens configured, verify byod_fleet can be set independently per AB token

UI

  • [x] Verify that all UI changes specified in the Figma wireframes are correctly implemented
  • [x] Verify expected UI states (loading, empty, error states if applicable)
  • [x] Verify long fleet names render correctly in the byod_fleet dropdown (responsiveness consideration)
  • [x] Verify the field appears correctly in GitOps mode (read-only with tooltip)
  • [x] Verify behavior when the fleet assigned to byod_fleet is deleted

Host lifecycle

  • [x] Transfer a BYOD-enrolled host to another fleet manually. Verify it works and doesn't conflict with the default
  • [x] Delete a host that was auto-assigned via byod_fleet and verify clean removal
  • [x] Re-enroll a previously deleted BYOD host. Verify it lands in the currently configured byod_fleet

API

  • [x] Verify that AB token endpoints return byod_team and byod_fleet and that either byod_team or byod_fleet can be used

GitOps (generate + run)

  • [ ] Configure byod_fleet through the UI and run fleetctl generate-gitops
  • [ ] Confirm the generated .yml includes the byod_fleet field under the ABM config
  • [x] Modify the byod_fleet value in .yml and run fleetctl gitops and confirm it updates correctly
  • [x] Remove the byod_fleet key from .yml and run fleetctl gitops and confirm it unsets or uses default
  • [x] Enable GitOps mode and verify the byod_fleet setting is read-only in the UI

Permissions

  • [x] Global Admin: can set/change/clear byod_fleet
  • [x] Global Maintainer: verify expected access (likely read-only or no access to ABM settings)
  • [x] Global Observer / Observer+: cannot modify byod_fleet
  • [x] Fleet-level Admin/Maintainer/Observer: verify appropriate restrictions
  • [x] GitOps user: can set byod_fleet via fleetctl gitops
  • [x] API-only user: can call the endpoint with appropriate role

Supplemental testing

Testing notes

Confirmation

  1. [x] 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": TO DO

marko-lisica avatar Jul 15 '25 10:07 marko-lisica

Related: https://github.com/fleetdm/fleet/issues/31748

allenhouchins avatar Aug 08 '25 19:08 allenhouchins

@JordanMontgomery Is this still 4.87 or actually 4.88?

MagnusHJensen avatar May 29 '26 08:05 MagnusHJensen

@MagnusHJensen I think this got pushed out of 4.87 but still a good candidate if we can pull it in.

JordanMontgomery avatar May 29 '26 13:05 JordanMontgomery

Validated

  • Set a BYOD default fleet in the Apple Business settings -> BYOD iPhone/iPad enrollments land in correct fleet.
  • Config profiles and apps scoped to the fleet reach the device after enrollment.
  • Change the BYOD fleet -> newly enrolling devices go to the new fleet (already-enrolled devices stay put).
  • Clear the BYOD fleet -> new BYOD devices fall back to No team.
  • The existing macOS/iOS/iPadOS fleet settings are unaffected by the new BYOD setting.
  • Unable to directly test multiple AB tokens, but verified by Claude.

UI

  • The BYOD fleet dropdown appears in the Edit fleets modal as designed, alongside macOS/iOS/iPadOS.
  • Long fleet names render cleanly in the dropdown (no cut-off or layout break).
  • In GitOps mode the setting is read-only (Edit fleets is disabled with the GitOps tooltip).
  • Deleting the fleet that's set as the BYOD fleet resets the setting to No team.
  • ☑Loading/empty/error states - spot-checked only (standard behavior; low risk).

Host lifecycle

  • Manually moving a BYOD device to another fleet works and doesn't fight the default setting.
  • Deleting a BYOD device removes it cleanly.
  • Re-enrolling a device lands it in the currently configured BYOD fleet. (Note: re-enrolling a BYOD device shows up as a new host record - expected for personal/Apple account-driven enrollment.)

API

  • The AB token endpoints return both byod_team and byod_fleet, and either name can be used to set the value.

GitOps

  • The BYOD fleet value is accepted in the GitOps config and reads back correctly; a GitOps user is allowed to set it; GitOps mode makes it read-only in the UI (as above).
  • Note: Acceptance criteria states that fleetctl generate-gitops should include the BYOD fleet in the .yml. Fleet assignment can be set through the UI, however fleetctl generate-gitops doesn't include the BYOD fleet in the exported file. This is pre-existing and affects all the AB fleet fields, not just BYOD. Not considering a blocker, but need input from product team to determine if this is a bug or feature request.

Permissions

  • Global Admin can set/change/clear the BYOD fleet.
  • Global Maintainer, Observer, and Observer+ cannot (no access to AB token settings).
  • Fleet-level Admin/Maintainer/Observer cannot (global-only settings).
  • GitOps user can set it via GitOps.

Free

  • On Fleet Free, the Apple Business page shows the "included in Fleet Premium" upgrade message and the API cleanly reports Premium is required - no errors.

chrstphr84 avatar Jul 02 '26 16:07 chrstphr84

Found during testing: https://github.com/fleetdm/fleet/issues/48653

This is an existing issue and does not block release.

chrstphr84 avatar Jul 02 '26 22:07 chrstphr84

@andreasn-work @pintomi1989 Assigning this to you to notify your customer this was shipped. Feel free to close this issue after you've done that!

ddribeiro avatar Jul 22 '26 16:07 ddribeiro

Notified the customer, closing now

pintomi1989 avatar Jul 22 '26 16:07 pintomi1989

Fleet now guides iPhones, Configuration ease, like sun, Rising, day's begun.

fleet-release avatar Jul 22 '26 16:07 fleet-release