2019-06-28 18:05:00 +00:00
|
|
|
---
|
|
|
|
layout: "docs"
|
|
|
|
page_title: "KMIP - Secrets Engines"
|
|
|
|
sidebar_title: "KMIP <sup>ENTERPRISE</sup>"
|
|
|
|
sidebar_current: "docs-secrets-kmip"
|
|
|
|
description: |-
|
|
|
|
The KMIP secrets engine allows Vault to act as a KMIP server provider and
|
|
|
|
handle the lifecycle of it KMIP managed objects.
|
|
|
|
---
|
|
|
|
|
|
|
|
# KMIP Secrets Engine
|
|
|
|
|
2019-11-25 16:56:08 +00:00
|
|
|
The KMIP secrets engine allows Vault to act as a [Key Management
|
|
|
|
Interoperability Protocol](#kmip-spec) (KMIP) server provider and handle
|
|
|
|
the lifecycle of its KMIP managed objects. KMIP is a standardized protocol that allows
|
2019-06-28 18:05:00 +00:00
|
|
|
services and applications to perform cryptographic operations without having to
|
2019-11-25 16:56:08 +00:00
|
|
|
manage cryptographic material, otherwise known as managed objects, by delegating
|
2019-06-28 18:05:00 +00:00
|
|
|
its storage and lifecycle to a key management server.
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
|
|
The KMIP secrets engine must be configured before it can start accepting KMIP
|
2019-10-14 17:31:03 +00:00
|
|
|
requests.
|
2019-06-28 18:05:00 +00:00
|
|
|
|
|
|
|
1. Enable the KMIP secrets engine
|
|
|
|
|
|
|
|
```text
|
|
|
|
$ vault secrets enable kmip
|
|
|
|
Success! Enabled the kmip secrets engine at: kmip/
|
|
|
|
```
|
2019-07-30 20:12:55 +00:00
|
|
|
|
2019-06-28 18:05:00 +00:00
|
|
|
1. Configure the secrets engine with the desired listener addresses to use and
|
|
|
|
TLS parameters, or leave unwritten to use default values
|
|
|
|
|
|
|
|
```text
|
2019-10-14 17:31:03 +00:00
|
|
|
$ vault write kmip/config listen_addrs=0.0.0.0:5696
|
2019-06-28 18:05:00 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
### Scopes and Roles
|
|
|
|
|
|
|
|
The KMIP secrets engine uses the concept of scopes to partition KMIP managed
|
|
|
|
object storage into multiple named buckets. Within a scope, roles can be created
|
2019-11-25 16:56:08 +00:00
|
|
|
which dictate the set of allowed operations that the particular role can perform.
|
2019-06-28 18:05:00 +00:00
|
|
|
TLS client certificates can be generated for a role, which services and applications
|
|
|
|
can then use when sending KMIP requests against Vault's KMIP secret engine.
|
|
|
|
|
|
|
|
In order to generate client certificates for KMIP clients to interact with Vault's
|
|
|
|
KMIP server, we must first create a scope and role and specify the desired set of
|
|
|
|
allowed operations for it.
|
|
|
|
|
|
|
|
1. Create a scope:
|
|
|
|
|
|
|
|
```text
|
2019-11-25 16:56:08 +00:00
|
|
|
$ vault write -f kmip/scope/my-service
|
2019-06-28 18:05:00 +00:00
|
|
|
Success! Data written to: kmip/scope/my-service
|
|
|
|
```
|
2019-10-14 17:31:03 +00:00
|
|
|
|
2019-06-28 18:05:00 +00:00
|
|
|
1. Create a role within the scope, specifying the set of operations to allow or
|
|
|
|
deny.
|
|
|
|
|
|
|
|
```text
|
2019-10-14 17:31:03 +00:00
|
|
|
$ vault write kmip/scope/my-service/role/admin operation_all=true
|
2019-06-28 18:05:00 +00:00
|
|
|
Success! Data written to: kmip/scope/my-service/role/admin
|
|
|
|
```
|
2019-10-14 17:31:03 +00:00
|
|
|
|
2019-06-28 18:05:00 +00:00
|
|
|
### Client Certificate Generation
|
|
|
|
|
|
|
|
Once a scope and role has been created, client certificates can be generated for
|
2019-11-25 16:56:08 +00:00
|
|
|
that role. The client certificate can then be provided to applications and
|
|
|
|
services that support KMIP to establish communication with Vault's KMIP server.
|
|
|
|
Scope and role identifiers are embedded in the certificate,
|
2019-06-28 18:05:00 +00:00
|
|
|
which will be used when evaluating permissions during a KMIP request.
|
|
|
|
|
|
|
|
1. Generate a client certificate. This returns the CA Chain, the certificate,
|
|
|
|
and the private key.
|
|
|
|
|
|
|
|
```text
|
|
|
|
$ vault write -f kmip/scope/my-service/role/admin/credential/generate
|
|
|
|
Key Value
|
|
|
|
--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QQAIwOBhgAEANVsHV8CHYpW
|
|
|
|
CBKbYVEx/sLphk67SdWxbII4Sc9Rj1KymApD4gPmS+rw0FDMZGFbn1sAfpqMBqMj
|
|
|
|
ylv72o9izbYSALHnYT+AaE0NFn4eGWZ2G0p56cVmfXm3ZI959E+3gvZK6X5Jnzm4
|
|
|
|
FKXTDKGA4pocYec/rnYJ5X8sbAJKHvk1OeO+o2cwZTAOBgNVHQ8BAf8EBAMCA6gw
|
|
|
|
EwYDVR0lBAwwCgYIKwYBBQUHAwIwHQYDVR0OBBYEFBEIsBo3HiBIg2l2psaQoYkT
|
|
|
|
D1RNMB8GA1UdIwQYMBaAFEdKNL+Kz4gVPUcEHxFLnMdycGzwMAoGCCqGSM49BAMC
|
|
|
|
A4GMADCBiAJCAc8DV23DJsHV4fdmbmssu0eDIgNH+PrRKdYgqiHptbuVjF2qbILp
|
|
|
|
Z34dJRVN+R9B+RprZXkYiv7gJ/47KSUKzRZpAkIByMjZqLtcypamJM/t+/O1BSst
|
|
|
|
CWcblb45FIxAmO4hE00Q5wnwXNxNnDHXWiuGdSNmIBjpb9nM5wehQlbkx7HzvPk=
|
|
|
|
-----END CERTIFICATE-----
|
|
|
|
private_key -----BEGIN EC PRIVATE KEY-----
|
|
|
|
MIHcAgEBBEIB9Nn7M28VUVW6g5IlOTS3bHIZYM/zqVy+PvYQxn2lFbg1YrQzfd7h
|
|
|
|
sdtCjet0lc7pvtoOwd1dFiATOGg98OVN7MegBwYFK4EEACOhgYkDgYYABADVbB1f
|
|
|
|
Ah2KVggSm2FRMf7C6YZOu0nVsWyCOEnPUY9SspgKQ+ID5kvq8NBQzGRhW59bAH6a
|
|
|
|
jAajI8pb+9qPYs22EgCx52E/gGhNDRZ+HhlmdhtKeenFZn15t2SPefRPt4L2Sul+
|
|
|
|
SZ85uBSl0wyhgOKaHGHnP652CeV/LGwCSh75NTnjvg==
|
|
|
|
-----END EC PRIVATE KEY-----
|
|
|
|
serial_number 317328055225536560033788492808123425026102524390
|
|
|
|
```
|
|
|
|
|
|
|
|
### Supported KMIP Operations
|
|
|
|
|
|
|
|
The KMIP protocol supports a wide [variety of operations](#kmip-ops) that can be
|
|
|
|
issued by clients to perform certain actions, such as key management,
|
|
|
|
encryption, signing, etc. The KMIP secrets engine currently supports a subset of
|
|
|
|
KMIP operations.
|
|
|
|
|
|
|
|
Supported KMIP operations:
|
|
|
|
|
|
|
|
```text
|
|
|
|
operation_create
|
|
|
|
operation_rekey
|
|
|
|
operation_locate
|
|
|
|
operation_get
|
|
|
|
operation_activate
|
|
|
|
operation_revoke
|
|
|
|
operation_destroy
|
|
|
|
operation_discover_versions
|
|
|
|
```
|
|
|
|
|
|
|
|
Additionally, there are two pseudo-operations that can be used to allow or deny
|
|
|
|
all operation capabilities to a role. These operations are mutually exclusive to
|
|
|
|
all other operations. That is, if it's provided during role creation or update,
|
|
|
|
no other operations can be provided. Similarly, if an existing role contains a
|
|
|
|
pseudo-operation, and it is then updated with a set supported operation, it will
|
|
|
|
be overwritten with the newly set of provided operations.
|
|
|
|
|
|
|
|
Pseudo-operations:
|
|
|
|
|
|
|
|
```text
|
|
|
|
operation_all
|
|
|
|
operation_none
|
|
|
|
```
|
|
|
|
|
2019-10-14 17:31:03 +00:00
|
|
|
## Learn
|
|
|
|
|
|
|
|
Refer to the [KMIP Secrets Engine](https://learn.hashicorp.com/vault/secrets-management/kmip-engine)
|
|
|
|
guide for a step-by-step tutorial.
|
|
|
|
|
|
|
|
|
2019-06-28 18:05:00 +00:00
|
|
|
[kmip-spec]: http://docs.oasis-open.org/kmip/spec/v1.4/kmip-spec-v1.4.html
|
2019-07-30 20:12:55 +00:00
|
|
|
[kmip-ops]: http://docs.oasis-open.org/kmip/spec/v1.4/os/kmip-spec-v1.4-os.html#_Toc490660840
|