Skip to content

Commit

Permalink
feat: Add for the kbn-xsrf header
Browse files Browse the repository at this point in the history
This should be ignored by ElasticSearch but is required when making Kibana API calls (https://www.elastic.co/guide/en/kibana/7.15/api.html#api-request-headers).

Adding this will allow to both target ElasticSearch and Kibana API using aws-sigv4 signed requests.

Similar to that PR that added the support to aws-es-proxy: abutaha/aws-es-proxy#72
  • Loading branch information
jphuynh committed Oct 18, 2021
1 parent 62d1ea2 commit 08f5e82
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ var execute = function(endpoint, region, path, method, body) {

req.headers['presigned-expires'] = false;
req.headers['content-type'] = 'application/json';
req.headers['kbn-xsrf'] = true;
req.headers.Host = endpoint.host;

var signer = new AWS.Signers.V4(req, 'es');
Expand Down

0 comments on commit 08f5e82

Please sign in to comment.