You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$Skip= ($__dbcconfig|Where-Object Name -EQ'skip.security.guestuserconnect').Value
228
+
229
+
Context "Testing Guest user has CONNECT permission" {
230
+
It "Database Guest user should return no CONNECT permissions in <_.Name> on <_.SqlInstance>"-Skip:$skip-ForEach $psitem.Databases.Where{ if ($Database) { $_.Name-in$Database } else { $psitem.ConfigValues.guestuserexclude-notcontains$psitem.Name } } {
231
+
$psitem.GuestUserConnect| Should -BeFalse -Because "we don't want the guest user to have connect access to our database."
Context "Testing if the CHECK_POLICY is enabled on all logins on <_.Name>" {
224
+
It "All logins should have the CHECK_POLICY option set to ON on <_.Name>"-Skip:$skip {
225
+
($psitem.logins|Where-Object { $_.LoginType-eq'SqlLogin'-and$_.PasswordPolicyEnforced-eq$false-and$_.IsDisabled-eq$false }).Count | Should -Be 0-Because "We expected the CHECK_POLICY for the all logins to be enabled"
It "There should be less than <_.MemoryDump.MaxDumps> since <_.MemoryDump.DumpDateCheckFrom> on <_.Name>"-Skip:$skip {
220
-
$Psitem.MemoryDump.Result| Should -BeTrue -Because "We expected less than $($Psitem.MemoryDump.MaxDumps) dumps since $(PsItem.MemoryDump.DumpDateCheckFrom)but found $($Psitem.MemoryDump.DumpCount) . Memory dumps often suggest issues with the SQL Server instance"
275
+
$Psitem.MemoryDump.Result| Should -BeTrue -Because "We expected less than $($Psitem.MemoryDump.MaxDumps) dumps since $($PsItem.MemoryDump.DumpDateCheckFrom)but found $($Psitem.MemoryDump.DumpCount) . Memory dumps often suggest issues with the SQL Server instance"
221
276
}
222
277
}
223
278
}
@@ -338,6 +393,29 @@ Describe "SQL Mail XPs Disabled" -Tag SQLMailXPsDisabled, Security, CIS, Low, In
Context "Checking that build is still supported by Microsoft for <_.Name>"-Skip:$skip {
399
+
It "The build is not behind the latest build by more than <_.SupportedBuild.BuildBehind> for <_.Name>" {
400
+
$psItem.SupportedBuild.Compliant| Should -BeTrue -Because "this build $($psItem.SupportedBuild.Build) should not be behind the required build"
401
+
}
402
+
It "The build is supported by Microsoft for <_.Name>" {
403
+
$psItem.SupportedBuild.InsideMicrosoftSupport| Should -BeTrue -Because "this build $($psItem.SupportedBuild.Build) is now unsupported by Microsoft"
404
+
}
405
+
It "The build is supported by Microsoft within the warning window of <_.SupportedBuild.BuildWarning> months for <_.Name>" {
406
+
$psItem.SupportedBuild.InsideBuildWarning| Should -BeTrue -Because "this build $($psItem.SupportedBuild.Build) will be unsupported by Microsoft on $($psItem.SupportedBuild.SupportedUntil) which is less than $($psItem.SupportedBuild.BuildWarning) months away"
0 commit comments