@@ -57,15 +57,14 @@ function Test-ThreatDetectionDatabaseUpdatePolicy
57
57
{
58
58
# Test
59
59
Set-AzureRmSqlDatabaseAuditingPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - DatabaseName $params.databaseName - StorageAccountName $params.storageAccount
60
- Set-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName
$params.rgname - ServerName
$params.serverName - DatabaseName
$params.databaseName - NotificationRecipientsEmails
" [email protected] ;[email protected] " - EmailAdmins
$false - ExcludedDetectionType
" Sql_Injection " , " Sql_Injection_Vulnerability"
60
+ Set-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName
$params.rgname - ServerName
$params.serverName - DatabaseName
$params.databaseName - NotificationRecipientsEmails
" [email protected] ;[email protected] " - EmailAdmins
$false - ExcludedDetectionType
" Sql_Injection_Vulnerability"
61
61
$policy = Get-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - DatabaseName $params.databaseName
62
62
63
63
# Assert
64
64
Assert-AreEqual $policy.ThreatDetectionState " Enabled"
65
65
Assert-AreEqual $policy.NotificationRecipientsEmails " [email protected] ;[email protected] "
66
66
Assert-False {$policy.EmailAdmins }
67
- Assert-AreEqual $policy.ExcludedDetectionTypes.Length 2
68
- Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Sql_Injection)}
67
+ Assert-AreEqual $policy.ExcludedDetectionTypes.Length 1
69
68
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Sql_Injection_Vulnerability)}
70
69
71
70
@@ -77,7 +76,7 @@ function Test-ThreatDetectionDatabaseUpdatePolicy
77
76
Assert-AreEqual $policy.ThreatDetectionState " Enabled"
78
77
Assert-AreEqual $policy.NotificationRecipientsEmails " [email protected] ;[email protected] "
79
78
Assert-False {$policy.EmailAdmins }
80
- Assert-AreEqual $policy.ExcludedDetectionTypes.Length 7
79
+ Assert-AreEqual $policy.ExcludedDetectionTypes.Length 4
81
80
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Sql_Injection)}
82
81
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Sql_Injection_Vulnerability)}
83
82
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Access_Anomaly)}
@@ -91,7 +90,7 @@ function Test-ThreatDetectionDatabaseUpdatePolicy
91
90
Assert-AreEqual $policy.ThreatDetectionState " Disabled"
92
91
Assert-AreEqual $policy.NotificationRecipientsEmails " [email protected] ;[email protected] "
93
92
Assert-False {$policy.EmailAdmins }
94
- Assert-AreEqual $policy.ExcludedDetectionTypes.Length 7
93
+ Assert-AreEqual $policy.ExcludedDetectionTypes.Length 4
95
94
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Sql_Injection)}
96
95
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Sql_Injection_Vulnerability)}
97
96
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Access_Anomaly)}
0 commit comments