We are trying to use Cert based authentication as client auth and followed this: Client certificate authentication - OpenSearch documentation. I created a new certificate and assigned that CN to the role “all_access” by calling below API. But, When I call any API with this cert, I am getting 403 error.
{
"error" : {
"root_cause" : [
{
"type" : "security_exception",
"reason" : "no permissions for [cluster:monitor/health] and User [name=<username>, backend_roles=[], requestedTenant=null]"
}
],
"type" : "security_exception",
"reason" : "no permissions for [cluster:monitor/health] and User [name=<username>, backend_roles=[], requestedTenant=null]"
},
"status" : 403
}
curl -k --cert /etc/elasticsearch/ssl/admin.pem --key /etc/elasticsearch/ssl/admin-key.pem --location --request PUT 'https://localhost:9200/_opendistro/_security/api/rolesmapping/readall' --header 'Content-Type: application/json' -d '{
"backend_roles" : ["all_access"],
"users" : [ "CN name in cert." ]
}'
Can you please help, what am I missing here. It seems the user is not mapped to any role. But, I am calling above API to map user to the role.