-
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
[Alerting] Passing additional rule fields to rule executor #99819
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
5eb4ded
Passing additional rule fields to rule executor
ymao1 41bc70b
Fixing types check
ymao1 4a91d53
Merge branch 'master' of https://github.com/elastic/kibana into alert…
ymao1 ca9c9ec
Api docs
ymao1 443736c
Merge branch 'master' of https://github.com/elastic/kibana into alert…
ymao1 2dc4574
Adding enabled and actions
ymao1 6dee10e
Api docs
ymao1 7c98191
Merge branch 'master' of https://github.com/elastic/kibana into alert…
ymao1 3395506
Encapsulating rule information into RuleConfig type
ymao1 0a9637c
Functional tests
ymao1 6d0d4fc
Merge branch 'master' of https://github.com/elastic/kibana into alert…
ymao1 8fd7ffe
Functional tests
ymao1 1886751
Merge branch 'master' of https://github.com/elastic/kibana into alert…
ymao1 c649270
Merge branch 'master' into alerting/pass-all-rule-params
kibanamachine bd86402
Adding producer, ruleTypeId and ruleTypeName
ymao1 2d64089
Api docs
ymao1 ad4674e
Merge branch 'master' of https://github.com/elastic/kibana into alert…
ymao1 cb443a8
Merge branch 'master' into alerting/pass-all-rule-params
kibanamachine 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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.
ah, interesting! I missed that on my first quick review of this.
Seems like I remember some conversations with @mikecote where we were a little concerned about rules knowing a lot about their context. Some of it just to keep rule executors from having to deal with too much info, but for actions specifically, could we be leaking any info? In theory action secrets are safe in this context, since they aren't passed in here, just the params.
But it is possible that someone would embed some secrets in something like a webhook header. Which would then be visible to the alert executor.Update: The case of webhook headers I mentioned isn't valid - webhook headers are part of the connector config, not params, so wouldn't be passed in here. I suspect there is no issue with "leaking secrets".I'm trying to think of good reason to actually pass the actions in, but failing to come up with one.
Thinking maybe we should remove it based on the security aspect.Update: I don't think there's a security issue here (see update above). But still would like to have @mikecote take a peek.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.
TL;DR if we don't have to, it's easier to add later than to remove later. Rule params are designed for the executor, rule object is designed for the framework.
My main concern is passing the
actions
enables rule types to change the execution behaviour based on what actions the user has configured. I've been pushing for rule executors to just query and flag things worth alerting on and to let the alerting framework handle the actions (notify every, mapping params, per instance, etc.). This principle facilitates future capabilities like rule simulation, alert summary, alert digest, notify after x amount of times, because of the limited context they know about the rule, forcing things to becomeparams
instead ofrule
properties where in the future we could call the rule executor without a rule to run a simulation or something.I get there are workarounds to uncover the
actions
but I prefer hearing use cases before providing such capability to ensure it doesn't harm future platform capabilities.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.
Discussed this with @mikecote offline and we are ok with moving forward on this for now.