From 946ffcc7c8d41c95a7f3ff208b4e1467ad9afeec Mon Sep 17 00:00:00 2001 From: Justin Lu Date: Wed, 1 Feb 2023 12:18:36 -0800 Subject: [PATCH] Add CheckDisks for disk encryption posture rule --- device_posture_rule.go | 39 +++++++++++++++++++------------------ device_posture_rule_test.go | 4 +++- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/device_posture_rule.go b/device_posture_rule.go index 288d5a2e53c7..83aedde75c4e 100644 --- a/device_posture_rule.go +++ b/device_posture_rule.go @@ -162,25 +162,26 @@ type DevicePostureRuleMatch struct { // DevicePostureRuleInput represents the value to be checked against. type DevicePostureRuleInput struct { - ID string `json:"id,omitempty"` - Path string `json:"path,omitempty"` - Exists bool `json:"exists,omitempty"` - Thumbprint string `json:"thumbprint,omitempty"` - Sha256 string `json:"sha256,omitempty"` - Running bool `json:"running,omitempty"` - RequireAll bool `json:"requireAll,omitempty"` - Enabled bool `json:"enabled,omitempty"` - Version string `json:"version,omitempty"` - VersionOperator string `json:"versionOperator,omitempty"` - Overall string `json:"overall,omitempty"` - SensorConfig string `json:"sensor_config,omitempty"` - Os string `json:"os,omitempty"` - OsDistroName string `json:"os_distro_name,omitempty"` - OsDistroRevision string `json:"os_distro_revision,omitempty"` - Operator string `json:"operator,omitempty"` - Domain string `json:"domain,omitempty"` - ComplianceStatus string `json:"compliance_status,omitempty"` - ConnectionID string `json:"connection_id,omitempty"` + ID string `json:"id,omitempty"` + Path string `json:"path,omitempty"` + Exists bool `json:"exists,omitempty"` + Thumbprint string `json:"thumbprint,omitempty"` + Sha256 string `json:"sha256,omitempty"` + Running bool `json:"running,omitempty"` + RequireAll bool `json:"requireAll,omitempty"` + CheckDisks []string `json:"checkDisks,omitempty"` + Enabled bool `json:"enabled,omitempty"` + Version string `json:"version,omitempty"` + VersionOperator string `json:"versionOperator,omitempty"` + Overall string `json:"overall,omitempty"` + SensorConfig string `json:"sensor_config,omitempty"` + Os string `json:"os,omitempty"` + OsDistroName string `json:"os_distro_name,omitempty"` + OsDistroRevision string `json:"os_distro_revision,omitempty"` + Operator string `json:"operator,omitempty"` + Domain string `json:"domain,omitempty"` + ComplianceStatus string `json:"compliance_status,omitempty"` + ConnectionID string `json:"connection_id,omitempty"` } // DevicePostureRuleListResponse represents the response from the list diff --git a/device_posture_rule_test.go b/device_posture_rule_test.go index 03be12721567..c7ba0f46890c 100644 --- a/device_posture_rule_test.go +++ b/device_posture_rule_test.go @@ -402,7 +402,8 @@ func TestDevicePostureDiskEncryptionRule(t *testing.T) { } ], "input": { - "requireAll": true + "requireAll": true, + "checkDisks": ["C", "D"] } } } @@ -419,6 +420,7 @@ func TestDevicePostureDiskEncryptionRule(t *testing.T) { Match: []DevicePostureRuleMatch{{Platform: "ios"}}, Input: DevicePostureRuleInput{ RequireAll: true, + CheckDisks: []string{"C", "D"}, }, }