Hi,
I am staring elasticsearch cluster with kubernetes and docker. While running the docker, I created an admin user using /usr/share/elasticsearch/bin/x-pack/users useradd myadmin -p secret -r admin. The following output is returned after executing users list command from inside the container.
bash-4.2$ /usr/share/elasticsearch/bin/x-pack/users list
myadmin : admin
In elasticsearch.yml, I also added
xpack.security.authc:
realms:
file:
type: file
order: 0
native:
type: native
order: 1
My roles.yml looks like
admin:
cluster: [ 'all' ]
indices:
- names: [ '*' ]
privileges: [ 'all' ]
I am successfully able to retrieve the cluster health using built in superuser elastic, but when I tried to do the same with my file user, I got
{
"error" : {
"root_cause" : [
{
"type" : "security_exception",
"reason" : "unable to authenticate user [myadmin] for REST request [/_cluster/health?pretty]",
"header" : {
"WWW-Authenticate" : "Basic realm="security" charset="UTF-8""
}
}
],
"type" : "security_exception",
"reason" : "unable to authenticate user [myadmin] for REST request [/_cluster/health?pretty]",
"header" : {
"WWW-Authenticate" : "Basic realm="security" charset="UTF-8""
}
},
"status" : 401
}
Any idea about what I am missing here?