How to Configure Opensearch Audit Log
You set up an opensearch audit log by turning on the built-in security plugin. Then you choose which REST and transport layer events the cluster will record. Most teams start by logging failed logins and broad role changes across nodes. Still, overly broad roles still let users run wide searches without pre-execution checks. How the opensearch audit log works The native security plugin watches traffic across two main paths inside your cluster. The REST layer handles incoming HTTP calls from u
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.
You set up an opensearch audit log by turning on the built-in security plugin. Then you choose which REST and transport layer events the cluster will record. Most teams start by logging failed logins and broad role changes across nodes. Still, overly broad roles still let users run wide searches without pre-execution checks.
How the opensearch audit log works
The native security plugin watches traffic across two main paths inside your cluster. The REST layer handles incoming HTTP calls from users and external apps. The transport layer handles internal talk between nodes inside the search cluster. When a request hits either layer, the plugin checks the event rules.
Admins pick specific categories to record, such as bad logins or missing permissions. You can also log granted permissions, index changes, and direct query bodies. Recording every granted action creates huge log volume on busy search clusters. Teams usually turn off read tracking on system indices to save disk space.
Next, you must decide where the cluster sends these recorded security events. Many teams store the records in a local index on the same cluster. Better setups send the records to an external storage destination or webhook. Separate storage keeps the audit trail safe if the main cluster goes down.
Storage choices and performance tuning
Storing audit records takes planning so your search speed stays fast. Writing a log entry for every single search query slows down your nodes. High traffic apps can fill up local disks with audit indices in hours. Teams must set up index lifecycle rules to delete or move old records.
You should also mute noisy service accounts that check cluster health every second. Health checks and monitoring tools create millions of useless log lines each day. By ignoring trusted internal accounts, you keep the log clean for real audits. You can also turn on field rules to hide sensitive text in logs.
Audit Log Integrity + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native logging solves and what it misses
Native audit logging is great for checking past events after an alert fires. It tells your security team who logged in and which index they read. It also shows when someone tries to guess passwords or change security settings. This record helps teams pass audits and investigate incidents after the fact.
Still, native logging only records actions after the cluster processes the request. It decides who logs in, not what individual queries do in flight. If an engineer has read rights, their query returns raw data right away. Native logs do not rewrite emails, phone numbers, or card numbers in results.
Broad roles also leave your cluster open to heavy or destructive requests. A user with write access can delete an entire index without a peer check. The audit log will show who ran the delete command after data vanishes. Teams need active controls before requests run, not just a passive paper trail.
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 inline in the protocol beside the service as an open-source proxy, a sidecar for your database or API. On every production query an agent or human runs, hoop.dev decides whether to pass, mask, block, or escalate it for review.
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 approval, and hoop.dev data masking rewrites sensitive fields in responses in memory. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Does turning on the opensearch audit log slow down search queries?
It can slow down queries if you log every single granted read event. Most teams only log failed logins and admin writes to keep clusters fast.
Where should teams store their search cluster audit records?
You should send audit records to an isolated cluster or external log storage. This stops attackers or disk errors on the main cluster from erasing evidence.
Can native audit logs hide sensitive user data in query results?
No, audit logs only record that a user ran a query against an index. To rewrite emails or national IDs in results, you need active data masking.
Related guides
In this post