-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[SecuritySolution][ProductFeatures] Add support for security.authz.requiredPrivileges
for the API auth control
#198312
[SecuritySolution][ProductFeatures] Add support for security.authz.requiredPrivileges
for the API auth control
#198312
Conversation
const disabled = authz.requiredPrivileges.some((privilegeEntry) => { | ||
if (typeof privilegeEntry === 'object') { | ||
if (privilegeEntry.allRequired) { | ||
if (privilegeEntry.allRequired.some(isApiPrivilegeSecurityAndDisabled)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be used visa versa, privilegeEntry.allRequired.every
and privilegeEntry.anyRequired.some
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am finding disabled actions, so I use the oposite operation. This approach allows me to check the privilege is a security solution action and is disabled, at the same time.
You can take a look at the test for examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha
Pinging @elastic/security-solution (Team: SecuritySolution) |
@elasticmachine merge upstream |
const API_ACTION_TAG_PREFIX = `access:${APP_ID}-`; | ||
|
||
const isAuthzEnabled = (authz?: RecursiveReadonly<RouteAuthz>): authz is AuthzEnabled => { | ||
return Boolean((authz as AuthzEnabled)?.requiredPrivileges); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would like to know what's the difference between security.authz.requiredFeatures
and security.authz.requiredPrivileges
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, the PR title was wrong, the correct entry is security.authz.requiredPrivileges
, security.authz.requiredFeatures
does not exist
💛 Build succeeded, but was flaky
Failed CI StepsTest FailuresMetrics [docs]
cc @semd |
security.authz.requiredFeatures
for the API auth controlsecurity.authz.requiredPrivileges
for the API auth control
Starting backport for target branches: 8.x |
…equiredPrivileges` for the API auth control (elastic#198312) ## Summary Adds support for the new API routes security authorization properties ([docs](https://docs.elastic.dev/kibana-dev-docs/key-concepts/security-api-authorization)) to the `ProductFeaturesService` API authorization control Closes: elastic#194445 Related: elastic#184674 --------- Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit 42e978b)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ity.authz.requiredPrivileges` for the API auth control (#198312) (#198566) # Backport This will backport the following commits from `main` to `8.x`: - [[SecuritySolution][ProductFeatures] Add support for `security.authz.requiredPrivileges` for the API auth control (#198312)](#198312) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Sergi Massaneda","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-31T15:31:00Z","message":"[SecuritySolution][ProductFeatures] Add support for `security.authz.requiredPrivileges` for the API auth control (#198312)\n\n## Summary\r\n\r\nAdds support for the new API routes security authorization properties\r\n([docs](https://docs.elastic.dev/kibana-dev-docs/key-concepts/security-api-authorization))\r\nto the `ProductFeaturesService` API authorization control\r\n\r\nCloses: https://github.com/elastic/kibana/issues/194445\r\n\r\nRelated: https://github.com/elastic/kibana/issues/184674\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"42e978be21bc7c85fc09f46213c194b89209690f","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team: SecuritySolution","backport:prev-minor","v8.17.0"],"title":"[SecuritySolution][ProductFeatures] Add support for `security.authz.requiredPrivileges` for the API auth control","number":198312,"url":"https://github.com/elastic/kibana/pull/198312","mergeCommit":{"message":"[SecuritySolution][ProductFeatures] Add support for `security.authz.requiredPrivileges` for the API auth control (#198312)\n\n## Summary\r\n\r\nAdds support for the new API routes security authorization properties\r\n([docs](https://docs.elastic.dev/kibana-dev-docs/key-concepts/security-api-authorization))\r\nto the `ProductFeaturesService` API authorization control\r\n\r\nCloses: https://github.com/elastic/kibana/issues/194445\r\n\r\nRelated: https://github.com/elastic/kibana/issues/184674\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"42e978be21bc7c85fc09f46213c194b89209690f"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/198312","number":198312,"mergeCommit":{"message":"[SecuritySolution][ProductFeatures] Add support for `security.authz.requiredPrivileges` for the API auth control (#198312)\n\n## Summary\r\n\r\nAdds support for the new API routes security authorization properties\r\n([docs](https://docs.elastic.dev/kibana-dev-docs/key-concepts/security-api-authorization))\r\nto the `ProductFeaturesService` API authorization control\r\n\r\nCloses: https://github.com/elastic/kibana/issues/194445\r\n\r\nRelated: https://github.com/elastic/kibana/issues/184674\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"42e978be21bc7c85fc09f46213c194b89209690f"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Sergi Massaneda <[email protected]>
…equiredPrivileges` for the API auth control (elastic#198312) ## Summary Adds support for the new API routes security authorization properties ([docs](https://docs.elastic.dev/kibana-dev-docs/key-concepts/security-api-authorization)) to the `ProductFeaturesService` API authorization control Closes: elastic#194445 Related: elastic#184674 --------- Co-authored-by: Elastic Machine <[email protected]>
Summary
Adds support for the new API routes security authorization properties (docs) to the
ProductFeaturesService
API authorization controlCloses: #194445
Related: #184674