# sgadmin api

**URL:** <https://forum.search-guard.com/t/sgadmin-api/1252>\
**Category:** Search Guard\
**Created:** [December 18, 2018, 1:39am UTC](https://forum.search-guard.com/t/sgadmin-api/1252 "2018-12-18T01:39:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sundeep](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@Sundeep](https://forum.search-guard.com/u/Sundeep)\
**Post date:** [December 18, 2018, 1:39am UTC](https://forum.search-guard.com/t/sgadmin-api/1252/1 "2018-12-18T01:39:16Z")

</div>

When asking questions, please provide the following information:

- Search Guard and Elasticsearch version

- Installed and used enterprise modules, if any

- JVM version and operating system version

- Search Guard configuration files

- Elasticsearch log messages on debug level

- Other installed Elasticsearch or Kibana plugins, if any

Search Guard: 6.2.3-23

Elastic: 6.2.3

Java: 1.8.0

Hi there,

We want to deploy search guard without the need to run sgadmin and wanted to see if someone can help me out here?

-Is there a API endpoint which replicates running sgadmin command line to load/reload configuration?

-Is it possible to load the configuration from disk on startup without the use of sgadmin?

Thanks

Sundeep

---

<div class="post-metadata">

**Author:** ![searchguard\_google\_group](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/searchguard_google_group/32/462_2.png) [@searchguard\_google\_group](https://forum.search-guard.com/u/searchguard_google_group)\
**Post date:** [December 18, 2018, 11:45am UTC](https://forum.search-guard.com/t/sgadmin-api/1252/2 "2018-12-18T11:45:26Z")

</div>

Yes, there is the REST API (commercial feature), see [Access Control | Security for Elasticsearch | Search Guard](https://docs.search-guard.com/latest/rest-api-access-control)

And yes, you can also load the config from disk on startup (searchguard.allow\_default\_init\_sgindex: true),  
see [Generated Artefacts | Security for Elasticsearch | Search Guard](https://docs.search-guard.com/latest/demo-installer-generated-artefacts#allow-demo-certificates-and-auto-initialization)

> **···**
>
> > Am 18.12.2018 um 02:39 schrieb Sundeep \<itssundeep@gmail.com\>:
> > 
> > When asking questions, please provide the following information:
> > 
> > \* Search Guard and Elasticsearch version  
> > \* Installed and used enterprise modules, if any  
> > \* JVM version and operating system version  
> > \* Search Guard configuration files  
> > \* Elasticsearch log messages on debug level  
> > \* Other installed Elasticsearch or Kibana plugins, if any
> > 
> > Search Guard: 6.2.3-23  
> > Elastic: 6.2.3  
> > Java: 1.8.0
> > 
> > Hi there,
> > 
> > We want to deploy search guard without the need to run sgadmin and wanted to see if someone can help me out here?
> > 
> > -Is there a API endpoint which replicates running sgadmin command line to load/reload configuration?  
> > -Is it possible to load the configuration from disk on startup without the use of sgadmin?
> > 
> > Thanks  
> > Sundeep
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups "Search Guard Community Forum" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an email to search-guard+unsubscribe@googlegroups.com.  
> > To post to this group, send email to search-guard@googlegroups.com.  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/search-guard/6f4011c5-0424-4b1f-b66e-82f3f3f1e4f9%40googlegroups.com\](https://groups.google.com/d/msgid/search-guard/6f4011c5-0424-4b1f-b66e-82f3f3f1e4f9%40googlegroups.com%5C).  
> > For more options, visit [https://groups.google.com/d/optout\](https://groups.google.com/d/optout%5C).

---

<div class="post-metadata">

**Author:** ![Sundeep](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@Sundeep](https://forum.search-guard.com/u/Sundeep)\
**Post date:** [December 18, 2018, 9:00pm UTC](https://forum.search-guard.com/t/sgadmin-api/1252/3 "2018-12-18T21:00:06Z")

</div>

Thanks for the response, does “searchguard.allow\_default\_init\_sgindex: true” work for the case of reloading or just one time initialization ?

During “searchguard.allow\_default\_init\_sgindex” how can I specify a different directory to load the config from, looks like it picks from ``/plugins/search-guard-6/sgconfig` `

wanted to know if there is a way to change it, like some ENV variable.

Thanks

> **···**
>
> On Tuesday, December 18, 2018 at 3:45:29 AM UTC-8, Search Guard wrote:
> 
> > Yes, there is the REST API (commercial feature), see [https://docs.search-guard.com/latest/rest-api-access-control](https://www.google.com/url?q=https%3A%2F%2Fdocs.search-guard.com%2Flatest%2Frest-api-access-control&sa=D&sntz=1&usg=AFQjCNG8t5jCRJKZPfYoMVix9CzdctsTbQ)
> > 
> > And yes, you can also load the config from disk on startup (searchguard.allow\_default\_init\_sgindex: true),  
> > see [https://docs.search-guard.com/latest/demo-installer-generated-artefacts#allow-demo-certificates-and-auto-initialization](https://docs.search-guard.com/latest/demo-installer-generated-artefacts#allow-demo-certificates-and-auto-initialization)
> > 
> > > Am 18.12.2018 um 02:39 schrieb Sundeep [itssu...@gmail.com](mailto:itssu...@gmail.com):
> > 
> > > When asking questions, please provide the following information:
> > 
> > > - Search Guard and Elasticsearch version
> > 
> > > - Installed and used enterprise modules, if any
> > 
> > > - JVM version and operating system version
> > 
> > > - Search Guard configuration files
> > 
> > > - Elasticsearch log messages on debug level
> > 
> > > - Other installed Elasticsearch or Kibana plugins, if any
> > 
> > > Search Guard: 6.2.3-23
> > 
> > > Elastic: 6.2.3
> > 
> > > Java: 1.8.0
> > 
> > > Hi there,
> > 
> > > We want to deploy search guard without the need to run sgadmin and wanted to see if someone can help me out here?
> > > 
> > > -Is there a API endpoint which replicates running sgadmin command line to load/reload configuration?  
> > > -Is it possible to load the configuration from disk on startup without the use of sgadmin?
> > > 
> > > Thanks
> > 
> > > Sundeep
> > 
> > > 
> > 
> > > –  
> > > You received this message because you are subscribed to the Google Groups “Search Guard Community Forum” group.
> > 
> > > To unsubscribe from this group and stop receiving emails from it, send an email to [search-guard...@googlegroups.com](mailto:search-guard...@googlegroups.com).
> > 
> > > To post to this group, send email to [search...@googlegroups.com](mailto:search...@googlegroups.com).
> > 
> > > To view this discussion on the web visit [https://groups.google.com/d/msgid/search-guard/6f4011c5-0424-4b1f-b66e-82f3f3f1e4f9%40googlegroups.com](https://groups.google.com/d/msgid/search-guard/6f4011c5-0424-4b1f-b66e-82f3f3f1e4f9%40googlegroups.com).
> > 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Sundeep](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@Sundeep](https://forum.search-guard.com/u/Sundeep)\
**Post date:** [December 18, 2018, 9:29pm UTC](https://forum.search-guard.com/t/sgadmin-api/1252/4 "2018-12-18T21:29:49Z")

</div>

Looks like “allow\_default\_init\_sgindex” works if the index does not exist and it does not work for the reload. Is there a way to achieve this on elasticsearch startup without using sgadmin command.

> **···**
>
> On Tuesday, December 18, 2018 at 1:00:06 PM UTC-8, Sundeep wrote:
> 
> > Thanks for the response, does “searchguard.allow\_default\_init\_sgindex: true” work for the case of reloading or just one time initialization ?
> 
> > 
> 
> > During “searchguard.allow\_default\_init\_sgindex” how can I specify a different directory to load the config from, looks like it picks from ``/plugins/search-guard-6/sgconfig` `
> 
> > wanted to know if there is a way to change it, like some ENV variable.
> 
> > Thanks
> > 
> > On Tuesday, December 18, 2018 at 3:45:29 AM UTC-8, Search Guard wrote:
> > 
> > > Yes, there is the REST API (commercial feature), see [https://docs.search-guard.com/latest/rest-api-access-control](https://www.google.com/url?q=https%3A%2F%2Fdocs.search-guard.com%2Flatest%2Frest-api-access-control&sa=D&sntz=1&usg=AFQjCNG8t5jCRJKZPfYoMVix9CzdctsTbQ)
> > > 
> > > And yes, you can also load the config from disk on startup (searchguard.allow\_default\_init\_sgindex: true),  
> > > see [https://docs.search-guard.com/latest/demo-installer-generated-artefacts#allow-demo-certificates-and-auto-initialization](https://docs.search-guard.com/latest/demo-installer-generated-artefacts#allow-demo-certificates-and-auto-initialization)
> > > 
> > > > Am 18.12.2018 um 02:39 schrieb Sundeep [itssu...@gmail.com](mailto:itssu...@gmail.com):
> > > 
> > > > When asking questions, please provide the following information:
> > > 
> > > > - Search Guard and Elasticsearch version
> > > 
> > > > - Installed and used enterprise modules, if any
> > > 
> > > > - JVM version and operating system version
> > > 
> > > > - Search Guard configuration files
> > > 
> > > > - Elasticsearch log messages on debug level
> > > 
> > > > - Other installed Elasticsearch or Kibana plugins, if any
> > > 
> > > > Search Guard: 6.2.3-23
> > > 
> > > > Elastic: 6.2.3
> > > 
> > > > Java: 1.8.0
> > > 
> > > > Hi there,
> > > 
> > > > We want to deploy search guard without the need to run sgadmin and wanted to see if someone can help me out here?
> > > > 
> > > > -Is there a API endpoint which replicates running sgadmin command line to load/reload configuration?  
> > > > -Is it possible to load the configuration from disk on startup without the use of sgadmin?
> > > > 
> > > > Thanks
> > > 
> > > > Sundeep
> > > 
> > > > 
> > > 
> > > > –  
> > > > You received this message because you are subscribed to the Google Groups “Search Guard Community Forum” group.
> > > 
> > > > To unsubscribe from this group and stop receiving emails from it, send an email to [search-guard...@googlegroups.com](mailto:search-guard...@googlegroups.com).
> > > 
> > > > To post to this group, send email to [search...@googlegroups.com](mailto:search...@googlegroups.com).
> > > 
> > > > To view this discussion on the web visit [https://groups.google.com/d/msgid/search-guard/6f4011c5-0424-4b1f-b66e-82f3f3f1e4f9%40googlegroups.com](https://groups.google.com/d/msgid/search-guard/6f4011c5-0424-4b1f-b66e-82f3f3f1e4f9%40googlegroups.com).
> > > 
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![searchguard\_google\_group](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/searchguard_google_group/32/462_2.png) [@searchguard\_google\_group](https://forum.search-guard.com/u/searchguard_google_group)\
**Post date:** [December 19, 2018, 6:48am UTC](https://forum.search-guard.com/t/sgadmin-api/1252/5 "2018-12-19T06:48:56Z")

</div>

allow\_default\_init\_sgindex works only on startup and if no searchguard index exists. For security reasons a reload on startup/filechange or loading from another directory is not supported.  
You need to script this or implement it on your own.

> **···**
>
> > Am 18.12.2018 um 22:29 schrieb Sundeep \<itssundeep@gmail.com\>:
> > 
> > Looks like "allow\_default\_init\_sgindex" works if the index does not exist and it does not work for the reload. Is there a way to achieve this on elasticsearch startup without using sgadmin command.
> > 
> > On Tuesday, December 18, 2018 at 1:00:06 PM UTC-8, Sundeep wrote:  
> > Thanks for the response, does "searchguard.allow\_default\_init\_sgindex: true" work for the case of reloading or just one time initialization ?
> > 
> > During "searchguard.allow\_default\_init\_sgindex" how can I specify a different directory to load the config from, looks like it picks from `\<Elasticsearch directory\>/plugins/search-guard-6/sgconfig `  
> > wanted to know if there is a way to change it, like some ENV variable.
> > 
> > Thanks
> > 
> > On Tuesday, December 18, 2018 at 3:45:29 AM UTC-8, Search Guard wrote:  
> > Yes, there is the REST API (commercial feature), see [Access Control | Security for Elasticsearch | Search Guard](https://docs.search-guard.com/latest/rest-api-access-control)
> > 
> > And yes, you can also load the config from disk on startup (searchguard.allow\_default\_init\_sgindex: true),  
> > see [Generated Artefacts | Security for Elasticsearch | Search Guard](https://docs.search-guard.com/latest/demo-installer-generated-artefacts#allow-demo-certificates-and-auto-initialization)
> > 
> > \> Am 18.12.2018 um 02:39 schrieb Sundeep \<itssu...@gmail.com\>:  
> > \>  
> > \> When asking questions, please provide the following information:  
> > \>  
> > \> \* Search Guard and Elasticsearch version  
> > \> \* Installed and used enterprise modules, if any  
> > \> \* JVM version and operating system version  
> > \> \* Search Guard configuration files  
> > \> \* Elasticsearch log messages on debug level  
> > \> \* Other installed Elasticsearch or Kibana plugins, if any  
> > \>  
> > \> Search Guard: 6.2.3-23  
> > \> Elastic: 6.2.3  
> > \> Java: 1.8.0  
> > \>  
> > \> Hi there,  
> > \>  
> > \> We want to deploy search guard without the need to run sgadmin and wanted to see if someone can help me out here?  
> > \>  
> > \> -Is there a API endpoint which replicates running sgadmin command line to load/reload configuration?  
> > \> -Is it possible to load the configuration from disk on startup without the use of sgadmin?  
> > \>  
> > \>  
> > \> Thanks  
> > \> Sundeep  
> > \>  
> > \>  
> > \>  
> > \>  
> > \> --  
> > \> You received this message because you are subscribed to the Google Groups "Search Guard Community Forum" group.  
> > \> To unsubscribe from this group and stop receiving emails from it, send an email to search-guard...@googlegroups.com.  
> > \> To post to this group, send email to search...@googlegroups.com.  
> > \> To view this discussion on the web visit [https://groups.google.com/d/msgid/search-guard/6f4011c5-0424-4b1f-b66e-82f3f3f1e4f9%40googlegroups.com\](https://groups.google.com/d/msgid/search-guard/6f4011c5-0424-4b1f-b66e-82f3f3f1e4f9%40googlegroups.com%5C).  
> > \> For more options, visit [https://groups.google.com/d/optout\](https://groups.google.com/d/optout%5C).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups "Search Guard Community Forum" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an email to search-guard+unsubscribe@googlegroups.com.  
> > To post to this group, send email to search-guard@googlegroups.com.  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/search-guard/c5330066-17c3-4201-bab3-e043d6ce7788%40googlegroups.com\](https://groups.google.com/d/msgid/search-guard/c5330066-17c3-4201-bab3-e043d6ce7788%40googlegroups.com%5C).  
> > For more options, visit [https://groups.google.com/d/optout\](https://groups.google.com/d/optout%5C).
