-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Support Advanced Threat Protection policy management #8523
Conversation
Can one of the admins verify this patch? |
@azuresdkci Add to whitelist |
@shblum Please link existing design review or fill out a new design review here: https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues |
Design review link is in the description. |
@shblum Please fix help validation errors: https://azuresdkci.westus2.cloudapp.azure.com/job/powershell/10723/artifact/artifacts/ValidateHelpIssues.csv/*view*/ |
Add DefaultParameterSetName
Fixed |
function Get-AdvancedThreatProtectionTestEnvironmentParameters ($testSuffix) | ||
{ | ||
return @{ subscriptionId = (Get-AzContext).Subscription.Id; | ||
rgName = "storage-atp-cmdlet-test-rg" +$testSuffix; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use "getAssetName" to add an element of randomness to your resource name generation.
rgName = "storage-atp-cmdlet-test-rg" +$testSuffix; | ||
accountName = "storage" +$testSuffix; | ||
storageSku = "Standard_GRS"; | ||
location = "West Central US" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use GetLocation -ProviderNamespace <namespace> -ResourceType <resourcetype> -PreferredLocation "West Central US"
to future proof the recording process.
@@ -63,21 +63,33 @@ public void RunPowerShellTest(ServiceManagement.Common.Models.XunitTracingInterc | |||
_helper.RMProfileModule, | |||
_helper.GetRMModulePath(@"AzureRM.Security.psd1"), | |||
"ScenarioTests\\Common.ps1", | |||
"ScenarioTests\\" + callingClassName + ".ps1"); | |||
"ScenarioTests\\" + callingClassName + ".ps1", | |||
_helper.GetRMModulePath(@"AzureRM.Resources"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using the Resources and Storage modules, please use our internal version of these cmdlets. This is just changing this import to the two ps1 files:
azure-powershell/src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/TestsBase.cs
Line 145 in d99d9f8
"AzureRM.Storage.ps1", |
azure-powershell/src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/TestsBase.cs
Line 32 in d99d9f8
using Microsoft.Azure.Management.Storage.Version2017_10_01; |
azure-powershell/src/RecoveryServices/RecoveryServices.Backup.Test/ScenarioTests/TestsBase.cs
Line 29 in d99d9f8
using Microsoft.Azure.Management.Internal.Resources; |
@@ -11,7 +11,8 @@ | |||
</PropertyGroup> | |||
|
|||
<ItemGroup> | |||
<PackageReference Include="Microsoft.Azure.Management.SecurityCenter" Version="0.10.0-preview" /> | |||
<PackageReference Include="Microsoft.Azure.Management.SecurityCenter" Version="0.11.0-preview" /> | |||
<PackageReference Include="Microsoft.Azure.Management.Storage" Version="9.1.0-preview" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this once you update to the common client.
@@ -41,6 +41,9 @@ Gets the pricing tier data for Azure Security Center for a scope. | |||
### [Get-AzSecurityTask](Get-AzSecurityTask.md) | |||
Gets the security tasks that Azure Security Center recommends you to do in order to strengthen your security posture. | |||
|
|||
### [Get-AzSecurityThreatProtection](Get-AzSecurityThreatProtection.md) | |||
{{Fill in the Synopsis}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please copy over the synopsis here for the two new cmdlets.
``` | ||
|
||
## DESCRIPTION | ||
The "Get-AzSecurityThreatProtection" cmdlet gets the threat protetion policy of a storage account. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*protection
|
||
### Example 1 | ||
```powershell | ||
PS C:\> Get-AzSecurityThreatProtection -ResourceId "/subscriptions/cma24pc8-89b5-4aa7-9ff6-486e886c304a/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add example output for all examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also remove the subscription and replace with xxxxxxx-xxxx-xxxx-xxxxxxxxxxxxx
PS C:\> Get-AzSecurityThreatProtection -ResourceId "/subscriptions/cma24pc8-89b5-4aa7-9ff6-486e886c304a/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount/" | ||
``` | ||
|
||
This command gets the threat protection policy for resource id "/subscriptions/cma24pc8-89b5-4aa7-9ff6-486e886c304a/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount/". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xxxxxxx-xxxx-xxxx-xxxxxxxxxxxxx for subscription
Just to reiterate Cormac's comments in the design review, this design is fine for a preview release, but will need to be revisited before the stable release as it doesn't match our standards for stable. |

Description
Adding Get/Set Advanced Threat Protection cmdlets + Tests + Help files.
Design Review: https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/237
Checklist
CONTRIBUTING.md
platyPS
module