From 9d6e6fced85df4e42d1a75cf15eef6463c7e4465 Mon Sep 17 00:00:00 2001 From: Jonathan Katz <44128041+jkatz01@users.noreply.github.com> Date: Fri, 12 Sep 2025 17:15:58 -0400 Subject: [PATCH] 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 --- changes/31318-sentinelone-pkg | 1 + pkg/file/xar.go | 8 ++++++++ pkg/file/xar_test.go | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 changes/31318-sentinelone-pkg diff --git a/changes/31318-sentinelone-pkg b/changes/31318-sentinelone-pkg new file mode 100644 index 0000000000..c3cb70fd3c --- /dev/null +++ b/changes/31318-sentinelone-pkg @@ -0,0 +1 @@ +* Fixed SentinelOne pkg generating wrong bundle identifier for auto-install policy. diff --git a/pkg/file/xar.go b/pkg/file/xar.go index 02f8456e8f..358a286fe7 100644 --- a/pkg/file/xar.go +++ b/pkg/file/xar.go @@ -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) diff --git a/pkg/file/xar_test.go b/pkg/file/xar_test.go index 1c56e04b1f..ecbd058895 100644 --- a/pkg/file/xar_test.go +++ b/pkg/file/xar_test.go @@ -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"}, }, {