Unable to access Kibana REST API
Hi,
I’m using the ElasticSearch service on a VPC with basic authentication.
I am able to make ES REST API calls, but Kibana API calls fail with 401 status code - "Authentication required". Kibana UI works well.
For example, the following API call works:
curl -u user:pass -H 'Content-Type: application/json' -X GET <vpc-es-endpoint>/_search
But this one fails with status 401:
curl -u user:pass -H 'Content-Type: application/json' -X GET <vpc-es-endpoint>/_plugin/kibana/api/saved_objects/index-pattern/<id>
Any idea what could be the problem?
Thanks
Hi,
I managed to make it work by calling /_plugin/kibana/auth/login and then using the security_authentication cookie when calling Kiabana API.
First call:
curl -u user:pass -H 'Content-Type: application/json' -X POST <vpc-es-endpoint>/_plugin/kibana/auth/login' -H 'kbn-xsrf: true' -d '{"username" : <username>, "password" : <password>}' -c /tmp/kibana_cookies.txt
Next calls:
curl -u user:pass -H 'Content-Type: application/json' -X GET <vpc-es-endpoint>/_plugin/kibana/api/saved_objects/index-pattern/<id> -b /tmp/kibana_cookies.txt
Or:
curl -u user:pass -H 'Content-Type: application/json' -X GET <vpc-es-endpoint>/_plugin/kibana/api/saved_objects/index-pattern/<id> --cookie 'security_authentication=<security_auth_cookie>
Cool. It worked. Once security cookie is available, I think user:password is no longer needed. One issue I am facing is that visualization created in elastic version of kibana (7.9.x) is failing to import into AWS ES kibana 7.9. We use the _import api end point
Relevant questions
How to Helth Check Rest IAM Certificated API
asked 3 months agoPublic APIGW Rest Api proxy to private Fargate App in VPC via VPC Link
asked 5 months agoHow to create Signature V4 authentication header when uploading files as multipart/form-data in REST API of API Gateway?
asked 3 months agoCombining Basic Auth & Cognito Auth in ES
Accepted Answerasked 2 years agoUnable to access Kibana REST API
asked a year agoHow to use postgres rest api in AWS
asked 6 days agoImporting Filebeat or Metricbeat dashboard on Amazon Elasticserach Kibana
Accepted Answerasked 2 years agoSecuring Kibana and ElasticSearch without X-Pack-Security plugin
Accepted Answerasked 5 years agoX-Pack alternative
Accepted Answerasked 5 years agoAPI Gateway integration with DAX
asked 4 months ago