Separate authentication backends from authorization, map external identities safely, use OpenSearch Dashboards tenants without confusing saved-object isolation with data authorization, and constrain impersonation to explicit troubleshooting cases.

Authentication Backends, LDAP/OIDC/SAML-Like Integrations, Dashboards Multi-Tenancy, and Impersonation Concepts

Build least-privilege OpenSearch security with observable identity, authorization, fine-grained read controls, credential lifecycle, and explicit Elasticsearch comparison boundaries.

Intermediate → Advanced120–160 minutesOpenSearch Security · Chapter 20 · Lesson 03OpenSearch 3.8.0 · OpenSearch Dashboards 3.8.0 · Elastic comparison: 9.5.3Last reviewed: September 2026

Learning outcomes

AtlasMart’s production identities live in a corporate identity provider, while local lab users live in the Security plugin’s internal database. Copying local users into production would duplicate password lifecycle and offboarding. This lesson separates the authentication backend that proves identity from role mappings that authorize it, then explains where LDAP, OIDC, SAML, tenants and impersonation fit.

01

Model the Security plugin authentication flow from credential extraction through backend verification, backend-role collection and role mapping.

02

Choose internal, LDAP/AD, JWT/OIDC, SAML or client-certificate patterns by client type instead of by feature name.

03

Explain why SAML is primarily a browser/Dashboards SSO mechanism rather than a general REST-client credential.

04

Use Dashboards tenants for saved-object separation while keeping index authorization independent.

05

Constrain impersonation to explicit principals, targets and audit/test workflows.

Chapter baseline

Examples target upstream self-managed OpenSearch 3.8.0 / OpenSearch Dashboards 3.8.0, released 4 August 2026, with the bundled Security plugin. The lab reuses the earlier single-node atlasmart-os container at https://localhost:9201 and OPENSEARCH_INITIAL_ADMIN_PASSWORD only for the disposable demo bootstrap. The upstream demo certificate is intentionally not a production PKI contract, so earlier local labs may use -k only against this isolated demo endpoint. Production must use hostname-valid certificates and normal CA verification. OpenSearch 3.8 distributions use the bundled Java runtime unless you intentionally supply a supported alternative. Elasticsearch 9.5.3 / Kibana 9.5.3 appears only for equivalent-intent comparisons; its /_security APIs, realms, Spaces and service-account model are not OpenSearch Security-plugin APIs.

Identity-provider boundary

The mandatory lab stays on the internal user database so it is free/local and deterministic. LDAP/OIDC/SAML require an identity provider and are architecture exercises unless you supply one. Never fabricate successful IdP responses.

Execution note

The generation environment does not run the AtlasMart Docker cluster. Requests below are deterministic lab instructions and response fragments are expected shapes/invariants, not fabricated captures. Record your own certificate DN/fingerprint/expiry, authinfo identity, role-resolution evidence, 200/403 behavior, tenant visibility, DLS/FLS results, API-key ID/expiry/revocation, audit events, and p95/p99 latency under authenticated load.

1. Authentication is a pipeline

The Security plugin receives credentials, passes them through configured authentication domains in order, verifies them against the selected backend, optionally collects backend roles, then maps the resulting user/backend roles to OpenSearch security roles. A successfully authenticated identity can still have zero useful permissions when mappings do not match.

Client Typical authentication choice Why
Local disposable lab HTTP Basic + internal user DB Self-contained and easy to inspect.
Corporate API/human tools LDAP/AD or token/JWT patterns Central lifecycle and groups; exact design depends on organization.
Dashboards browser SSO OIDC or SAML Redirect/session-based login fits browser workflows.
Mutual-TLS automation Client certificate authentication Strong machine identity when PKI operations are mature.

2. Chain backends deliberately

Conceptual config.yml chain
config:
  dynamic:
    authc:
      basic_internal_auth_domain:
        http_enabled: true
        transport_enabled: true
        order: 0
        http_authenticator:
          type: basic
          challenge: false
        authentication_backend:
          type: internal

      oidc_auth_domain:
        http_enabled: true
        transport_enabled: false
        order: 1
        http_authenticator:
          type: openid
          challenge: true
          config:
            subject_key: preferred_username
            roles_key: roles
            openid_connect_url: https://idp.example/.well-known/openid-configuration
        authentication_backend:
          type: noop

The first domain above keeps a controlled basic-auth path for APIs/administration while OIDC handles browser/token identities. The exact configuration must be validated against your IdP. TLS to the IdP, hostname verification and key rollover are part of the identity trust chain.

Subtle edge case

Standard role mappings do not encode the identity-provider name as a namespace. Two users with the same username from different identity providers can therefore require careful backend-role and mapping design. Do not assume “same username” uniquely identifies an organization-wide principal.

3. SAML is not a generic API token

OpenSearch’s SAML integration implements the web-browser SSO profile and is primarily used with OpenSearch Dashboards. It is not the credential format you should hand to a headless bulk loader. Keep a compatible API authentication domain—such as internal/basic for a lab, LDAP-backed Basic, JWT/client certificate, or OpenSearch API keys depending on the machine use case.

4. Dashboards multi-tenancy isolates saved objects

A tenant is a namespace for OpenSearch Dashboards saved objects. Global, private and custom tenants can separate dashboards and visualizations. They do not replace index permissions, DLS or FLS. This distinction matters during incident response: a tenant mistake may expose saved objects; an index-role mistake may expose underlying data through any client.

Create a custom tenant and grant read-only tenant access
PUT _plugins/_security/api/tenants/atlasmart_ops
{
  "description": "AtlasMart operations dashboards"
}

PUT _plugins/_security/api/roles/atlasmart_ops_viewer
{
  "cluster_permissions": ["cluster_composite_ops_ro"],
  "index_permissions": [{
    "index_patterns": ["atlasmart-products-secure-v1"],
    "allowed_actions": ["read"]
  }],
  "tenant_permissions": [{
    "tenant_patterns": ["atlasmart_ops"],
    "allowed_actions": ["kibana_all_read"]
  }]
}

The OpenSearch Dashboards server also needs its own service identity and permissions. Do not assign the built-in kibana_server role to human users.

5. Impersonation is delegated authority, not a convenience header

OpenSearch supports controlled user impersonation for REST and transport scenarios. A privileged authenticated principal can submit a request as another configured user. That is useful for support/testing, but a wildcard target list turns a troubleshooting feature into broad delegated authority.

Constrain REST impersonation in opensearch.yml
plugins.security.authcz.rest_impersonation_user:
  atlasmart_support_admin:
    - atlasmart_reader_user
    - atlasmart_analyst_user
Observe the impersonated identity
curl -k -u "$SUPPORT_USER:$SUPPORT_PASSWORD"   -H 'opendistro_security_impersonate_as: atlasmart_reader_user'   https://localhost:9201/_plugins/_security/authinfo?pretty

Audit both the authenticated actor and effective identity where the event format provides them. Never let ordinary application identities impersonate arbitrary users.

6. Wrong approach: map a broad directory group to all_access

A corporate group such as employees is convenient but usually far broader than an OpenSearch administrative role. Map narrowly governed groups such as atlasmart-search-readers to dedicated security roles. Test offboarding and group removal so access disappears when the source identity changes.

7. Production judgment

Identity availability becomes part of search availability. Define what happens when LDAP/IdP is down, how token clock skew/key rotation works, how emergency administration is performed, and which login path is intentionally non-interactive. Monitor authentication failures without logging secrets. For managed services, identity and tenancy may be integrated with provider IAM or hosted SSO and differ from upstream plugin configuration.

Check your understanding

  1. What is the difference between authentication and role mapping?
  2. Why is SAML not the default choice for a bulk loader?
  3. What does a Dashboards tenant isolate?
  4. Why restrict impersonation targets?
  5. What can happen if an identity authenticates but no mapping matches?
Review the answers

1. Authentication proves identity; role mapping assigns OpenSearch security roles to that user/backend roles.

2. OpenSearch SAML support targets browser SSO/Dashboards rather than general headless REST authentication.

3. Saved objects and Dashboards workspace content, not the underlying index authorization by itself.

4. Impersonation delegates another user’s effective identity; broad targets greatly increase blast radius.

5. Authentication succeeds, but the user has no mapped permissions and receives authorization failures.

Summary and next step

Preserve the evidence, assumptions, version boundaries, and safety checks established in this lesson. Carry them into the next lesson—or, at the end of the capstone, into the production runbook—rather than treating this lesson as an isolated recipe.

References

Keep knowledge open

Help the academy stay free and grow.

If these tutorials save you time, a small donation supports new lessons, technical review, diagrams, examples, and long-term maintenance.

ETHEthereum / ERC-20 only
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0

Send only Ethereum or ERC-20 compatible assets to this address.