The Simplest Way to Make Compass and Elasticsearch Work Like They Should
Teams use compass and elasticsearch together to track service health alongside live log data. Compass maps who owns each app, while Elasticsearch stores and searches the logs. This pairing helps on-call engineers find the right service owner and check recent errors fast. When an alert fires, the team sees service links and log trends in one place. Good role rules keep this link safe and clear for every user. How data and permissions flow between compass and elasticsearch Compass acts as a ce
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.
Teams use compass and elasticsearch together to track service health alongside live log data. Compass maps who owns each app, while Elasticsearch stores and searches the logs.
This pairing helps on-call engineers find the right service owner and check recent errors fast. When an alert fires, the team sees service links and log trends in one place. Good role rules keep this link safe and clear for every user.
How data and permissions flow between compass and elasticsearch
Compass acts as a central catalog for all your software services and teams. Elasticsearch holds the raw log events, metrics, and search indexes from those running apps. To link them, a sync job or webhook sends status updates between the two tools.
First, an engineer or sync worker must log in to both systems with valid keys. Elasticsearch checks the key to see which indexes the caller can read or write. Compass checks its own token to make sure the caller can update service cards.
Data flows best when you map each service in Compass to a specific index pattern. When a build fails or error rates climb, a worker reads the count from Elasticsearch. That worker then sends a short score or event note back to the Compass catalog. Engineers see the health score in Compass without needing full admin keys to the cluster.
Common failure modes and how to scope roles
Many teams take shortcuts when they first wire these two tools together. They create one master API key in Elasticsearch and paste it into a shared script. Soon, every app and developer uses that same shared account to run searches.
This setup creates big blind spots for your security team. When a slow query brings down the cluster, the logs only show the shared account. You cannot tell which person or job ran the bad search.
Elasticsearch Security + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Broad keys also risk leaking private customer data stored inside raw log lines. Logs often hold emails, phone numbers, card numbers, or national IDs from failed web requests. If a sync key can read every index, any compromised script can pull those records. Field masking rewrites matched fields in results so raw values do not spill into catalogs.
To fix this, give each sync worker a small, scoped role in Elasticsearch. That role should only read the specific index names needed for service health checks. Block write and delete actions on all log indexes for catalog sync accounts.
Next, lock down the network path between your sync workers and the search cluster. Only allow traffic from known worker addresses over encrypted links. Rotate API keys on a set schedule and remove unused accounts right away.
Keeping ad-hoc log checks safe during incidents
Service cards in Compass give a quick summary, but incidents require deeper checks. Engineers often leave the catalog and query Elasticsearch directly to read full stack traces. If developers share static cluster passwords for these checks, audit trails break down again.
Map each engineer to their own identity before they run any direct search queries. Limit their read scope to the indexes owned by their specific team in Compass. Log every search query along with the user identity and the time it ran. This habit keeps incident response fast while meeting strict audit rules.
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
What data should go from Elasticsearch into Compass?
Send only high-level health scores, error counts, and alert states to the service catalog. Keep raw log lines and full stack traces inside the search cluster.
How do we stop sync scripts from reading too much data?
Create a dedicated role in Elasticsearch that only reads specific service metrics indexes. Never give catalog sync workers cluster admin rights or broad wildcard permissions.
How can we protect private data inside search results?
Use data masking to rewrite emails, phone numbers, and card numbers in query results. This keeps sensitive fields safe when engineers inspect logs during an outage.
Related guides
In this post