Is security initialized?

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
2.x

Describe the issue:
I’m writing scripts that will help us maintain OpenSearch on our customer sites. This could either be a new install, in which I need to initialize security, or an existing install that has everything configured already.

Is there an API that I can call that will tell me whether security is already initialized? Initializing security is required on a new install, but is dangerous on an existing install as it will replace any customization already done to the site.

Hi @mdu,

you could use something like:

curl -XGET "http://<OS_node>:9200_plugins/_security/health"

or if you need a configuration itself:

curl -XGET https://<OS_node>:9200/_plugins/_security/api/securityconfig?pretty

more details here: API - OpenSearch Documentation

best,
mj