# Kibana access to anonymous Internet users

**URL:** <https://forum.search-guard.com/t/kibana-access-to-anonymous-internet-users/1283>\
**Category:** Search Guard\
**Created:** [January 16, 2019, 8:05am UTC](https://forum.search-guard.com/t/kibana-access-to-anonymous-internet-users/1283 "2019-01-16T08:05:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![S11](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@S11](https://forum.search-guard.com/u/S11)\
**Post date:** [January 16, 2019, 8:05am UTC](https://forum.search-guard.com/t/kibana-access-to-anonymous-internet-users/1283/1 "2019-01-16T08:05:41Z")

</div>

Hi Searchguard team,

We have a lively internal discussion between dev/ops teams and we would like to have Searchguard team opinion. We currently use Elasticsearch 6.x.

Some developers want to **expose Kibana dashboards to anonymous users on the Internet**. These dashboards only access to some indices with public data.

They want to use a proxy webapp to perform the Searchguard authentification in order to use a Searchguard user that has only **read-only access to some Kibana dashboards and Elasticsearch indices** (that is configured in the Searchguard configuration).

However, the Elasticsearch cluster may also contains sensitive data in other indices.

Ops team fears about **Internet anonymous users** forging Kibana requests, especially using inline scripts, to gain access to sensitive indices or to execute arbitrary code on the Kibana / Elasticsearch servers.

**Question:**

- Is this situation safe when using the Searchguard?
- Is the ops team “paranoid”?

Hereby a schema to better understand the situation:

 ![schema.png](https://us1.discourse-cdn.com/flex019/uploads/search_guard/original/1X/ecaa2a36cf57f664a9c2a38eba030973b022775a.png)

Thanks for your advices.

---

<div class="post-metadata">

**Author:** ![jkressin](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/jkressin/32/9_2.png) [@jkressin](https://forum.search-guard.com/u/jkressin)\
**Post date:** [January 16, 2019, 11:37am UTC](https://forum.search-guard.com/t/kibana-access-to-anonymous-internet-users/1283/2 "2019-01-16T11:37:47Z")

</div>

Hi,

I think the best way to implement this scenario is to just use the anonymous auth feature of Search Guard and the Kibana plugin. IMHO there is no need to involve a proxy, if I understood your requirements correctly.

Search Guard supports anon authentication:

> **[Search Guard Documentation 404](https://docs.search-guard.com/latest/404.html)**
>
> Seems like the page you are looking for does not exist. We deeply and humbly apologize.

If a request does not carry any credentials, we assign it to a default anonymous user and backend role. You can then map this user / backend role to an SG role which has read access to your public indices only. The Kibana plugin supports anon auth as well:

> **[Anonymous authentication](https://docs.search-guard.com/latest/kibana-authentication-anonymous)**
>
> How to configure Kibana to allow anonymous access to indices, dashboards, and visualization

Which means you can access Kibana without logging in. The requests are forwarded to ES/SG and get assigned to the anonymous user as outlined above. Regular users can hit the “login” button to perform a regular login.

You can also combine the anonymous authentication with the Kibana read-only mode:

> **[Read Only mode](https://docs.search-guard.com/latest/kibana-read-only)**
>
> Use the Kibana read only mode to give users access to dashboards, but prevent them from accessing anything else.

If you assign the read-only mode to the anonymous role then the anonymous users will only see the “Dashboards” application.

Let me know if this helps!

> **···**
>
> On Tuesday, January 15, 2019 at 3:34:28 PM UTC+1, S. wrote:
> 
> > Hi Searchguard team,
> 
> > 
> 
> > We have a lively internal discussion between dev/ops teams and we would like to have Searchguard team opinion. We currently use Elasticsearch 6.x.
> 
> > 
> 
> > Some developers want to **expose Kibana dashboards to anonymous users on the Internet**. These dashboards only access to some indices with public data.
> 
> > They want to use a proxy webapp to perform the Searchguard authentification in order to use a Searchguard user that has only **read-only access to some Kibana dashboards and Elasticsearch indices** (that is configured in the Searchguard configuration).
> 
> > 
> 
> > However, the Elasticsearch cluster may also contains sensitive data in other indices.
> 
> > Ops team fears about **Internet anonymous users** forging Kibana requests, especially using inline scripts, to gain access to sensitive indices or to execute arbitrary code on the Kibana / Elasticsearch servers.
> 
> > 
> 
> > **Question:**
> 
> > - Is this situation safe when using the Searchguard?
> > - Is the ops team “paranoid”?
> 
> > 
> 
> > 
> 
> > Hereby a schema to better understand the situation:
> 
> > ![schema.png](https://us1.discourse-cdn.com/flex019/uploads/search_guard/original/1X/ecaa2a36cf57f664a9c2a38eba030973b022775a.png)
> 
> > 
> 
> > 
> 
> > 
> 
> > Thanks for your advices.

---

<div class="post-metadata">

**Author:** ![S11](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@S11](https://forum.search-guard.com/u/S11)\
**Post date:** [January 16, 2019, 1:29pm UTC](https://forum.search-guard.com/t/kibana-access-to-anonymous-internet-users/1283/3 "2019-01-16T13:29:44Z")

</div>

Thanks Jochen for all these details.  
I understand the anonymous usage in an **INTRANET** network because you can be relatively confident with your users.  
However, I was guessing about the couple “ **anonymous** users + **INTERNET** access”, especially after reading this [article](https://www.elastic.co/blog/guarding-kibana-from-data-hijacking) because they say:

- “Your first line of defense is to not expose Kibana directly to the internet.”
- “The next step is to restrict access to known users.”  
I thought that their recommendations were general and that is do not only apply for data hijacking.

So, if I correctly understand, you say that it’s safe to expose a Kibana instance on the INTERNET for ANONYMOUS users if:

1. Kibana and Elasticsearch are protected with Searchguard
2. Kibana is set to read-only mode for the define Searchguard role
3. This Searchguard role has only read-only access to public Elasticsearch indices  
Is it correct?

> **···**
>
> Le mercredi 16 janvier 2019 12:37:47 UTC+1, Jochen Kressin a écrit :
> 
> > Hi,
> 
> > I think the best way to implement this scenario is to just use the anonymous auth feature of Search Guard and the Kibana plugin. IMHO there is no need to involve a proxy, if I understood your requirements correctly.
> 
> > 
> 
> > Search Guard supports anon authentication:
> 
> > 
> 
> > [https://docs.search-guard.com/latest/anonymous-authentication](https://docs.search-guard.com/latest/anonymous-authentication)
> 
> > 
> 
> > If a request does not carry any credentials, we assign it to a default anonymous user and backend role. You can then map this user / backend role to an SG role which has read access to your public indices only. The Kibana plugin supports anon auth as well:
> 
> > 
> 
> > [https://docs.search-guard.com/latest/kibana-authentication-anonymous](https://docs.search-guard.com/latest/kibana-authentication-anonymous)
> 
> > 
> 
> > Which means you can access Kibana without logging in. The requests are forwarded to ES/SG and get assigned to the anonymous user as outlined above. Regular users can hit the “login” button to perform a regular login.
> 
> > 
> 
> > You can also combine the anonymous authentication with the Kibana read-only mode:
> 
> > 
> 
> > [https://docs.search-guard.com/latest/kibana-read-only](https://docs.search-guard.com/latest/kibana-read-only)
> 
> > 
> 
> > If you assign the read-only mode to the anonymous role then the anonymous users will only see the “Dashboards” application.
> 
> > 
> 
> > Let me know if this helps!
> > 
> > On Tuesday, January 15, 2019 at 3:34:28 PM UTC+1, S. wrote:
> > 
> > > Hi Searchguard team,
> 
> > >
> 
> > > We have a lively internal discussion between dev/ops teams and we would like to have Searchguard team opinion. We currently use Elasticsearch 6.x.
> 
> > >
> 
> > > Some developers want to **expose Kibana dashboards to anonymous users on the Internet**. These dashboards only access to some indices with public data.
> 
> > > They want to use a proxy webapp to perform the Searchguard authentification in order to use a Searchguard user that has only **read-only access to some Kibana dashboards and Elasticsearch indices** (that is configured in the Searchguard configuration).
> 
> > >
> 
> > > However, the Elasticsearch cluster may also contains sensitive data in other indices.
> 
> > > Ops team fears about **Internet anonymous users** forging Kibana requests, especially using inline scripts, to gain access to sensitive indices or to execute arbitrary code on the Kibana / Elasticsearch servers.
> 
> > >
> 
> > > **Question:**
> 
> > > - Is this situation safe when using the Searchguard?
> > > - Is the ops team “paranoid”?
> 
> > >
> 
> > >
> 
> > > Hereby a schema to better understand the situation:
> 
> > > ![schema.png](https://us1.discourse-cdn.com/flex019/uploads/search_guard/original/1X/ecaa2a36cf57f664a9c2a38eba030973b022775a.png)
> 
> > >
> 
> > >
> 
> > >
> 
> > > Thanks for your advices.

---

<div class="post-metadata">

**Author:** ![jkressin](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/jkressin/32/9_2.png) [@jkressin](https://forum.search-guard.com/u/jkressin)\
**Post date:** [January 16, 2019, 10:54pm UTC](https://forum.search-guard.com/t/kibana-access-to-anonymous-internet-users/1283/4 "2019-01-16T22:54:31Z")

</div>

Well … exposing anything publicly on the internet always bears risks, so do not take me to court for my advice 😉 But having said that, the main point is that Search Guard enforces access control directly on the Elasticsearch level. Regardless of whether you connect to Elasticsearch with Kibana or curl or anything else, roles and permissions are always checked directly on ES. So by using the anon auth feature, you are “just” making sure that requests without any user credentials are assigned to a default Search Guard role (and do not get rejected immediately). After that, the access control of SG is the same high level, regardless whether the user has provided credentials or has been assigned to a SG role automatically by using the anon auth feature.

Regarding your questions, yes, I would say yes, but:

1. Kibana is set to read-only mode for the define Searchguard role

This is just icing on the cake. If the SG role that is being used for anon authentication just grants RO access to public indices, then this role is not able to make any changes to any ES index whatsoever. However, in Kibana these users would still see the “Management” navigation entry on the left side for example. If they would try to make any changes, they would get a security exception, since their SG role does not allow anything else than accessing public indices. This might be confusing for the users, so my suggestion was to use the read-only mode to limit the accessible Kibana areas to Dashboard only.

So from a security point of view 1) and 3) are sufficient, and 2) just contributes to the user experience.

Just as a side note, the article you quoted is from January 2017, where there have been a lot of ransomware attacks against unprotected ES clusters exposed on the internet. I guess that’s where the statements come from. You should of course never expose any ES/KI instance on the public internet **without** applying any sort of access control.

> **···**
>
> On Wednesday, January 16, 2019 at 2:29:45 PM UTC+1, S. wrote:
> 
> > Thanks Jochen for all these details.  
> > I understand the anonymous usage in an **INTRANET** network because you can be relatively confident with your users.  
> > However, I was guessing about the couple “ **anonymous** users + **INTERNET** access”, especially after reading this [article](https://www.google.com/url?q=https%3A%2F%2Fwww.elastic.co%2Fblog%2Fguarding-kibana-from-data-hijacking&sa=D&sntz=1&usg=AFQjCNGlPeY7ZF2g3_fpHOlZYksDUbqWvg) because they say:
> > 
> > - “Your first line of defense is to not expose Kibana directly to the internet.”
> > - “The next step is to restrict access to known users.”  
> > I thought that their recommendations were general and that is do not only apply for data hijacking.
> 
> > 
> 
> > So, if I correctly understand, you say that it’s safe to expose a Kibana instance on the INTERNET for ANONYMOUS users if:
> > 
> > 1. Kibana and Elasticsearch are protected with Searchguard
> > 2. Kibana is set to read-only mode for the define Searchguard role
> > 3. This Searchguard role has only read-only access to public Elasticsearch indices  
> > Is it correct?
> 
> > 
> 
> > Le mercredi 16 janvier 2019 12:37:47 UTC+1, Jochen Kressin a écrit :
> > 
> > > Hi,
> 
> > > I think the best way to implement this scenario is to just use the anonymous auth feature of Search Guard and the Kibana plugin. IMHO there is no need to involve a proxy, if I understood your requirements correctly.
> 
> > >
> 
> > > Search Guard supports anon authentication:
> 
> > >
> 
> > > [https://docs.search-guard.com/latest/anonymous-authentication](https://docs.search-guard.com/latest/anonymous-authentication)
> 
> > >
> 
> > > If a request does not carry any credentials, we assign it to a default anonymous user and backend role. You can then map this user / backend role to an SG role which has read access to your public indices only. The Kibana plugin supports anon auth as well:
> 
> > >
> 
> > > [https://docs.search-guard.com/latest/kibana-authentication-anonymous](https://docs.search-guard.com/latest/kibana-authentication-anonymous)
> 
> > >
> 
> > > Which means you can access Kibana without logging in. The requests are forwarded to ES/SG and get assigned to the anonymous user as outlined above. Regular users can hit the “login” button to perform a regular login.
> 
> > >
> 
> > > You can also combine the anonymous authentication with the Kibana read-only mode:
> 
> > >
> 
> > > [https://docs.search-guard.com/latest/kibana-read-only](https://docs.search-guard.com/latest/kibana-read-only)
> 
> > >
> 
> > > If you assign the read-only mode to the anonymous role then the anonymous users will only see the “Dashboards” application.
> 
> > >
> 
> > > Let me know if this helps!
> > > 
> > > On Tuesday, January 15, 2019 at 3:34:28 PM UTC+1, S. wrote:
> > > 
> > > > Hi Searchguard team,
> 
> > > >
> 
> > > > We have a lively internal discussion between dev/ops teams and we would like to have Searchguard team opinion. We currently use Elasticsearch 6.x.
> 
> > > >
> 
> > > > Some developers want to **expose Kibana dashboards to anonymous users on the Internet**. These dashboards only access to some indices with public data.
> 
> > > > They want to use a proxy webapp to perform the Searchguard authentification in order to use a Searchguard user that has only **read-only access to some Kibana dashboards and Elasticsearch indices** (that is configured in the Searchguard configuration).
> 
> > > >
> 
> > > > However, the Elasticsearch cluster may also contains sensitive data in other indices.
> 
> > > > Ops team fears about **Internet anonymous users** forging Kibana requests, especially using inline scripts, to gain access to sensitive indices or to execute arbitrary code on the Kibana / Elasticsearch servers.
> 
> > > >
> 
> > > > **Question:**
> 
> > > > - Is this situation safe when using the Searchguard?
> > > > - Is the ops team “paranoid”?
> 
> > > >
> 
> > > >
> 
> > > > Hereby a schema to better understand the situation:
> 
> > > > ![schema.png](https://us1.discourse-cdn.com/flex019/uploads/search_guard/original/1X/ecaa2a36cf57f664a9c2a38eba030973b022775a.png)
> 
> > > >
> 
> > > >
> 
> > > >
> 
> > > > Thanks for your advices.
