-
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
[Event Log] Add support for aggregations #125645
Comments
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
As an aside, apparently there are ways to have aggregations which can bypass filtering, and so are a security consideration. I don't know the details on this, just know that we are generally sensitive to exposing aggregation support at the HTTP API level because of it. As such, it would be "simplest" for the ResponseOps team if the code did not have to worry about that, and we could do that by just exposing the aggregation API on the event log plugin APIs, and not through an HTTP interface. We could then make that API just take open-ended aggregations, and it would be the responsibility of the plugins calling that interface to make sure they are not using "security-challenged" aggs in their actual calls. Long-term I would like to make an open-ended aggs HTTP endpoint for the event log, but not sure what all would be involved in securing it. This implies that the eventual HTTP endpoints would end up being solution-specific, or perhaps rule-registry specific. |
I think this is a very reasonable compromise @pmuellr. Lets collaborate closely with the detection team to make sure the usage is secure. |
Regarding this requirement:
We rely on the Alerting RBAC model to evaluate whether a user disallowed to read the rule in question. This suggests we need the RBAC related fields on the Even Log entries themselves - looking at the mappings we don't seem to store the consumer or provider fields, both of which are needed. I'd recommend we split this issue into several deliverables and make incremental progress against it, as some of these requirements are bigger than others and it would be good to identify which ones are prerequisites to a first MVP. |
Yup, the good old Event Log RBAC topic strikes back! 🙂
Sounds good to me 👍 I think at this point we're most interested in support for aggs for a single rule - to be able to properly finalize the Rule Execution Log UI. So probably these items are going to be required for that (@spong please correct me if I'm wrong):
Maybe it would be helpful to write some examples of ES requests to the Event Log that would allow us to build these views in the app. |
We don't need the producer, as we can construct large, unwieldy queries based on the rule type instead, which is mapped (this the way it's done for SO's). That said, perhaps it would be better to have the producer mapped, so we don't have such unwieldy filters :-). |
@banderror I have a draft PR to try to address some (not all!) of these requirements. Can you take a look? https://github.com/elastic/kibana/pull/126948/files
This PR does not address the following:
Question:
|
Thanks @ymao1! I'll give this a test and make sure everything is there to port over the Rule Execution Log (#126215) and provide any additional feedback.
This should be fine -- I don't see an immediate need for returning individual docs, so we should be good here. |
Closing as addressed by #126948 |
Summary
In order to support various features in Security Solution (e.g. implementation of Rule Execution Log UI and Detection Engine health endpoint) we need to be able to execute aggregations on top of events in Event Log.
We have the following specific needs:
Edited to cross out the requirements addressed by #126948
We should be able to aggregate events of a single given rule. Examples:get buckets aggregated bykibana.alert.rule.execution.uuid
, and all events in the bucket (including our Security events and Framework events)for eachevent.action
we are interested in, calculate aggregations specific to this event type (e.g. givenevent.action = "execution-metrics"
and a specified time range, calculate percentiles for each metric we write in this event type)We need to be able to combine aggregations with filters in a single request to Event Log.We need support for sorting by multiple fields.The text was updated successfully, but these errors were encountered: