Skip to content

Commit 6efdfd1

Browse files
Add field masking search limitation (#11489)
* Add field masking search limitation Signed-off-by: Fanit Kolchina <[email protected]> * Remove redundancy Signed-off-by: Fanit Kolchina <[email protected]> * Update _security/access-control/field-masking.md Signed-off-by: Nathan Bower <[email protected]> --------- Signed-off-by: Fanit Kolchina <[email protected]> Signed-off-by: Nathan Bower <[email protected]> Co-authored-by: Nathan Bower <[email protected]>
1 parent d138a91 commit 6efdfd1

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

_security/access-control/field-masking.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,24 @@ redirect_from:
1212

1313
If you don't want to remove fields from a document using [field-level security]({{site.url}}{{site.baseurl}}/security/access-control/field-level-security/), you can mask their values. Currently, field masking is only available for string-based fields and replaces the field's value with a cryptographic hash.
1414

15-
Field masking works alongside field-level security on the same per-role, per-index basis. You can allow certain roles to see sensitive fields in plain text and mask them for others. A search result with a masked field might look like the following:
15+
Field masking works alongside field-level security on the same per-role, per-index basis. You can allow certain roles to see sensitive fields in plain text and mask them for others.
16+
17+
## Important limitation: Search functionality
18+
19+
**Fields with masking applied cannot be searched.** When you apply field masking to a field, you will not be able to search for terms within that field, even if the terms are not masked by your pattern. This occurs because field masking is applied after indexing, while search operations rely on the inverted index created during the indexing process.
20+
{: .warning}
21+
22+
For example, if you have a field `message` with the value `"User [email protected] accessed the system"` and apply pattern-based masking to hide email addresses, the displayed result might show `"User ***@***.*** accessed the system"`. However, you will not be able to search for `"User"`, `"accessed"`, or `"system"` in this field, even though these terms are not masked.
23+
24+
### Workarounds
25+
26+
If you need to maintain search functionality on partially masked fields, consider these alternatives:
27+
28+
- **Use separate fields**: Split your data into separate fields—one for searchable content and another for sensitive data that needs masking.
29+
- **Index transformation**: Create a separate index with pre-applied masking transformations rather than using dynamic field masking.
30+
- **Field-level security**: Instead of masking, use [field-level security]({{site.url}}{{site.baseurl}}/security/access-control/field-level-security/) to completely hide sensitive fields from unauthorized users.
31+
32+
A search result with a masked field might appear similar to the following:
1633

1734
```json
1835
{

0 commit comments

Comments
 (0)