Additional changes for Zorin OS support (#48779)
Follow up PR for community PR: https://github.com/fleetdm/fleet/pull/45712. - [X] QA'd all new/changed functionality manually <img width="1574" height="827" alt="Screenshot 2026-07-06 at 1 54 44 PM" src="https://github.com/user-attachments/assets/672d7b84-155f-4dab-8246-fe88e391e416" /> <img width="1235" height="827" alt="Screenshot 2026-07-06 at 1 54 01 PM" src="https://github.com/user-attachments/assets/51df3344-b002-45df-9cda-afa573652944" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * OS settings and disk-encryption views now correctly include Zorin devices in Linux-related results. * Host filtering counts now account for Zorin alongside other supported Linux platforms. * Updated related checks so Zorin devices are handled consistently in status and encryption reporting. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -230,6 +230,8 @@ export const generateTableData = (
|
||||
return makeDarwinRows(hostMDMData);
|
||||
case "ubuntu":
|
||||
return makeLinuxRows(hostMDMData);
|
||||
case "zorin":
|
||||
return makeLinuxRows(hostMDMData);
|
||||
case "rhel":
|
||||
return makeLinuxRows(hostMDMData);
|
||||
case "ios":
|
||||
|
||||
@@ -1767,7 +1767,7 @@ func (ds *Datastore) filterHostsByOSSettingsStatus(ctx context.Context, sql stri
|
||||
// supported linux platforms if disk encryption is enabled.
|
||||
includeLinuxCond := "FALSE"
|
||||
if diskEncryptionConfig.Enabled {
|
||||
includeLinuxCond = `(h.platform = 'ubuntu' OR h.os_version LIKE 'Fedora%%')`
|
||||
includeLinuxCond = `(h.platform = 'ubuntu' OR h.platform = 'zorin' OR h.os_version LIKE 'Fedora%%')`
|
||||
}
|
||||
|
||||
sqlFmt := ` AND (
|
||||
@@ -1893,7 +1893,7 @@ func (ds *Datastore) filterHostsByOSSettingsDiskEncryptionStatus(ctx context.Con
|
||||
return sql, params
|
||||
}
|
||||
|
||||
sqlFmt := " AND h.platform IN('windows', 'darwin', 'ubuntu', 'rhel')"
|
||||
sqlFmt := " AND h.platform IN('windows', 'darwin', 'ubuntu', 'zorin', 'rhel')"
|
||||
if opt.TeamFilter == nil {
|
||||
// OS settings filter is not compatible with the "all teams" option so append the "no
|
||||
// team" filter here (note that filterHostsByTeam applies the "no team" filter if TeamFilter == 0)
|
||||
@@ -1902,7 +1902,7 @@ func (ds *Datastore) filterHostsByOSSettingsDiskEncryptionStatus(ctx context.Con
|
||||
sqlFmt += ` AND (
|
||||
(h.platform = 'windows' AND mwe.host_uuid IS NOT NULL AND hmdm.enrolled = 1 AND hmdm.is_server = 0 AND %s) -- windows
|
||||
OR (h.platform = 'darwin' AND ne.id IS NOT NULL AND hmdm.enrolled = 1 AND %s) -- apple
|
||||
OR ((h.platform = 'ubuntu' OR h.os_version LIKE 'Fedora%%') AND %s) -- linux
|
||||
OR ((h.platform = 'ubuntu' OR h.platform = 'zorin' OR h.os_version LIKE 'Fedora%%') AND %s) -- linux
|
||||
)`
|
||||
|
||||
var subqueryMacOS string
|
||||
|
||||
@@ -950,6 +950,15 @@ func testHostListOptionsTeamFilter(t *testing.T, ds *Datastore) {
|
||||
hosts = append(hosts, newHost.Host)
|
||||
}
|
||||
|
||||
// Add a Zorin OS host (Ubuntu-based), supported for linux disk encryption.
|
||||
// Appended after the Android hosts (index 22) so the existing host indices
|
||||
// used for team assignments below are unaffected. Left on "no team" and
|
||||
// pending (no escrowed key) to exercise the supported-linux OS settings /
|
||||
// disk-encryption filter path.
|
||||
zorinHost := test.NewHost(t, ds, "foo.local.22", "1.1.1.1", "22", "22", time.Now(), test.WithPlatform("zorin"))
|
||||
hosts = append(hosts, zorinHost)
|
||||
nanoEnrollAndSetHostMDMData(t, ds, zorinHost, false)
|
||||
|
||||
userFilter := fleet.TeamFilter{User: test.UserAdmin}
|
||||
|
||||
// confirm initial state
|
||||
@@ -1042,7 +1051,7 @@ func testHostListOptionsTeamFilter(t *testing.T, ds *Datastore) {
|
||||
err = ds.SaveAppConfig(context.Background(), ac)
|
||||
require.NoError(t, err)
|
||||
|
||||
listHostsCheckCount(t, ds, userFilter, fleet.HostListOptions{TeamFilter: teamIDFilterZero, OSSettingsFilter: fleet.OSSettingsPending}, 5) // pending supported linux hosts
|
||||
listHostsCheckCount(t, ds, userFilter, fleet.HostListOptions{TeamFilter: teamIDFilterZero, OSSettingsFilter: fleet.OSSettingsPending}, 6) // pending supported linux hosts (ubuntu 1,2; fedora 3,4,5; zorin 22)
|
||||
|
||||
_, err = ds.SaveLUKSData(context.Background(), hosts[1], "key1", "morton", 1)
|
||||
require.NoError(t, err) // set host 1 to verified
|
||||
@@ -1050,11 +1059,11 @@ func testHostListOptionsTeamFilter(t *testing.T, ds *Datastore) {
|
||||
|
||||
listHostsCheckCount(t, ds, userFilter, fleet.HostListOptions{TeamFilter: teamIDFilterZero, OSSettingsFilter: fleet.OSSettingsVerified}, 1) // hosts[1]
|
||||
listHostsCheckCount(t, ds, userFilter, fleet.HostListOptions{TeamFilter: teamIDFilterZero, OSSettingsFilter: fleet.OSSettingsFailed}, 2) // hosts[2], hosts[21]
|
||||
listHostsCheckCount(t, ds, userFilter, fleet.HostListOptions{TeamFilter: teamIDFilterZero, OSSettingsFilter: fleet.OSSettingsPending}, 3) // still-pending supported linux hosts
|
||||
listHostsCheckCount(t, ds, userFilter, fleet.HostListOptions{TeamFilter: teamIDFilterZero, OSSettingsFilter: fleet.OSSettingsPending}, 4) // still-pending supported linux hosts (fedora 3,4,5; zorin 22)
|
||||
|
||||
listHostsCheckCount(t, ds, userFilter, fleet.HostListOptions{TeamFilter: teamIDFilterZero, OSSettingsDiskEncryptionFilter: fleet.DiskEncryptionVerified}, 1)
|
||||
listHostsCheckCount(t, ds, userFilter, fleet.HostListOptions{TeamFilter: teamIDFilterZero, OSSettingsDiskEncryptionFilter: fleet.DiskEncryptionFailed}, 1)
|
||||
listHostsCheckCount(t, ds, userFilter, fleet.HostListOptions{TeamFilter: teamIDFilterZero, OSSettingsDiskEncryptionFilter: fleet.DiskEncryptionActionRequired}, 3)
|
||||
listHostsCheckCount(t, ds, userFilter, fleet.HostListOptions{TeamFilter: teamIDFilterZero, OSSettingsDiskEncryptionFilter: fleet.DiskEncryptionActionRequired}, 4) // fedora 3,4,5; zorin 22
|
||||
|
||||
// test team filter in combination with os settings disk encryptionfilter
|
||||
require.NoError(t, ds.BulkUpsertMDMAppleHostProfiles(context.Background(), []*fleet.MDMAppleBulkUpsertHostProfilePayload{
|
||||
@@ -1107,7 +1116,7 @@ func testHostListOptionsTeamFilter(t *testing.T, ds *Datastore) {
|
||||
listHostsCheckCount(t, ds, userFilter, fleet.HostListOptions{TeamFilter: teamIDFilterNil, OSSettingsDiskEncryptionFilter: fleet.DiskEncryptionEnforcing}, 1) // hosts[18]
|
||||
listHostsCheckCount(t, ds, userFilter, fleet.HostListOptions{OSSettingsDiskEncryptionFilter: fleet.DiskEncryptionEnforcing}, 1) // hosts[18]
|
||||
|
||||
listHostsCheckCount(t, ds, userFilter, fleet.HostListOptions{TeamFilter: teamIDFilterZero, OSSettingsDiskEncryptionFilter: fleet.DiskEncryptionActionRequired}, 4) // hosts[3, 4, 5, 19]
|
||||
listHostsCheckCount(t, ds, userFilter, fleet.HostListOptions{TeamFilter: teamIDFilterZero, OSSettingsDiskEncryptionFilter: fleet.DiskEncryptionActionRequired}, 5) // hosts[3, 4, 5, 19, 22 (zorin)]
|
||||
|
||||
// move linux hosts to team 1 (un-escrows keys)
|
||||
require.NoError(t, ds.AddHostsToTeam(context.Background(), fleet.NewAddHostsToTeamParams(&team1.ID, []uint{hosts[1].ID, hosts[2].ID, hosts[3].ID, hosts[4].ID, hosts[5].ID})))
|
||||
|
||||
Reference in New Issue
Block a user