enabling authentication for kibana using apache web server1 min read

Prabhin Prabharkaran Administrator
DevOps Engineer

He is a Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!

follow me

enabling authentication for kibana using Apache web server

Hello Techrunnr Readers, This document deals with enabling authentication for kibana using Apache web server.

Kibana is an open source data visualization plugin for Elasticsearch. It provides visualization capabilities on top of the content indexed on an Elasticsearch cluster.
By default, kibana doesn’t support authentication for the dashboard. Here we restrict the kibana dashboard using Apache web server by setting by creating htuser.
This provides one more layer of security. This protects your analytics system from unauthorized access from hackers.

1. Install Apache web server.

sudo yum install httpd            //Centos/Redhat

apt-get install apache2          //Ubuntu/Debian

2. Create a http user and provide the password.

sudo htpasswd -c /etc/kiabana_pass admin

3. Step Proxy pass and authentication configuration

By default, Kibana dashboard works on port 5601. For user easy accessible we do process so we can access the dashboard as kiabana.techrunnr.com rather than kibana.techrunnr.com:5601

sudo vi /etc/httpd/conf/httpd.conf

Add the following lines

ProxyPreserveHost On
ProxyRequests On
ProxyPass / http://localhost:5601/
ProxyPassReverse / http://localhost:5601/

# Protecting with basic authentication
<Location />
AuthType Basic
AuthName “Restricted Content”
AuthUserFile /etc/apache2/.htpasswd
Require valid-user

4. Once you complete the above step. Restart the Apache web server service to apply the effect.

5. Now open the browser and browse Ip address or FQDN, you get a User authentication POP UP asking for Username and password.

Don’t forget to close the port 5601 in your firewall ! because if you don’t kibana will still be accessible without basic authentication on the port 5601

© 2018, Techrunnr. All rights reserved.

Questions Answered
Articles Written
Overall Points

Related posts

Leave a Reply