Skip to content
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

Add 'DLS and multiple roles' section to DLS topic #6408

Merged

Conversation

john-eliatra
Copy link
Contributor

@john-eliatra john-eliatra commented Feb 14, 2024

Description

A request came in from a user searching for documentation on the dfm_empty_overrides_all setting that was introduced in OpenSearch previously.

Background

The exact setting is plugins.security.dfm_empty_overrides_all, and it caters for when a user with multiple roles has their search results restricted by DLS from one of those roles.

Proposed change to documentation

Added a new section to the Document-level security topic called 'DLS and multiple roles', which describes the situation and how to change it by adding the setting.

Issues Resolved

This PR resolves #6049

Checklist

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin.
    For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@hdhalter
Copy link
Contributor

Thanks, @john-eliatra !
@scrawfor99 - Can you please review this for technical accuracy? Thanks!

@hdhalter hdhalter added the 3 - Tech review PR: Tech review in progress label Feb 14, 2024
@hdhalter
Copy link
Contributor

Hi @rursprung , can you please take a look at this PR to see if it addresses your issue? Thanks!

@rursprung
Copy link
Contributor

thanks for documenting this. i think it should more explicitly mention that this also applies to roles which do not grant read access to the documents (e.g. a role granting access to search templates), see opensearch-project/security#3963 for more details.
it might also not hurt if it would give an example.

Copy link
Contributor

@stephen-crawford stephen-crawford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signing off on technical accuracy.

@leanneeliatra
Copy link
Contributor

leanneeliatra commented Feb 21, 2024

@rursprung , I have updated the documentation to give an example of the case you mentioned, could you review it please. if you're happy with the changes we should be good to merge.
Thank you.

_security/access-control/document-level-security.md Outdated Show resolved Hide resolved
_security/access-control/document-level-security.md Outdated Show resolved Hide resolved
_security/access-control/document-level-security.md Outdated Show resolved Hide resolved
_security/access-control/document-level-security.md Outdated Show resolved Hide resolved
_security/access-control/document-level-security.md Outdated Show resolved Hide resolved
@Naarcha-AWS Naarcha-AWS added 4 - Doc review PR: Doc review in progress and removed 3 - Tech review PR: Tech review in progress labels Feb 22, 2024
@Naarcha-AWS
Copy link
Collaborator

@leanneeliatra: Added some formatting and wording changes.

@leanneeliatra
Copy link
Contributor

@leanneeliatra: Added some formatting and wording changes.

Yes thank you for those improvements, they have been integrated.

@rursprung
Copy link
Contributor

thanks for the example!

tbh, i kind-of think that two examples would be helpful:

  • the case for why you would want to have this setting enabled: namely you have two roles granting read access, one with DLS and one without, where the former is e.g. granted to a whole group of users while the latter is granted only to specific users (e.g. an admin user) where you somehow can't filter out the admin user from the group receiving the first (restricted) role, thus requiring the latter to be able to override the former
  • the case you've now documented which is generally an unintentional consequence of having enabled the setting (which you enabled because you had the first case)

then you can clearly explain:

  • why/when you'd want to enable it
  • what you need to be extra careful about when you do need to enable it

@Naarcha-AWS Naarcha-AWS added 5 - Editorial review PR: Editorial review in progress backport 2.12 PR: Backport label for 2.12 3 - Tech review PR: Tech review in progress and removed 4 - Doc review PR: Doc review in progress 5 - Editorial review PR: Editorial review in progress labels Feb 26, 2024
@leanneeliatra
Copy link
Contributor

leanneeliatra commented Feb 29, 2024

I added another example @rursprung and hopefully made the docs clearer.

Could you review and let me know your thoughts please?

leanneeliatra and others added 11 commits March 1, 2024 14:51
Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>
Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>
Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>
Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>
Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>
Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>
Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
@Naarcha-AWS Naarcha-AWS added 5 - Editorial review PR: Editorial review in progress and removed 3 - Tech review PR: Tech review in progress labels Mar 1, 2024
Copy link
Collaborator

@natebower natebower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@john-eliatra @Naarcha-AWS Please see my comments and changes and let me know if you have any questions. Thanks!

_security/access-control/document-level-security.md Outdated Show resolved Hide resolved

## DLS and multiple roles

OpenSearch combines all DLS queries with the logical `OR` operator. However, when a role with DLS is combined with another security role that doesn't use DLS, the query results are filtered to display only documents matching the DLS from the first role. This filter rule also applies to roles which do not grant read documents.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is "grant read documents" correct? (It may be, but it reads a bit oddly to me).

Copy link
Collaborator

@Naarcha-AWS Naarcha-AWS Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"...grant read document permissions?"

_security/access-control/document-level-security.md Outdated Show resolved Hide resolved
_security/access-control/document-level-security.md Outdated Show resolved Hide resolved
_security/access-control/document-level-security.md Outdated Show resolved Hide resolved
_security/access-control/document-level-security.md Outdated Show resolved Hide resolved
_security/access-control/document-level-security.md Outdated Show resolved Hide resolved
_security/access-control/document-level-security.md Outdated Show resolved Hide resolved
_security/access-control/document-level-security.md Outdated Show resolved Hide resolved

When a user has both Role A and Role B permissions, the query results are filtered based on Role A's DLS, even though Role B doesn't use DLS. The DLS settings are held and the returned access is appropriately restricted.

With the `plugins.security.dfm_empty_overrides_all` is enabled when a user is assigned both Role A and Role B, Role B's permissions will override Role A's restrictions, allowing that user to access all documents. This ensures that the role without DLS takes precedence in the search query response.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would the first sentence be better as "When a user is assigned both Role A and Role B and the plugins.security.dfm_empty_overrides_all setting is enabled, Role B's permissions..."?

Naarcha-AWS and others added 3 commits March 1, 2024 12:36
Co-authored-by: Nathan Bower <nbower@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Co-authored-by: Nathan Bower <nbower@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
@Naarcha-AWS Naarcha-AWS merged commit 93d07a0 into opensearch-project:main Mar 1, 2024
3 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 1, 2024
* explaination of setting plugins.security.dfm_empty_overrides_all: true

Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>

* datadog grammer corrected in documentation

Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>

* Update _security/access-control/document-level-security.md

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>

* Update _security/access-control/document-level-security.md

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>

* Update _security/access-control/document-level-security.md

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>

* Update _security/access-control/document-level-security.md

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>

* Update _security/access-control/document-level-security.md

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>

* adding more examples of setting for dsl to make it clearer

Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>

* small edits to fix spacing in previous commit

Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>

* Update _security/access-control/document-level-security.md

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>

* reviewdog fixes

Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>

* Formatting edits.

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update document-level-security.md

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Nathan Bower <nbower@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Nathan Bower <nbower@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

---------

Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Co-authored-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Co-authored-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>
Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Co-authored-by: Nathan Bower <nbower@amazon.com>
(cherry picked from commit 93d07a0)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Naarcha-AWS added a commit that referenced this pull request Mar 1, 2024
* explaination of setting plugins.security.dfm_empty_overrides_all: true



* datadog grammer corrected in documentation



* Update _security/access-control/document-level-security.md




* Update _security/access-control/document-level-security.md




* Update _security/access-control/document-level-security.md




* Update _security/access-control/document-level-security.md




* Update _security/access-control/document-level-security.md




* adding more examples of setting for dsl to make it clearer



* small edits to fix spacing in previous commit



* Update _security/access-control/document-level-security.md




* reviewdog fixes



* Formatting edits.



* Update document-level-security.md



* Apply suggestions from code review




* Apply suggestions from code review




---------








(cherry picked from commit 93d07a0)

Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Co-authored-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>
Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Co-authored-by: Nathan Bower <nbower@amazon.com>
oeyh pushed a commit to oeyh/documentation-website that referenced this pull request Mar 14, 2024
…#6408)

* explaination of setting plugins.security.dfm_empty_overrides_all: true

Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>

* datadog grammer corrected in documentation

Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>

* Update _security/access-control/document-level-security.md

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>

* Update _security/access-control/document-level-security.md

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>

* Update _security/access-control/document-level-security.md

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>

* Update _security/access-control/document-level-security.md

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>

* Update _security/access-control/document-level-security.md

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>

* adding more examples of setting for dsl to make it clearer

Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>

* small edits to fix spacing in previous commit

Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>

* Update _security/access-control/document-level-security.md

Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>

* reviewdog fixes

Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>

* Formatting edits.

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update document-level-security.md

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Nathan Bower <nbower@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Nathan Bower <nbower@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

---------

Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Signed-off-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Co-authored-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
Co-authored-by: leanneeliatra <131779422+leanneeliatra@users.noreply.github.com>
Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Co-authored-by: Nathan Bower <nbower@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Editorial review PR: Editorial review in progress backport 2.12 PR: Backport label for 2.12 security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DOC] document dfm_empty_overrides_all setting in the security plugin
7 participants