Current macOS logic works using algebra of sets to diff host_mdm_apple_profiles (current state) and mdm_apple_configuration_profiles (desired state) to calculate which profiles need to be installed/deleted on each host.
Changes
The diffing and assignment logic happens in two places, both need to be updated:
Cron job
There's a cron job that runs every 30 seconds and calls the ReconcileProfiles service method. This method needs to be updated to account for Windows hosts
Any operation that changes the team of a host, creates a host, etc. calls the BulkSetPendingMDMAppleHostProfiles function with different arguments depending on the context.
Update the function definition to account for windows profiles.
Context
Current macOS logic works using algebra of sets to diff
host_mdm_apple_profiles
(current state) andmdm_apple_configuration_profiles
(desired state) to calculate which profiles need to be installed/deleted on each host.Changes
The diffing and assignment logic happens in two places, both need to be updated:
Cron job
There's a cron job that runs every 30 seconds and calls the
ReconcileProfiles
service method. This method needs to be updated to account for Windows hostshttps://github.com/fleetdm/fleet/blob/8950d46cbc9f746435fe1990a65733bd1b3253b5/server/service/apple_mdm.go#L2499
Operations that trigger profile changes
Any operation that changes the team of a host, creates a host, etc. calls the
BulkSetPendingMDMAppleHostProfiles
function with different arguments depending on the context.Update the function definition to account for windows profiles.
https://github.com/fleetdm/fleet/blob/8950d46cbc9f746435fe1990a65733bd1b3253b5/server/datastore/mysql/apple_mdm.go#L1252