Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Gmail 19.2 and 19.3 in rego #338

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion Testing/RegoTests/gmail/gmail19_test.rego
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import future.keywords
#
# GWS.GMAIL.19.1v0.2
#--
test_Spam_Correct_V1 if {
test_Domains_Correct_V1 if {
# Test not implemented
PolicyId := "GWS.GMAIL.19.1v0.2"
Output := tests with input as {
Expand All @@ -21,4 +21,48 @@ test_Spam_Correct_V1 if {
not RuleOutput[0].NoSuchEvent
RuleOutput[0].ReportDetails == "Currently not able to be tested automatically; please manually check."
}
#--

#
# GWS.GMAIL.19.2v0.2
#--
test_HideWarnings_Correct_V1 if {
# Test not implemented
PolicyId := "GWS.GMAIL.19.2v0.2"
Output := tests with input as {
"gmail_logs": {"items": [
]},
"tenant_info": {
"topLevelOU": ""
}
}

RuleOutput := [Result | some Result in Output; Result.PolicyId == PolicyId]
count(RuleOutput) == 1
not RuleOutput[0].RequirementMet
not RuleOutput[0].NoSuchEvent
RuleOutput[0].ReportDetails == "Currently not able to be tested automatically; please manually check."
}
#--

#
# GWS.GMAIL.19.3v0.2
#--
test_BypassAll_Correct_V1 if {
# Test not implemented
PolicyId := "GWS.GMAIL.19.3v0.2"
Output := tests with input as {
"gmail_logs": {"items": [
]},
"tenant_info": {
"topLevelOU": ""
}
}

RuleOutput := [Result | some Result in Output; Result.PolicyId == PolicyId]
count(RuleOutput) == 1
not RuleOutput[0].RequirementMet
not RuleOutput[0].NoSuchEvent
RuleOutput[0].ReportDetails == "Currently not able to be tested automatically; please manually check."
}
#--
30 changes: 30 additions & 0 deletions rego/Gmail.rego
Original file line number Diff line number Diff line change
Expand Up @@ -2101,6 +2101,10 @@ tests contains {
}
#--

################
# GWS.GMAIL.19 #
################

#
# Baseline GWS.GMAIL.19.1v0.2
#--
Expand All @@ -2114,4 +2118,30 @@ tests contains {
"RequirementMet": false,
"NoSuchEvent": false
}
#--

#
# Baseline GWS.GMAIL.19.2v0.2
#--
tests contains {
"PolicyId": "GWS.GMAIL.19.2v0.2",
"Criticality": "Shall/Not-Implemented",
"ReportDetails": "Currently not able to be tested automatically; please manually check.",
"ActualValue": "",
"RequirementMet": false,
"NoSuchEvent": false
}
#--

#
# Baseline GWS.GMAIL.19.3v0.2
#--
tests contains {
"PolicyId": "GWS.GMAIL.19.3v0.2",
"Criticality": "Shall/Not-Implemented",
"ReportDetails": "Currently not able to be tested automatically; please manually check.",
"ActualValue": "",
"RequirementMet": false,
"NoSuchEvent": false
}
#--
Loading