SlideShare a Scribd company logo
© 2018 floragunn GmbH - All Rights Reserved
SEARCH GUARD
DOCUMENT AND
FIELD-LEVEL SECURITY
DOCUMENTS
© 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security
01.
WHAT IS IT?
Document-level security (DLS)
Filter out documents from Elasticsearch result sets
Based on (dynamic) DLS queries
Assignable to roles and indices
Field-level security (FLS)
Filter out fields from document
Support for blacklists and whitelists
Assignable to roles and indices
© 2018 floragunn GmbH - All Rights Reserved Search Guard – Active Directory & LDAP Authentication
LDAP AUTHENTICATION BACKEND
ldap:
http_enabled: true
transport_enabled: true
order: 0
http_authenticator:
type: basic
challenge: false
authentication_backend:
type: ldap
config:
enable_ssl: true
verify_hostnames: true
hosts:
- ldap.example.com:636
bind_dn: cn=admin,dc=example,dc=com
password: password
userbase: 'ou=people,dc=example,dc=com'
# Filter to search for users (currently in the whole subtree beneath userbase)
# {0} is substituted with the username
usersearch: '(sAMAccountName={0})'
© 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security
01.
WHAT IS IT?
Document-level security (DLS)
Filter out documents from Elasticsearch result sets
Based on (dynamic) DLS queries
Assignable to roles and indices
Field-level security (FLS)
Filter out fields from document
Support for blacklists and whitelists
Assignable to roles and indices
© 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security
02.
DLS QUERIES
Defined as standard Elasticsearch queries
All Elasticsearch query features can be used
Query can be as complex as necessary
Run “in addition” to original query
More precisely: Hides documents on Lucene level
Multiple roles and DLS queries
A user can be member of multiple roles
Thus, multiple DLS queries for the same index can apply
Queries are combined by OR
© 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security
03.EXAMPLE
Filters out all records
from the “humanresources” index
where the “Designation” field matches “CEO”
sg_human_resources:

cluster:

- CLUSTER_COMPOSITE_OPS

indices:

'humanresources':

'*':

- CRUD

_dls_: '{ "bool": { "must_not": { "match": { "Designation": "CEO" }}}}'

…
© 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security
04.
DYNAMIC DLS QUERIES
DLS queries support variable substitution
username
user attributes
User attributes
LDAP attributes
JWT claims
Internal user attributes
Example
_dls_: '{ "bool": { "must": { "match": { "owner": ${user.name} }}}}’
© 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security
05.
DYNAMIC DLS QUERIES
Example: LDAP user record
DLS query
_dls_: '{ "bool": { "must": { "match": { "department": ${attr.ldap.department} }}}}’
Translates to
_dls_: '{ "bool": { "must": { "match": { “department”:"HR"} }}}}’
Very powerful role definitions possible
dn: CN=hr_employee,CN=Users,DC=test,DC=local
cn: hr_employee
…
department: HR
© 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security
06.
FIELD LEVEL SECURITY
Example: LDAP user record
FLS filters out fields from documents in result set
Defined per role and per index
Fields can be included or excluded
Wildcard and regular expression support
© 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security
07.INCLUDING FIELDS
sg_human_resources_trainee:

cluster:

- CLUSTER_COMPOSITE_OPS_RO

indices:

'humanresources':

'*':

- CRUD

_dls_: '{ "bool": { "must_not": { "match": { "Designation": "CEO" }}}}'

_fls_:

- 'Designation'

- 'FirstName'

- 'LastName'

- 'Salary'

© 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security
08.EXCLUDING FIELDS, USING WILDCARDS
sg_human_resources_trainee:

cluster:

- CLUSTER_COMPOSITE_OPS_RO

indices:

'humanresources':

'*':

- CRUD

_dls_: '{ "bool": { "must_not": { "match": { "Designation": "CEO" }}}}'

_fls_:

- '~Designation'

- '~*Name'

- '~Salary'

© 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security
09.
FLS - MULTIPLE ROLES
Fields can be either included or excluded
Mixing leads to unpredictable results
If user is in multiple roles, make sure to use either include or exclude
Fields in multiple roles are combined by AND
© 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security
10.
FLS - PERFORMANCE CONSIDERATIONS
For best performance
avoid using wildcards
if no wildcards are used, an optimised version of FLS filter can be applied
Keep the field list short
by choosing include OR exclude
© 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security
11.
FLS - ANONYMIZIMG FIELDS
Fields can be anonymized on-the-fly
Field value is replaced by a salted hash
Applied at runtime, not ingest time
Can be applied to existing indices and data
No reindexing necessary
Support for String-based fields
Wildcard and regular expression support
© 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security
12.ANONYMIZING FIELDS
sg_human_resources_trainee:

cluster:

- CLUSTER_COMPOSITE_OPS_RO

indices:

'humanresources':

'*':

- CRUD

_dls_: '{ "bool": { "must_not": { "match": { "Designation": "CEO" }}}}'

_fls_:
- 'Designation'
- 'Salary'
- 'FirstName'
- 'LastName'
- 'Address'
_masked_fields_:
- '*Name'
- 'Address'
© 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security
13.
RESOURCES
Search Guard website
https://search-guard.com/
Documentation
https://docs.search-guard.com
Community Forum
https://groups.google.com/d/forum/search-guard
GitHub
https://github.com/floragunncom
© 2018 floragunn GmbH - All Rights Reserved
WE LOOK FORWARD
TO YOUR MESSAGE
CONTACT US:
info@search-guard.com
© 2018 floragunn GmbH - All Rights Reserved
floragunn GmbH
Tempelhofer Ufer 16
D-10963 Berlin, Germany


E-Mail: info@search-guard.com
Web: search-guard.com
Managing Directors: Claudia Kressin, Jochen Kressin

Registergericht: Amtsgericht Charlottenburg 

Registernummer: HRB 147010 B E-Mail: info@floragunn.com
Search Guard is a trademark of floragunn GmbH, registered in the U.S. and in other countries.
Elasticsearch, Kibana, Logstash, and Beats are trademarks of Elasticsearch BV, registered in the U.S. and in other countries.
floragunn GmbH is not affiliated with Elasticsearch BV.
Search Guard is an independent implementation of a security access layer for Elasticsearch.
It is completely independent from Elasticsearch own products.

More Related Content

PPTX
All Aboard the Boxcar! Going Beyond the Basics of REST
PDF
Search Guard Configuration | Security for Elasticsearch
PDF
Active Directory & LDAP | Security for Elasticsearch
PDF
Search Guard | Meetup Presentation | Security for Elasticsearch
PDF
Elasticsearch audit logging | Search Guard
PPTX
Deep Dive: Security Trimming in Fusion
PDF
Search Guard Architecure | Security for Elasticsearch
PDF
As You Seek – How Search Enables Big Data Analytics
All Aboard the Boxcar! Going Beyond the Basics of REST
Search Guard Configuration | Security for Elasticsearch
Active Directory & LDAP | Security for Elasticsearch
Search Guard | Meetup Presentation | Security for Elasticsearch
Elasticsearch audit logging | Search Guard
Deep Dive: Security Trimming in Fusion
Search Guard Architecure | Security for Elasticsearch
As You Seek – How Search Enables Big Data Analytics

Similar to Elasticsearch Document- and Field-Level Security | Search Guard (20)

PDF
Efficient content structures and queries in CRX/CQ
PPTX
Demystifying Terraform 012
PDF
CloudFormation techniques from the Dutch trenches (DVC07) - AWS re:Invent 2018
PDF
Elasticsearch JSON web token authentication | Search Guard
PDF
Not Big Data, AnyData
PDF
MarkLogic Overview and Use Cases
PDF
MarkLogic Overview and Use Cases
PPTX
Secure Collaboration: Start classifying, labeling, and protecting your (most ...
PDF
Working with Terraform on Azure
PDF
SPSNL17 - Secure Collaboration: Start classifying, labeling, and protecting y...
PPTX
test-sgsgsgs.pptx
PDF
Microsoft Azure Rights Management
PPTX
Exploring_agents_with_Amazon_Bedrock.pptx
PPTX
Big Data on Azure Tutorial
PDF
O365Con18 - Classify, Label and Protect your Data with Azure Information Prot...
PPTX
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
PDF
Demystifying Initial Access in Azure
PDF
MySQL 8.0 - Security Features
PDF
MongodB Internals
PDF
CloudWatch hidden features for debugging serverless application
Efficient content structures and queries in CRX/CQ
Demystifying Terraform 012
CloudFormation techniques from the Dutch trenches (DVC07) - AWS re:Invent 2018
Elasticsearch JSON web token authentication | Search Guard
Not Big Data, AnyData
MarkLogic Overview and Use Cases
MarkLogic Overview and Use Cases
Secure Collaboration: Start classifying, labeling, and protecting your (most ...
Working with Terraform on Azure
SPSNL17 - Secure Collaboration: Start classifying, labeling, and protecting y...
test-sgsgsgs.pptx
Microsoft Azure Rights Management
Exploring_agents_with_Amazon_Bedrock.pptx
Big Data on Azure Tutorial
O365Con18 - Classify, Label and Protect your Data with Azure Information Prot...
Evolving your Data Access with MongoDB Stitch - Drew Di Palma
Demystifying Initial Access in Azure
MySQL 8.0 - Security Features
MongodB Internals
CloudWatch hidden features for debugging serverless application
Ad

Recently uploaded (20)

PPT
Introduction Database Management System for Course Database
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PPTX
Transform Your Business with a Software ERP System
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Nekopoi APK 2025 free lastest update
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
System and Network Administration Chapter 2
PDF
top salesforce developer skills in 2025.pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
System and Network Administraation Chapter 3
PDF
medical staffing services at VALiNTRY
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Introduction Database Management System for Course Database
Operating system designcfffgfgggggggvggggggggg
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Transform Your Business with a Software ERP System
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Design an Analysis of Algorithms II-SECS-1021-03
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Nekopoi APK 2025 free lastest update
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Which alternative to Crystal Reports is best for small or large businesses.pdf
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
System and Network Administration Chapter 2
top salesforce developer skills in 2025.pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
System and Network Administraation Chapter 3
medical staffing services at VALiNTRY
Upgrade and Innovation Strategies for SAP ERP Customers
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Ad

Elasticsearch Document- and Field-Level Security | Search Guard

  • 1. © 2018 floragunn GmbH - All Rights Reserved SEARCH GUARD DOCUMENT AND FIELD-LEVEL SECURITY DOCUMENTS
  • 2. © 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security 01. WHAT IS IT? Document-level security (DLS) Filter out documents from Elasticsearch result sets Based on (dynamic) DLS queries Assignable to roles and indices Field-level security (FLS) Filter out fields from document Support for blacklists and whitelists Assignable to roles and indices
  • 3. © 2018 floragunn GmbH - All Rights Reserved Search Guard – Active Directory & LDAP Authentication LDAP AUTHENTICATION BACKEND ldap: http_enabled: true transport_enabled: true order: 0 http_authenticator: type: basic challenge: false authentication_backend: type: ldap config: enable_ssl: true verify_hostnames: true hosts: - ldap.example.com:636 bind_dn: cn=admin,dc=example,dc=com password: password userbase: 'ou=people,dc=example,dc=com' # Filter to search for users (currently in the whole subtree beneath userbase) # {0} is substituted with the username usersearch: '(sAMAccountName={0})'
  • 4. © 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security 01. WHAT IS IT? Document-level security (DLS) Filter out documents from Elasticsearch result sets Based on (dynamic) DLS queries Assignable to roles and indices Field-level security (FLS) Filter out fields from document Support for blacklists and whitelists Assignable to roles and indices
  • 5. © 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security 02. DLS QUERIES Defined as standard Elasticsearch queries All Elasticsearch query features can be used Query can be as complex as necessary Run “in addition” to original query More precisely: Hides documents on Lucene level Multiple roles and DLS queries A user can be member of multiple roles Thus, multiple DLS queries for the same index can apply Queries are combined by OR
  • 6. © 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security 03.EXAMPLE Filters out all records from the “humanresources” index where the “Designation” field matches “CEO” sg_human_resources:
 cluster:
 - CLUSTER_COMPOSITE_OPS
 indices:
 'humanresources':
 '*':
 - CRUD
 _dls_: '{ "bool": { "must_not": { "match": { "Designation": "CEO" }}}}'
 …
  • 7. © 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security 04. DYNAMIC DLS QUERIES DLS queries support variable substitution username user attributes User attributes LDAP attributes JWT claims Internal user attributes Example _dls_: '{ "bool": { "must": { "match": { "owner": ${user.name} }}}}’
  • 8. © 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security 05. DYNAMIC DLS QUERIES Example: LDAP user record DLS query _dls_: '{ "bool": { "must": { "match": { "department": ${attr.ldap.department} }}}}’ Translates to _dls_: '{ "bool": { "must": { "match": { “department”:"HR"} }}}}’ Very powerful role definitions possible dn: CN=hr_employee,CN=Users,DC=test,DC=local cn: hr_employee … department: HR
  • 9. © 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security 06. FIELD LEVEL SECURITY Example: LDAP user record FLS filters out fields from documents in result set Defined per role and per index Fields can be included or excluded Wildcard and regular expression support
  • 10. © 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security 07.INCLUDING FIELDS sg_human_resources_trainee:
 cluster:
 - CLUSTER_COMPOSITE_OPS_RO
 indices:
 'humanresources':
 '*':
 - CRUD
 _dls_: '{ "bool": { "must_not": { "match": { "Designation": "CEO" }}}}'
 _fls_:
 - 'Designation'
 - 'FirstName'
 - 'LastName'
 - 'Salary'

  • 11. © 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security 08.EXCLUDING FIELDS, USING WILDCARDS sg_human_resources_trainee:
 cluster:
 - CLUSTER_COMPOSITE_OPS_RO
 indices:
 'humanresources':
 '*':
 - CRUD
 _dls_: '{ "bool": { "must_not": { "match": { "Designation": "CEO" }}}}'
 _fls_:
 - '~Designation'
 - '~*Name'
 - '~Salary'

  • 12. © 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security 09. FLS - MULTIPLE ROLES Fields can be either included or excluded Mixing leads to unpredictable results If user is in multiple roles, make sure to use either include or exclude Fields in multiple roles are combined by AND
  • 13. © 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security 10. FLS - PERFORMANCE CONSIDERATIONS For best performance avoid using wildcards if no wildcards are used, an optimised version of FLS filter can be applied Keep the field list short by choosing include OR exclude
  • 14. © 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security 11. FLS - ANONYMIZIMG FIELDS Fields can be anonymized on-the-fly Field value is replaced by a salted hash Applied at runtime, not ingest time Can be applied to existing indices and data No reindexing necessary Support for String-based fields Wildcard and regular expression support
  • 15. © 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security 12.ANONYMIZING FIELDS sg_human_resources_trainee:
 cluster:
 - CLUSTER_COMPOSITE_OPS_RO
 indices:
 'humanresources':
 '*':
 - CRUD
 _dls_: '{ "bool": { "must_not": { "match": { "Designation": "CEO" }}}}'
 _fls_: - 'Designation' - 'Salary' - 'FirstName' - 'LastName' - 'Address' _masked_fields_: - '*Name' - 'Address'
  • 16. © 2018 floragunn GmbH - All Rights Reserved Search Guard – Document and Field-Level Security 13. RESOURCES Search Guard website https://search-guard.com/ Documentation https://docs.search-guard.com Community Forum https://groups.google.com/d/forum/search-guard GitHub https://github.com/floragunncom
  • 17. © 2018 floragunn GmbH - All Rights Reserved WE LOOK FORWARD TO YOUR MESSAGE CONTACT US: info@search-guard.com
  • 18. © 2018 floragunn GmbH - All Rights Reserved floragunn GmbH Tempelhofer Ufer 16 D-10963 Berlin, Germany 
 E-Mail: info@search-guard.com Web: search-guard.com Managing Directors: Claudia Kressin, Jochen Kressin
 Registergericht: Amtsgericht Charlottenburg 
 Registernummer: HRB 147010 B E-Mail: info@floragunn.com Search Guard is a trademark of floragunn GmbH, registered in the U.S. and in other countries. Elasticsearch, Kibana, Logstash, and Beats are trademarks of Elasticsearch BV, registered in the U.S. and in other countries. floragunn GmbH is not affiliated with Elasticsearch BV. Search Guard is an independent implementation of a security access layer for Elasticsearch. It is completely independent from Elasticsearch own products.