How to Configure Elk Port
An elk port controls how network traffic reaches your log tools. You set it up by binding each service to a safe local address. The stack has three main parts that talk over the network. Elasticsearch stores and searches the logs you send it. Logstash takes in data from your apps and formats it. Kibana gives your team a web view to read those logs. Each tool listens on its own network port for incoming traffic. If you leave these ports open to the public internet, attackers can read your data.
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
An elk port controls how network traffic reaches your log tools. You set it up by binding each service to a safe local address.
The stack has three main parts that talk over the network. Elasticsearch stores and searches the logs you send it. Logstash takes in data from your apps and formats it. Kibana gives your team a web view to read those logs. Each tool listens on its own network port for incoming traffic. If you leave these ports open to the public internet, attackers can read your data. A safe setup locks down each port before you send any real logs.
How an elk port setup works
Every tool in the log stack needs clear network rules. By default, these tools often bind to the local loopback address. This means they only accept traffic from the same machine. When you run the tools on separate servers, you must change the bind address. You update the main settings file for each tool to use a private IP.
This change affects all apps and users that send or read logs. Log shippers on your app servers need a clear path to the intake port. Data nodes in a cluster need a separate port to talk to each other. Your team needs access to the web port to view dashboards. You should never bind these ports to all network interfaces on a public server.
Safe defaults start with a strict firewall on every host. Allow only known app servers to send data to your log intake port. Allow only cluster nodes to talk to the internal cluster port. Put the web dashboard behind a private network so outsiders cannot reach it. Turn on TLS encryption for every port so network traffic stays private. Require a username and password for every service and user role.
Checking your setup and closing security gaps
After you set up your network rules, you must check them from the outside. Run a port scan from a machine outside your private network. Make sure the storage and intake ports drop all external packets. Next, test the connection from an allowed app server. Confirm that logs flow in and that TLS encryption works as expected.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
You also need to turn on audit logs inside the search engine. These logs record who logs in and which ports receive requests. Review these logs often to spot strange login attempts or blocked traffic. Still, static port rules and basic passwords still leave big security gaps.
Once a user logs in through an open port, the network firewall stops helping. A valid user with a broad role can run heavy queries that crash the cluster. They can also read raw logs that hold sensitive user data. App errors often write emails, phone numbers, card numbers, or national IDs into log files. Standard port rules cannot rewrite these fields in query results. Static keys stored on developer laptops can also leak and give attackers full entry. To fix this, teams need deeper controls over live sessions and data results.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Why should I keep the search port off the public internet?
Public search ports let anyone try to guess passwords or exploit software bugs. Keeping the port on a private network stops outside attacks before they reach the service.
How do I change the network port for a log service?
Open the main settings file for the specific service on your server. Change the port setting to your chosen number and restart the service.
Can port rules hide sensitive data inside my logs?
No, network port rules only control which machines can reach the service. You need data masking rules to rewrite emails or card numbers in search results.
Related guides
In this post