Skip to content

Adding support of storage v2 to Sql auditing #615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jul 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ad68185
Adding storage v2 support to Sql audit cmdlets
yoavrubin Jul 13, 2015
89a9293
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
yoavrubin Jul 13, 2015
6e9ed40
Adding test of support of storage v2
yoavrubin Jul 13, 2015
33be4af
removing unneeded line in config + cleanup
yoavrubin Jul 13, 2015
dff1455
Removing initialization of storageV2 client
yoavrubin Jul 13, 2015
39c899e
Changes due to build break
yoavrubin Jul 13, 2015
c9c4242
Updating version
yoavrubin Jul 13, 2015
e933dfb
Re-adding storage v2 client
yoavrubin Jul 13, 2015
417ed60
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
yoavrubin Jul 14, 2015
894b36e
Updated build and changelog
yoavrubin Jul 14, 2015
a6e4ed7
Updating wxi
yoavrubin Jul 14, 2015
790b328
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
yoavrubin Jul 14, 2015
f760368
Merge branch 'dev' of https://github.com/Azure/azure-powershell into dev
yoavrubin Jul 14, 2015
abfb937
Merge branch 'release-0.9.5' of https://github.com/Azure/azure-powers…
yoavrubin Jul 15, 2015
f48508d
Merge branch 'release-0.9.5' of https://github.com/Azure/azure-powers…
yoavrubin Jul 15, 2015
3cb95db
Merge branch 'release-0.9.5' of https://github.com/Azure/azure-powers…
yoavrubin Jul 16, 2015
c2f2b1f
Fixing changelog formatting and wxi file deletions
markcowl Jul 16, 2015
ebf7ddb
Merge pull request #1 from markcowl/release-0.9.5
yoavrubin Jul 16, 2015
aadc3c1
Updated changelog
markcowl Jul 16, 2015
10a4115
Merge pull request #2 from markcowl/release-0.9.5
yoavrubin Jul 16, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
199 changes: 99 additions & 100 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,108 +1,107 @@
2015.07.16 version 0.9.5
2015.07.17 version 0.9.5
* Azure SQL cmdlets
* Allowing to use of Storage V2 accounts in Auditing policies
* Azure RedisCache cmdlets
* Set-AzureRedisCache - Bug fix done in management API that fixes bug here as well, Make return type public
* New-AzureRedisCache - Make return type public
* Get-AzureRedisCache - Make return type public
* Azure Network Resource Provider cmdlets
* Added Application Gateway cmdlets
* New-AzureApplicationGateway
* Start-AzureApplicationGateway
* Stop-AzureApplicationGateway
* SetAzureApplicationGateway
* GetAzureApplicationGateway
* RemoveAzureApplicationGateway
* Added Application Gateway Backend Address Pool cmdlets
* New-AzureApplicationGatewayBackendAddressPool
* Add-AzureApplicationGatewayBackendAddressPool
* Set-AzureApplicationGatewayBackendAddressPool
* Get-AzureApplicationGatewayBackendAddressPool
* Remove-AzureApplicationGatewayBackendAddressPool
* Added Application Gateway Backend HTTP Settings cmdlets
* New-AzureApplicationGatewayBackendHttpSettings
* Add-AzureApplicationGatewayBackendHttpSettings
* Set-AzureApplicationGatewayBackendHttpSettings
* Get-AzureApplicationGatewayBackendHttpSettings
* Remove-AzureApplicationGatewayBackendHttpSettings
* Added Application Gateway Frontend IP Configuration cmdlets
* New-AzureApplicationGatewayFrontendIPConfiguration
* Add-AzureApplicationGatewayFrontendIPConfiguration
* Set-AzureApplicationGatewayFrontendIPConfiguration
* Get-AzureApplicationGatewayFrontendIPConfiguration
* Remove-AzureApplicationGatewayFrontendIPConfiguration
* Added Application Gateway Frontend Port cmdlets
* New-AzureApplicationGatewayFrontendPort
* Add-AzureApplicationGatewayFrontendPort
* Set-AzureApplicationGatewayFrontendPort
* Get-AzureApplicationGatewayFrontendPort
* Remove-AzureApplicationGatewayFrontendPort
* Added Application Gateway IP Configuration cmdlets
* New-AzureApplicationGatewayGatewayIPConfiguration
* Add-AzureApplicationGatewayGatewayIPConfiguration
* Set-AzureApplicationGatewayGatewayIPConfiguration
* Get-AzureApplicationGatewayGatewayIPConfiguration
* Remove-AzureApplicationGatewayGatewayIPConfiguration
* Added Application Gateway HTTP Listener cmdlets
* New-AzureApplicationGatewayHttpListener
* Add-AzureApplicationGatewayHttpListener
* Set-AzureApplicationGatewayHttpListener
* Get-AzureApplicationGatewayHttpListener
* Remove-AzureApplicationGatewayHttpListener
* Added Application Gateway Request Routing Rule cmdlets
* New-AzureApplicationGatewayRequestRoutingRule
* Add-AzureApplicationGatewayRequestRoutingRule
* Set-AzureApplicationGatewayRequestRoutingRule
* Get-AzureApplicationGatewayRequestRoutingRule
* Remove-AzureApplicationGatewayRequestRoutingRule
* Added Application Gateway SKU cmdlets
* New-AzureApplicationGatewaySku
* Set-AzureApplicationGatewaySku
* Get-AzureApplicationGatewaySku
* Added Application Gateway SSL Certificate cmdlets
* New-AzureApplicationGatewaySslCertificate
* Add-AzureApplicationGatewaySslCertificate
* Set-AzureApplicationGatewaySslCertificate
* Get-AzureApplicationGatewaySslCertificate
* Remove-AzureApplicationGatewaySslCertificate
* Fixed minor bugs AzureLoadbalancer
* Renamed Get-AzureCheckDnsAvailablity to Test-AzureDnsAvailability
* Added cmdlets to RouteTables and Routes
* New-AzureRouteTable
* Get-AzureRouteTable
* Set-AzureRouteTable
* Remove-AzureRouteTable
* New-AzureRouteConfig
* Add-AzureRouteConfig
* Set-AzureRouteConfig
* Get-AzureRouteConfig
* Remove-AzureRouteConfig
*Azure Network cmdlets
* Reserved IP cmdlets (New-AzureReservedIP, Get-AzureReservedIP, Set-AzureReservedIPAssociation, Remove-AzureReservedIPAssociation) fixed to support -VirtualIPName parameter
* Multivip Cmdlets (Add-AzureVirtualIP, Remove-AzureVirtualIP) fixed to support -VirtualIPName parameter

2015.07.10 version 1.0.0
* Set-AzureRedisCache - Bug fix done in management API that fixes bug here as well, Make return type public
* New-AzureRedisCache - Make return type public
* Get-AzureRedisCache - Make return type public
* Azure Network Resource Provider cmdlets
* Added Application Gateway cmdlets
* New-AzureApplicationGateway
* Start-AzureApplicationGateway
* Stop-AzureApplicationGateway
* SetAzureApplicationGateway
* GetAzureApplicationGateway
* RemoveAzureApplicationGateway
* Added Application Gateway Backend Address Pool cmdlets
* New-AzureApplicationGatewayBackendAddressPool
* Add-AzureApplicationGatewayBackendAddressPool
* Set-AzureApplicationGatewayBackendAddressPool
* Get-AzureApplicationGatewayBackendAddressPool
* Remove-AzureApplicationGatewayBackendAddressPool
* Added Application Gateway Backend HTTP Settings cmdlets
* New-AzureApplicationGatewayBackendHttpSettings
* Add-AzureApplicationGatewayBackendHttpSettings
* Set-AzureApplicationGatewayBackendHttpSettings
* Get-AzureApplicationGatewayBackendHttpSettings
* Remove-AzureApplicationGatewayBackendHttpSettings
* Added Application Gateway Frontend IP Configuration cmdlets
* New-AzureApplicationGatewayFrontendIPConfiguration
* Add-AzureApplicationGatewayFrontendIPConfiguration
* Set-AzureApplicationGatewayFrontendIPConfiguration
* Get-AzureApplicationGatewayFrontendIPConfiguration
* Remove-AzureApplicationGatewayFrontendIPConfiguration
* Added Application Gateway Frontend Port cmdlets
* New-AzureApplicationGatewayFrontendPort
* Add-AzureApplicationGatewayFrontendPort
* Set-AzureApplicationGatewayFrontendPort
* Get-AzureApplicationGatewayFrontendPort
* Remove-AzureApplicationGatewayFrontendPort
* Added Application Gateway IP Configuration cmdlets
* New-AzureApplicationGatewayGatewayIPConfiguration
* Add-AzureApplicationGatewayGatewayIPConfiguration
* Set-AzureApplicationGatewayGatewayIPConfiguration
* Get-AzureApplicationGatewayGatewayIPConfiguration
* Remove-AzureApplicationGatewayGatewayIPConfiguration
* Added Application Gateway HTTP Listener cmdlets
* New-AzureApplicationGatewayHttpListener
* Add-AzureApplicationGatewayHttpListener
* Set-AzureApplicationGatewayHttpListener
* Get-AzureApplicationGatewayHttpListener
* Remove-AzureApplicationGatewayHttpListener
* Added Application Gateway Request Routing Rule cmdlets
* New-AzureApplicationGatewayRequestRoutingRule
* Add-AzureApplicationGatewayRequestRoutingRule
* Set-AzureApplicationGatewayRequestRoutingRule
* Get-AzureApplicationGatewayRequestRoutingRule
* Remove-AzureApplicationGatewayRequestRoutingRule
* Added Application Gateway SKU cmdlets
* New-AzureApplicationGatewaySku
* Set-AzureApplicationGatewaySku
* Get-AzureApplicationGatewaySku
* Added Application Gateway SSL Certificate cmdlets
* New-AzureApplicationGatewaySslCertificate
* Add-AzureApplicationGatewaySslCertificate
* Set-AzureApplicationGatewaySslCertificate
* Get-AzureApplicationGatewaySslCertificate
* Remove-AzureApplicationGatewaySslCertificate
* Fixed minor bugs AzureLoadbalancer
* Renamed Get-AzureCheckDnsAvailablity to Test-AzureDnsAvailability
* Added cmdlets to RouteTables and Routes
* New-AzureRouteTable
* Get-AzureRouteTable
* Set-AzureRouteTable
* Remove-AzureRouteTable
* New-AzureRouteConfig
* Add-AzureRouteConfig
* Set-AzureRouteConfig
* Get-AzureRouteConfig
* Remove-AzureRouteConfig
* Azure Network cmdlets
* Reserved IP cmdlets (New-AzureReservedIP, Get-AzureReservedIP, Set-AzureReservedIPAssociation, Remove-AzureReservedIPAssociation) fixed to support -VirtualIPName parameter
* Multivip Cmdlets (Add-AzureVirtualIP, Remove-AzureVirtualIP) fixed to support -VirtualIPName parameter
* Azure Backup cmdlets
*Added New-AzureBackupVault cmdlets
*Added Get-AzureBackupVault cmdlets
*Added Set-AzureBackupVault cmdlets
*Added Remove-AzureBackupVault cmdlets
*Added Get-AzureBackupVaultCredential cmdlets
*Added New-AzureBackupVault cmdlets
*Added Get-AzureBackupVault cmdlets
*Added Set-AzureBackupVault cmdlets
*Added Remove-AzureBackupVault cmdlets
*Added Get-AzureBackupVaultCredential cmdlets
* Azure Resource Manager cmdlets
* Fixed formatting of output for Get-UsageAggregates
* Fixed executing Get-UsageAggregates when first cmdlet being called.
* Fixed formatting of output for Get-UsageAggregates
* Fixed executing Get-UsageAggregates when first cmdlet being called.
* Added TrafficManager cmdlets
* Enable-AzureTrafficManagerProfile
* Disable-AzureTrafficManagerProfile
* New-AzureTrafficManagerEndpoint
* Get-AzureTrafficManagerEndpoint
* Set-AzureTrafficManagerEndpoint
* Remove-AzureTrafficManagerEndpoint
* Enable-AzureTrafficManagerEndpoint
* Disable-AzureTrafficManagerEndpoint
* Enable-AzureTrafficManagerProfile
* Disable-AzureTrafficManagerProfile
* New-AzureTrafficManagerEndpoint
* Get-AzureTrafficManagerEndpoint
* Set-AzureTrafficManagerEndpoint
* Remove-AzureTrafficManagerEndpoint
* Enable-AzureTrafficManagerEndpoint
* Disable-AzureTrafficManagerEndpoint
* Upgraded TrafficManager cmdlets
* Get-AzureTrafficManagerProfile
* Name is now optional (it will list all profiles in resource group)
* Resource group is now optional (it will list all profiles in subscription)

* Get-AzureTrafficManagerProfile
* Name is now optional (it will list all profiles in resource group)
* Resource group is now optional (it will list all profiles in subscription)
* Azure Data Factory cmdlets
* Upgraded management library to 1.0.0 with breaking JSON format change.
* Updated list operation paging support in cmdlets.
Expand Down
4 changes: 4 additions & 0 deletions setup/azurecmdfiles.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,9 @@
<Component Id="cmp95CE3E0A8DCAF570E9BB97BACD5D3D37" Guid="*">
<File Id="fil6C841008462630CCAC59CB99E8D9FFB1" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Sql\Microsoft.Azure.Management.Sql.dll" />
</Component>
<Component Id="cmpA6382DD7FA07C06254423D6530966AA3" Guid="*">
<File Id="fil7310B877A7D30750513E4C104A721DD2" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Sql\Microsoft.Azure.Management.Storage.dll" />
</Component>
<Component Id="cmpEC1BF12EB3CCE29C1628238CC52B4380" Guid="*">
<File Id="fil6B289741EE9328CDED33E1F242EF95C6" KeyPath="yes" Source="$(var.sourceDir)\ResourceManager\AzureResourceManager\Sql\Microsoft.Azure.ResourceManager.dll" />
</Component>
Expand Down Expand Up @@ -4545,6 +4548,7 @@
<ComponentRef Id="cmpDA20E40FD1BE07A113851AFDBA89787D" />
<ComponentRef Id="cmp2C144B41FAE124CE1C9921E8B7DB9776" />
<ComponentRef Id="cmp95CE3E0A8DCAF570E9BB97BACD5D3D37" />
<ComponentRef Id="cmpA6382DD7FA07C06254423D6530966AA3" />
<ComponentRef Id="cmpEC1BF12EB3CCE29C1628238CC52B4380" />
<ComponentRef Id="cmp818CABBA9AFBAC0A3B15EBA346EF1EDD" />
<ComponentRef Id="cmpD1FFC10879A7E53D48A22EEACFB20B99" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
<Reference Include="Microsoft.Azure.Management.Sql">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Sql.0.28.0-prerelease\lib\net40\Microsoft.Azure.Management.Sql.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.Storage">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Storage.2.4.0-preview\lib\net40\Microsoft.Azure.Management.Storage.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.1-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -281,6 +284,7 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestDatabaseUpdatePolicyWithStorage.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestDatabaseUpdatePolicyWithStorageV2.json" />
<None Include="SessionRecords\Microsoft.Azure.Commands.ScenarioTest.SqlTests.SecurityTests\TestDisableDatabaseAuditing.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
11 changes: 11 additions & 0 deletions src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/Common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ function Create-TestEnvironmentWithParams ($params)
New-AzureResourceGroup -Name $params.rgname -Location "West US" -TemplateFile ".\Templates\sql-audit-test-env-setup.json" -serverName $params.serverName -databaseName $params.databaseName -EnvLocation "West US" -Force
}

<#
.SYNOPSIS
Creates the test environment needed to perform the Sql auditing tests, while using storage V2 as the used storage account
#>
function Create-TestEnvironmentWithStorageV2 ($testSuffix)
{
$params = Get-SqlAuditingTestEnvironmentParameters $testSuffix
New-AzureResourceGroup -Name $params.rgname -Location "West US" -TemplateFile ".\Templates\sql-audit-test-env-setup.json" -serverName $params.serverName -databaseName $params.databaseName -EnvLocation "West US" -Force
New-AzureStorageAccount -Name $params.storageAccount -Location "West US" -ResourceGroupName $params.rgname -Type "Standard_GRS"
}

<#
.SYNOPSIS
Creates the test environment needed to perform the Sql data masking tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,51 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Test;
using Microsoft.Azure.Test.HttpRecorder;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;

namespace Microsoft.Azure.Commands.ScenarioTest.SqlTests
{
public class SecurityTests : SqlTestsBase
{
protected Microsoft.Azure.Management.Storage.StorageManagementClient GetStorageV2Client()
{
var client = TestBase.GetServiceClient<Microsoft.Azure.Management.Storage.StorageManagementClient>(new CSMTestEnvironmentFactory());
if (HttpMockServer.Mode == HttpRecorderMode.Playback)
{
client.LongRunningOperationInitialTimeout = 0;
client.LongRunningOperationRetryTimeout = 0;
}
return client;
}

protected override void SetupManagementClients()
{
var sqlCSMClient = GetSqlClient(); // to interact with the security endpoints
var storageClient = GetStorageClient();
var storageV2Client = GetStorageV2Client();
var resourcesClient = GetResourcesClient();
var authorizationClient = GetAuthorizationManagementClient();
helper.SetupSomeOfManagementClients(sqlCSMClient, storageClient, storageV2Client, resourcesClient, authorizationClient);
}


[Fact(Skip = "Skip for the version header upgrade on Storage library.")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestDatabaseUpdatePolicyWithStorage()
{
RunPowerShellTest("Test-DatabaseUpdatePolicyWithStorage");
}

[Fact(Skip = "Skip for the version header upgrade on Storage library.")]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestDatabaseUpdatePolicyWithStorageV2()
{
RunPowerShellTest("Test-DatabaseUpdatePolicyWithStorageV2");
}

[Fact(Skip = "Skip for the version header upgrade on Storage library.")]
[Trait(Category.RunType, Category.LiveOnly)]
public void TestServerUpdatePolicyWithStorage()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,36 @@
# limitations under the License.
# ----------------------------------------------------------------------------------


<#
.SYNOPSIS
Tests that when setting the storage account property's value in a database's auditing policy, that value is later fetched properly
#>
function Test-DatabaseUpdatePolicyWithStorageV2
{
# Setup
$testSuffix = 102
Create-TestEnvironmentWithStorageV2 $testSuffix
$params = Get-SqlAuditingTestEnvironmentParameters $testSuffix

try
{
# Test
Set-AzureSqlDatabaseAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName -StorageAccountName $params.storageAccount
$policy = Get-AzureSqlDatabaseAuditingPolicy -ResourceGroupName $params.rgname -ServerName $params.serverName -DatabaseName $params.databaseName

# Assert
Assert-AreEqual $policy.StorageAccountName $params.storageAccount
Assert-AreEqual $policy.AuditState "Enabled"
Assert-AreEqual $policy.UseServerDefault "Disabled"
}
finally
{
# Cleanup
Remove-TestEnvironment $testSuffix
}
}

<#
.SYNOPSIS
Tests that when setting the storage account property's value in a database's auditing policy, that value is later fetched properly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ namespace Microsoft.Azure.Commands.ScenarioTest.SqlTests
{
public class SqlTestsBase
{
private EnvironmentSetupHelper helper;
protected EnvironmentSetupHelper helper;

protected SqlTestsBase()
{
helper = new EnvironmentSetupHelper();
}

protected void SetupManagementClients()
protected virtual void SetupManagementClients()
{
var sqlCSMClient = GetSqlClient(); // to interact with the security endpoints
var storageClient = GetStorageClient();
Expand Down Expand Up @@ -95,7 +95,7 @@ protected ResourceManagementClient GetResourcesClient()
return client;
}

private AuthorizationManagementClient GetAuthorizationManagementClient()
protected AuthorizationManagementClient GetAuthorizationManagementClient()
{
AuthorizationManagementClient client = TestBase.GetServiceClient<AuthorizationManagementClient>(new CSMTestEnvironmentFactory());
if (HttpMockServer.Mode == HttpRecorderMode.Playback)
Expand All @@ -104,7 +104,6 @@ private AuthorizationManagementClient GetAuthorizationManagementClient()
client.LongRunningOperationRetryTimeout = 0;
}
return client;

}
}
}
Loading