Skip to content

[9.4] fix(sharepoint): add compact site-group DLS mode to reduce ACL memory (#4396) - #4499

Merged
Jan-Kazlouski-elastic merged 1 commit into
9.4from
backport/9.4/pr-4396
Sep 18, 2026
Merged

Jan-Kazlouski-elastic merged 1 commit into
9.4from
backport/9.4/pr-4396

Conversation

@github-actions

Copy link
Copy Markdown

Backports the following commits to 9.4:

…#4396)

## Closes elastic/chat-program#48

Part of elastic/chat-program#47.
SharePoint Online DLS expands every site group member onto each
document's `_allow_access_control` array. Large site groups can produce
multi-megabyte ACLs per document and OOM Elasticsearch during
`_reindex`.

This PR adds `expand_site_group_members` (default `true` to preserve
existing behavior). When disabled (compact mode):

- Content documents store a compact `site_group:<site_id>:<group_id>`
token instead of every site group member
- Direct user, Entra group, and site user permissions are unchanged on
the document
- ACL sync builds a site-group membership index and enriches identity
docs so DLS term overlap still resolves access (including nested Entra
groups and EEEU guest exclusion)
- If a compact token cannot be written safely (e.g. missing `site_id`),
the connector falls back to expanding site group members and logs a
warning

Changing the setting requires a full content sync and access control
sync.

## Checklists

#### Pre-Review Checklist
- [x] this PR does NOT contain credentials of any kind, such as API keys
or username/passwords (double check `config.yml.example`)
- [x] this PR has a meaningful title
- [x] this PR links to all relevant github issues that it fixes or
partially addresses
- [x] if there is no GH issue, please create it. Each PR should have a
link to an issue
- [x] this PR has a thorough description
- [x] Covered the changes with automated tests
- [x] Tested the changes locally
- [ ] Added a label for each target release version (example: `v7.13.2`,
`v7.14.0`, `v8.0.0`)
- [ ] For bugfixes: backport safely to all minor branches still
receiving patch releases
- [ ] Considered corresponding documentation changes
- [ ] Contributed any configuration settings changes to the
configuration reference
- [x] if you added or changed Rich Configurable Fields for a Native
Connector, you made a corresponding PR in
[Kibana](https://github.com/elastic/kibana/blob/main/packages/kbn-search-connectors/types/native_connectors.ts)

#### Changes Requiring Extra Attention

- [x] Security-related changes (encryption, TLS, SSRF, etc)
- [ ] New external service dependencies added.

## Related Pull Requests

* #4392 — ServiceNow compact
role DLS (same tracking issue)
* elastic/kibana#288070 — Kibana RCF for
`expand_site_group_members`

## Release Note

SharePoint Online document-level security can store compact site-group
tokens on documents instead of expanding every site group member onto
each record, reducing memory use for large site groups. Disable **Expand
site group members** to enable compact mode. The default preserves the
previous behavior. Changing the setting requires a full content sync and
access control sync.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@Jan-Kazlouski-elastic
Jan-Kazlouski-elastic enabled auto-merge (squash) September 18, 2026 12:33
@Jan-Kazlouski-elastic
Jan-Kazlouski-elastic merged commit bf53821 into 9.4 Sep 18, 2026
2 checks passed
@Jan-Kazlouski-elastic
Jan-Kazlouski-elastic deleted the backport/9.4/pr-4396 branch September 18, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants