fleet/server/mdm/apple/mobileconfig/file_vault_options.go
Victor Lyuboslavsky 94aa81e42d
Removing Apple MDM profile validation checks for some com.apple.MCX keys (#28498)
For #28343 

Connects to #28343

Removing Apple MDM profile validation checks for com.apple.MCX keys
(dontAllowFDEDisable and dontAllowFDEEnable) due to customer feedback.

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
- [x] Added/updated automated tests
- [x] Manual QA for all new/changed functionality
2025-04-23 14:06:17 -05:00

31 lines
1 KiB
Go

package mobileconfig
import "github.com/micromdm/plist"
type FDEFileVaultOptionsProfileContent struct {
PayloadContent []FDEFileVaultOptionsPayload `plist:"PayloadContent"`
}
type FDEFileVaultOptionsPayload struct {
PayloadType string `plist:"PayloadType"`
DestroyFVKeyOnStandby *bool `plist:"DestroyFVKeyOnStandby"`
}
// ContainsFDEFileVaultOptionsPayload returns true if the payload contains any FileVault options.
// https://developer.apple.com/documentation/devicemanagement/fdefilevaultoptions
// Fleet users are not allowed to upload such payloads because Fleet fully manages disk encryption (FileVault).
func ContainsFDEFileVaultOptionsPayload(contents []byte) (bool, error) {
if len(contents) == 0 {
return false, nil
}
var prof FDEFileVaultOptionsProfileContent
err := plist.Unmarshal(contents, &prof)
if err != nil {
return false, err
}
for _, p := range prof.PayloadContent {
if p.PayloadType == FleetCustomSettingsPayloadType && p.DestroyFVKeyOnStandby != nil {
return true, nil
}
}
return false, nil
}