ReadonlyREST
Portal
develop
develop
  • README
  • For Elasticsearch
    • Audit configuration
    • External to local groups mapping
    • FIPS mode
    • FLS engine
    • indices rule - Index not found scenario
    • indices rule - ES Templates handling
  • For Kibana
    • Impersonation (Enterprise)
    • Kibana 7.8.x and older
    • ReadonlyREST API
  • For ECK
  • Universal Builds
  • Examples
    • Multi-tenancy Elastic Stack (Enterprise)
    • Multi-user Elastic Stack (PRO)
    • SAML SSO (Enterprise)
      • Keycloak
      • Microsoft Azure AD
      • Microsoft ADFS
      • Duo Security MFA
    • OpenID Connect (OIDC) (Enterprise)
      • Keycloak
    • Impersonation (Enterprise)
      • Creating Test Settings
      • Defining external services mock configurations
      • Impersonating users
    • ROR cluster with Elastic Cloud integration
      • Docker-based playground
      • Configuration details
    • Custom middleware (Enterprise)
      • Enriching the metadata
      • Reject machine-to-machine traffic using custom metadata ACL rules
      • Reordering available tenancies
      • Available rorRequest API
      • Secure Logstash
      • Secure Metricbeat
  • Contribution License Agreement
  • Commercial Licenses
  • Changelog
Powered by GitBook
On this page
  • Configuration
  • ES limitations

Was this helpful?

Edit on GitHub
  1. For Elasticsearch

FLS engine

PreviousFIPS modeNextindices rule - Index not found scenario

Last updated 10 days ago

Was this helpful?

Applicable in the context of the

FLS engine specifies how ROR handles field-level security internally. Previously FLS was based entirely on - that's why ROR needed to be installed on all nodes to make the fields rule work properly. Now the fields rule is more flexible and part of FLS responsibilities is handled solely by ES. Increasing ES usage and reducing Lucene exploitation in FLS implementation makes the rule more efficient.

Unfortunately, a few FLS functionalities still have to be handled at the Lucene level, and cannot benefit of the new ES level implementation (see supported at ES level ) Lucene is still used by fields rule when ES is not able to handle a request properly (as kind of a fallback).

Configuration

FLS engine can be configured with global, optional property fls_engine set under the readonlyrest.global_settings section.

There are two engines available:

  • es_with_lucene (default)

⚠️IMPORTANT As Lucene is part of this engine, the ReadonlyREST plugin still needs to be installed in all the cluster nodes that contain data.

Default hybrid approach - the major part of FLS is handled by ES. Corner cases are passed to Lucene. This solution handles all requests properly being more performant than the old full Lucene-based approach.

  • es

FLS is handled only by ES, without fallback to Lucene. When ES is not able to handle FLS properly, the fields rule is not matched. In the es engine, FLS is not available for some types of requests (requirements listed below). The major advantage of this approach is to not rely on Lucene, so ROR doesn't need to be installed on all nodes.

If a lack of full FLS support is unacceptable and all type of requests needs to be handled properly (rule matching, no rejection) it's advised to use a more reliable es_with_lucene engine.

ES limitations

Supported by es FLS engine requests are:

  • all Get/MGet API requests

  • Search/MSearch/AsyncSearch API requests with the following restrictions:

    • not using script fields

    • the used query is one of

      • common terms

      • match bool

      • match

      • match phrase

      • match phrase prefix

      • exists

      • fuzzy

      • prefix

      • range

      • regexp

      • term

      • wildcard

      • terms set

      • bool

      • boosting

      • constant score

      • dis max

    • the defined query doesn't use wildcards in field names

    • defined compound queries using only listed above supported queries as inner queries

    • the Search request doesn't use scroll

If the request doesn't meet above requirements (e.g. it's using query_string or script fields), the es engine will reject it.

Example configuration (ROR using es FLS engine):

readonlyrest:
 
 global_settings:
   fls_engine: "es"
 
 access_control_rules:

   - name: "user_using_fields"
     auth_key: user:pass
     fields: ["~someNotAllowedField"]

Property fls_engine can be omitted, then by default, ROR uses es_with_lucene FLS engine.

Lucene
requests
fields rule