azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

[Feature]: Replace pull default SKR policy from github with MAA Service Discovery API and Policy template

Open praenubilus opened this issue 10 months ago • 1 comments

Description of the new feature

Today default CVM SKR Policy is pull from a public Github repo
https://raw.githubusercontent.com/Azure/confidential-computing-cvm/main/cvm_deployment/key/skr-policy.json . This will hit performance issue with the expanding default policy file and also raising security concerns.

We have decided to replace the current implementation with MAA Service Discovery API to get regional default provider and fill it in the template as following:

{
    "anyOf": [
        {
            "allOf": [
                {
                    "claim": "x-ms-compliance-status",
                    "equals": "azure-compliant-cvm"
                }
            ],
            "authority": "{regional-maa-endpoint}"
        }
    ],
    "version": "1.0.0"
}

The service discovery API from MAA:

GET https://management.azure.com/subscriptions/{your_subscription}/providers/Microsoft.Attestation/Locations/{your_location}/defaultProvider?api-version=2020-10-01

Here is a reference application in Azure Powershell for default provider by location

This REST API is call to ARM, so all that's required is an Azure subscription and an identity (e.g., user, service principal, MSI identity, etc.) with RBAC permissions to access that subscription's resources.

The current implementation in the repo: https://github.com/Azure/azure-powershell/blob/37badb2ffe4fb193ca8d7c661328bea9eb52ec28/src/KeyVault/KeyVault/Commands/Key/AddAzureKeyVaultKey.cs#L77

Proposed implementation details (optional)

For mooncake, Fairfax, USNAT and USSec the API part /subscriptions/{your_subscription}/providers/Microsoft.Attestation/Locations/{your_location}/defaultProvider?api-version=2020-10-01 remain the same. But the arm endpoint https://management.azure.com/ will be different (see below),

  • https://management.usgovcloudapi.net/
  • https://management.chinacloudapi.cn/
  • https://management.azure.eaglex.ic.gov/
  • https://management.azure.microsoft.scloud/

praenubilus avatar Apr 10 '24 08:04 praenubilus

Adding announcement for this change: https://github.com/Azure/azure-powershell/pull/24674

BethanyZhou avatar Apr 22 '24 06:04 BethanyZhou