Share via


Installing and testing the new Azure Security Center Preview Cmdlets

UPDATE 23.09.2018: New Version 0.2 available. Works with the most current AzureRM.Profile now

CAUTION: This post handles pre-release software. Please test carefully in your Lab/Test environment first!

Last week the Azure Security Center (ASC) team released a preview of a new PowerShell module: AzureRM.Security center that allows for managing ASC automatically.

The current version contains these Cmdlets:

Name Version
Get-AzureRmDiscoveredSecuritySolution 0.1.0
Get-AzureRmExternalSecuritySolution 0.1.0
Get-AzureRmJitNetworkAccessPolicy 0.1.0
Get-AzureRmSecurityAlert 0.1.0
Get-AzureRmSecurityAutoProvisioningSetting 0.1.0
Get-AzureRmSecurityCompliance 0.1.0
Get-AzureRmSecurityContact 0.1.0
Get-AzureRmSecurityLocation 0.1.0
Get-AzureRmSecurityPricing 0.1.0
Get-AzureRmSecurityTask 0.1.0
Get-AzureRmSecurityWorkspaceSetting 0.1.0
Remove-AzureRmJitNetworkAccessPolicy 0.1.0
Remove-AzureRmSecurityContact 0.1.0
Remove-AzureRmSecurityWorkspaceSetting 0.1.0
Set-AzureRmJitNetworkAccessPolicy 0.1.0
Set-AzureRmSecurityAlert 0.1.0
Set-AzureRmSecurityAutoProvisioningSetting 0.1.0
Set-AzureRmSecurityContact 0.1.0
Set-AzureRmSecurityPricing 0.1.0
Set-AzureRmSecurityWorkspaceSetting 0.1.0
Start-AzureRmJitNetworkAccessPolicy 0.1.0

 

With this module, you can configure important parts of your ASC automatically (e.g. enable Auto Provisioning, get ASC Alerts etc.).

Requirements

This module has some requirements:

  1. It needs the latest version (1.6.7) of PowerShellGet
  2. It needs a specific version of the AzureRM.Profile (5.5.0)

 

Install the module

To test this module, you have to follow these steps:

  1. Open an admin PowerShell console

  2. Update PowerShellGet

     PS>Install-Module -Name PowerShellGet -Force
    
  3. Install the right AzureRM.Profile version (in addition to newer versions that might already exists on your system)

     PS>Install-Module -name AzureRM.Profile -requiredversion 5.5.0
    
  4. Install the new ASC module

     PS>Install-Module -Name AzureRM.Security -AllowPrerelease
    
  5. Close the PowerShell

 

Test the new module

  1. Open a new PowerShell console

  2. Import AzureRM.Security

     PS>import-module AzureRM.Security
    
  3. Log on to Azure with an Account that has access to ASC

     PS> Connect-AzureRmAccount
    
  4. Test the Cmdlets, e.g.

     PS> Get-AzureRmSecurityAlert
    

 

Happy testing!

If you notice any issues or have questions, please visit the PowerShell Gallery: https://www.powershellgallery.com/packages/AzureRM.Security/0.1.0-preview