fleetdm / fleet

Open-source platform for IT, security, and infrastructure teams. (Linux, macOS, Chrome, Windows, cloud, data center)
https://fleetdm.com
Other
3.01k stars 418 forks source link

Manage profiles for a host #9590

Closed lukeheath closed 1 year ago

lukeheath commented 1 year ago

Tasks

Details

Pasting details from a conversation in Slack:

For profiles/hosts, the state of a profile is derived from the state of the InstallProfile / RemoveProfile command used to deliver/remove the profile, it can be:

  • pending (the command is enqueued but wasn't delivered to the host yet)
  • failed (the command failed)
  • success (the command was successful)

In terms of requirements we need to:

  1. Add a new attribute to fleet.Host that aggregates the state of the profiles (eg: "pending" if there's at least one install/removal pending, "failed" if there's at least one install/removal failed, "success" otherwise)
    1. Add a new filter to /hosts that allows filtering by pending/failed/success.
    2. Add a global aggregate based on this aggregate (eg: 23 hosts pending, 33, failed and 100 succeeded)
  2. Add a list of all the profiles assigned to a host + their status

I'm thinking of two options that probably will need refinement as we implement stuff:

  1. Since nanomdm keeps track of all the commands sent to a device in a table, and the state of the profile is in reality the state of the command used to deliver/remove it, we could compute all of the requirements if we keep some sort of timestamp entry (maybe in the host_updates table) that tells us what InstallProfile / RemoveProfile commands are relevant. Potentially we could use a VIEW for this.
  2. Add a new host_mdm_apple_profiles table with host_id, status that we use to keep track of the profile status for a host.
    1. On InstallProfile, add a new row to the table, update the status when we get the command response
    2. On RemoveProfile , update the status to pending when the command is sent, remove the row if successful or update to failed if it fails

I'm leaning towards 2, I would love your input to define the right path forward

lukeheath commented 1 year ago

Hey team! Please add your planning poker estimate with Zenhub @gillespi314 @mna @roperzh

noahtalerman commented 1 year ago

Hey @roperzh! When you get the chance, can you please file a separate technical subtask for the "profile diff’ing" between the device and the server) ?

If it's helpful, I'm happy to hop on a call to do this together.

fleet-release commented 1 year ago

/dashboard/?status=pending/failed/success)

A cloud city in sight, Profiles managed with ease,
Users save precious time.