Error querying from elasticsearch using token and getting error `no permissions for cluster:monitor/health'
Issue
- Unable to query elasticsearch using token.
$ curl -k -H "X-Proxy-Remote-User: `oc whoami`" -H "X-Forwarded-For: 0.0.0.0" -H "Authorization: Bearer `oc whoami -t`" https://elasticsearch-apps.example.com/_cluster/health | python -m json.tool
- Got the below error
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 203 100 203 0 0 40 0 0:00:05 0:00:05 --:--:-- 51
{
"error": {
"reason": "no permissions for cluster:monitor/health",
"root_cause": [
{
"reason": "no permissions for cluster:monitor/health",
"type": "security_exception"
}
],
"type": "security_exception"
},
"status": 403
}
Environment
- OpenShift Container Platform (OCP)
- 3.4
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
