Skip to content

Commit

Permalink
Update MS.DEFENDER.4.1 policy id version in Defender rego unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
schrolla committed Dec 5, 2024
1 parent 8f71b0d commit 39a1ceb
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import data.utils.report.NotCheckedDetails
import rego.v1

#
# Policy MS.DEFENDER.4.1v1
# Policy MS.DEFENDER.4.1v2
#--
test_ContentContainsSensitiveInformation_Correct_V1 if {
Output := defender.tests with input.dlp_compliance_rules as [DlpComplianceRules]
with input.dlp_compliance_policies as [DlpCompliancePolicies]
with input.defender_license as true
with input.defender_dlp_license as true

TestResult("MS.DEFENDER.4.1v1", Output, PASS, true) == true
TestResult("MS.DEFENDER.4.1v2", Output, PASS, true) == true
}

test_AdvancedRule_Correct_V2 if {
Expand All @@ -33,7 +33,7 @@ test_AdvancedRule_Correct_V2 if {
with input.defender_license as true
with input.defender_dlp_license as true

TestResult("MS.DEFENDER.4.1v1", Output, PASS, true) == true
TestResult("MS.DEFENDER.4.1v2", Output, PASS, true) == true
}

test_ContentContainsSensitiveInformation_Incorrect_V1 if {
Expand All @@ -46,7 +46,7 @@ test_ContentContainsSensitiveInformation_Incorrect_V1 if {
with input.defender_dlp_license as true

ReportDetailString := "No matching rules found for: U.S. Social Security Number (SSN)"
TestResult("MS.DEFENDER.4.1v1", Output, ReportDetailString, false) == true
TestResult("MS.DEFENDER.4.1v2", Output, ReportDetailString, false) == true
}

test_ContentContainsSensitiveInformation_Incorrect_V2 if {
Expand All @@ -59,7 +59,7 @@ test_ContentContainsSensitiveInformation_Incorrect_V2 if {
with input.defender_dlp_license as true

ReportDetailString := "No matching rules found for: U.S. Individual Taxpayer Identification Number (ITIN)"
TestResult("MS.DEFENDER.4.1v1", Output, ReportDetailString, false) == true
TestResult("MS.DEFENDER.4.1v2", Output, ReportDetailString, false) == true
}

test_ContentContainsSensitiveInformation_Incorrect_V3 if {
Expand All @@ -72,7 +72,7 @@ test_ContentContainsSensitiveInformation_Incorrect_V3 if {
with input.defender_dlp_license as true

ReportDetailString := "No matching rules found for: Credit Card Number"
TestResult("MS.DEFENDER.4.1v1", Output, ReportDetailString, false) == true
TestResult("MS.DEFENDER.4.1v2", Output, ReportDetailString, false) == true
}

test_ContentContainsSensitiveInformation_Incorrect_V4 if {
Expand All @@ -89,7 +89,7 @@ test_ContentContainsSensitiveInformation_Incorrect_V4 if {
"U.S. Individual Taxpayer Identification Number (ITIN), U.S. Social Security Number (SSN)"
])

TestResult("MS.DEFENDER.4.1v1", Output, ReportDetailString, false) == true
TestResult("MS.DEFENDER.4.1v2", Output, ReportDetailString, false) == true
}

test_ContentContainsSensitiveInformation_Incorrect_V5 if {
Expand All @@ -106,7 +106,7 @@ test_ContentContainsSensitiveInformation_Incorrect_V5 if {
"U.S. Individual Taxpayer Identification Number (ITIN), U.S. Social Security Number (SSN)"
])

TestResult("MS.DEFENDER.4.1v1", Output, ReportDetailString, false) == true
TestResult("MS.DEFENDER.4.1v2", Output, ReportDetailString, false) == true
}

test_ContentContainsSensitiveInformation_Incorrect_V6 if {
Expand All @@ -123,15 +123,15 @@ test_ContentContainsSensitiveInformation_Incorrect_V6 if {
"U.S. Individual Taxpayer Identification Number (ITIN), U.S. Social Security Number (SSN)"
])

TestResult("MS.DEFENDER.4.1v1", Output, ReportDetailString, false) == true
TestResult("MS.DEFENDER.4.1v2", Output, ReportDetailString, false) == true
}

test_NoDLPLicense_Incorrect_4_1_V1 if {
Output := defender.tests with input.defender_license as false
with input.defender_dlp_license as false

ReportDetailString := concat(" ", [FAIL, DLPLICENSEWARNSTR])
TestResult("MS.DEFENDER.4.1v1", Output, ReportDetailString, false) == true
TestResult("MS.DEFENDER.4.1v2", Output, ReportDetailString, false) == true
}

#--
Expand Down

0 comments on commit 39a1ceb

Please sign in to comment.