Open noahtalerman opened 1 month ago
Hey @roperzh, we decided to work on software title matching separately from VPP story. Can you take a look at "To fix" section of issue description.
It's mostly what we discussed yesterday during our call, with one change. Instead of merging title that's created via upload to osquery reported title, we would like to do reverse (merge osquery title to one that we created). What do you think about this approach?
Also, I spent some time and dug into many distribution.plist
files for different apps, so I would like to update the extraction logic.
I found out that some apps have must-close
element and bundle ID is always correct there. (e.g. in Zoom's package only correct bundle ID is inside the must-close
element, that's why I would check that first and if not available, then go to the next one).
Also, I found out that many packages have bundle
element inside bundle-version
element which has path
attribute, which is usually <app_name>.app
which I would use before the <title>
element.
@roperzh btw I used the format bundle-version[0].bundle[0].path
which might not be correct but added an explanation of what should we read in parentheses.
@marko-lisica sorry for the delay on this
It's mostly what we discussed yesterday during our call, with one change. Instead of merging title that's created via upload to osquery reported title, we would like to do reverse (merge osquery title to one that we created). What do you think about this approach?
this makes sense, we should reach out to you ASAP if we find any gotchas during the actual implementation, but I can't think of anything right now.
I found out that some apps have must-close element and bundle ID is always correct there. (e.g. in Zoom's package only correct bundle ID is inside the must-close element, that's why I would check that first and if not available, then go to the next one). Also, I found out that many packages have bundle element inside bundle-version element which has path attribute, which is usually
.app which I would use before the element.
This is awesome, thanks!
A note in regards to must-close
from the docs
must-close
Identifies applications that must be closed before the package is installed.
This seems a bit brittle to me.
@marko-lisica the script in the issue description wasn't working with a bunch of distribution files so I implemented a different approach.
If you're interested and have any feedback, the unit tests here use real distribution files I extracted from different pkg
installers and show the current output:
Fleet version: Unknown but likely an issue in Fleet 4.50. We decided not to resolve this in 4.50
đź’Ą Â Actual behavior
Roberto: This has happened with a couple of apps already. Note how the installer is "Microsoft Edge", but after I install it, I have a different software title named "Microsoft Edge.app", from a different source:
🧑‍💻  Steps to reproduce
🕯️ More info (optional)
Discussion from Slack here (internal)
Noah: Is this a door we can’t walk back out of? Put differently, if we ship as-is and a user uploads Edge, will we be able to “squish” the two software titles into one title for them in a later release? If yes, I think we can ship as-is and file a bug so we can make a quick follow up to improve the matching.
Roberto: The matching is done in two places:
Noah: Got it. So, if we were to ship as-is w/ a bug fix later, then we’d probably do two things:
Odds are we don’t get the matching perfectly even if we plugged all the gaps this release right?
So, even if we plugged all the gaps we know of now, I’m thinking it’s likely we’ll add something like that new cron to match uploaded software later.
🛠️ To fix
Improve version > title matching for macOS apps.
bundle_identifier
instead of thename
bundle_identifier
extracted from package -> create new title onesoftware_title_id
of the newly created titlezoomInstaller.pkg
and we extract nameZoom Workplace
and bundle IDus.zoom.osx
. After app is installed osquery will report version namedZoom.us.app
and we'll have two separate titles for same app. In this case osquery reported titleZoom.us.app
will be merged intoZoom Workplace
(title ID will be kept) andname
from the osquery title will be infered.bundle_identifier
field to software title detailsImprove
name
,bundle_identifier
extraction. For name extraction get information in the following order of priority:<bundle-version>
-><bundle>
->path
attribute)For bundle ID extraction get information in the following order of priority:
<must-close>
-><app>
->id
attribute)