KMIP Secrets Engine (API)
This is the API documentation for the Vault KMIP secrets engine. For general information about the usage and operation of the KMIP secrets engine, please see these docs.
This documentation assumes the KMIP secrets engine is enabled at the /kmip
path
in Vault. Since it is possible to mount secrets engines at any path, please
update your API calls accordingly.
Write Config
Method | Path |
---|---|
POST | /kmip/config |
This endpoint configures shared information for the secrets engine. After writing to it the KMIP engine will generate a CA and start listening for KMIP requests. If the server was already running and any non-client settings are changed, the server will be restarted using the new settings. All generated CAs will use entropy augmentation to generate their certificates if entropy augmentation is enabled.
Parameters
listen_addrs
(list: ["127.0.0.1:5696"] || string
) - Address and port the KMIP server should listen on. Can be given as a JSON list or a comma-separated string list. If multiple values are given, all will be listened on.connection_timeout
(int: 1 || string:"1s"
) - Duration in either an integer number of seconds (10) or an integer time unit (10s) within which connections must become ready.server_hostnames
(list: ["localhost"] || string
) - Hostnames to include in the server's TLS certificate as SAN DNS names. The first will be used as the common name (CN).server_ips
(list: [] || string
) - IPs to include in the server's TLS certificate as SAN IP addresses. Localhost (IPv4 and IPv6) will be automatically included.tls_ca_key_type
(string: "ec"
) - CA key type,rsa
orec
.tls_ca_key_bits
(int: 521
) - CA key bits, valid values depend on key type.tls_min_version
(string: "tls12"
) - Minimum TLS version to accept.default_tls_client_key_type
(string: "ec"
): - Client certificate key type,rsa
orec
.default_tls_client_key_bits
(int: 521
): - Client certificate key bits, valid values depend on key type.default_tls_client_ttl
(int: 86400 || string:"24h"
) – Client certificate TTL in either an integer number of seconds (10) or an integer time unit (10s).
Sample Payload
Sample Request
Read Config
Method | Path |
---|---|
GET | /kmip/config |
Sample Request
Sample Response
Read CA
Method | Path |
---|---|
GET | /kmip/ca |
Returns the CA certificates in PEM format. Returns an error if config has never been written.
Sample Request
Sample Response
Write scope
Method | Path |
---|---|
POST | /kmip/scope/:scope |
Creates a new scope with the given name.
Parameters
scope
(string: <required>
) - Name of scope. This is part of the request URL.
Sample Request
List scopes
Method | Path |
---|---|
LIST | /kmip/scope |
List existing scopes.
Sample Request
Sample Response
Delete scope
Method | Path |
---|---|
DELETE | /kmip/scope/:scope |
Delete a scope by name.
Parameters
scope
(string: <required>
) - Name of scope. This is part of the request URL.force
(bool: false
) - Force scope deletion. If KMIP managed objects have been created within the scope this param must be provided or the deletion will fail. This value should be supplied as a query parameter, or as an argument in the CLI.
Sample Request
Write role
Method | Path |
---|---|
POST | /kmip/scope/:scope/role/:role |
Creates or updates a role.
Parameters
scope
(string: <required>
) - Name of scope. This is part of the request URL.role
(string: <required>
) - Name of role. This is part of the request URL.tls_client_key_type
(string
): - Client certificate key type,rsa
orec
. Overrides engine-wide default managed inconfig
endpoint.tls_client_key_bits
(int
): - Client certificate key bits, valid values depend on key type. Overrides engine-wide default managed inconfig
endpoint.tls_client_ttl
(int or string
) – Client certificate TTL in either an integer number of seconds (10) or an integer time unit (10s). Overrides engine-wide default managed inconfig
endpoint.operation_none
(bool: false
) - Remove all permissions from this role. May not be specified with any otheroperation_
params.operation_all
(bool: false
) - Grant all permissions to this role. May not be specified with any otheroperation_
params.operation_activate
(bool: false
) - Grant permission to use the KMIPActivate
operation.operation_add_attribute
(bool: false
) - Grant permission to use the KMIPAdd Attribute
operation.operation_create
(bool: false
) - Grant permission to use the KMIPCreate
operation.operation_destroy
(bool: false
) - Grant permission to use the KMIPDestroy
operation.operation_discover_versions
(bool: false
) - Grant permission to use the KMIPDiscover Version
operation.operation_get
(bool: false
) - Grant permission to use the KMIPGet
operation.operation_get_attribute_list
(bool: false
) - Grant permission to use the KMIPGet Attribute List
operation.operation_get_attributes
(bool: false
) - Grant permission to use the KMIPGet Attributes
operation.operation_locate
(bool: false
) - Grant permission to use the KMIPLocate
operation.operation_register
(bool: false
) - Grant permission to use the KMIPRegister
operation.operation_rekey
(bool: false
) - Grant permission to use the KMIPRekey
operation.operation_revoke
(bool: false
) - Grant permission to use the KMIPRevoke
operation.
Sample Payload
Sample Request
Read role
Method | Path |
---|---|
GET | /kmip/scope/:scope/role/:role |
Read a role.
Parameters
scope
(string: <required>
) - Name of scope. This is part of the request URL.role
(string: <required>
) - Name of role. This is part of the request URL.
Sample Request
Sample Response
List roles
Method | Path |
---|---|
LIST | /kmip/scope/:scope/role |
List roles with a scope.
Parameters
scope
(string: <required>
) - Name of scope. This is part of the request URL.
Sample Request
Sample Response
Delete role
Method | Path |
---|---|
DELETE | /kmip/scope/:scope/role/:role |
Delete a role by name.
Parameters
scope
(string: <required>
) - Name of scope. This is part of the request URL.role
(string: <required>
) - Name of role. This is part of the request URL.
Sample Request
Generate credential
Method | Path |
---|---|
POST | /kmip/scope/:scope/role/:role/credential/generate |
Create a new client certificate tied to the given role and scope. This endpoint uses entropy augmentation to generate the client certificate if entropy augmentation is enabled.
Parameters
scope
(string: <required>
) - Name of scope. This is part of the request URL.role
(string: <required>
) - Name of role. This is part of the request URL.format
(string: "pem"
) - Format to return the certificate, private key, and CA chain in. One ofpem
,pem_bundle
, order
.
Sample Request
Sample Response
Sign CSR
Method | Path |
---|---|
POST | /kmip/scope/:scope/role/:role/credential/sign |
Create a new client certificate tied to the given role and scope, based on a Certificate Signing Request (CSR) provided as input. The key type and key bits used in the CSR must match those of the role.
Parameters
scope
(string: <required>
) - Name of scope. This is part of the request URL.role
(string: <required>
) - Name of role. This is part of the request URL.format
(string: "pem"
) - Format to return the certificate, private key, and CA chain in. One ofpem
,pem_bundle
, order
.csr
(string
) - CSR in PEM format.
Sample Request
Sample Response
Lookup credential
Method | Path |
---|---|
GET | /kmip/scope/:scope/role/:role/credential/lookup |
Read a certificate by serial number. The private key cannot be obtained except at generation time.
Parameters
scope
(string: <required>
) - Name of scope. This is part of the request URL.role
(string: <required>
) - Name of role. This is part of the request URL.serial_number
(string: <required>
) - Serial number of certificate to revoke.format
(string: "pem"
) - Format to return the certificate, private key, and CA chain in. One ofpem
,pem_bundle
, order
.
Sample Request
Sample Response
List credential serial numbers
Method | Path |
---|---|
LIST | /kmip/scope/:scope/role/:role/credential |
List the serial numbers of all certificates within a role.
Parameters
scope
(string: <required>
) - Name of scope. This is part of the request URL.role
(string: <required>
) - Name of role. This is part of the request URL.
Sample Request
Sample Response
Revoke credential
Method | Path |
---|---|
POST | /kmip/scope/:scope/role/:role/credential/revoke |
Delete a certificate, thereby revoking it.
Parameters
scope
(string: <required>
) - Name of scope. This is part of the request URL.role
(string: <required>
) - Name of role. This is part of the request URL.serial_number
(string: ""
) - Serial number of certificate to revoke. Exactly one ofserial_number
orcertificate
must be provided.certificate
(string: """
) - Certificate to revoke, in PEM format. Exactly one ofserial_number
orcertificate
must be provided.
Sample Payload
Sample Request