Skip to content

Commit 0e276f2

Browse files
authored
Merge pull request #230386 from agowdamsft/agowdamsft-patch-skr-3
AKV SKR Related PR
2 parents e98d0b2 + 630b265 commit 0e276f2

File tree

11 files changed

+1183
-1
lines changed

11 files changed

+1183
-1
lines changed

articles/confidential-computing/TOC.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,18 @@
122122
- name: How To
123123
expanded: true
124124
items:
125+
- name: concept
126+
items:
127+
- name: Secure Key Release (SKR) with Azure Key Vault
128+
items:
129+
- name: SKR with Azure Confidential Computing Concept
130+
href: concept-skr-attestation.md
131+
- name: SKR with AMD SEV-SNP based Confidential VMs
132+
href: skr-flow-confidential-vm-sev-snp.md
133+
- name: SKR with Confidential containers on Azure Container Instance
134+
href: skr-flow-confidential-containers-azure-container-instance.md
135+
- name: SKR Policy Examples
136+
href: skr-policy-examples.md
125137
- name: Partner Solutions
126138
items:
127139
- name: Fortanix
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
title: Secure Key Release with Azure Key Vault and Azure Confidential Computing
3+
description: Concept guide on what SKR is and its usage with Azure Confidential Computing Offerings
4+
author: agowdamsft
5+
ms.service: virtual-machines
6+
ms.subservice: confidential-computing
7+
ms.workload: infrastructure
8+
ms.topic: conceptual
9+
ms.date: 2/2/2023
10+
ms.author: amgowda
11+
---
12+
13+
# Secure Key Release feature with AKV and Azure Confidential Computing (ACC)
14+
15+
Secure Key Release (SKR) is a functionality of Azure Key Vault (AKV) Managed HSM and Premium offering. Secure key release enables the release of an HSM protected key from AKV to an attested Trusted Execution Environment (TEE), such as a secure enclave, VM based TEEs etc. SKR adds another layer of access protection to your data decryption/encryption keys where you can target an application + TEE runtime environment with known configuration get access to the key material. The SKR policies defined at the time of exportable key creation govern the access to these keys.
16+
17+
## SKR support with AKV offerings
18+
19+
- [Azure Key Vault Premium](../security/fundamentals/key-management.md)
20+
- [Azure Key Vault Managed HSM](../key-vault/managed-hsm/overview.md)
21+
22+
## Overall Secure Key Release Flow with TEE
23+
24+
SKR can only release keys based on the Microsoft Azure Attestation (MAA) generated claims. There's a tight integration on the SKR policy definition to MAA claims.
25+
26+
![Diagram of Secure Key Release Flow.](media/skr-flow-confidential-vm-sev-snp-attestation/skr-e2e-flow.png)
27+
28+
The below steps are for AKV Premium.
29+
30+
### Step 1: Create a Key Vault Premium HSM Backed
31+
32+
[Follow the details here for Az CLI based AKV creation](../key-vault/general/quick-create-cli.md)
33+
34+
Make sure to set the value of [--sku] to "premium".
35+
36+
### Step 2: Create a Secure Key Release Policy
37+
38+
A Secure Key Release Policy is a json format release policy as defined [here](/rest/api/keyvault/keys/create-key/create-key?tabs=HTTP#keyreleasepolicy) that specifies a set of claims required in addition to authorization to release the key. The claims here are MAA based claims as referenced [here for SGX](/azure/attestation/attestation-token-examples#sample-jwt-generated-for-sgx-attestation) and here for [AMD SEV-SNP CVM](/azure/attestation/attestation-token-examples#sample-jwt-generated-for-sev-snp-attestation).
39+
40+
Visit the TEE specific [examples page for more details](skr-policy-examples.md)
41+
42+
Before you set an SKR policy make sure to run your TEE application through the remote attestation flow. Remote attestation isn't covered as part of this tutorial.
43+
44+
Example
45+
46+
```json
47+
{
48+
"version": "1.0.0",
49+
"anyOf": [ // Always starts with "anyOf", meaning you can multiple, even varying rules, per authority.
50+
{
51+
"authority": "https://sharedweu.weu.attest.azure.net",
52+
"allOf": [ // can be replaced by "anyOf", though you cannot nest or combine "anyOf" and "allOf" yet.
53+
{
54+
"claim": "x-ms-isolation-tee.x-ms-attestation-type", // These are the MAA claims.
55+
"equals": "sevsnpvm"
56+
},
57+
{
58+
"claim": "x-ms-isolation-tee.x-ms-compliance-status",
59+
"equals": "azure-compliant-cvm"
60+
}
61+
]
62+
}
63+
]
64+
}
65+
66+
67+
```
68+
69+
### Step 3: Create an exportable key in AKV with attached SKR policy
70+
71+
Exact details of the type of key and other attributes associated can be found [here](../key-vault/general/quick-create-cli.md).
72+
73+
```azurecli
74+
az keyvault key create --exportable true --vault-name "vault name from step 1" --kty RSA-HSM --name "keyname" --policy "jsonpolicyfromstep3 -can be a path to JSON" --protection hsm --vault-name "name of vault created from step1"
75+
```
76+
77+
### Step 4: Application running within a TEE doing a remote attestation
78+
79+
This step can be specific to the type of TEE you're running your application Intel SGX Enclaves or AMD SEV-SNP based Confidential Virtual Machines (CVM) or Confidential Containers running in CVM Enclaves with AMD SEV-SNP etc.
80+
81+
Follow these references examples for various TEE types offering with Azure:
82+
83+
- [Application within AMD EV-SNP based CVM's performing Secure Key Release](skr-flow-confidential-vm-sev-snp.md)
84+
- [Confidential containers with Azure Container Instances (ACI) with SKR side-car containers](skr-flow-confidential-containers-azure-container-instance.md)
85+
- [Intel SGX based applications performing Secure Key Release - Open Source Solution Mystikos Implementation](https://github.com/deislabs/mystikos/tree/main/samples/confidential_ml#environment)
86+
87+
## Frequently Asked Questions (FAQ)
88+
89+
### Can I perform SKR with non confidential computing offerings?
90+
91+
No. The policy attached to SKR only understands MAA claims that are associated to hardware based TEEs.
92+
93+
### Can I bring my own attestation provider or service and use those claims for AKV to validate and release?
94+
95+
No. AKV only understands and integrates with MAA today.
96+
97+
### Can I use AKV SDKs to perform key RELEASE?
98+
99+
Yes. Latest SDK integrated with 7.3 AKV API's support key RELEASE.
100+
101+
### Can you share some examples of the key release policies?
102+
103+
Yes, detailed examples by TEE type are listed [here.](./skr-policy-examples.md)
104+
105+
## Can I attach SKR type of policy with certificates and secrets?
106+
107+
No. Not at this time.
108+
109+
## References
110+
111+
[SKR Policy Examples](skr-policy-examples.md)
112+
113+
[Azure Container Instance with confidential containers Secure Key Release with container side-cars](skr-flow-confidential-containers-azure-container-instance.md)
114+
115+
[CVM on AMD SEV-SNP Applications with Secure Key Release Example](skr-flow-confidential-vm-sev-snp.md)
116+
117+
[AKV REST API With SKR Details](/rest/api/keyvault/keys/create-key/create-key?tabs=HTTP)
118+
119+
[AKV SDKs](../key-vault/general/client-libraries.md)

articles/confidential-computing/confidential-containers-enclaves.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Confidential containers with Intex SGX enclaves on Azure
2+
title: Confidential containers with Intel SGX enclaves on Azure
33
description: Learn about unmodified container support with confidential containers on Intel SGX through OSS and partner solutions
44
services: container-service
55
author: agowdamsft

articles/confidential-computing/index.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,20 @@ landingContent:
166166
url: ../virtual-machines/dcv2-series.md
167167
- text: DCsv3 and DCdsv3-series virtual machines
168168
url: ../virtual-machines/dcv3-series.md
169+
## Row 2
170+
# Card
171+
- title: Concepts
172+
linkLists:
173+
- linkListType: concept
174+
links:
175+
- text: Secure Key Release(SKR) with AKV and Azure Confidential Computing
176+
url: concept-skr-attestation.md
177+
- text: Secure Key Release(SKR) with AKV example policies
178+
url: skr-policy-examples.md
179+
- linkListType: quickstart
180+
links:
181+
- text: Confidential VM's SKR with guest attestation application
182+
url: skr-flow-confidential-vm-sev-snp.md
183+
- text: Confidential containers with Azure Container Instances SKR Side-Car
184+
url: skr-flow-confidential-containers-azure-container-instance.md
185+
Loading
412 KB
Loading
271 KB
Loading
1.12 MB
Loading
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: Secure Key Release with Azure Key Vault and Confidential Containers on Azure Container Instance
3+
description: Learn how to build an application that securely gets the key from AKV to an attested Azure Container Instances confidential container environment
4+
author: agowdamsft
5+
ms.service: virtual-machines
6+
ms.subservice: confidential-computing
7+
ms.workload: infrastructure
8+
ms.topic: conceptual
9+
ms.date: 3/9/2023
10+
ms.author: amgowda
11+
---
12+
13+
# Secure Key Release with Confidential containers on Azure Container Instance (ACI)
14+
15+
Secure Key Release (SKR) flow with Azure Key Vault (AKV) with confidential container offerings can implement in couple of ways. Confidential containers run a guest enlightened exposting AMD SEV-SNP device through a Linux Kernel that uses an in guest firmware with necessary Hyper-V related patches that we refer as Direct Linux Boot (DLB). This platform doesn't use vTPM and HCL based that Confidential VMs with AMD SEV-SNP support. This concept document assumes you plan to run the containers in [Azure Container Support choosing a confidential computing SKU](../container-instances/container-instances-tutorial-deploy-confidential-containers-cce-arm.md)
16+
17+
- Side-Car Helper Container provided by Azure
18+
- Custom implementation with your container application
19+
20+
## Side-Car helper container provided by Azure
21+
22+
An [open sourced GitHub project "confidential side-cars"](https://github.com/microsoft/confidential-sidecar-containers) details how to build this container and what parameters/environment variables are required for you to prepare and run this side-car container. The current side car implementation provides various HTTP REST APIs that your primary application container can use to fetch the key from AKV. The integration through Microsoft Azure Attestation(MAA) is already built in. The preparation steps to run the side-car SKR container can be found in details [here](https://github.com/microsoft/confidential-sidecar-containers/tree/main/examples/skr).
23+
24+
Your main application container application can call the side-car WEB API end points as defined in the example blow. Side-cars runs within the same container group and is a local endpoint to your application container. Full details of the API can be found [here](https://github.com/microsoft/confidential-sidecar-containers/blob/main/cmd/skr/README.md)
25+
26+
The `key/release` POST method expects a JSON of the following format:
27+
28+
```json
29+
{
30+
"maa_endpoint": "<maa endpoint>", //https://learn.microsoft.com/en-us/azure/attestation/quickstart-portal#attestation-provider
31+
"akv_endpoint": "<akv endpoint>", //AKV URI
32+
"kid": "<key identifier>" //key name,
33+
"access_token": "optional aad token if the command will run in a resource without proper managed identity assigned"
34+
}
35+
```
36+
37+
Upon success, the `key/release` POST method response carries a `StatusOK` header and a payload of the following format:
38+
39+
```json
40+
{
41+
"key": "<key in JSON Web Key format>"
42+
}
43+
```
44+
45+
Upon error, the `key/release` POST method response carries a `StatusForbidden` header and a payload of the following format:
46+
47+
```json
48+
{
49+
"error": "<error message>"
50+
}
51+
```
52+
53+
## Custom implementation with your container application
54+
55+
To perform a custom container application that extends the capability of Azure Key Vault (AKV) - Secure Key Release and Microsoft Azure Attestation (MAA), use the below as a high level reference flow. An easy approach is to review the current side-car implementation code in this [side-car Github project](https://github.com/microsoft/confidential-sidecar-containers/tree/d933d0f4e3d5498f7ed9137189ab6a23ade15466/pkg/common).
56+
57+
![Image of the aforementioned operations, which you should be performing.](media/skr-flow-azure-container-instance-sev-snp-attestation/skr-flow-custom-container.png)
58+
59+
1. **Step 1:** Set up AKV with Exportable Key and attach the release policy. More [here](concept-skr-attestation.md)
60+
1. **Step 2:** Set up a managed identity with Azure Active Directory and attach that to AKV. More [here](../container-instances/container-instances-managed-identity.md)
61+
1. **Step 3:** Deploy your container application with required parameters within ACI by setting up a confidential computing enforcement policy. More [here](../container-instances/container-instances-tutorial-deploy-confidential-containers-cce-arm.md)
62+
1. **Step 4:** In this step, your application shall fetch a RAW AMD SEV-SNP hardware report by doing a IOCTL Linux Socket call. You don't need any guest attestation library to perform this action. More on existing side-car [implementation](https://github.com/microsoft/confidential-sidecar-containers/blob/d933d0f4e3d5498f7ed9137189ab6a23ade15466/pkg/attest/snp.go)
63+
1. **Step 5:** Fetch the AMD SEV-SNP cert chain for the container group. These certs are delivered from Azure host IMDS endpoint. More [here](https://github.com/microsoft/confidential-sidecar-containers/blob/d933d0f4e3d5498f7ed9137189ab6a23ade15466/pkg/common/info.go)
64+
1. **Step 6:** Send the SNP RAW hardware report and cert details to MAA for verification and return claims. More [here](../attestation/basic-concepts.md)
65+
1. **Step 7:** Send the MAA token and the managed identity token generated by ACI to AKV for key release. More [here](../container-instances/container-instances-managed-identity.md)
66+
67+
On success of the key fetch from AKV, you can consume the key for decrypting the data sets or encrypt the data going out of the confidential container environment.
68+
69+
## References
70+
71+
[ACI with Confidential container deployments](../container-instances/container-instances-tutorial-deploy-confidential-containers-cce-arm.md)
72+
73+
[Side-Car Implementation with encrypted blob fetch and decrypt with SKR AKV key](https://github.com/microsoft/confidential-sidecar-containers/#encrypted-filesystem-sidecar)
74+
75+
[AKV SKR with Confidential VM's AMD SEV-SNP](skr-flow-confidential-vm-sev-snp.md)
76+
77+
[Microsoft Azure Attestation (MAA)](../attestation/overview.md)
78+
79+
[SKR Policy Examples](skr-policy-examples.md)

0 commit comments

Comments
 (0)