Add manual translation for com.sentinelone.SentinelAgent (#32936)

Fixes: #31318 
Worth noting that SentinelOne [bundles its
content](https://developer.apple.com/documentation/bundleresources/placing-content-in-a-bundle)
under `./Library/Sentinel/sentinel-agent.bundle` in an embedded pkg
file. It could be worth adding parsing logic for that case if more apps
in the future are bundled this way.
# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [x] Added/updated automated tests

- [x] QA'd all new/changed functionality manually
This commit is contained in:
Jonathan Katz 2025-09-12 17:15:58 -04:00 committed by GitHub
parent f6cc722223
commit 9d6e6fced8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View file

@ -0,0 +1 @@
* Fixed SentinelOne pkg generating wrong bundle identifier for auto-install policy.

View file

@ -327,6 +327,10 @@ var knownBadNames = map[string]struct{}{
"SU_TITLE": {},
}
var idTranslations = map[string]string{
"com.sentinelone.sentinel-agent": "com.sentinelone.SentinelAgent",
}
// getDistributionInfo gets the name, bundle identifier and version of a PKG distribution file
func getDistributionInfo(d *distributionXML) (name string, identifier string, version string, packageIDs []string) {
var appVersion string
@ -458,6 +462,10 @@ func getDistributionInfo(d *distributionXML) (name string, identifier string, ve
}
}
if newID, ok := idTranslations[identifier]; ok {
identifier = newID
}
// if package IDs are still empty, use the identifier as the package ID
if len(packageIDs) == 0 && identifier != "" {
packageIDs = append(packageIDs, identifier)

View file

@ -211,7 +211,7 @@ func TestParseRealDistributionFiles(t *testing.T) {
file: "distribution-sentinelone.xml",
expectedName: "SentinelOne",
expectedVersion: "24.3.2.7753",
expectedBundleID: "com.sentinelone.sentinel-agent",
expectedBundleID: "com.sentinelone.SentinelAgent",
expectedPackageIDs: []string{"com.sentinelone.pkg.sentinel-agent", "com.sentinelone.sentinel-agent"},
},
{