Skip to content

Commit

Permalink
Removed Get-ASCDataCollection cmdlet
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Kassis committed Dec 12, 2017
1 parent cb67226 commit d33a4b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 81 deletions.
2 changes: 1 addition & 1 deletion Azure-Security-Center.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'Azure-Security-Center.psm1'

# Version number of this module.
ModuleVersion = '0.0.18'
ModuleVersion = '0.0.19'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
81 changes: 1 addition & 80 deletions Azure-Security-Center.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Build-ASCPolicy -PolicyName Default
The above example simply shows the existing configuration for the specified policy.
.EXAMPLE
Build-ASCPolicy -PolicyName Default -AllOff -LogCollection Off -SecurityContactEmail "[email protected]","[email protected]"
Build-ASCPolicy -PolicyName Default -AllOff -DataCollection Off -SecurityContactEmail "[email protected]","[email protected]"
{
"properties": {
Expand Down Expand Up @@ -943,85 +943,6 @@ function Set-ASCAlert {
}
<#
.Synopsis
Get-ASCDataCollection
.DESCRIPTION
Retrieves data collection information around the specified resource.
.EXAMPLE
Get-ASCDataCollection -ComputeType Compute -ResourceGroup CXP-MIKE -VM "2012R2-DC1" | fl -Force
id : /subscriptions/6b1ceacd-5921-4780-8f96-2078ad96fd96/resourceGroups/CXP-MIKE/providers/Microsoft.Compute/virtualMachines/2012R2-DC1//providers/Micros
oft.Security/securityStatuses/Patch
name : Patch
type : Microsoft.Security/securityStatuses
properties : @{missingPatches=System.Object[]; name=PatchSecurityDataProperties; type=Patch}
id : /subscriptions/6b1ceacd-5921-4780-8f96-2078ad96fd96/resourceGroups/CXP-MIKE/providers/Microsoft.Compute/virtualMachines/2012R2-DC1//providers/Micros
oft.Security/securityStatuses/Baseline
name : Baseline
type : Microsoft.Security/securityStatuses
properties : @{failedBaselineRules=System.Object[]; name=BaselineSecurityDataProperties; type=Baseline}
id : /subscriptions/6b1ceacd-5921-4780-8f96-2078ad96fd96/resourceGroups/CXP-MIKE/providers/Microsoft.Compute/virtualMachines/2012R2-DC1//providers/Micros
oft.Security/securityStatuses/Antimalware
name : Antimalware
type : Microsoft.Security/securityStatuses
properties : @{antimalwareScenarios=System.Object[]; name=AntimalwareSecurityDataProperties; type=Antimalware}
The above example retrieves data collection information for the specified resource.
#>
function Get-ASCDataCollection {
[CmdletBinding()]
Param
(
# Specify compute type. 'Compute' or 'Classic Compute'
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$false)]
[ValidateSet('Compute','Classic Compute')]
[string]$ComputeType,

# Specify resource group.
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$false)]
[string]$ResourceGroup,

# Specify VM name.
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$false)]
[string]$VM,

# Security API version. By default this uses the $asc_version variable which this module pre-sets. Only specify this if necessary.
[Parameter(Mandatory=$false)]
[string]$Version
)

Begin {
Show-Warning
Set-Context
if (!$Version) {$Version = $asc_version}
$asc_APIVersion = "?api-version=$Version" #Build version syntax.
$asc_endpoint = 'dataCollectionResults' #Set endpoint.

$asc_resourceGroup = $ResourceGroup
$asc_compute = $ComputeType
$asc_vm = $VM
}
Process {
$asc_uri = "https://$asc_url/subscriptions/$asc_subscriptionId/resourceGroups/$asc_resourceGroup/providers/microsoft.$asc_compute/virtualMachines/$asc_vm/providers/microsoft.Security/$asc_endpoint$asc_APIVersion"
Try {
Write-Verbose "Retrieving data for $asc_vm..."
$asc_request = Invoke-RestMethod -Uri $asc_uri -Method Get -Headers $asc_requestHeader
$asc_request
}
Catch {
Write-Error $_
}
}
End {
}
}
<#
.Synopsis
Get-ASCLocation
.DESCRIPTION
Retrieves data center location information for Azure Security Center data.
Expand Down

0 comments on commit d33a4b9

Please sign in to comment.