Skip to content
Discussion options

You must be logged in to vote

ok the answer is as follows-

It's inferred from the Elastic docs but not specified that your API token user must have permissions and these are separate from the user creating the token.

So test your credentialed access with-

curl -v -k -u user:pass --request GET \
--url 'https://FQDN:9200/_cat/indices' \
--header 'kbn-xsrf: true' \
--header 'Content-Type: application/json'

If this works you can add some read only permissions to your API token with this-

curl -v -k -u user:pass --request POST \
--url 'https://FQDN:9200/_security/api_key' \
—H 'Content-Type: application/json’ \
-d '{
  "name": "API_Token_Name",
  "role_descriptors": {
    "read_only": {
      "cluster": ["monitor"],
     …

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@adamphetamine
Comment options

Comment options

You must be logged in to vote
1 reply
@cm-ops
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by adamphetamine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
2.4
Labels
None yet
2 participants