manifests/collectors/Security/KeyVaultKeys.psd1
|
# # GENERATED by scripts/Build-ScoutServiceCollector.ps1 from manifests/specs/service-collectors.psd1 (AB#6741). # Authored as data -- there is no source collector script to drift from. Edit the spec and # regenerate; do not hand-patch this file. # @{ ResourceTypes = @( 'AZSC/ARMChild/KeyVaultKeys' ) ResourceTypeMatching = 'Grouped' AdditionalFilter = $null FilterPreamble = '' RowLoopVariable = '1' Preamble = @' $ResUCount = 1 $data = $1.PROPERTIES $sub1 = $SUB | Where-Object { $_.id -eq $1.subscriptionId } $KeyName = if([string]::IsNullOrEmpty($1.name)){$null}else{(([string]$1.name) -split '/')[-1]} $Expires = if($null -eq $data.attributes.exp){''}else{[string]([datetime]::UnixEpoch).AddSeconds([double]$data.attributes.exp).ToString('yyyy-MM-dd')} $DaysToExpiry = if($null -eq $data.attributes.exp){$null}else{[math]::Floor(((([datetime]::UnixEpoch).AddSeconds([double]$data.attributes.exp)) - $ScoutRunTime).TotalDays)} $ExpiryStatus = if($null -eq $DaysToExpiry){'No expiry set'}elseif($DaysToExpiry -lt 0){'EXPIRED'}elseif($DaysToExpiry -le 30){'Expires within 30 days'}elseif($DaysToExpiry -le 90){'Expires within 90 days'}else{'OK'} '@ AdditionalRowLoops = @() TagLoop = $null Fields = @( @{ Name = 'ID' Expression = '$1.id' } @{ Name = 'Subscription' Expression = '$sub1.Name' } @{ Name = 'Resource Group' Expression = '$1.RESOURCEGROUP' } @{ Name = 'Key Vault' Expression = '$1.PARENTNAME' } @{ Name = 'Key' Expression = '$KeyName' } @{ Name = 'Key Type' Expression = '$data.kty' } @{ Name = 'Key Size' Expression = '[string]$data.keySize' } @{ Name = 'Curve' Expression = '$data.curveName' } @{ Name = 'Enabled' Expression = '[string]$data.attributes.enabled' } @{ Name = 'Expires' Expression = '$Expires' } @{ Name = 'Days To Expiry' Expression = '[string]$DaysToExpiry' } @{ Name = 'Expiry Status' Expression = '$ExpiryStatus' } @{ Name = 'Rotation Policy' Expression = '[string]$data.rotationPolicy.lifetimeActions.Count' } @{ Name = 'Resource U' Expression = '$ResUCount' } ) Export = @{ WorksheetName = 'Key Vault Keys' TableNamePrefix = 'KeyVaultKeysTable_' Columns = @( 'Subscription' 'Resource Group' 'Key Vault' 'Key' 'Key Type' 'Key Size' 'Curve' 'Enabled' 'Expires' 'Days To Expiry' 'Expiry Status' 'Rotation Policy' 'Resource U' ) TagColumns = @() NumberFormat = '0' ConditionalText = @() } } |