Skip to content

Commit fa02637

Browse files
lcawll-trotta
authored andcommitted
Add security.delegate_pki
1 parent ad1630f commit fa02637

File tree

11 files changed

+368
-0
lines changed

11 files changed

+368
-0
lines changed

docs/overlays/elasticsearch-openapi-overlays.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,3 +471,20 @@ actions:
471471
$ref: "../../specification/search_application/render_query/SearchApplicationsRenderQueryRequestExample1.yaml"
472472
renderSearchApplicationQueryResponseExample1:
473473
$ref: "../../specification/search_application/render_query/SearchApplicationsRenderQueryResponseExample1.yaml"
474+
475+
- target: "$.paths['/_security/delegate_pki']['post']"
476+
description: "Add examples for delegate PKI operation"
477+
update:
478+
requestBody:
479+
content:
480+
application/json:
481+
examples:
482+
delegatePkiRequestExample1:
483+
$ref: "../../specification/security/delegate_pki/SecurityDelegatePkiRequestExample1.yaml"
484+
responses:
485+
200:
486+
content:
487+
application/json:
488+
examples:
489+
delegatePkiResponseExample1:
490+
$ref: "../../specification/security/delegate_pki/SecurityDelegatePkiResponseExample1.yaml"

output/openapi/elasticsearch-openapi.json

Lines changed: 66 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 127 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/validation-errors.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,12 @@
634634
],
635635
"response": []
636636
},
637+
"security.delegate_pki": {
638+
"request": [
639+
"Request: should not have a body"
640+
],
641+
"response": []
642+
},
637643
"security.get_settings": {
638644
"request": [
639645
"Missing request & response"

output/typescript/types.ts

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_doc_ids/table.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ paginate-search-results,https://www.elastic.co/guide/en/elasticsearch/reference/
383383
painless-contexts,https://www.elastic.co/guide/en/elasticsearch/painless/{branch}/painless-contexts.html
384384
painless-execute-api,https://www.elastic.co/guide/en/elasticsearch/painless/{branch}/painless-execute-api.html
385385
pipeline-processor,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/pipeline-processor.html
386+
pki-realm,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/pki-realm.html
386387
point-in-time-api,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/point-in-time-api.html
387388
preview-dfanalytics,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/preview-dfanalytics.html
388389
preview-transform,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/preview-transform.html
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"security.delegate_pki": {
3+
"documentation": {
4+
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-delegate-pki-authentication.html",
5+
"description": "Delegate PKI authentication."
6+
},
7+
"stability": "stable",
8+
"visibility": "public",
9+
"headers": {
10+
"accept": ["application/json"]
11+
},
12+
"url": {
13+
"paths": [
14+
{
15+
"path": "/_security/delegate_pki",
16+
"methods": ["POST"]
17+
}
18+
]
19+
},
20+
"params": {}
21+
}
22+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { RequestBase } from '@_types/Base'
21+
22+
/**
23+
* Delegate PKI authentication.
24+
* This API implements the exchange of an X509Certificate chain for an Elasticsearch access token.
25+
* The certificate chain is validated, according to RFC 5280, by sequentially considering the trust configuration of every installed PKI realm that has `delegation.enabled` set to `true`.
26+
* A successfully trusted client certificate is also subject to the validation of the subject distinguished name according to thw `username_pattern` of the respective realm.
27+
*
28+
* This API is called by smart and trusted proxies, such as Kibana, which terminate the user's TLS session but still want to authenticate the user by using a PKI realm—-​as if the user connected directly to Elasticsearch.
29+
*
30+
* IMPORTANT: The association between the subject public key in the target certificate and the corresponding private key is not validated.
31+
* This is part of the TLS authentication process and it is delegated to the proxy that calls this API.
32+
* The proxy is trusted to have performed the TLS authentication and this API translates that authentication into an Elasticsearch access token.
33+
* @rest_spec_name security.delegate_pki
34+
* @availability stack since=7.4.0 stability=stable
35+
* @cluster_privileges all
36+
* @ext_doc_id pki-realm
37+
*/
38+
export interface Request extends RequestBase {
39+
body: {
40+
/**
41+
* The X509Certificate chain, which is represented as an ordered string array.
42+
* Each string in the array is a base64-encoded (Section 4 of RFC4648 - not base64url-encoded) of the certificate's DER encoding.
43+
*
44+
* The first element is the target certificate that contains the subject distinguished name that is requesting access.
45+
* This may be followed by additional certificates; each subsequent certificate is used to certify the previous one.
46+
*/
47+
x509_certificate_chain: string[]
48+
}
49+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# summary:
2+
description: Delegate a one element certificate chain.
3+
# type": "response",
4+
# response_code": 200,
5+
value: "{\n\"x509_certificate_chain\": [\"MIIDeDCCAmCgAwIBAgIUBzj/nGGKxP2iXawsSquHmQjCJmMwDQYJKoZIhvcNAQELBQAwUzErMCkGA1UEAxMiRWxhc3RpY3NlYXJjaCBUZXN0IEludGVybWVkaWF0ZSBDQTEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMB4XDTIzMDcxODE5MjkwNloXDTQzMDcxMzE5MjkwNlowSjEiMCAGA1UEAxMZRWxhc3RpY3NlYXJjaCBUZXN0IENsaWVudDEWMBQGA1UECxMNRWxhc3RpY3NlYXJjaDEMMAoGA1UEChMDb3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAllHL4pQkkfwAm/oLkxYYO+r950DEy1bjH+4viCHzNADLCTWO+lOZJVlNx7QEzJE3QGMdif9CCBBxQFMapA7oUFCLq84fPSQQu5AnvvbltVD9nwVtCs+9ZGDjMKsz98RhSLMFIkxdxi6HkQ3Lfa4ZSI4lvba4oo+T/GveazBDS+NgmKyq00EOXt3tWi1G9vEVItommzXWfv0agJWzVnLMldwkPqsw0W7zrpyT7FZS4iLbQADGceOW8fiauOGMkscu9zAnDR/SbWl/chYioQOdw6ndFLn1YIFPd37xL0WsdsldTpn0vH3YfzgLMffT/3P6YlwBegWzsx6FnM/93Ecb4wIDAQABo00wSzAJBgNVHRMEAjAAMB0GA1UdDgQWBBQKNRwjW+Ad/FN1Rpoqme/5+jrFWzAfBgNVHSMEGDAWgBRcya0c0x/PaI7MbmJVIylWgLqXNjANBgkqhkiG9w0BAQsFAAOCAQEACZ3PF7Uqu47lplXHP6YlzYL2jL0D28hpj5lGtdha4Muw1m/BjDb0Pu8l0NQ1z3AP6AVcvjNDkQq6Y5jeSz0bwQlealQpYfo7EMXjOidrft1GbqOMFmTBLpLA9SvwYGobSTXWTkJzonqVaTcf80HpMgM2uEhodwTcvz6v1WEfeT/HMjmdIsq4ImrOL9RNrcZG6nWfw0HR3JNOgrbfyEztEI471jHznZ336OEcyX7gQuvHE8tOv5+oD1d7s3Xg1yuFp+Ynh+FfOi3hPCuaHA+7F6fLmzMDLVUBAllugst1C3U+L/paD7tqIa4ka+KNPCbSfwazmJrt4XNiivPR4hwH5g==\"]\n}"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { integer } from '@_types/Numeric'
21+
22+
export class Response {
23+
body: {
24+
/**
25+
* An access token associated with the subject distinguished name of the client's certificate.
26+
*/
27+
access_token: string
28+
/**
29+
* The amount of time (in seconds) before the token expires.
30+
*/
31+
expires_in: integer
32+
/**
33+
* The type of token.
34+
*/
35+
type: string
36+
}
37+
}

0 commit comments

Comments
 (0)