@@ -120,19 +120,18 @@ function Test-ThreatDetectionDatabaseUpdatePolicy
120
120
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Sql_Injection_Vulnerability)}
121
121
122
122
# Test
123
- Set-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - DatabaseName $params.databaseName - ExcludedDetectionType " Sql_Injection" , " Sql_Injection_Vulnerability" , " Access_Anomaly" , " Usage_Anomaly "
123
+ Set-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - DatabaseName $params.databaseName - ExcludedDetectionType " Sql_Injection" , " Sql_Injection_Vulnerability" , " Access_Anomaly"
124
124
$policy = Get-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - DatabaseName $params.databaseName
125
125
126
126
# Assert
127
127
Assert-AreEqual $policy.ThreatDetectionState " Enabled"
128
128
Assert-AreEqual $policy.NotificationRecipientsEmails " [email protected] ;[email protected] "
129
129
Assert-False {$policy.EmailAdmins }
130
- Assert-AreEqual $policy.ExcludedDetectionTypes.Length 4
130
+ Assert-AreEqual $policy.ExcludedDetectionTypes.Length 3
131
131
Assert-AreEqual $policy.StorageAccountName $params.storageAccount
132
132
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Sql_Injection)}
133
133
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Sql_Injection_Vulnerability)}
134
134
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Access_Anomaly)}
135
- Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Usage_Anomaly)}
136
135
137
136
# Test
138
137
Remove-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - DatabaseName $params.databaseName
@@ -142,11 +141,10 @@ function Test-ThreatDetectionDatabaseUpdatePolicy
142
141
Assert-AreEqual $policy.ThreatDetectionState " Disabled"
143
142
Assert-AreEqual $policy.NotificationRecipientsEmails " [email protected] ;[email protected] "
144
143
Assert-False {$policy.EmailAdmins }
145
- Assert-AreEqual $policy.ExcludedDetectionTypes.Length 4
144
+ Assert-AreEqual $policy.ExcludedDetectionTypes.Length 3
146
145
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Sql_Injection)}
147
146
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Sql_Injection_Vulnerability)}
148
147
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Access_Anomaly)}
149
- Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Usage_Anomaly)}
150
148
151
149
# Test
152
150
Set-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - DatabaseName $params.databaseName - ExcludedDetectionType " None"
@@ -191,18 +189,17 @@ function Test-ThreatDetectionServerUpdatePolicy
191
189
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Sql_Injection_Vulnerability)}
192
190
193
191
# Test
194
- Set-AzureRmSqlServerThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - ExcludedDetectionType Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Usage_Anomaly - StorageAccountName $params.storageAccount
192
+ Set-AzureRmSqlServerThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - ExcludedDetectionType Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly - StorageAccountName $params.storageAccount
195
193
$policy = Get-AzureRmSqlServerThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName
196
194
197
195
# Assert
198
196
Assert-AreEqual $policy.ThreatDetectionState " Enabled"
199
197
Assert-AreEqual $policy.NotificationRecipientsEmails " [email protected] ;[email protected] "
200
198
Assert-False {$policy.EmailAdmins }
201
- Assert-AreEqual $policy.ExcludedDetectionTypes.Length 4
199
+ Assert-AreEqual $policy.ExcludedDetectionTypes.Length 3
202
200
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Sql_Injection)}
203
201
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Sql_Injection_Vulnerability)}
204
202
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Access_Anomaly)}
205
- Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Usage_Anomaly)}
206
203
207
204
# Test
208
205
Remove-AzureRmSqlServerThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName
@@ -212,11 +209,10 @@ function Test-ThreatDetectionServerUpdatePolicy
212
209
Assert-AreEqual $policy.ThreatDetectionState " Disabled"
213
210
Assert-AreEqual $policy.NotificationRecipientsEmails " [email protected] ;[email protected] "
214
211
Assert-False {$policy.EmailAdmins }
215
- Assert-AreEqual $policy.ExcludedDetectionTypes.Length 4
212
+ Assert-AreEqual $policy.ExcludedDetectionTypes.Length 3
216
213
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Sql_Injection)}
217
214
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Sql_Injection_Vulnerability)}
218
215
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Access_Anomaly)}
219
- Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Usage_Anomaly)}
220
216
221
217
# Test
222
218
Set-AzureRmSqlServerThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - ExcludedDetectionType None - StorageAccountName $params.storageAccount
0 commit comments