Skip to content

Bypass 'Get-AzSKAzureServicesSecurityStatus' cmdlet's confirmation prompt for attestation #1184

@vinodsunkara

Description

@vinodsunkara

Bypass 'Get-AzSKAzureServicesSecurityStatus' cmdlet's confirmation prompt for attestation

If possible can you guys please add the force/confirm feature to 'Get-AzSKAzureServicesSecurityStatus' cmdlet.

We are trying to automate the resources attestation using a PowerShell runbook, the attestation is successful. But, we don't see any attestations details in the security report. After further investigation, we found that we do not have a force/confirm switch to bypass the below prompt in automation.

image


Steps to reproduce

# Attestation
foreach ($inputItem in $inputContents) {
    
    $ControlID = $inputItem.ControlID
    $ResourceName = $inputItem.ResourceName
    $AttestationStatus = $inputItem.AttestationStatus
    $JustificationText = $inputItem.JustificationText

    try {
        Get-AzSKAzureServicesSecurityStatus -SubscriptionId $RunAsConnection.SubscriptionId `
            -ResourceNames $ResourceName `
            -ControlsToAttest NotAttested `
            -ControlId $ControlID `
            -AttestationStatus $AttestationStatus `
            -JustificationText $JustificationText

            Write-Host "INFO: Completed the attestation for $ResourceName"
    }
    catch {
        Write-Host "ERROR: Could not attest the resource $ResourceName due to error $_ "
        
    }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions