How to Configure Opensearch Proxy

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up an opensearch proxy by placing a web server in front of your cluster. This server checks user identity headers and forwards valid search requests to your data nodes. Most teams start by setting up a reverse web server on a cloud host. They map internal team groups to cluster roles so engineers can query logs. When teams grant broad roles to speed up work, any user can delete indices. Overly wide permissions also expose raw customer fields in search responses. How a native opensearch

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 proxy by placing a web server in front of your cluster. This server checks user identity headers and forwards valid search requests to your data nodes. Most teams start by setting up a reverse web server on a cloud host. They map internal team groups to cluster roles so engineers can query logs. When teams grant broad roles to speed up work, any user can delete indices. Overly wide permissions also expose raw customer fields in search responses.

How a native opensearch proxy setup works

OpenSearch includes a built-in security plugin that supports proxy auth out of the box. In this setup, an upstream web server handles the initial user login check. Once a user logs in, the upstream server adds specific HTTP headers to the request. One header carries the user name, and another header carries a list of roles. The cluster checks the source IP address of the upstream server against a trusted list. If the IP address matches a trusted node, the cluster reads the role headers. It then maps those external roles to internal cluster permissions for indices and actions.

To make this work safely, you must block direct network traffic to the data nodes. Only the upstream server should have network routes to reach the cluster HTTP port. If a user bypasses the upstream server, they could send fake role headers directly. Teams use firewall rules and private subnets to lock down this network path. They also enable TLS encryption between the upstream server and the cluster nodes. This keeps user names and search queries safe as they cross the network.

What native proxy auth solves and where it falls short

A native proxy setup solves the problem of managing separate passwords inside the cluster. Your team can log in with their main work accounts through a single portal. You do not need to create or delete local user accounts when people join. The cluster trusts the upstream server to verify who the person is.

Still, this native approach only decides who can enter the cluster at login time. Once a user has an active session, the upstream server passes every request straight through. It does not inspect the body of individual search queries or bulk write requests. An engineer with read access to an index can pull thousands of customer records. If those logs contain emails, phone numbers, or card numbers, the user gets raw values. Also, native cluster roles can be tough to write and test for temporary debug tasks. Engineers often ask for admin roles just to check one broken index during an outage. Those wide roles often stay active long after the team fixes the bug.

Database Proxy (ProxySQL, PgBouncer) + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Managing index permissions and sensitive data in flight

To reduce risk, teams separate daily read tasks from high-risk cluster changes. Most engineers only need to run search queries on recent app logs. They do not need permission to change cluster settings or delete old data snapshots. You should create narrow roles that only allow read operations on specific index patterns.

Even with read-only roles, app logs often hold private user details by mistake. A payment service might write a full credit card number into an error log. Native field masking inside the cluster requires strict mapping rules on every single index. When teams add new log fields every day, static index mappings fall behind quickly. Inspecting search results as they leave the cluster helps catch and rewrite matched fields. Masking rewrites emails, phone numbers, and national IDs in results before the user reads them.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Why do teams put an opensearch proxy in front of a cluster?

Teams use it to check user identities before requests reach the data nodes. It lets staff log in with existing work accounts and keeps the cluster off public networks.

How does the cluster trust headers from the upstream server?

You configure the cluster security settings with the exact IP address of the upstream server. The cluster only accepts user and role headers that arrive from those trusted IP addresses.

Can native proxy auth stop a user from running a bad delete command?

No, the upstream server only passes identity headers and does not check command bodies. If the mapped role allows deletes, the cluster will run the delete request.

The query runs. The emails stay hidden.