# How to protect Kibana 4 dashboards using apache httpd?

**URL:** https://discuss.elastic.co/t/how-to-protect-kibana-4-dashboards-using-apache-httpd/28396
**Category:** Kibana
**Created:** [August 31, 2015, 10:52pm UTC](https://discuss.elastic.co/t/how-to-protect-kibana-4-dashboards-using-apache-httpd/28396 "2015-08-31T22:52:39Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![gustavomr](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@gustavomr](https://discuss.elastic.co/u/gustavomr)
#### Post date: [August 31, 2015, 10:52pm UTC](https://discuss.elastic.co/t/how-to-protect-kibana-4-dashboards-using-apache-httpd/28396/1 "2015-08-31T22:52:39Z")

</div>

Hi, we're trying to protect some dashboards using apache httpd but we don't have any URL that identify the dashboard as an unique resource.

Using Chrome dev tools we could see that when a dashboard is requested the url contains: /elasticsearch/.kibana/dashboard, but the dashboard requested is a json parameter submitted to elasticsearch. So, we need to identify the url as unique to protect it on apache httpd.

I tried to use thie article: [http://wiki.linuxwall.info/doku.php/en:ressources:astuces:kibana4\_nginx](http://wiki.linuxwall.info/doku.php/en:ressources:astuces:kibana4_nginx) and rewrite the same rules on apache httpd but without success.

Any ideas how to do this? By the way, we cannot use Shield.

---

<div class="post-metadata">

### Author: ![tinle](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@tinle](https://discuss.elastic.co/u/tinle)
#### Post date: [September 1, 2015, 5:25pm UTC](https://discuss.elastic.co/t/how-to-protect-kibana-4-dashboards-using-apache-httpd/28396/2 "2015-09-01T17:25:07Z")

</div>

You will need to setup ... protection. I use nginx to do similar.

---

<div class="post-metadata">

### Author: ![gustavomr](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@gustavomr](https://discuss.elastic.co/u/gustavomr)
#### Post date: [September 1, 2015, 5:33pm UTC](https://discuss.elastic.co/t/how-to-protect-kibana-4-dashboards-using-apache-httpd/28396/3 "2015-09-01T17:33:20Z")

</div>

Could you provide more details on how you do this?  
Why cant I use apache httpd?

---

<div class="post-metadata">

### Author: ![tinle](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@tinle](https://discuss.elastic.co/u/tinle)
#### Post date: [September 2, 2015, 12:00am UTC](https://discuss.elastic.co/t/how-to-protect-kibana-4-dashboards-using-apache-httpd/28396/4 "2015-09-02T00:00:06Z")

</div>

You can use Apache. Personally I prefer nginx as it is smaller, lighter weight, and more secure.

Essentially, you are going to be using a web server (whether Apache or nginx) as a proxy. You can control what you allow through the proxy.

My nginx configs are a little bit complicated at the moment and contain corporate settings. So I'll need to clean it up before I can release it.

The basic thing is to protect URL that points to your dashboard.

In nginx, use the location directive:

> location ~ ^/(kibana(-int)?|kibana-int-.\*?)/(?:dashboard|temp)/dashboard-you-want-to-protect {  
> auth\_ldap "Authorized personnel only";  
> auth\_ldap\_server my-ldap-server;  
> }

Something like that, but more....

---

<div class="post-metadata">

### Author: ![gustavomr](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@gustavomr](https://discuss.elastic.co/u/gustavomr)
#### Post date: [September 2, 2015, 12:14am UTC](https://discuss.elastic.co/t/how-to-protect-kibana-4-dashboards-using-apache-httpd/28396/5 "2015-09-02T00:14:00Z")

</div>

Hi, but this configuration made on nginx works with kibana 4? Because, as I know this is a url schema from kibana 3.

---

<div class="post-metadata">

### Author: ![tinle](https://avatars.discourse-cdn.com/v4/letter/t/c77e96/32.png) [@tinle](https://discuss.elastic.co/u/tinle)
#### Post date: [September 2, 2015, 12:27am UTC](https://discuss.elastic.co/t/how-to-protect-kibana-4-dashboards-using-apache-httpd/28396/6 "2015-09-02T00:27:19Z")

</div>

Yes, I grabbed it from my kibana3 config section. I am running both k3 and k4 in the same nginx config.

Regardless, it is intended as an example. 🙂 The same concept work for K4.

---

<div class="post-metadata">

### Author: ![gustavomr](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@gustavomr](https://discuss.elastic.co/u/gustavomr)
#### Post date: [September 2, 2015, 12:32am UTC](https://discuss.elastic.co/t/how-to-protect-kibana-4-dashboards-using-apache-httpd/28396/7 "2015-09-02T00:32:08Z")

</div>

Thanks! I"ll try it doing similar on Apache and post the results.

---

<div class="post-metadata">

### Author: ![gustavomr](https://avatars.discourse-cdn.com/v4/letter/g/85e7bf/32.png) [@gustavomr](https://discuss.elastic.co/u/gustavomr)
#### Post date: [September 2, 2015, 11:42am UTC](https://discuss.elastic.co/t/how-to-protect-kibana-4-dashboards-using-apache-httpd/28396/8 "2015-09-02T11:42:57Z")

</div>

> [@tinle](#):
>
> location ~ ^/(kibana(-int)?|kibana-int-.\*?)/(?:dashboard|temp)/dashboard-you-want-to-protect {  
> auth\_ldap "Authorized personnel only";  
> auth\_ldap\_server my-ldap-server;  
> }

Are you sure that this configuration works on kibana 4? I tried to do this on apache and not working. I got this concept but Kibana 4 works with Rest in order to get dashboard configuration.

---

<div class="post-metadata">

### Author: ![michelbragaguimaraes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michelbragaguimaraes/32/8430_2.png) [@michelbragaguimaraes](https://discuss.elastic.co/u/michelbragaguimaraes)
#### Post date: [March 11, 2016, 1:52pm UTC](https://discuss.elastic.co/t/how-to-protect-kibana-4-dashboards-using-apache-httpd/28396/9 "2016-03-11T13:52:48Z")

</div>

I have used this same article in order to block the settings session of my kibana.

I used this article to configure my nginx, and when I click on menu settings, it asks for the password, but if I cancel the login popup without actually login, I can still change anything I want on this session.

Can someone help me? I didn't find nothing to guide me through this.

Thx anyway!!

---

<div class="post-metadata">

### Author: ![dfaropennetwork](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@dfaropennetwork](https://discuss.elastic.co/u/dfaropennetwork)
#### Post date: [March 19, 2016, 1:36am UTC](https://discuss.elastic.co/t/how-to-protect-kibana-4-dashboards-using-apache-httpd/28396/10 "2016-03-19T01:36:32Z")

</div>

i can help you with apache 😃

---

<div class="post-metadata">

### Author: ![michelbragaguimaraes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michelbragaguimaraes/32/8430_2.png) [@michelbragaguimaraes](https://discuss.elastic.co/u/michelbragaguimaraes)
#### Post date: [March 23, 2016, 6:35pm UTC](https://discuss.elastic.co/t/how-to-protect-kibana-4-dashboards-using-apache-httpd/28396/11 "2016-03-23T18:35:33Z")

</div>

Hey man...  
Bout the apache, how would it be.

Can you teach me?

Already appreciate any kind of help

---

<div class="post-metadata">

### Author: ![dfr0](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dfr0/32/6433_2.png) [@dfr0](https://discuss.elastic.co/u/dfr0)
#### Post date: [March 24, 2016, 12:35am UTC](https://discuss.elastic.co/t/how-to-protect-kibana-4-dashboards-using-apache-httpd/28396/12 "2016-03-24T00:35:11Z")

</div>

> [@michelbragaguimaraes](#):
>
> Hey man...Bout the apache, how would it be.
> 
> Can you teach me?
> 
> Already appreciate any kind of help

Sure not problem, i can try to help you

I've two users :D, same person

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 1:58pm UTC](https://discuss.elastic.co/t/how-to-protect-kibana-4-dashboards-using-apache-httpd/28396/13 "2017-07-06T13:58:01Z")

</div>


