Apache 2.0 Go 1.22 CI OpenSearch 220 tests 23 packages

OAuth 2.0 Proxy for OpenSearch

Secure machine-to-machine access with scoped tokens, OIDC federation, and zero breaking changes to your existing cluster.

The Gap oauth4os Fills

OpenSearch has strong auth primitives β€” but lacks the developer experience layer for machine-to-machine access.

CapabilityGrafanaDatadogElasticOpenSearch+ oauth4os
OIDC / SSOβœ…βœ…βœ…βœ…βœ…
API Keysβœ…βœ…βœ…πŸ”„ 3.7βœ…
OAuth Apps / Scoped Tokensβœ…βœ…βœ…βŒβœ…
Token Governance UIβœ…βœ…βœ…βŒβœ…
Cedar Fine-Grained PoliciesβŒβŒβŒβŒβœ…
PKCE (Browser Clients)βœ…βŒβœ…βŒβœ…
Multi-Tenancyβœ…βœ…βœ…βš οΈβœ…
SDKs (Go/Python/Java/Rust/Node)βš οΈβœ…βœ…βŒβœ…

Architecture

oauth4os sits between your clients and OpenSearch β€” validating tokens, mapping scopes, forwarding requests.

Clients πŸ€– AI Agent πŸ”§ CI/CD πŸ’¬ Slack Bot ⌨️ CLI 🌐 MCP Server Bearer token oauth4os Go Β· :8443 πŸ”‘ JWT Validation 🎯 Scope β†’ Role 🌲 Cedar Policies πŸ“‹ Audit Log πŸ“Š Metrics Mapped role OpenSearch πŸ” Engine :9200 πŸ“Š Dashboards :5601 Security plugin unchanged JWKS OIDC Provider Keycloak Β· Auth0 Β· Okta Β· Dex

Interactive Demo

Click each step to see the request and response. Copy commands with one click.

1. Start
2. Get Token
3. Query
4. Revoke
docker compose up

βœ… Expected output:

oauth4os-proxy     | listening on :8443
oauth4os-opensearch | OpenSearch Security initialized
oauth4os-keycloak  | Keycloak started in 4.2s
curl -s -X POST http://localhost:8443/oauth/token \
  -d "grant_type=client_credentials" \
  -d "client_id=my-agent" \
  -d "client_secret=secret" \
  -d "scope=read:logs-*"

βœ… Response:

{
  "access_token": "eyJhbGciOiJSUzI1NiIs...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "read:logs-*"
}
curl -s -H "Authorization: Bearer $TOKEN" \
  http://localhost:8443/logs-*/_search \
  -d '{"query":{"match":{"level":"error"}}}'

βœ… Response (proxied to OpenSearch):

{
  "hits": {
    "total": { "value": 42 },
    "hits": [
      { "_source": { "level": "error", "message": "connection timeout", "service": "payment" } }
    ]
  }
}
curl -s -X POST http://localhost:8443/oauth/revoke \
  -d "token=$TOKEN"

βœ… Response:

{ "revoked": true }

Features

πŸ”‘

JWT Validation

JWKS auto-discovery, RS256/ES256, audience validation, clock skew tolerance.

🎯

Scope β†’ Role Mapping

read:logs-* β†’ OpenSearch logs_reader. Per-provider multi-tenant mappings.

🌲

Cedar Policies

Fine-grained access control. Index-level deny rules. Try the playground β†’

⚑

Rate Limiting

Per-client token bucket. Configurable RPM per scope. 429 + Retry-After.

πŸ“‹

Token Lifecycle

Issue, refresh, revoke, introspect (RFC 7662). Rotation with reuse detection.

πŸ”„

PKCE Flow

Secure browser auth (RFC 7636). Token exchange (RFC 8693).

πŸ‘₯

Multi-Tenancy

Per-OIDC-provider isolation. Separate scope mappings and Cedar policies.

πŸ“Š

OSD Plugin

Token management UI in OpenSearch Dashboards. List, create, revoke.

πŸ€–

MCP Server

AI agent integration. 7 tools: search, aggregate, create index, mappings.

⌨️

CLI + SDKs

CLI with auto-refresh. SDKs for Go, Python, Java, Rust, Node.js.

πŸ“ˆ

Observability

Prometheus metrics, Grafana dashboard, structured JSON logging, OTel tracing.

πŸ›‘οΈ

Enterprise

mTLS, IP allowlist, session management, key rotation, backup/restore, webhooks.

Ecosystem

Tools and integrations for every workflow.

πŸ”§

GitHub Action

Get scoped tokens in CI/CD. Auto-masked in logs.

πŸ’»

VS Code Extension

Token management, query OpenSearch, inspect scopes from IDE.

🌲

Cedar Playground

Interactive policy tester with presets and evaluation trace.

πŸ“Š

Analytics Dashboard

Live token analytics β€” usage charts, top clients, scope distribution.

πŸ—οΈ

Terraform Provider

Manage clients, scopes, policies as Terraform resources.

πŸ“¦

5 SDKs

Go, Python, Java, Rust, Node.js. Token auto-refresh built in.

☸️

Helm Chart

One-command Kubernetes deployment with configurable values.

🐳

Docker Compose

Dev, demo, and monitoring stacks. Prometheus + Grafana included.

Roadmap

βœ… Shipped

Phase 1-2 β€” Core

JWT, scope mapping, Cedar, rate limiting, PKCE, introspection, OSD plugin, MCP server, CLI.

βœ… Shipped

Phase 3-5 β€” Production

Multi-tenancy, token exchange, key rotation, CI/CD, Helm, CDK, benchmarks, docs.

βœ… Shipped

Phase 6-8 β€” Enterprise

mTLS, IP filter, sessions, webhooks, SDKs (5 languages), VS Code, GitHub Action, Terraform.