How to Configure Opensearch Read Only User
You set up an opensearch read only user by mapping an account to a read role. This role grants view rights on your target data indices and blocks all write commands. Many teams start by sharing one broad admin login across their whole staff. When roles stay too wide, one bad command can wipe out live data indices. A strict read role stops accidental edits and drops right away. How to set up an opensearch read only user The native security plugin uses three main parts to control data access. T
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 read only user by mapping an account to a read role. This role grants view rights on your target data indices and blocks all write commands. Many teams start by sharing one broad admin login across their whole staff. When roles stay too wide, one bad command can wipe out live data indices. A strict read role stops accidental edits and drops right away.
How to set up an opensearch read only user
The native security plugin uses three main parts to control data access. These parts are users, roles, and role mappings. First, you create a new user account inside the internal user store. You can also link an external identity group from your company login tool.
Next, you pick or build a role that holds read permissions only. The search engine ships with built-in roles for common read tasks. You can also build a custom role for specific index patterns. In a custom role, you grant cluster monitor permissions and index read permissions. You leave out all write, delete, and index management actions.
Then, you create a role mapping to tie the user to that role. When the engineer logs in, the security plugin checks the role mapping first. It matches the user identity and loads the read permissions for that session. You must also add a dashboard role if the person uses the visual interface. Without that dashboard role, the login will fail on the home screen. You can also add document rules or field rules to the role. These rules hide whole records or drop specific columns from the search response.
Why static read roles leave security gaps
Native read roles solve a big problem for engineering teams. They stop staff from deleting indices, changing cluster settings, or editing live records. This setup works well for basic compliance and daily log viewing. Still, native roles only check who logs into the cluster at the start. They do not inspect what individual queries do while in flight.
A read role still lets a user pull millions of records at once. Logs and search indices often hold sensitive customer data inside free-text fields. You might store emails, phone numbers, card numbers, or national IDs in those logs. Built-in field rules only hide whole JSON keys that you name in advance. They cannot find or mask a card number hidden inside an error message string.
Read-Only Root Filesystem + User Provisioning (SCIM): architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Static roles also rely on long-lived passwords or shared role mappings. Teams often forget to remove these accounts after a support ticket closes. A heavy search query from a read account can also slow down the cluster. The native role system cannot pause a risky query for a quick manager check.
Managing query risk and sensitive log data
To close these gaps, teams must look past static cluster accounts. Good access control checks every single search request before it hits the data nodes. You need a way to scan the text results that come back. Data masking rewrites matched fields like emails and phone numbers in results. This step happens in real time, even inside messy log lines.
Teams also benefit when they remove static passwords from user laptops. Short access windows work much better than permanent read accounts. When an engineer needs to debug an issue, they request access for an hour. Every search query they run links back to their real work identity. This gives your security team a clear audit trail for every data view.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev sits inline in the protocol beside each supported service as an open-source proxy, a sidecar for your database or API. For every query or command an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human approval.
First, hoop.dev guardrails block banned queries before they run or hold risky ones for review, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Can an opensearch read only user still build dashboard charts?
Main dashboard objects like saved charts live inside a special system index. A strict read role blocks users from saving new charts to that index. You can grant write rights on a single tenant space so they can save views.
How do I limit a read user to one specific log index?
You create a custom role and set the index pattern to match that log name. Then you assign read actions only to that pattern. The user will not see any other indices in the cluster.
Do native field rules mask sensitive text inside log messages?
No, native field rules only block or hash whole field keys by name. They do not scan inside free-text log strings for emails or card numbers. You need pattern-based data masking to rewrite sensitive text inside a single field.
Related guides
In this post