Adding a new platform to Fleet’s Well Known MDM list

Fleet is both an endpoint reporting tool, built around osquery, and an MDM platform. When using Fleet as a reporting tool, one provided data point is which MDM platform hosts are enrolled in.

However if an MDM is not in Fleet’s hardcoded list it will show up as “Unknown” in the Fleet UI. This is exactly the scenario I ran into when I first started testing out Fleet last year.

Thankfully this is easy to fix with a simple PR since Fleet is open source.

Read on for the details…

Well Known MDMs

Fleet includes a hardcoded list of “WellKnownMDM”s that are displayed in the UI.

First, the code defines a set of fixed string values representing well-known MDM product names. Then it defines a lookup table that checks for certain keywords in the server URL and maps them to the correct MDM display name.

You can view the current list at this link, however note that future changes to the code will likely shift the specific line numbers:

https://github.com/fleetdm/fleet/blob/main/server/fleet/hosts.go#L1182-L1206

At the time of of publishing the list looked like this:


// List of well-known MDM solution names. Those correspond to names stored in
// the mobile_device_management_solutions table.
const (
	UnknownMDMName        = ""
	WellKnownMDMKandji    = "Kandji"
	WellKnownMDMJamf      = "Jamf"
	WellKnownMDMJumpCloud = "JumpCloud"
	WellKnownMDMVMWare    = "VMware Workspace ONE"
	WellKnownMDMIntune    = "Intune"
	WellKnownMDMSimpleMDM = "SimpleMDM"
	WellKnownMDMFleet     = "Fleet"
	WellKnownMDMMosyle    = "Mosyle"
)

var mdmNameFromServerURLChecks = map[string]string{
	"kandji":    WellKnownMDMKandji,
	"jamf":      WellKnownMDMJamf,
	"jumpcloud": WellKnownMDMJumpCloud,
	"airwatch":  WellKnownMDMVMWare,
	"awmdm":     WellKnownMDMVMWare,
	"microsoft": WellKnownMDMIntune,
	"simplemdm": WellKnownMDMSimpleMDM,
	"fleetdm":   WellKnownMDMFleet,
	"mosyle":    WellKnownMDMMosyle,
}

Adding a new MDM to the list

This setup makes it very easy to add an additional MDM vendor to the list. You simply need a unique part of the MDM server URL and then you can map it to an entry on the list.

First define the display name for the MDM vendor and add it to the list of constants.

e.g. WellKnownMDMMosyle = "Mosyle"

Second add the unique aspect of the server URL to the mdmNameFromServerURLChecks and map it to constant defined above it.

e.g. "mosyle": WellKnownMDMMosyle,

That’s it!

To further illustrate how easy it is take a look at these pull requests:

If you use Fleet for reporting and an MDM not on the list I hope you’ll take a shot at opening a PR to get it added. Let me know if you have any questions.

Leave a Reply

Your email address will not be published. Required fields are marked *