-
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
[Timeline][RBAC] - Add RBAC logic to timeline alerts search strategy #105333
Merged
+2,496
−605
Merged
Changes from 20 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
00cf943
changes made to search strategy to allow for internal user
yctercero a2cd92c
adds spaceId filter as option to alerting auth find filter constructor
yctercero cd764da
updates security solution custom rule script, integration test alerts…
yctercero 7f93d65
terrible commit because it has a lot, but has tests passing for searc…
yctercero 7ff22db
updates search strategy to include a search strategy that queries usi…
yctercero 819b20e
reverted changes to create persistence rule
yctercero 3ae4c47
updated some types
yctercero b19e93e
tests only work when adding security solution rule registry flag, may…
yctercero aae42ff
cleanup and updates integration tests to be skipped as they require t…
yctercero 8a4f9de
Merge branch 'master' of github.com:elastic/kibana into rbac_search_s…
yctercero 3453827
made changes to alerting kuery builder per PR comments
yctercero 4523431
updating authorization filter options
yctercero 9fd4b37
updates to use getspaceid, removing async issues
yctercero e94f321
fixing up type issues
yctercero c9cfa5b
Removed unnecessary spreads
yctercero 2268c0a
added a flag to determine search cancel logic
yctercero da04629
moved tests to be under api integration tests specific to auth in ord…
yctercero 6a793b6
Merge branch 'master' of github.com:yctercero/kibana into rbac_search…
yctercero 2125d30
Merge branch 'master' of github.com:elastic/kibana into rbac_search_s…
yctercero 4f8972a
cleaned up some of the auth kuery code per suggestions
yctercero cc787f6
additional pr feedback around nameing and context comments
yctercero 612b3f7
Merge branch 'master' of github.com:elastic/kibana into rbac_search_s…
yctercero 3591194
additional cleanup and adding some tests
yctercero a54a480
update security and spaces trial tests
yctercero 775b56f
Merge branch 'master' of github.com:elastic/kibana into rbac_search_s…
yctercero 338a9db
clean up types
yctercero d87e796
removing new cancel logic to be addressed in follow up pr. updates tests
yctercero aaa6dad
Merge branch 'master' of github.com:elastic/kibana into rbac_search_s…
yctercero 124ff67
updating one rename from alertTypeRegistry to ruleTypeRegistry
yctercero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...a/server/kibana-plugin-plugins-data-server.isearchstart.searchasinternaluser.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [ISearchStart](./kibana-plugin-plugins-data-server.isearchstart.md) > [searchAsInternalUser](./kibana-plugin-plugins-data-server.isearchstart.searchasinternaluser.md) | ||
|
||
## ISearchStart.searchAsInternalUser property | ||
|
||
Search as the internal Kibana system user. This is not a registered search strategy as we don't want to allow access from the client. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
searchAsInternalUser: ISearchStrategy; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
*/ | ||
|
||
export * from './technical_field_names'; | ||
export * from './alerts_as_data_rbac'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,6 +109,7 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> { | |
private searchStrategies: StrategyMap = {}; | ||
private sessionService: ISearchSessionService; | ||
private asScoped!: ISearchStart['asScoped']; | ||
private searchAsInternalUser!: ISearchStrategy; | ||
|
||
constructor( | ||
private initializerContext: PluginInitializerContext<ConfigSchema>, | ||
|
@@ -156,6 +157,17 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> { | |
) | ||
); | ||
|
||
// We don't want to register this because we don't want the client to be able to access this | ||
// strategy, but we do want to expose it to other server-side plugins | ||
// see x-pack/plugins/security_solution/server/search_strategy/timeline/index.ts | ||
// for example use case | ||
this.searchAsInternalUser = enhancedEsSearchStrategyProvider( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lukasolson now that we're exposing this here, should route logic be added to ensure routes throw based on space access? Right now only those that add RBAC explicitly will (which we are doing) hit logic that throws a 403, otherwise, call would go through. |
||
this.initializerContext.config.legacy.globalConfig$, | ||
this.logger, | ||
usage, | ||
true | ||
); | ||
|
||
this.registerSearchStrategy(EQL_SEARCH_STRATEGY, eqlSearchStrategyProvider(this.logger)); | ||
|
||
registerBsearchRoute( | ||
|
@@ -220,6 +232,7 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> { | |
uiSettings, | ||
indexPatterns, | ||
}), | ||
searchAsInternalUser: this.searchAsInternalUser, | ||
getSearchStrategy: this.getSearchStrategy, | ||
asScoped: this.asScoped, | ||
searchSource: { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not for this PR, but I'm wondering if there's a way we can get this dynamically through the registered rule types instead of hard-coding it here. We aren't adding consumers frequently so it's probably not a high priority though..
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.
Yea, there's been a lot of discussion around this. One of the things that's been suggested is whether or not this state can be registered or maintained within alerting.
#104958