PortGate

Resources · Port reference · port 5601

Port 5601 (Kibana): what it is and how to secure it

Kibana on port 5601 is the window into everything in Elasticsearch. Bind it to localhost and put authentication and HTTPS in front.

Check command

sudo ss -tlnp | grep ':5601 '

Copied.

Port 5601 is Kibana, the web interface for Elasticsearch. It shows, searches and often edits whatever Elasticsearch holds: logs, user data, security events. Kibana listens on localhost by default; if yours answers publicly, someone changed server.host.

What port 5601 is for

Kibana is the dashboard of the Elastic (ELK) stack. Logs from Filebeat or Logstash land in Elasticsearch, and people browse them in Kibana.

Why an open 5601 is dangerous

  • Data exposure. Logs routinely contain email addresses, IPs, tokens and sometimes passwords. Many public data leaks have come from open Elasticsearch and Kibana.
  • No login on older setups. Before Elasticsearch 8, security was off by default, so Kibana had no login unless someone set it up.
  • Kibana bugs. Kibana has had remote code execution flaws in the past. Public and unpatched is the risky combination.

Check yours

sudo ss -tlnp | grep ':5601 '
grep -E '^\s*server.host' /etc/kibana/kibana.yml

0.0.0.0:5601 or server.host: "0.0.0.0" means public.

Fix it

Bind Kibana to loopback in /etc/kibana/kibana.yml:

server.host: "127.0.0.1"
sudo systemctl restart kibana

In Docker, publish 127.0.0.1:5601:5601.

Make sure Elasticsearch security is on (xpack.security.enabled: true; it is the default from version 8), so Kibana asks for a login. Then either reach it through an SSH tunnel:

ssh -L 5601:127.0.0.1:5601 you@your-server

or serve it through nginx with HTTPS and an extra layer such as an IP allow list or SSO. Also check port 9200: an open Elasticsearch exposes the same data without Kibana.

Common mistakes

  • Locking down 5601 but leaving 9200 open.
  • Using the elastic superuser for daily Kibana logins. Create named users with only the roles they need.
  • Shipping secrets into logs. Even with Kibana locked down, tokens and passwords in log lines are readable by everyone with Kibana access. Filter them out in Filebeat or Logstash before they are stored.

If it was already public

Check Kibana's and Elasticsearch's audit and access logs for logins and queries you do not recognise, look for indices you did not create (attackers sometimes leave a ransom note index after deleting data), and rotate any credentials that appear in the stored logs.

FAQ

Is Kibana safe behind a password? Safer. It should still not face the whole internet; put it behind a VPN, tunnel or IP allow list.

How do I get warned? PortGate's Server Guard alerts when 5601, or any new port, starts answering on a public address.