Vault
SCEP auth method (API)
Use the SCEP authentication plugin API to interact with a mounted plugin instance. For general information about the usage and operation of the SCEP method, refer to the Vault SCEP method documentation.
Create SCEP role
Creates or updates a named SCEP role.
| Method | Path |
|---|---|
POST | /auth/{mount_path}/role/:name |
Parameters
name(string: <required>)- The name of the SCEP role.display_name(string: "<name>")- Thedisplay_namevalue for tokens issued when authenticating against the role. Defaults toname.auth_type(enum: <required>)- Required authentication type for the SCEP role. Must be one of:static-challenge,intune.challenge(string: "")- The authentication challenge to use whenauth_typeisstatic-challenge.
token_ttl(integer: 0 or string: "")- The incremental lifetime for generated tokens. This current value of this will be referenced at renewal time.token_max_ttl(integer: 0 or string: "")- The maximum lifetime for generated tokens. This current value of this will be referenced at renewal time.token_policies(array: [] or comma-delimited string: "")- List of token policies to encode onto generated tokens. Depending on the auth method, this list may be supplemented by user/group/other values.policies(array: [] or comma-delimited string: "")- DEPRECATED: Please use thetoken_policiesparameter instead. List of token policies to encode onto generated tokens. Depending on the auth method, this list may be supplemented by user/group/other values.
token_bound_cidrs(array: [] or comma-delimited string: "")- List of CIDR blocks; if set, specifies blocks of IP addresses which can authenticate successfully, and ties the resulting token to these blocks as well.token_explicit_max_ttl(integer: 0 or string: "")- If set, will encode an explicit max TTL onto the token. This is a hard cap even iftoken_ttlandtoken_max_ttlwould otherwise allow a renewal.token_no_default_policy(bool: false)- If set, thedefaultpolicy will not be set on generated tokens; otherwise it will be added to the policies set intoken_policies.token_num_uses(integer: 0)- The maximum number of times a generated token may be used (within its lifetime); 0 means unlimited. If you require the token to have the ability to create child tokens, you will need to set this value to 0.token_period(integer: 0 or string: "")- The maximum allowed period value when a periodic token is requested from this role.token_type(string: "")- The type of token that should be generated. Can beservice,batch, ordefaultto use the mount's tuned default (which unless changed will beservicetokens). For token store roles, there are two additional possibilities:default-serviceanddefault-batchwhich specify the type to return unless the client requests a different type at generation time. For machine based authentication cases, you should usebatchtype tokens.
Sample payload
{
"auth_type": "static-challenge",
"challenge": "super-secret-challenge",
"display_name": "test",
"token_policies": ["access-scep"],
"token_type": "batch"
}
Sample request
$ curl \
--header "X-Vault-Token: ..." \
--request POST \
--data @payload.json
http://127.0.0.1:8200/v1/auth/scep/role/static-challenge-1
Sample response
{
"request_id": "c22d68ec-ac3d-ea24-d5d0-efe07dcc0ef6",
"lease_id": "",
"renewable": false,
"lease_duration": 0,
"data": {
"auth_type": "static-challenge",
"display_name": "test",
"name": "static-challenge-1",
"token_bound_cidrs": [],
"token_explicit_max_ttl": 0,
"token_max_ttl": 0,
"token_no_default_policy": false,
"token_num_uses": 0,
"token_period": 0,
"token_policies": [
"access-scep"
],
"token_ttl": 0,
"token_type": "batch"
},
"wrap_info": null,
"warnings": null,
"auth": null,
"mount_type": "scep"
}
Read SCEP role
Get information associated with the named role.
| Method | Path |
|---|---|
GET | /auth/{mount_path}/role/:name |
Parameters
name(string: <required>)- The name of the SCEP role.
Sample request
$ curl \
--header "X-Vault-Token: ..." \
http://127.0.0.1:8200/v1/auth/scep/role/static-challenge-1
Sample response
{
"request_id": "07c9bfcc-ee30-6ba9-fce8-07bae5033989",
"lease_id": "",
"renewable": false,
"lease_duration": 0,
"data": {
"auth_type": "static-challenge",
"display_name": "static-challenge-1",
"name": "static-challenge-1",
"token_bound_cidrs": [],
"token_explicit_max_ttl": 0,
"token_max_ttl": 0,
"token_no_default_policy": false,
"token_num_uses": 0,
"token_period": 0,
"token_policies": [
"access-scep"
],
"token_ttl": 0,
"token_type": "batch"
},
"wrap_info": null,
"warnings": null,
"auth": null,
"mount_type": "scep"
}
List SCEP roles
List all currently configured SCEP role names.
| Method | Path |
|---|---|
LIST | /auth/{mount_path}/role |
Sample request
$ curl \
--header "X-Vault-Token: ..." \
--request LIST \
http://127.0.0.1:8200/v1/auth/scep/role
Sample response
{
"auth": null,
"warnings": null,
"wrap_info": null,
"data": {
"keys": ["static-challenge-1", "intune-1"]
},
"lease_duration": 0,
"renewable": false,
"lease_id": ""
}
Delete SCEP role
Delete the named role.
| Method | Path |
|---|---|
DELETE | /auth/{mount_path}/role/:name |
Parameters
name(string: <required>)- The name of the SCEP role.
Sample request
$ curl \
--header "X-Vault-Token: ..." \
--request DELETE \
http://127.0.0.1:8200/v1/auth/scep/role/static-challenge-1
Login
SCEP authentication endpoint for delegated authentication from a PKI mount.
| Method | Path |
|---|---|
POST | /auth/{mount_path}/login |
Parameters
name(string: "")- The SCEP role associated with the PKI mount. Leavingnameunset tells Vault to try all SCEP roles and return the first one that matches.