-
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
[Alerts as Data] - Finding a home #104958
Comments
Some context about the framework vs library situation: the main goal that I think we should focus on when trying to be "not a framework" is that we shouldn't block access to Kibana Alerting Framework APIs. We don't want to provide "registerType", we want rule type authors to use that API directly, with decoration tools provided by this plugin. That said, this plugin should feel free to engage in creating its own APIs, storing its own state, etc. So in that sense, it doesn't need to purely be a stateless library package. Example: const { initializeRuleTypeDecorator } = require('../rule_registry');
const alerting = require('../alerting');
const { ruleTypeDecorator } = initializeRuleTypeDecorator({
// ... index name, mappings, other config
});
const myRuleTypeConfig = ruleTypeDecorator({
// ... my rule type config
});
alerting.registerType(myRuleTypeConfig); In this pseudo-code-ish example, I'm not exactly clear on how/when code authors will want to gain access to an RBAC-scoped Alerts Client, so I don't know if that should be returned from |
Pinging @elastic/security-solution (Team: SecuritySolution) |
The description above talks about some advanced setting that can be used to change the index. Which is that? And on a related note, when do we plan to restore the functionality of the |
@weltenwort I am forgetting what was the reasoning for the customizability of that setting again? Given this is a system index we probably should not allow users to change the name, especially given we are trying to move away from index-level privileges which, given a custom setting, would force us to resort to searching with |
@dhurley14 there are two "settings" that I know about, I'll try to provide context for both so that anyone following along can understand the difference:
For this second one, we earlier settled on a separate kibana.yml flag, something along the lines of "alert.index" but do something like if "alert.index" is "banana", we store those alerts in Since that point, I don't know if we've fully considered a) the ramifications of allowing this and b) user demand for it (although it will be a strange experience for rules to be managed this way but alerts to flow across "tenants"). @dhurley14 / @yctercero can you outline how much pain something like this might cause for RBAC? Also, I think we talked about this setting being related to a setting where the customer can read alerts as the current user instead of the system user + RBAC filters, but it's been a long time since anyone has mentioned that too. Lastly, if the rules are already segmented by tenant, would the alerts those rules create already be visibility-restricted without needing this separate flag? I think the answer is no but my mind is mush and I can't remember why. |
Summary
The existing implementation of alerts as data includes the
ruleRegistry
, and thealertsClient
. These currently both live within theruleRegistry
plugin. TheruleRegistry
began as a very stateful plugin and was subsequently updated to resemble more of a stateless library that provides a toolkit for registering rules with the alerting framework. ThealertsClient
exposes CRUD methods for interacting with the alerts generated by the registered rules.As it stands, which index an alert is written to during rule execution is determined by which solution the rule is registered with. So a rule whose rule type is registered with security solution will have its alerts written to
.alerts-security.alerts
. However, there's an exception! Users, using the advanced settings, can specify a separate index they want to use. Living in a stateless library, thealertsClient
does not have the ability to dynamically query for which index to use.Right now we are hardcoding the alert index names based on the information we get - ie: which solution we're dealing with. This is clearly not ideal as any new solutions would need to go in and update the code.
Long story short, there are a few questions we'd like to discuss and kick off here:
alertsClient
?Discussions for reference
#100705 (comment)
#100705 (review)
The text was updated successfully, but these errors were encountered: