Skip to content

Instantly share code, notes, and snippets.

@portante
Last active May 10, 2017 15:07
Show Gist options
  • Select an option

  • Save portante/19ae191040e13343af8d0e725d56aad2 to your computer and use it in GitHub Desktop.

Select an option

Save portante/19ae191040e13343af8d0e725d56aad2 to your computer and use it in GitHub Desktop.
A simple script to verify Kibana can access ES on behalf of a user
#!/bin/bash
_BASE=/etc/kibana/keys
_CA=$_BASE/ca
_CERT=$_BASE/cert
_KEY=$_BASE/key
ls -l $_CA $_CERT $_KEY
_USER=foo
_TOKEN=bar
_INDEX=goo
ES_URL='https://logging-es:9200'
curl_get="curl -X GET --cacert $_CA --cert $_CERT --key $_KEY"
$curl_get -H "X-Proxy-Remote-User: $_USER" -H "Authorization: Bearer $_TOKEN" -H "X-Forwarded-For: 127.0.0.1" $ES_URL/$_INDEX?v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment