Recreating Elasticsearch security roles in OpenSearch Security

Migration Assistant moves your indices but not your security configuration, so users, roles, role mappings, SSO and document or field controls must be rebuilt in OpenSearch Security. This page shows what maps, what does not and how to plan the rebuild.

On this page

Recreating Elasticsearch security roles in OpenSearch Security: what the move involves

A team leaving Elasticsearch security for OpenSearch usually has roles, realms, API keys and Kibana spaces that have grown over years. The short answer is that the data can move, but the security configuration must be rebuilt. Migration Assistant does not migrate security configuration, so users, roles, role mappings, SSO settings and tenant-style workspace rules need to be designed again in OpenSearch Security. Plan this as a separate workstream from the index move, and confirm the current behavior in the OpenSearch Migration Assistant documentation before the project starts.

The effort depends on three things: how many roles exist, how complex the SSO setup is, and how many document-level or field-level controls are in use. A small cluster with a handful of roles and one identity provider is a modest rebuild. A cluster with hundreds of roles, several realms, API keys that feed services, and role filters that hide particular documents or fields takes much longer, because every filter has to be translated, tested and reviewed. Ask any partner to inventory these three counts before quoting, and ask which items they expect to recreate by hand and which they expect to script.

OpenSearch Security covers role-based access control, document-level security (DLS), field-level security (FLS), field masking, user impersonation, audit logs and TLS for node and client traffic. Elasticsearch role definitions map to these controls, but not one to one, so each role needs a review: which indices it reads, which documents it may see, which fields are hidden or masked, and whether it needs impersonation or audit visibility. Record the result in a role matrix before any configuration is written, since that matrix becomes the test plan for access checks at cutover.

Which Elasticsearch security features map to OpenSearch Security

This table compares the Elasticsearch security features your team likely uses with their OpenSearch Security counterparts. Where the documented equivalent is clear, the cell names it; where parity is not documented or depends on your version and license, the cell tells you what to confirm before you plan the rebuild.

Elasticsearch featureOpenSearch Security equivalentWhat to confirm
Users and internal accountsInternal users managed in the Security plugin configuration, with password hashing and attributesRecreate each account and its attributes; do not carry over password hashes from Elasticsearch
RolesRoles defined with cluster, index and tenant permissions in the Security pluginMap each Elasticsearch role to an OpenSearch role and confirm the action groups cover your existing privileges
Realms (native, LDAP, SAML, OIDC)Authentication and authorization backends including SAML, OpenID Connect, Active Directory, LDAP, Kerberos and JWTConfirm each Elasticsearch realm has a documented OpenSearch backend and its required settings
Role mappingsRole mappings that assign backend users or groups to OpenSearch rolesRebuild mappings from your identity provider groups; check claim and attribute names against your IdP
Document-level security (DLS)Document-level security expressed as a query on the role's index permissionsRewrite each Elasticsearch DLS query and test it with a representative user, since query syntax and field handling can differ
Field-level security (FLS)Field-level security that includes or excludes listed fields for a roleConfirm the include and exclude semantics match your Elasticsearch definitions on nested and multi-field mappings
Field maskingField masking documented in the Security plugin to hide values while keeping the fieldConfirm masking behavior matches what your applications and dashboards expect
Audit loggingAudit logs configurable in the Security plugin with categories and destinationsDecide which events you need, confirm the destination, and compare against your retention requirements
TLS for transport and HTTPTLS for node-to-node and client traffic configured in the Security pluginPlan certificate issuance, rotation and trust chains; these do not transfer from Elasticsearch
API keysNo one-to-one equivalent is documented in this comparison; confirm the current OpenSearch approach for service credentialsInventory every Elasticsearch API key and decide whether each one becomes a new credential, a role-scoped account or an application change

Documented ways to bring security configuration across

The Security plugin keeps its configuration as YAML files, and a security engineer can write the users, roles and role mappings the new cluster needs by hand. This route suits teams that keep security configuration in version control and deploy it through the same pipeline as other infrastructure.

  • Source of truth: Files such as internal_users.yml, roles.yml and roles_mapping.yml hold the definitions you translate from your Elasticsearch inventory.
  • Version control: Store the files in Git so every change to a role or mapping has a reviewer and a history.
  • Loading changes: Edited files only take effect after they are loaded into the security index with the security admin tool, so confirm the load step for your version.
  • Secrets: Password hashes and backend settings should come from your secrets process, not from plain text committed to the repository.

Check the file names, key formats and load behavior against the OpenSearch security docs for your exact version before writing any production file.

How to sequence the security rebuild alongside the data move

The sequence runs the security rebuild in parallel with the data move, so every role, mapping and SSO path is proven with test identities before any client or user is switched over. Each step closes with a check that tells the team whether the next step can start.

  1. Inventory Elasticsearch users, roles, realms and mappings

    The security owner and the platform engineer export the current Elasticsearch security configuration: native users, role definitions, realms and role mappings, plus the list of applications and service accounts that authenticate with API keys or basic credentials. Each role is recorded with its index patterns, privileges, document-level queries and field restrictions, because those are the settings most often lost in translation. The step is done when every identity and every active access path has a line in the inventory, and the owner has signed off that nothing relies on undocumented access.

  2. Design the OpenSearch role model and backends

    The team decides which identity backend will authenticate users, such as SAML, OpenID Connect, LDAP or Active Directory, and how groups from that backend map to OpenSearch Security roles. Roles are designed from business access needs rather than copied one for one from Elasticsearch, so redundant roles can be merged and gaps closed. The output is a written role matrix that lists each OpenSearch role, its permissions, its document and field restrictions, and the group it maps to. Confirm with your identity team which backend claims and group attributes are available before the matrix is final.

  3. Build roles and mappings in a test cluster

    The platform engineer creates the roles, role mappings and internal users in a test cluster using the security configuration tooling, and keeps the definitions in version control so changes are reviewed and repeatable. Document-level and field-level restrictions are built and checked against the role matrix line by line. The step is complete when the test cluster loads the configuration without errors and the role matrix and live configuration match.

  4. Validate access with test identities

    The security engineer creates a set of test identities, one for each role in the matrix plus negative cases such as a user with no role, and signs in through each intended backend. For each identity, the team tests allowed and denied index operations, the document filter on sensitive data, field masking, and the admin functions it should not reach. Failures are fixed in the role definitions and retested. Access tests must pass on the test cluster before any production SSO or client change is scheduled, and the signed test results become the evidence for the cutover decision.

  5. Run the data move and security model in parallel

    While the data migration proceeds, the old Elasticsearch cluster keeps serving users and clients, and the new OpenSearch cluster receives the security configuration and the migrated data. The team compares the two access models on the same workloads, checking that each identity sees the same results in both systems and that audit logs in OpenSearch record the activity. Differences are logged as defects and resolved before cutover. The step is done when the parallel comparison shows no unexplained access differences for the migrated indices.

  6. Cut over SSO and client credentials

    The team moves SSO applications and client credentials to OpenSearch in a planned change window, starting with the lowest-risk applications and keeping a documented rollback. Applications that use API keys or service accounts receive new credentials stored in the organization's secrets tooling, and old credentials are kept valid only until the rollback window closes. The change is verified when each application signs in through OpenSearch, the access tests from the previous step are repeated against production, and the change record names the owner who accepted the result.

  7. Decommission old Elasticsearch access

    Once every application and user has cut over and the rollback window has closed, the team disables old Elasticsearch users, revokes unused API keys and removes the old realms, then shuts down the Elasticsearch cluster according to the retention plan for its data and logs. The security owner checks that no client still authenticates against Elasticsearch by reviewing its access logs over an agreed period. The step is complete when the old access paths are removed, the configuration inventory is updated to match OpenSearch, and the decommission record is filed with the security team.

How OpenSearch role mappings connect identity providers to roles

The core decision is how identities from your provider become OpenSearch permissions. The OpenSearch Security plugin authenticates a user through one configured authentication backend, which can be SAML, OpenID Connect, LDAP or Active Directory, Kerberos or JSON Web Token. Authentication only establishes who the user is. Authorization then depends on backend roles, which are attributes such as group names or claims that the backend passes along with the user, and on role mappings that translate those backend roles into OpenSearch roles. In Elasticsearch, these were usually realm-based role mappings; in OpenSearch they live in the Security configuration and are not carried over by Migration Assistant, so each mapping must be written again against your identity provider's actual group or claim values.

Your first decision is whether groups or claims from the identity provider should map directly to backend roles, or whether a smaller set of application-specific backend roles should sit in between. Direct mapping is simpler to audit, but it exposes every group your directory holds to the search cluster, so confirm which groups actually need access before exporting them. Also confirm how the provider emits group membership: some send group names, others send group identifiers or only include groups when a specific setting is enabled. The OpenSearch security documentation covers each backend's options, and that is the right place to check claim names and attribute handling for your chosen protocol.

Index, document and field permissions attach to the OpenSearch roles, not to the identity provider. A role defines which indices and actions are allowed, and can add document-level security queries and field-level security lists, including field masking, so one index can serve several audiences. Decide these per role before you write mappings, because a mapping that grants a broad role will bypass narrower intent. Before cutover, test every mapping with a representative user from each group, confirm that denied fields and documents stay hidden, check admin and impersonation rights separately, and keep the test results with your change record. Ask your identity provider team to confirm the exact claim or attribute names in a non-production tenant first.

What drives the cost and duration of the security rebuild

This table lists the inputs that change how much work the security rebuild takes and which costs are paid once versus repeated. Use it to tell a partner or your own team what to inventory before asking for a quote. The main takeaway is that role count, SSO integrations and embedded client credentials usually matter more than the number of users.

DriverWhy it changes cost or effortHow to keep it downOne-time or recurring
Elasticsearch roles and realmsEach role, role mapping and realm must be exported, translated and tested against OpenSearch roles and role mappings. Overlapping roles multiply review work.Consolidate roles before translation and document the intended access for each one.One-time build, then recurring review
Number of SSO integrationsEach identity provider needs its own SAML, OIDC, LDAP or other backend configuration, claim mapping and login testing.Confirm which identity providers stay in scope and retire unused realms before the build.One-time build, recurring upkeep
Use of document-level and field-level securityDLS and FLS rules need query-level and field-level testing, and each restricted index adds cases that must return the right results to each role.Limit DLS and FLS to indices that truly need them and reuse common rule patterns.One-time design and testing, recurring rule review
Kibana or Dashboards tenant mappingSaved objects and tenants must map to user groups, so each team with its own dashboards adds design and verification work.Map tenants to a small number of shared groups and agree ownership rules in writing.One-time design, recurring access reviews
Audit logging requirementsRequired events, retention, log destinations and field content must be chosen and verified, and changes to the audit configuration must be controlled.Write down the events your assessor or internal policy requires before configuring anything.One-time configuration, recurring log review
Compliance evidence needsEvidence such as role design records, approval trails and test results must be collected in a form an auditor can review. Auditors and certification bodies decide what is sufficient.Agree the evidence list with your auditor before the build starts.One-time setup, recurring evidence collection
Client applications with embedded credentialsEach application that logs in with a stored Elasticsearch username or password needs a new service identity, credential rotation and a cutover window.Inventory every application and its credential source early, then group applications by owner.One-time cutover, recurring credential rotation
Size of the test matrixEach role crossed with each index pattern, tenant and identity provider is a test case. Negative tests for denied access usually take as long as positive tests.Test representative roles and high-risk indices first, then expand where results show gaps.One-time testing, recurring regression tests on upgrades

Where security rebuilds usually fail and how to prevent it

Security rebuilds rarely fail in the cluster itself. They fail in the gaps between old Elasticsearch access rules, new OpenSearch roles, the identity provider and the applications that still hold old credentials. Each risk below has a prevention step you can check before cutover.

Assuming data keeps its access rules

Migration Assistant moves indices and data, but it does not migrate security configuration. Users, roles, role mappings and tenants that protected the Elasticsearch cluster must be recreated in OpenSearch Security before any user reads migrated data. Treat the migrated index as unprotected until your access model is in place and tested. Confirm that no index is reachable through a default or admin path on the new cluster.

Migration Assistant limits

Over-broad roles copied from Elasticsearch

Teams often copy Elasticsearch roles one for one, including wildcard index patterns and cluster-level privileges that were added for convenience. In OpenSearch Security, every role should map to a named job function with explicit index permissions and action groups. Export your current role list, mark each privilege that no current user needs, and remove it before creating the new roles. Review the result with the data owners who approve access.

Mismatched group claims breaking SSO

Single sign-on depends on the identity provider sending group or role claims that match the role mappings in OpenSearch Security. The OpenSearch Security plugin supports SAML, OpenID Connect, LDAP and other backends, and each one passes groups in a different form. A renamed group or a changed claim name locks users out or, worse, grants the wrong role. Test each group with a sample user from the identity provider before go-live, and confirm that users outside the groups are denied.

OpenSearch Security docs

Missing DLS or FLS filters exposing fields

Elasticsearch document-level and field-level restrictions must be rebuilt as OpenSearch Security document-level security and field-level security rules on each role. A role that grants index access without the matching filter returns every document and every field, including personal data or secrets stored in logs. Write one test query per restricted role that confirms the expected document count and the list of returned fields. Use field masking where a value must be visible in a masked form only.

Unverified audit logging

Audit logs that were enabled on Elasticsearch are not carried over automatically, so the new cluster can run without the evidence your security team relies on. Enable the OpenSearch Security audit log, choose which categories to record, and confirm that authentication failures, permission changes and admin actions reach your log store. Run a deliberate failed login and a role change, then check that both events appear with the expected user and time before you sign off.

Clients left on old credentials

Applications, pipelines and scheduled jobs often authenticate with a shared Elasticsearch user or API key that no one tracks. When that user is not recreated, the service fails in production, and teams may respond by granting broad access to a new shared account. Inventory every client before cutover, give each one its own OpenSearch user or service account with a narrow role, and rotate the old credentials once traffic has moved.

Questions teams ask before recreating Elasticsearch security in OpenSearch

Can Elasticsearch security configuration be migrated to OpenSearch automatically?

No. Migration Assistant does not migrate security configuration, so users, roles, role mappings and authentication settings have to be recreated in the OpenSearch Security plugin. Data and indices can move with the migration, but access rules do not follow them. Plan the security rebuild as its own workstream with its own review and sign-off, and do not assume that a successful data move means access is already in place. Confirm the current behavior for your source and target versions in the OpenSearch Migration Assistant documentation before you finalize the plan.

What drives the effort of rebuilding Elasticsearch security in OpenSearch?

The effort follows the size and shape of your existing access model. The main drivers are the number of roles and users, how many distinct identity sources feed them, how many applications and service accounts authenticate, and how much access logic depends on document-level or field-level restrictions. Teams with many custom roles and few clear owners usually need more time to reconcile them. Ask any partner for a quote that breaks the work into role inventory, mapping, identity integration, DLS and FLS rules, and verification, and confirm which items are one-time and which need ongoing review.

Can our internal team rebuild the OpenSearch security configuration without outside help?

Often yes, if the team has someone who understands the OpenSearch Security plugin, your identity provider and your current Elasticsearch roles. The work is configuration rather than new software, but mistakes in role mappings or document-level rules can expose data quietly, so a second reviewer matters. Teams that lack Security plugin experience, or that must prove the result to auditors, often bring in a partner for review and testing. DeployOpen implements and tests these configurations inside your infrastructure, and the scope is agreed in writing before work starts.

What do we need to provide before the security rebuild can start?

Start with a complete inventory of existing Elasticsearch roles, users, role mappings and the applications that use each account. Add administrative access to the identity provider so SAML or OpenID Connect settings can be checked, and confirm which claims or groups carry access decisions. Test accounts for each persona are essential, along with a list of who approves access changes. Also gather the data classification for each index, since that determines where document-level and field-level rules are needed. Ask your partner to confirm this list in writing as part of scoping.

How are document-level and field-level security rebuilt in OpenSearch?

OpenSearch Security provides document-level security (DLS) and field-level security (FLS), along with field masking, so the rules you use in Elasticsearch need to be translated into OpenSearch role definitions. Start by listing each restriction, the index pattern it applies to and the business reason for it. Then write the equivalent role for each restriction and test it with the test accounts. Field masking is useful when users need to see that a value exists without seeing its content. Confirm the exact syntax against the OpenSearch security documentation for your version, because query-based rules and field lists behave differently and should be tested.

How do we verify access before cutover to OpenSearch?

Verify access with a test matrix that lists every persona, every index pattern and every expected allow or deny result, including DLS and FLS cases. Run the matrix against the new cluster with the test accounts, record the results and retest after each change. Include negative tests, such as a user who should not see restricted fields or documents, and check that audit logs record the attempts. Review SSO login paths, admin access and service accounts separately. Agree on the pass criteria and the sign-off owner before cutover, so the decision is not made under pressure during the switch.

Which identity providers can OpenSearch Security use for SSO?

The OpenSearch Security plugin supports SAML, OpenID Connect, Active Directory and LDAP, Kerberos and JSON Web Token authentication backends. Choose the backend that matches your existing identity provider and confirm how groups or claims map to OpenSearch roles. Test single sign-on with real users from each group before cutover, and keep a documented break-glass admin path for recovery. Confirm the supported configuration for your chosen backend and version in the OpenSearch security documentation.

How identity, role mapping and data access fit together in the target cluster

The flow starts with a user signing in through an identity provider such as SAML or OpenID Connect. OpenSearch Security takes the identity, maps it through role mappings to roles, and applies index, document-level and field-level permissions before any query reaches the data nodes. The migrated indices sit on the data nodes separately from the security configuration, which is rebuilt in the target cluster. Check that every hand-off carries the expected backend roles and that no path skips the mapping step.

Identity flows through OpenSearch Security roles before reaching migrated indices on data nodes.

Official OpenSearch sources for the security rebuild

Start the rebuild with the OpenSearch Security documentation, because it defines every control you need to map from Elasticsearch. The plugin covers identity backends (SAML, OpenID Connect, Active Directory and LDAP, Kerberos and JSON Web Token authentication), role-based access control, document-level and field-level security, field masking, user impersonation, audit logs and TLS for node and client traffic. Use the documentation as a checklist. For each Elasticsearch user, role, role mapping, realm and API key in your current cluster, find the OpenSearch control that replaces it before you write any configuration. Read the pages for the exact version you will deploy, since OpenSearch ships a new minor version about every eight weeks and the security settings can change between releases. OpenSearch Security documentation

Next, read the Migration Assistant guidance on what the tool does not move. Migration Assistant does not migrate security configuration, so users, roles, role mappings and SSO settings have to be recreated on the target cluster even when the indices move cleanly. Treat this as a scoping decision, not a late surprise. Before the migration plan is approved, export an inventory of the source security objects, assign an owner to each one, and decide which ones are still needed. Old roles that nobody uses are cheaper to drop now than to recreate. Confirm with the documentation for your target version exactly which items the tool handles and which remain manual. Is Migration Assistant right for you?

Finally, test access before cutover rather than trusting the configuration on paper. Create one test user per role, with the same identity provider group membership that production users will have, and run representative searches and writes against sample data. Check that document-level security filters the right documents, that field-level security and field masking hide the right fields, and that audit logs record the denied and allowed requests you expect. Ask your security team to sign off on this evidence, and keep the results with the change record. This also gives your compliance reviewers a concrete artifact showing how the access model was verified in your own environment.

How DeployOpen scopes and delivers the security rebuild

DeployOpen treats the Elasticsearch security rebuild as a designed piece of work, not a copy of old settings. We map the users, roles and single sign-on arrangements you run today, then rebuild them in the OpenSearch Security plugin inside infrastructure you control, and test each access path before cutover.

How we scope

  • Inventory every Elasticsearch user, role, role mapping and realm before any configuration is written
  • Agree in writing which identity backend (SAML, OpenID Connect, LDAP, Kerberos or JWT) each user population will use
  • Define which document-level and field-level restrictions must be reproduced and which access paths need evidence for review
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts

How we build

  • Rebuild roles, role mappings and document-level and field-level rules in a non-production OpenSearch cluster first
  • Configure TLS for node and client traffic and set audit logging so access decisions can be reviewed later
  • Test each role against representative users, including denied actions, to confirm access matches the agreed matrix
  • Keep security configuration in version-controlled files so changes are reviewed and repeatable across environments

How we hand over

  • Deliver a role and access matrix that maps each Elasticsearch role to its OpenSearch equivalent with the reason for any difference
  • Document the identity provider settings, role mappings and admin procedures your operations team will maintain
  • Walk your security and platform engineers through the test results and the open decisions that remain for your organization
  • Provide a retest of the final configuration after cutover so the handover reflects the production state

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after the initial rebuild is complete
  • Retainers can cover role changes, new identity providers and review of access requests as your teams and systems change
  • Ask any partner to confirm how security configuration will be backed up and restored before a cutover date is set
  • Ask for the support scope, response arrangements and upgrade handling to be written into the quote

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.