Skip to content

Commit 20a4f0c

Browse files
committed
Implement CIS 1.3.6 Customer Lockbox policy and tests
1 parent 8edd10e commit 20a4f0c

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package cis.microsoft_365_foundations.v6_0_0.control_1_3_6
2+
3+
import rego.v1
4+
5+
default result := {
6+
"compliant": false,
7+
"message": "Evaluation failed: unable to verify Customer Lockbox status",
8+
"details": {}
9+
}
10+
11+
result := {
12+
"compliant": true,
13+
"message": "Customer Lockbox is enabled",
14+
"details": {"customer_lockbox_enabled": true}
15+
} if {
16+
input.customer_lockbox_enabled == true
17+
}
18+
19+
result := {
20+
"compliant": false,
21+
"message": "Customer Lockbox is not enabled",
22+
"details": {"customer_lockbox_enabled": false}
23+
} if {
24+
input.customer_lockbox_enabled == false
25+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package cis.microsoft_365_foundations.v6_0_0.test_control_1_3_6
2+
3+
import rego.v1
4+
5+
test_compliant_customer_lockbox_enabled if {
6+
result := data.cis.microsoft_365_foundations.v6_0_0.control_1_3_6.result with input as {
7+
"customer_lockbox_enabled": true
8+
}
9+
result.compliant == true
10+
}
11+
12+
test_non_compliant_customer_lockbox_disabled if {
13+
result := data.cis.microsoft_365_foundations.v6_0_0.control_1_3_6.result with input as {
14+
"customer_lockbox_enabled": false
15+
}
16+
result.compliant == false
17+
}
18+
19+
test_unknown_status_null if {
20+
result := data.cis.microsoft_365_foundations.v6_0_0.control_1_3_6.result with input as {
21+
"customer_lockbox_enabled": null
22+
}
23+
result.compliant == false
24+
}
25+
26+
test_missing_field if {
27+
result := data.cis.microsoft_365_foundations.v6_0_0.control_1_3_6.result with input as {}
28+
result.compliant == false
29+
}

0 commit comments

Comments
 (0)