Skip to content

Added DisabledAuthz utility#216633

Merged
elena-shostak merged 15 commits intoelastic:mainfrom
elena-shostak:216632-disabled-authz-helper
Apr 8, 2025
Merged

Added DisabledAuthz utility#216633
elena-shostak merged 15 commits intoelastic:mainfrom
elena-shostak:216632-disabled-authz-helper

Conversation

@elena-shostak
Copy link
Contributor

@elena-shostak elena-shostak commented Apr 1, 2025

Summary

Added DisabledAuthz utility class, this will address the current repetition of the reason string 'This route delegates authorization to the ES/SO client and other common scenarios.

Closes: #216632

@elena-shostak elena-shostak added Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// backport:version Backport to applied version labels v8.19.0 release_note:skip Skip the PR/issue when compiling release notes enhancement New value added to drive a business result labels Apr 1, 2025
@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak
Copy link
Contributor Author

/ci

@elena-shostak
Copy link
Contributor Author

/сi

@elena-shostak elena-shostak marked this pull request as ready for review April 2, 2025 07:42
@elena-shostak elena-shostak requested review from a team as code owners April 2, 2025 07:42
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

Cool, nice work @elena-shostak !

enabled: false,
reason: `This route delegates authorization to Core's scoped ES cluster client`,
},
authz: AuthzDisabled.delegateToESClient,
Copy link
Contributor

Choose a reason for hiding this comment

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

Will we replace all other cases where routes delegate to the ES or SO client? Or will that be follow-up work for other teams?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will be a follow up work

Copy link
Contributor

@jeramysoucy jeramysoucy left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for adding this. Just left a minor nit/suggestion.

Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co>
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #8 / QueryBar check if we format the appropriate props to QueryBar

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/core-security-server 77 84 +7
Unknown metric groups

API count

id before after diff
@kbn/core-security-server 161 168 +7

History

@elena-shostak elena-shostak merged commit 18ca869 into elastic:main Apr 8, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/14331805609

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 216633

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Apr 9, 2025
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 216633 locally

1 similar comment
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 216633 locally

elena-shostak added a commit to elena-shostak/kibana that referenced this pull request Apr 10, 2025
## Summary

Added `DisabledAuthz` utility class, this will address the current
repetition of the reason string `'This route delegates authorization to
the ES/SO client` and other common scenarios.

__Closes: https://github.com/elastic/kibana/issues/216632__

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co>
(cherry picked from commit 18ca869)

# Conflicts:
#	x-pack/platform/plugins/shared/security/server/routes/authorization/roles/delete.ts
#	x-pack/platform/plugins/shared/security/server/routes/authorization/roles/get.ts
#	x-pack/platform/plugins/shared/security/server/routes/authorization/roles/get_all.ts
#	x-pack/platform/plugins/shared/security/server/routes/authorization/roles/post.ts
#	x-pack/platform/plugins/shared/security/server/routes/authorization/roles/put.ts
#	x-pack/platform/plugins/shared/security/server/routes/authorization/roles/query.ts
@elena-shostak
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
9.0
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

elena-shostak added a commit to elena-shostak/kibana that referenced this pull request Apr 10, 2025
## Summary

Added `DisabledAuthz` utility class, this will address the current
repetition of the reason string `'This route delegates authorization to
the ES/SO client` and other common scenarios.

__Closes: https://github.com/elastic/kibana/issues/216632__

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co>
(cherry picked from commit 18ca869)

# Conflicts:
#	x-pack/platform/plugins/shared/security/server/routes/authorization/roles/delete.ts
#	x-pack/platform/plugins/shared/security/server/routes/authorization/roles/get.ts
#	x-pack/platform/plugins/shared/security/server/routes/authorization/roles/get_all.ts
#	x-pack/platform/plugins/shared/security/server/routes/authorization/roles/post.ts
#	x-pack/platform/plugins/shared/security/server/routes/authorization/roles/put.ts
#	x-pack/platform/plugins/shared/security/server/routes/authorization/roles/query.ts
elena-shostak added a commit that referenced this pull request Apr 11, 2025
# Backport

This will backport the following commits from `main` to `9.0`:
- [Added DisabledAuthz utility
(#216633)](#216633)

<!--- Backport version: 9.5.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Elena
Shostak","email":"165678770+elena-shostak@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-04-08T10:59:28Z","message":"Added
DisabledAuthz utility (#216633)\n\n## Summary\n\nAdded `DisabledAuthz`
utility class, this will address the current\nrepetition of the reason
string `'This route delegates authorization to\nthe ES/SO client` and
other common scenarios.\n\n__Closes:
https://github.com/elastic/kibana/issues/216632__\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"18ca869d926d91b126b754bbbc1234a524949e14","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Security","enhancement","release_note:skip","backport
missing","backport:version","v9.1.0","v8.19.0"],"title":"Added
DisabledAuthz
utility","number":216633,"url":"https://github.com/elastic/kibana/pull/216633","mergeCommit":{"message":"Added
DisabledAuthz utility (#216633)\n\n## Summary\n\nAdded `DisabledAuthz`
utility class, this will address the current\nrepetition of the reason
string `'This route delegates authorization to\nthe ES/SO client` and
other common scenarios.\n\n__Closes:
https://github.com/elastic/kibana/issues/216632__\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"18ca869d926d91b126b754bbbc1234a524949e14"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/216633","number":216633,"mergeCommit":{"message":"Added
DisabledAuthz utility (#216633)\n\n## Summary\n\nAdded `DisabledAuthz`
utility class, this will address the current\nrepetition of the reason
string `'This route delegates authorization to\nthe ES/SO client` and
other common scenarios.\n\n__Closes:
https://github.com/elastic/kibana/issues/216632__\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"18ca869d926d91b126b754bbbc1234a524949e14"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
elena-shostak added a commit that referenced this pull request Apr 11, 2025
# Backport

This will backport the following commits from `main` to `8.x`:
- [Added DisabledAuthz utility
(#216633)](#216633)

<!--- Backport version: 9.5.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Elena
Shostak","email":"165678770+elena-shostak@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-04-08T10:59:28Z","message":"Added
DisabledAuthz utility (#216633)\n\n## Summary\n\nAdded `DisabledAuthz`
utility class, this will address the current\nrepetition of the reason
string `'This route delegates authorization to\nthe ES/SO client` and
other common scenarios.\n\n__Closes:
https://github.com/elastic/kibana/issues/216632__\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"18ca869d926d91b126b754bbbc1234a524949e14","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Security","enhancement","release_note:skip","backport
missing","backport:version","v9.1.0","v8.19.0"],"title":"Added
DisabledAuthz
utility","number":216633,"url":"https://github.com/elastic/kibana/pull/216633","mergeCommit":{"message":"Added
DisabledAuthz utility (#216633)\n\n## Summary\n\nAdded `DisabledAuthz`
utility class, this will address the current\nrepetition of the reason
string `'This route delegates authorization to\nthe ES/SO client` and
other common scenarios.\n\n__Closes:
https://github.com/elastic/kibana/issues/216632__\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"18ca869d926d91b126b754bbbc1234a524949e14"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/216633","number":216633,"mergeCommit":{"message":"Added
DisabledAuthz utility (#216633)\n\n## Summary\n\nAdded `DisabledAuthz`
utility class, this will address the current\nrepetition of the reason
string `'This route delegates authorization to\nthe ES/SO client` and
other common scenarios.\n\n__Closes:
https://github.com/elastic/kibana/issues/216632__\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Jeramy Soucy
<jeramy.soucy@elastic.co>","sha":"18ca869d926d91b126b754bbbc1234a524949e14"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Apr 11, 2025
@mistic mistic added v9.0.1 and removed v9.0.0 labels Apr 15, 2025
@mistic
Copy link
Contributor

mistic commented Apr 15, 2025

This PR didn't make it into the latest BC. Updating the labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels enhancement New value added to drive a business result release_note:skip Skip the PR/issue when compiling release notes Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// v8.19.0 v9.0.1 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce Helper Function/Enum for Authorization Opt-Out Reasons

6 participants