Skip to content

Commit

Permalink
add additional test case to account for anyone link value of 0 (unche…
Browse files Browse the repository at this point in the history
…cked), added to both unit/functional tests
  • Loading branch information
mitchelbaker-cisa committed Sep 24, 2024
1 parent 32bd22a commit 8f181fb
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ test_SharingCapability_Anyone_LinkExpirationInvalid_Incorrect_V2 if {
TestResult("MS.SHAREPOINT.3.1v1", Output, ReportDetailsString, false) == true
}

test_SharingCapability_Anyone_LinkExpirationInvalid_Incorrect_V3 if {
# If "RequireAnonymousLinksExpireInDays" == 0, Anyone links is unchecked,
# the policy must indicate a fail for this case.
Tenant := json.patch(SPOTenant,
[{"op": "add", "path": "SharingCapability", "value": 2},
{"op": "add", "path": "RequireAnonymousLinksExpireInDays", "value": 0}])

Output := sharepoint.tests with input.SPO_tenant as [Tenant]

ReportDetailsString := concat(" ", [
"Requirement not met:",
"total expiration days are not set to 30 days or less"
])
TestResult("MS.SHAREPOINT.3.1v1", Output, ReportDetailsString, false) == true
}

# Test if the Sharepoint external sharing slider is set to "Only people in your organization".
# The result must be N/A because the policy is not applicable unless external sharing is set to "Anyone".
test_SharingCapability_OnlyPeopleInOrg_NotApplicable_V1 if {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ TestPlan:
SharingCapability: ExternalUserAndGuestSharing
Postconditions: []
ExpectedResult: true
- TestDescription: MS.SHAREPOINT.3.1v1 Non-Compliant - SharingCapability = ExternalUserAndGuestSharing (Anyone); RequireAnonymousLinksExpireInDays = 0 (Anyone links in unchecked state)
Preconditions:
- Command: Set-PnPTenant
Splat:
RequireAnonymousLinksExpireInDays: 0
SharingCapability: ExternalUserAndGuestSharing
Postconditions: []
ExpectedResult: false
- TestDescription: MS.SHAREPOINT.3.1v1 Non-Compliant - SharingCapability = ExternalUserSharingOnly (New and existing guests); RequireAnonymousLinksExpireInDays = 30
Preconditions:
- Command: Set-PnPTenant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@ TestPlan:
SharingCapability: ExternalUserAndGuestSharing
Postconditions: []
ExpectedResult: true
- TestDescription: MS.SHAREPOINT.3.1v1 Non-Compliant - SharingCapability = ExternalUserAndGuestSharing (Anyone); RequireAnonymousLinksExpireInDays = 0 (Anyone links in unchecked state)
Preconditions:
- Command: Set-SPOTenant
Splat:
RequireAnonymousLinksExpireInDays: 0
SharingCapability: ExternalUserAndGuestSharing
Postconditions: []
ExpectedResult: false
- TestDescription: MS.SHAREPOINT.3.1v1 Non-Applicable - SharingCapability = ExternalUserSharingOnly (New and existing guests); RequireAnonymousLinksExpireInDays = 30
Preconditions:
- Command: Set-SPOTenant
Expand Down

0 comments on commit 8f181fb

Please sign in to comment.