-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds documentation for GCP Cloud KMS support in key management secret…
…s engine (#13153)
- Loading branch information
1 parent
b8b0ad1
commit b580c62
Showing
8 changed files
with
166 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
layout: api | ||
page_title: GCP Cloud KMS - Key Management - Secrets Engines - HTTP API | ||
description: The GCP Cloud KMS API documentation for the Key Management secrets engine. | ||
--- | ||
|
||
# GCP Cloud KMS (API) | ||
|
||
The Key Management secrets engine supports lifecycle management of keys in [GCP Cloud KMS](https://cloud.google.com/security-key-management) | ||
[key rings](https://cloud.google.com/kms/docs/resource-hierarchy#key_rings). This is accomplished by | ||
configuring a KMS provider resource with the `gcpckms` provider and other provider-specific parameter | ||
values. | ||
|
||
The following sections provide API documentation that is specific to GCP Cloud KMS. | ||
|
||
## Create/Update KMS Provider | ||
|
||
This endpoint creates or updates a KMS provider. If a KMS provider with the given `name` | ||
does not exist, it will be created. If the KMS provider exists, it will be updated with | ||
the given parameter values. | ||
|
||
| Method | Path | | ||
| :----- | :------------------- | | ||
| `PUT` | `/keymgmt/kms/:name` | | ||
|
||
### Parameters | ||
|
||
- `name` `(string: <required>)` – Specifies the name of the KMS provider to create or update. | ||
This is provided as part of the request URL. | ||
|
||
- `provider` `(string: <required>)` – Specifies the name of a KMS provider that's external to | ||
Vault. Must be set to `gcpckms`. Cannot be changed after creation. | ||
|
||
- `key_collection` `(string: <required>)` – Refers to the | ||
[resource ID](https://cloud.google.com/kms/docs/resource-hierarchy#retrieve_resource_id) | ||
of an existing GCP Cloud KMS [key ring](https://cloud.google.com/kms/docs/resource-hierarchy#key_rings). | ||
Cannot be changed after creation. | ||
|
||
- `credentials` `(map<string|string>: nil)` – The credentials to use for authentication with GCP | ||
Cloud KMS. Supplying values for this parameter is optional, as credentials may also be specified | ||
as environment variables. See the [authentication](/docs/secrets/key-management/gcpkms#authentication) | ||
section for details on precedence. | ||
|
||
- `service_account_file` `(string: <required>)` - The path to a Google service account key file. The | ||
key file must be readable on the host that Vault server is running on. May also be provided by the | ||
`GOOGLE_CREDENTIALS` environment variable or by | ||
[application default credentials](https://cloud.google.com/docs/authentication/production). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
layout: docs | ||
page_title: GCP Cloud KMS - Key Management - Secrets Engines | ||
description: GCP Cloud KMS is a supported KMS provider of the Key Management secrets engine. | ||
--- | ||
|
||
# GCP Cloud KMS | ||
|
||
The Key Management secrets engine supports lifecycle management of keys in GCP Cloud KMS | ||
[key rings](https://cloud.google.com/kms/docs/resource-hierarchy#key_rings). This is accomplished | ||
by configuring a KMS provider resource with the `gcpckms` provider and other provider-specific | ||
parameter values. | ||
|
||
The following sections describe how to properly configure the secrets engine to enable | ||
the functionality. | ||
|
||
## Authentication | ||
|
||
The Key Management secrets engine must be configured with credentials that have sufficient | ||
permissions to manage keys in an existing GCP Cloud KMS [key ring](https://cloud.google.com/kms/docs/resource-hierarchy#key_rings). | ||
The authentication parameters are described in the [credentials](/api/secret/key-management/gcpkms#credentials) | ||
section of the API documentation. The authentication parameters will be set with the following order | ||
of precedence: | ||
|
||
1. `GOOGLE_CREDENTIALS` environment variable | ||
2. [KMS provider credentials](/api/secret/key-management/gcpkms#credentials) parameter | ||
3. [Application default credentials](https://cloud.google.com/docs/authentication/production) | ||
|
||
The service account must be authorized with the following minimum | ||
[IAM permissions](https://cloud.google.com/kms/docs/reference/permissions-and-roles) on the | ||
target [key ring](https://cloud.google.com/kms/docs/resource-hierarchy#key_rings) resource: | ||
|
||
- `cloudkms.cryptoKeys.create` | ||
- `cloudkms.cryptoKeys.update` | ||
- `cloudkms.importJobs.create` | ||
- `cloudkms.importJobs.get` | ||
- `cloudkms.cryptoKeyVersions.list` | ||
- `cloudkms.cryptoKeyVersions.destroy` | ||
- `cloudkms.cryptoKeyVersions.update` | ||
- `cloudkms.cryptoKeyVersions.create` | ||
|
||
## Configuration | ||
|
||
The following is an example of how to configure the KMS provider resource using the Vault CLI: | ||
|
||
```text | ||
$ vault write keymgmt/kms/example-kms \ | ||
provider="gcpckms" \ | ||
key_collection="projects/<project-id>/locations/<location>/keyRings/<keyring>" \ | ||
credentials=service_account_file="/path/to/service_account/credentials.json" | ||
``` | ||
|
||
Refer to the GCP Cloud KMS [API documentation](/api/secret/key-management/gcpkms) | ||
for a detailed description of individual configuration parameters. | ||
|
||
## Key Transfer Specification | ||
|
||
Keys are securely transferred from the secrets engine to GCP Cloud KMS in accordance | ||
with the [key import](https://cloud.google.com/kms/docs/key-import) specification. | ||
|
||
## Key Purpose Compatability | ||
|
||
The following table defines which key [purposes](/api-docs/secret/key-management#purpose) can be used | ||
for each key type supported by GCP Cloud KMS. | ||
|
||
| Key Type | Purpose | | ||
| -------------- | ----------------------- | | ||
| `aes256-gcm96` | `encrypt` and `decrypt` | | ||
| `rsa-2048` | `decrypt` or `sign` | | ||
| `rsa-3072` | `decrypt` or `sign` | | ||
| `rsa-4096` | `decrypt` or `sign` | | ||
| `ecdsa-p256` | `sign` | | ||
| `ecdsa-p384` | `sign` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters