Skip to content

Instantly share code, notes, and snippets.

@deepakdeore2004
Created August 29, 2019 07:57
Show Gist options
  • Save deepakdeore2004/727a8a907e02ca515e835b5126df8e77 to your computer and use it in GitHub Desktop.
Save deepakdeore2004/727a8a907e02ca515e835b5126df8e77 to your computer and use it in GitHub Desktop.

Elasticsearch roles to use for zipkin user if Elasticsearch has the auth enabled

Create a role named as zipkin (use correct auth in -u curl option)

curl -k -X POST -H 'Content-Type: application/json' -u $ELASTIC_USERNAME:$ELASTIC_PASSWORD https://elasticsearch-host:9200/_security/role/zipkin -d'
{
  "indices": [
    {
      "names": [ "zipkin*" ],
      "privileges": ["all"] 
    }
  ],
  "cluster": [
     "manage_index_templates",
     "monitor"
  ]
}
'

Create an user named as zipkin and assign the role to it

curl -k -X POST -H 'Content-Type: application/json' -u $ELASTIC_USERNAME:$ELASTIC_PASSWORD https://elasticsearch-host:9200/_security/user/zipkin -d'
{
  "enabled" : true,
  "password" : "super_secret",
  "roles" : [ "zipkin" ],
  "full_name" : "Zipkin User"
}
'

Start zipkin with elasticsearch and auth

STORAGE_TYPE=elasticsearch ES_HOSTS=https://elasticsearch-host:9200 ES_USERNAME=zipkin ES_PASSWORD=super_secret java -jar zipkin.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment