Skip to content

Commit 93d0cff

Browse files
committed
Bug fixes
- removing direct access - removing masking level - blocking auditing policy setting for old tiers
1 parent 98d660c commit 93d0cff

File tree

44 files changed

+15476
-60858
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+15476
-60858
lines changed

src/ResourceManager/Sql/Commands.Sql.Test/Commands.Sql.Test.csproj

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,6 @@
242242
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.DataMaskingTests\TestDatabaseDataMaskingBasicRuleLifecycle.json">
243243
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
244244
</None>
245-
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.DataMaskingTests\TestDatabaseDataMaskingLevelChanges.json">
246-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
247-
</None>
248245
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.DataMaskingTests\TestDatabaseDataMaskingNumberRuleLifecycle.json">
249246
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
250247
</None>
@@ -260,83 +257,77 @@
260257
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.DataMaskingTests\TestDatabaseDataMaskingTextRuleLifecycle.json">
261258
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
262259
</None>
263-
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestDatabaseDirectAccess.json">
264-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
265-
</None>
266260
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestDatabaseDisableEnableKeepProperties.json">
267-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
261+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
268262
</None>
269263
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestDatabaseRetentionKeepProperties.json">
270-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
264+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
271265
</None>
272266
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestDatabaseStorageKeyRotation.json">
273-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
267+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
274268
</None>
275269
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestDatabaseUpdatePolicyKeepPreviousStorage.json">
276-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
270+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
277271
</None>
278272
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestDatabaseUpdatePolicyWithEventTypes.json">
279-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
273+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
280274
</None>
281275
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestDatabaseUpdatePolicyWithEventTypeShortcuts.json">
282-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
276+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
283277
</None>
284278
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestDatabaseUpdatePolicyWithRetention.json">
285-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
279+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
286280
</None>
287281
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestDatabaseUpdatePolicyWithStorage.json">
288-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
282+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
289283
</None>
290284
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestDisableDatabaseAuditing.json">
291-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
285+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
292286
</None>
293287
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestDisableServerAuditing.json">
294-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
288+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
295289
</None>
296290
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestFailedDatabaseUpdatePolicyWithNoStorage.json">
297-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
291+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
298292
</None>
299293
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestFailedServerUpdatePolicyWithNoStorage.json">
300-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
294+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
301295
</None>
302296
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestFailedUseServerDefault.json">
303-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
297+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
304298
</None>
305299
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestFailWithBadDatabaseIndentity.json">
306-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
300+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
307301
</None>
308302
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestFailWithBadServerIndentity.json">
309-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
310-
</None>
311-
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestServerDirectAccess.json">
312-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
303+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
313304
</None>
314305
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestServerDisableEnableKeepProperties.json">
315-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
306+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
316307
</None>
317308
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestServerRetentionKeepProperties.json">
318-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
309+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
319310
</None>
320311
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestServerStorageKeyRotation.json">
321-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
312+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
322313
</None>
323314
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestServerUpdatePolicyKeepPreviousStorage.json">
324-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
315+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
325316
</None>
326317
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestServerUpdatePolicyWithEventTypes.json">
327-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
318+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
328319
</None>
329320
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestServerUpdatePolicyWithEventTypeShortcuts.json">
330-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
321+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
331322
</None>
332323
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestServerUpdatePolicyWithRetention.json">
333-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
324+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
334325
</None>
335326
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestServerUpdatePolicyWithStorage.json">
336-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
327+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
337328
</None>
338329
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestUseServerDefault.json">
339-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
330+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
340331
</None>
341332
<None Include="SessionRecords\Microsoft.Azure.Commands.Sql.Test.ScenarioTests.DatabaseActivationTests\TestDatabasePauseResume.json">
342333
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DataMaskingTests.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ public void TestDatabaseDataMaskingPolicyEnablementToggling()
2727
RunPowerShellTest("Test-DatabaseDataMaskingPolicyEnablementToggling");
2828
}
2929

30-
[Fact]
31-
[Trait(Category.RunType, Category.LiveOnly)]
32-
public void TestDatabaseDataMaskingLevelChanges()
33-
{
34-
RunPowerShellTest("Test-DatabaseDataMaskingLevelChanges");
35-
}
36-
3730
[Fact]
3831
[Trait(Category.RunType, Category.LiveOnly)]
3932
public void TestDatabaseDataMaskingPrivilegedLoginsChanges()

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DataMaskingTests.ps1

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -51,59 +51,9 @@ function Test-DatabaseDataMaskingPolicyEnablementToggling
5151
}
5252
}
5353

54-
55-
<#
56-
.SYNOPSIS
57-
Tests changes of the masking level property of a data masking policy
58-
#>
59-
function Test-DatabaseDataMaskingLevelChanges
60-
{
61-
62-
# Setup
63-
$testSuffix = 20777
64-
$params = Create-DataMaskingTestEnvironment $testSuffix
65-
66-
try
67-
{
68-
# Test
69-
Set-AzureSqlDatabaseDataMaskingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName -MaskingLevel "Standard"
70-
$policy = Get-AzureSqlDatabaseDataMaskingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
71-
72-
# Assert
73-
Assert-AreEqual $policy.MaskingLevel "Standard"
74-
75-
# Test
76-
Set-AzureSqlDatabaseDataMaskingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName -DataMaskingState "Enabled"
77-
$policy = Get-AzureSqlDatabaseDataMaskingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
78-
79-
# Assert
80-
Assert-AreEqual $policy.MaskingLevel "Standard"
81-
82-
83-
# Test
84-
Set-AzureSqlDatabaseDataMaskingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName -MaskingLevel "Extended"
85-
$policy = Get-AzureSqlDatabaseDataMaskingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
86-
87-
# Assert
88-
Assert-AreEqual $policy.MaskingLevel "Extended"
89-
90-
# Test
91-
Set-AzureSqlDatabaseDataMaskingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName -MaskingLevel "Standard"
92-
$policy = Get-AzureSqlDatabaseDataMaskingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
93-
94-
# Assert
95-
Assert-AreEqual $policy.MaskingLevel "Standard"
96-
}
97-
finally
98-
{
99-
# Cleanup
100-
}
101-
}
102-
103-
10454
<#
10555
.SYNOPSIS
106-
Tests changes of the masking level property of a data masking policy
56+
Tests changes of the privileged logins property of a data masking policy
10757
#>
10858
function Test-DatabaseDataMaskingPrivilegedLoginsChanges
10959
{

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/SecurityTests.cs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ public void TestDatabaseUpdatePolicyWithStorage()
2626
RunPowerShellTest("Test-DatabaseUpdatePolicyWithStorage");
2727
}
2828

29-
[Fact]
29+
[Fact(Skip = "Skip for the version header upgrade on Storage library.")]
3030
[Trait(Category.RunType, Category.LiveOnly)]
3131
public void TestServerUpdatePolicyWithStorage()
3232
{
3333
RunPowerShellTest("Test-ServerUpdatePolicyWithStorage");
3434
}
3535

36-
[Fact]
36+
[Fact(Skip = "Skip for the version header upgrade on Storage library.")]
3737
public void TestDatabaseUpdatePolicyWithEventTypes()
3838
{
3939
RunPowerShellTest("Test-DatabaseUpdatePolicyWithEventTypes");
4040
}
4141

42-
[Fact]
42+
[Fact(Skip = "Skip for the version header upgrade on Storage library.")]
4343
[Trait(Category.RunType, Category.LiveOnly)]
4444
public void TestServerUpdatePolicyWithEventTypes()
4545
{
@@ -157,14 +157,6 @@ public void TestFailWithBadServerIndentity()
157157
RunPowerShellTest("Test-FailWithBadServerIndentity");
158158
}
159159

160-
[Fact(Skip = "Skip for the version header upgrade on Storage library.")]
161-
[Trait(Category.RunType, Category.LiveOnly)]
162-
[Trait(Category.AcceptanceType, Category.CheckIn)]
163-
public void TestDatabaseDirectAccess()
164-
{
165-
RunPowerShellTest("Test-DatabaseDirectAccess");
166-
}
167-
168160
[Fact(Skip = "Skip for the version header upgrade on Storage library.")]
169161
[Trait(Category.RunType, Category.LiveOnly)]
170162
[Trait(Category.AcceptanceType, Category.CheckIn)]
@@ -181,28 +173,28 @@ public void TestServerStorageKeyRotation()
181173
RunPowerShellTest("Test-ServerStorageKeyRotation");
182174
}
183175

184-
[Fact]
176+
[Fact(Skip = "Skip for the version header upgrade on Storage library.")]
185177
[Trait(Category.RunType, Category.LiveOnly)]
186178
public void TestServerUpdatePolicyWithRetention()
187179
{
188180
RunPowerShellTest("Test-ServerUpdatePolicyWithRetention");
189181
}
190182

191-
[Fact]
183+
[Fact(Skip = "Skip for the version header upgrade on Storage library.")]
192184
[Trait(Category.RunType, Category.LiveOnly)]
193185
public void TestDatabaseUpdatePolicyWithRetention()
194186
{
195187
RunPowerShellTest("Test-DatabaseUpdatePolicyWithRetention");
196188
}
197189

198-
[Fact]
190+
[Fact(Skip = "Skip for the version header upgrade on Storage library.")]
199191
[Trait(Category.RunType, Category.LiveOnly)]
200192
public void TestServerRetentionKeepProperties()
201193
{
202194
RunPowerShellTest("Test-ServerRetentionKeepProperties");
203195
}
204196

205-
[Fact]
197+
[Fact(Skip = "Skip for the version header upgrade on Storage library.")]
206198
[Trait(Category.RunType, Category.LiveOnly)]
207199
public void TestDatabaseRetentionKeepProperties()
208200
{

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/SecurityTests.ps1

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -611,48 +611,6 @@ function Test-FailWithBadServerIndentity
611611
}
612612
}
613613

614-
<#
615-
.SYNOPSIS
616-
Tests that the direct access property is getting updated correctly for a sql database
617-
#>
618-
function Test-DatabaseDirectAccess
619-
{
620-
# Setup
621-
$testSuffix = 551
622-
Create-TestEnvironment $testSuffix
623-
$params = Get-SqlAuditingTestEnvironmentParameters $testSuffix
624-
625-
try
626-
{
627-
# Test
628-
Enable-AzureSqlDatabaseDirectAccess -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
629-
$policy = Get-AzureSqlDatabaseSecureConnectionPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
630-
631-
# Assert
632-
Assert-AreEqual $policy.SecureConnectionState "Optional"
633-
634-
# Test
635-
Disable-AzureSqlDatabaseDirectAccess -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
636-
$policy = Get-AzureSqlDatabaseSecureConnectionPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
637-
638-
# Assert
639-
Assert-AreEqual $policy.SecureConnectionState "Required"
640-
641-
# Test
642-
Enable-AzureSqlDatabaseDirectAccess -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
643-
$policy = Get-AzureSqlDatabaseSecureConnectionPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName
644-
645-
# Assert
646-
Assert-AreEqual $policy.SecureConnectionState "Optional"
647-
648-
}
649-
finally
650-
{
651-
# Cleanup
652-
Remove-TestEnvironment $testSuffix
653-
}
654-
}
655-
656614
<#
657615
.SYNOPSIS
658616
Tests that storage key rotation process for a policy of a Sql database server is managed properly

0 commit comments

Comments
 (0)