using Elasticsearch file realm for authentication instead of using roles and users APIs

Viewed 31

As mentioned in the official documentation of Elasticsearch, using file realm to define all roles in Elasticsearch is not a preferred approach:

"Please note however, that the roles.yml file is provided as a minimal administrative function and is not intended to cover and be used to define roles for all use cases."

https://www.elastic.co/guide/en/elasticsearch/reference/8.3/defining-roles.html

What is the reason? can anyone argue pros and cons of using Elasticsearch file realm for all roles and users instead of using its native realm (roles and users APIs)?

1 Answers

Tldr;

It depends on ones use case. File realm can be a perfectly sound way to create your users.

BUT it has some pitfalls, such as:

  • Not centralized, the file has to be replicated over every nodes in the cluster.
  • Hard to update, the changes has to be replicated to every node before taking effect.
  • ELastic snapshot mecanism does not cover files.

I am sure you could find Pro / Cons. But those are some I could think of.

Related