Skip to content

Commit 228228c

Browse files
committed
Split the usage doc from the overview
1 parent 6d55140 commit 228228c

File tree

7 files changed

+351
-270
lines changed

7 files changed

+351
-270
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
layout: docs
3+
page_title: Azure Key Vault - Key Management - Secrets Engines
4+
description: Key management secrets engine supports lifecycle management of keys in Azure Key Vault instances.
5+
---
6+
7+
# Azure Key Vault
8+
9+
The key management secrets engine supports lifecycle management of keys in named
10+
[Azure Key Vault](https://docs.microsoft.com/en-us/azure/key-vault/) instances.
11+
This is accomplished by configuring a KMS provider resource with the `azurekeyvault`
12+
provider and other provider-specific parameter values.
13+
14+
The following sections describe how to properly configure the secrets engine to enable
15+
the functionality.
16+
17+
Refer to the [setup guide](/vault/docs/secrets/key-management/azurekeyvault/setup) for CLI command examples.
18+
19+
## Authentication
20+
21+
You need to configure the key management secrets engine with credentials that have sufficient
22+
permissions to manage keys in an Azure Key Vault instance. The [credentials](/vault/api-docs/secret/key-management/azurekeyvault#credentials) section of the API documentation describes the authentication parameters. The authentication parameters will be set with the following order
23+
of precedence:
24+
25+
1. Environment variables
26+
2. [KMS provider credentials](/vault/api-docs/secret/key-management/azurekeyvault#credentials)
27+
3. [Managed Service Identity (MSI)](https://docs.microsoft.com/en-us/azure/active-directory/managed-service-identity/overview)
28+
29+
If the client ID or secret are not provided and Vault is running on an Azure VM, Vault will attempt
30+
to use MSI to access Azure. Note that when MSI is used, the tenant ID must still be explicitly provided by the configuration or environment variable.
31+
32+
An Azure Key Vault [access policy](https://docs.microsoft.com/en-us/azure/key-vault/general/assign-access-policy-portal) determines whether a given service principal, namely an application or user group, can perform certain operations on a Key Vault instance. The service principal associated with the provided credentials must have an access policy on the Key Vault instance with the following minimum key permissions:
33+
34+
- `create`
35+
- `delete`
36+
- `get`
37+
- `import`
38+
- `update`
39+
40+
<Tip title="Use Terraform">
41+
42+
If you are familiar with Terraform, you can use it to deploy the necessary Azure infrastructure. Refer to the [Terraform example](/vault/docs/secrets/key-management/azurekeyvault/setup#terraform-example) section.
43+
44+
</Tip>
45+
46+
## Key transfer specification
47+
48+
Keys are securely transferred from the secrets engine to Azure key vault instances in accordance
49+
with the Azure [Bring Your Own Key](https://docs.microsoft.com/en-us/azure/key-vault/keys/byok-specification)
50+
specification.
51+
52+
## Key purpose compatibility
53+
54+
The following table defines which key [purposes](/vault/api-docs/secret/key-management#purpose) can be used
55+
for each key type supported by Azure Key Vault KMS.
56+
57+
| Key Type | Purpose |
58+
| -------------- | ------------------------------------------------------- |
59+
| `rsa-2048` | [All purposes](/vault/api-docs/secret/key-management#purpose) |
60+
| `rsa-3072` | [All purposes](/vault/api-docs/secret/key-management#purpose) |
61+
| `rsa-4096` | [All purposes](/vault/api-docs/secret/key-management#purpose) |

website/content/docs/secrets/key-management/azurekeyvault.mdx website/content/docs/secrets/key-management/azurekeyvault/setup.mdx

+67-88
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,17 @@
11
---
22
layout: docs
3-
page_title: Azure Key Vault - Key Management - Secrets Engines
4-
description: Azure Key Vault is a supported KMS provider of the Key Management secrets engine.
3+
page_title: Azure Key Vault setup guide
4+
description: Configure the key management secrets engine, and distribute the Vault-managed keys to the target Azure Key Vault instance.
55
---
66

7-
# Azure key Vault
8-
9-
The Key Management secrets engine supports lifecycle management of keys in named
10-
[Azure Key Vault](https://docs.microsoft.com/en-us/azure/key-vault/) instances.
11-
This is accomplished by configuring a KMS provider resource with the `azurekeyvault`
12-
provider and other provider-specific parameter values.
13-
14-
The following sections describe how to properly configure the secrets engine to enable
15-
the functionality.
16-
17-
## Authentication
18-
19-
You need to configure the Key Management secrets engine with credentials that have sufficient
20-
permissions to manage keys in an Azure Key Vault instance. The [credentials](/vault/api-docs/secret/key-management/azurekeyvault#credentials) section of the API documentation describes the authentication parameters. The authentication parameters will be set with the following order
21-
of precedence:
22-
23-
1. Environment variables
24-
2. [KMS provider credentials](/vault/api-docs/secret/key-management/azurekeyvault#credentials)
25-
3. [Managed Service Identity (MSI)](https://docs.microsoft.com/en-us/azure/active-directory/managed-service-identity/overview)
26-
27-
If the client ID or secret are not provided and Vault is running on an Azure VM, Vault will attempt
28-
to use MSI to access Azure. Note that when MSI is used, the tenant ID must still be explicitly provided by the configuration or environment variable.
29-
30-
An Azure Key Vault [access policy](https://docs.microsoft.com/en-us/azure/key-vault/general/assign-access-policy-portal) determines whether a given service principal, namely an application or user group, can perform certain operations on a Key Vault instance. The service principal associated with the provided credentials must have an access policy on the Key Vault instance with the following minimum key permissions:
31-
32-
- `create`
33-
- `delete`
34-
- `get`
35-
- `import`
36-
- `update`
37-
38-
<Tip title="Use Terraform">
39-
40-
If you are familiar with Terraform, you can use it to deploy the necessary Azure infrastructure. Refer to the [Terraform example](#terraform-example) section.
41-
42-
</Tip>
7+
# Setup guide - Azure Key Vault
438

9+
To manage the lifecycle of the Azure Key Vault keys, you need to setup the
10+
key management secrets engine using `azurekeyvault` provider.
4411

4512
## Setup
4613

47-
1. Enable the secrets engine.
14+
1. Enable the key management secrets engine.
4815

4916
```shell-session
5017
$ vault secrets enable keymgmt
@@ -64,47 +31,70 @@ If you are familiar with Terraform, you can use it to deploy the necessary Azure
6431

6532
The command specified the following:
6633

67-
- The full path to this KMS provider instance in Vault (`keymgmt/kms/example-kms`).
68-
- A key collection, which corresponds to the name of the key vault instance in Azure.
34+
- The full path to this KMS provider instance in Vault
35+
(`keymgmt/kms/example-kms`).
36+
- A key collection, which corresponds to the name of the key vault instance
37+
in Azure.
6938
- The KMS provider is set to `azurekeyvault`.
70-
- Azure client ID credential, that can also be specified with `AZURE_CLIENT_ID` environment variable.
71-
- Azure client secret credential, that can also be specified with `AZURE_CLIENT_SECRET `environment variable.
72-
- Azure tenant ID credential, that can also be specified with `AZURE_TENANT_ID` environment variable.
39+
- Azure client ID credential, that can also be specified with
40+
`AZURE_CLIENT_ID` environment variable.
41+
- Azure client secret credential, that can also be specified with
42+
`AZURE_CLIENT_SECRET `environment variable.
43+
- Azure tenant ID credential, that can also be specified with
44+
`AZURE_TENANT_ID` environment variable.
7345

7446
<Tip title="API documentation">
7547

76-
Refer to the Azure Key Vault [API documentation](/vault/api-docs/secret/key-management/azurekeyvault) for a detailed description of individual configuration parameters.
48+
Refer to the Azure Key Vault [API
49+
documentation](/vault/api-docs/secret/key-management/azurekeyvault) for a
50+
detailed description of individual configuration parameters.
7751

7852
</Tip>
7953

8054
## Usage
8155

82-
1. Write a pair of RSA-2048 keys to the secrets engine. The following command will write a new key of type **rsa-2048** to the path `keymgmt/key/rsa-1`.
56+
1. Write a pair of RSA-2048 keys to the secrets engine. The following command
57+
will write a new key of type **rsa-2048** to the path `keymgmt/key/rsa-1`.
8358

8459
```shell-session
8560
$ vault write keymgmt/key/rsa-1 type="rsa-2048"
8661
Success! Data written to: keymgmt/key/rsa-1
8762
```
8863

89-
The Key Management secrets engine currently supports generation of the key types specified in [Key Types](/vault/docs/secrets/key-management#key-types).
64+
The key management secrets engine currently supports generation of the key
65+
types specified in [Key
66+
Types](/vault/docs/secrets/key-management#key-types).
9067

91-
Based on the [Compatibility](/vault/docs/secrets/key-management#compatibility) section of the documentation, Azure Key Vault currently supports use of RSA-2048, RSA-3072, and RSA-4096 key types.
68+
Based on the
69+
[Compatibility](/vault/docs/secrets/key-management#compatibility) section of
70+
the documentation, Azure Key Vault currently supports use of RSA-2048,
71+
RSA-3072, and RSA-4096 key types.
9272

93-
1. Read the **rsa-1** key you created. Use JSON as the output and pipe that into `jq`.
73+
1. Read the **rsa-1** key you created. Use JSON as the output and pipe that into
74+
`jq`.
9475

9576
```shell-session
9677
$ vault read -format=json keymgmt/key/rsa-1 | jq
9778
```
9879

99-
1. To use the keys you wrote, you must distribute them to the key vault. Distribute the **rsa-1** key to the key vault at the path `keymgmt/kms/example-kms/key/rsa-1`.
80+
1. To use the keys you wrote, you must distribute them to the key vault.
81+
Distribute the **rsa-1** key to the key vault at the path
82+
`keymgmt/kms/example-kms/key/rsa-1`.
10083

10184
```shell-session
10285
$ vault write keymgmt/kms/example-kms/key/rsa-1 \
10386
purpose="encrypt,decrypt" \
10487
protection="hsm"
10588
```
10689

107-
Here you are instructing Vault to distribute the key and specify that its purpose is only to encrypt and decrypt. The protection type is dependent on the cloud provider and the value is either `hsm` or `software`. In the case of Azure, you specify `hsm` for the protection type. The key will be securely delivered to the key vault instance according to the [Azure Bring Your Own Key](https://docs.microsoft.com/en-us/azure/key-vault/keys/byok-specification) (BYOK) specification.
90+
Here you are instructing Vault to distribute the key and specify that its
91+
purpose is only to encrypt and decrypt. The protection type is dependent on
92+
the cloud provider and the value is either `hsm` or `software`. In the case
93+
of Azure, you specify `hsm` for the protection type. The key will be
94+
securely delivered to the key vault instance according to the [Azure Bring
95+
Your Own
96+
Key](https://docs.microsoft.com/en-us/azure/key-vault/keys/byok-specification)
97+
(BYOK) specification.
10898

10999
1. You can list the keys that have been distributed to the Azure Key Vault instance.
110100

@@ -122,44 +112,33 @@ Refer to the Azure Key Vault [API documentation](/vault/api-docs/secret/key-mana
122112
Success! Data written to: keymgmt/key/rsa-1/rotate
123113
```
124114

125-
1. Confirm successful key rotation by reading the key, and getting the value of `.data.latest_version`.
115+
1. Confirm successful key rotation by reading the key, and getting the value of
116+
`.data.latest_version`.
126117

127118
```shell-session
128119
$ vault read -format=json keymgmt/key/rsa-1 | jq '.data.latest_version'
129120
2
130121
```
131122

132-
## Key transfer specification
133-
134-
Keys are securely transferred from the secrets engine to Azure key vault instances in accordance
135-
with the Azure [Bring Your Own Key](https://docs.microsoft.com/en-us/azure/key-vault/keys/byok-specification)
136-
specification.
137-
138-
## Key purpose compatibility
139-
140-
The following table defines which key [purposes](/vault/api-docs/secret/key-management#purpose) can be used
141-
for each key type supported by Azure Key Vault KMS.
142-
143-
| Key Type | Purpose |
144-
| -------------- | ------------------------------------------------------- |
145-
| `rsa-2048` | [All purposes](/vault/api-docs/secret/key-management#purpose) |
146-
| `rsa-3072` | [All purposes](/vault/api-docs/secret/key-management#purpose) |
147-
| `rsa-4096` | [All purposes](/vault/api-docs/secret/key-management#purpose) |
148-
149123
## Azure private link
150124

151-
The secrets engine can be configured to communicate with Azure Key Vault instances
152-
using [Azure Private Endpoints](https://docs.microsoft.com/en-us/azure/private-link/private-endpoint-overview).
153-
Follow the guide at [Integrate Key Vault with Azure Private Link](https://docs.microsoft.com/en-us/azure/key-vault/general/private-link-service?tabs=portal)
154-
to set up a Private Endpoint for your target Key Vault instance in Azure. The Private Endpoint must
155-
be network reachable by Vault. This means Vault needs to be running in the same virtual network or
156-
a peered virtual network to properly resolve the Key Vault domain name to the Private Endpoint IP
157-
address.
158-
159-
The Private Endpoint configuration relies on a correct [Azure Private DNS](https://docs.microsoft.com/en-us/azure/dns/private-dns-overview)
125+
The secrets engine can be configured to communicate with Azure Key Vault
126+
instances using [Azure Private
127+
Endpoints](https://docs.microsoft.com/en-us/azure/private-link/private-endpoint-overview).
128+
Follow the guide at [Integrate Key Vault with Azure Private
129+
Link](https://docs.microsoft.com/en-us/azure/key-vault/general/private-link-service?tabs=portal)
130+
to set up a Private Endpoint for your target Key Vault instance in Azure. The
131+
Private Endpoint must be network reachable by Vault. This means Vault needs to
132+
be running in the same virtual network or a peered virtual network to properly
133+
resolve the Key Vault domain name to the Private Endpoint IP address.
134+
135+
The Private Endpoint configuration relies on a correct [Azure Private
136+
DNS](https://docs.microsoft.com/en-us/azure/dns/private-dns-overview)
160137
integration. From the host that Vault is running on, follow the steps in
161-
[Validate that the private link connection works](https://docs.microsoft.com/en-us/azure/key-vault/general/private-link-service?tabs=portal#validate-that-the-private-link-connection-works)
162-
to ensure that the Key Vault domain name resolves to the Private Endpoint IP address you've configured.
138+
[Validate that the private link connection
139+
works](https://docs.microsoft.com/en-us/azure/key-vault/general/private-link-service?tabs=portal#validate-that-the-private-link-connection-works)
140+
to ensure that the Key Vault domain name resolves to the Private Endpoint IP
141+
address you've configured.
163142

164143
```shell-session
165144
$ nslookup <keyvault-name>.vault.azure.net
@@ -171,19 +150,20 @@ Aliases: <keyvault-name>.vault.azure.net
171150
<keyvault-name>.privatelink.vaultcore.azure.net
172151
```
173152

174-
The secrets engine doesn't require special configuration to communicate with a Key Vault instance
175-
over an Azure Private Endpoint. For example, the given [KMS configuration](/vault/docs/secrets/key-management/azurekeyvault#configuration)
176-
will result in the secrets engine resolving a Key Vault domain name of `keyvault-name.vault.azure.net`
177-
to the Private Endpoint IP address. Note that it's possible to change the Key Vault DNS suffix using the
153+
The secrets engine doesn't require special configuration to communicate with a
154+
Key Vault instance over an Azure Private Endpoint. For example, the given [KMS
155+
configuration](/vault/docs/secrets/key-management/azurekeyvault#configuration)
156+
will result in the secrets engine resolving a Key Vault domain name of
157+
`keyvault-name.vault.azure.net` to the Private Endpoint IP address. Note that
158+
it's possible to change the Key Vault DNS suffix using the
178159
[environment](/vault/api-docs/secret/key-management/azurekeyvault#environment)
179160
configuration parameter or `AZURE_ENVIRONMENT` environment variable.
180161

181162

182163
## Terraform example
183164

184-
If you are familiar with [Terraform](/terraform/), you can use it to deploy the necessary Azure infrastructure.
185-
186-
**Example:**
165+
If you are familiar with [Terraform](/terraform/), you can use it to deploy the
166+
necessary Azure infrastructure.
187167

188168
```hcl
189169
provider "azuread" {
@@ -299,4 +279,3 @@ output "client_secret" {
299279
value = azuread_service_principal_password.key_vault_sp_pwd.value
300280
}
301281
```
302-

0 commit comments

Comments
 (0)