Closed roperzh closed 5 months ago
Investigating this a bit before sprint kickoff (not assigning myself just yet as I don't have the means to test those mac DEP enrollment flows by myself):
TokenUpdate
and this call returns the information whether the host is DEPAssignedToFleet
and/or InstalledFromDEP
: https://github.com/fleetdm/fleet/blob/dbe8f956925f111122736a415a054b5c2c4c94f0/server/service/apple_mdm.go#L2496enabled
, type="device"
and token_update_tally=1
, we consider the request a new enrollment: https://github.com/fleetdm/fleet/blob/dbe8f956925f111122736a415a054b5c2c4c94f0/server/service/apple_mdm.go#L2512-L2513
nano_enrollments
table is reset when a device authenticates to Fleet MDM on re-enrollment: https://github.com/fleetdm/fleet/blob/dbe8f956925f111122736a415a054b5c2c4c94f0/server/datastore/mysql/apple_mdm.go#L3333-L3338installed_from_dep
(which comes from the host_mdm
table, deleted when the corresponding hosts
entry is deleted) OR dep_assigned_to_fleet
(which comes from the host_dep_assignments
table, which may get soft-deleted by the DEP syncer if it receives that deleted serial but it may be only when removed from ABM?) do we enqueue the post-DEP-enrollment flow: https://github.com/fleetdm/fleet/blob/dbe8f956925f111122736a415a054b5c2c4c94f0/server/service/apple_mdm.go#L2526-L2528So the issue seems to be that the DEP syncer only moves forward, doesn't re-consider old devices once ingested once unless the setup assistant changed, but if we always did a full sync, it might introduce performance issues or rate limits? We already keep some DEP information in host_dep_assignments
, but we only link the host via its host.id
which isn't constant. Could we store the host UUID/serial and try to match using this on host_dep_assignments
, and ignore it if the row has been soft-deleted (which I believe would indicate that the host is no longer assigned to Fleet in ABM)?
ADE host reborn, Fleet's embrace ensures no scorn, Tools restored, no mourn.
Fleet version: 4.46.1
💥 Actual behavior
If an ADE host is deleted from the UI, and has been assigned to Fleet for a long time in ABM, it won't get the bootstrap package delivered the next time the host enrolls.
🧑💻 Steps to reproduce
🕯️ More info (optional)