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"}, }, {