Skip to content

Support chained IndexReader wrappers for extensible custom features like Field Masking #130982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: 7.17
Choose a base branch
from

Conversation

ttfcfc
Copy link

@ttfcfc ttfcfc commented Jul 10, 2025

This pull request introduces a flexible mechanism to chain multiple IndexReader wrappers inside Elasticsearch's security plugin. This allows custom extensions—such as field-level data masking (field desensitization)—to be implemented cleanly at the Lucene layer.

Elasticsearch natively supports FLS and DLS by wrapping Lucene DirectoryReader instances to filter unauthorized fields and documents per user roles. However, existing implementations have limited extensibility for other security-related features like field masking.

  • Adds a method to chain multiple CheckedFunction<DirectoryReader, DirectoryReader, IOException> wrappers that can be applied sequentially to the index reader.

  • Integrates this chaining mechanism into the security plugin’s index reader wrapping flow.

  • Provides a public API for SecurityExtension implementations to contribute custom reader wrappers, allowing third-party plugins to implement additional security or masking logic at the Lucene layer.

  • Ensures compatibility with existing DLS and FLS implementations.

Copy link

cla-checker-service bot commented Jul 10, 2025

💚 CLA has been signed

@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v7.17.30 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Jul 10, 2025
@ttfcfc ttfcfc changed the title Support chained IndexReader wrappers for extensible Field-Level Secur…lll、 Support chained IndexReader wrappers for extensible Field-Level Security, Document-Level Security, and custom features like Field Masking Jul 10, 2025
@ttfcfc ttfcfc closed this Jul 10, 2025
@ttfcfc ttfcfc deleted the 7.17 branch July 10, 2025 06:16
@ttfcfc ttfcfc restored the 7.17 branch July 10, 2025 06:17
@ttfcfc ttfcfc reopened this Jul 10, 2025
…ity, Document-Level Security, and custom features like Field Masking
ttfcfc pushed a commit to ttfcfc/elasticsearch that referenced this pull request Jul 10, 2025
@ttfcfc ttfcfc changed the title Support chained IndexReader wrappers for extensible Field-Level Security, Document-Level Security, and custom features like Field Masking Support chained IndexReader wrappers for extensible custom features like Field Masking Jul 10, 2025
@PeteGillinElastic PeteGillinElastic added :Security/Security Security issues without another label and removed needs:triage Requires assignment of a team area label labels Jul 11, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

@elasticsearchmachine elasticsearchmachine added the Team:Security Meta label for security team label Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external-contributor Pull request authored by a developer outside the Elasticsearch team :Security/Security Security issues without another label Team:Security Meta label for security team v7.17.30
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants