@@ -2881,6 +2881,40 @@ func (s *integrationEnterpriseTestSuite) TestAppleOSUpdatesTeamConfig() {
2881
2881
}, http.StatusUnprocessableEntity, &tmResp)
2882
2882
}
2883
2883
2884
+ func (s *integrationEnterpriseTestSuite) TestLinuxDiskEncryption() {
2885
+ t := s.T()
2886
+
2887
+ // create a Linux host
2888
+ hostLin, err := s.ds.NewHost(context.Background(), &fleet.Host{
2889
+ DetailUpdatedAt: time.Now(),
2890
+ LabelUpdatedAt: time.Now(),
2891
+ PolicyUpdatedAt: time.Now(),
2892
+ SeenTime: time.Now(),
2893
+ NodeKey: ptr.String(strings.ReplaceAll(t.Name(), "/", "_") + "3"),
2894
+ OsqueryHostID: ptr.String(strings.ReplaceAll(t.Name(), "/", "_") + "3"),
2895
+ UUID: t.Name() + "3",
2896
+ Hostname: t.Name() + "foo3.local",
2897
+ PrimaryIP: "192.168.1.3",
2898
+ PrimaryMac: "30-65-EC-6F-C4-60",
2899
+ Platform: "ubuntu",
2900
+ OSVersion: "Ubuntu 22.04",
2901
+ })
2902
+ require.NoError(t, err)
2903
+
2904
+ // turn on disk encryption enforcement
2905
+ s.Do("POST", "/api/latest/fleet/disk_encryption", updateDiskEncryptionRequest{EnableDiskEncryption: true}, http.StatusNoContent)
2906
+
2907
+ // set encrypted for host
2908
+ require.NoError(t, s.ds.SetOrUpdateHostDisksEncryption(context.Background(), hostLin.ID, true))
2909
+
2910
+ // should succeed as we no longer require MDM to access this endpoint, as Linux encryption doesn't require MDM
2911
+ var summary getMDMDiskEncryptionSummaryResponse
2912
+ s.DoJSON("GET", "/api/latest/fleet/mdm/disk_encryption/summary", getMDMDiskEncryptionSummaryRequest{}, http.StatusOK, &summary)
2913
+ s.DoJSON("GET", "/api/latest/fleet/disk_encryption", getMDMDiskEncryptionSummaryRequest{}, http.StatusOK, &summary)
2914
+ // disk is encrypted but key hasn't been escrowed yet
2915
+ require.Equal(t, fleet.MDMDiskEncryptionSummary{ActionRequired: fleet.MDMPlatformsCounts{Linux: 1}}, *summary.MDMDiskEncryptionSummary)
2916
+ }
2917
+
2884
2918
func (s *integrationEnterpriseTestSuite) TestListDevicePolicies() {
2885
2919
t := s.T()
2886
2920
ctx := context.Background()
0 commit comments