Access Control in Elastic - missing authentication credentials for REST request

10,060

I had security already enabled and user authentication working. Kibana loaded fine.

I have a 3 node cluster and stopped elasticsearch service on each node so I could add transport ssl. After enabling xpack.security.transport.ssl.enabled and keystore and truststore settings, I got the same ""missing authentication credentials for REST request" error in Kibana. Turns out the error was because I only had one node running and needed a minimum of two. After enabling transport ssl on another node and starting it, kibana worked again.

Share:
10,060
Tech Geek
Author by

Tech Geek

Updated on June 08, 2022

Comments

  • Tech Geek
    Tech Geek almost 2 years

    I am using Elastic 7.9.2 version and wanted to use security. so I ran :

    bin/elasticsearch-certutil cert -out config/elastic-certificates.p12 -pass ""
    

    and then added

    xpack.security.enabled: true
    xpack.security.transport.ssl.enabled: true
    xpack.security.transport.ssl.verification_mode: certificate
    xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
    xpack.security.transport.ssl.truststore.path: elastic-certificates.p1
    

    in config/elasticsearch.yaml

    Now when I am running the ES by

     bin/elasticsearch
    

    getting below error :

    "error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials
     for REST request [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-
    8\""}}],"type":"security_exception","reason":"missing authentication credentials for REST 
    request [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-
    8\""}},"status":401}root@ip-localhost:/var/log/elasticsearch
    

    Can anyone please help!