-
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
[RAM] [META] Make rule params searchable #123982
Comments
Pinging @elastic/response-ops (Team:ResponseOps) |
@banderror, can you provide me with a list of all the params who need to be searchable/sortable and let's go over it together to make sure that we are doing the right thing. |
@XavierM Here's the list of rule fields that we use for sorting, as of now: https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/types.ts#L180-L192 export type RulesSortingFields =
| 'created_at'
| 'enabled'
| 'execution_summary.last_execution.date'
| 'execution_summary.last_execution.metrics.execution_gap_duration_s'
| 'execution_summary.last_execution.metrics.total_indexing_duration_ms'
| 'execution_summary.last_execution.metrics.total_search_duration_ms'
| 'execution_summary.last_execution.status'
| 'name'
| 'risk_score'
| 'severity'
| 'updated_at'
| 'version'; Note that all |
As for filtering, we'll need to filter rules using the following fields:
More info in this epic: https://github.com/elastic/security-team/issues/1972 |
@XavierM Just expanding on what @xcrzx posted previously: Framework-level rule fields (not rule params):
Rule params of our SIEM rule types:
Additional fields that we'd like to store in the rule object which are not rule params but dynamic rule execution data. This is what we currently store in the sidecar
Something that we need which is not implemented at all:
This is how /**
* Maps the legacy SIEM rule type to the new RAC rule type on the Framework level
* "alert.params.type" -> "alert.alertTypeId"
*/
export const ruleTypeMappings: {
eql: "siem.eqlRule";
machine_learning: "siem.mlRule";
query: "siem.queryRule";
saved_query: "siem.savedQueryRule";
threat_match: "siem.indicatorRule";
threshold: "siem.thresholdRule";
}; Example value of [
{
"framework" : "MITRE ATT&CK",
"tactic" : {
"id" : "TA0005",
"name" : "Defense Evasion",
"reference" : "https://attack.mitre.org/tactics/TA0005/"
},
"technique" : [
{
"id" : "T1574",
"name" : "Hijack Execution Flow",
"reference" : "https://attack.mitre.org/techniques/T1574/",
"subtechnique" : [
{
"id" : "T1574.007",
"name" : "Path Interception by PATH Environment Variable",
"reference" : "https://attack.mitre.org/techniques/T1574/007/"
}
]
}
]
}
] |
Currently, when we filter rules by their fields, the filter we pass to the
For us as clients of the Framework, are
|
Team had a discussion around it, we agree to set the expectation on just these fields below inside of params
|
I think that's the task around this functionality
|
Not sure if it was discussed yesterday as I had to drop early (and not seeing a comment here about it), but we should be able to clean up all our extra logic around the So I propose we add |
@spong I think filtering by |
Oh that's right, I keep forgetting they're mapped as |
Trying to decompose my previous comment into tickets, I opened these:
And we already had this one: |
I have created a draft PR with the POC implementation (#125889). In the implementation, I've turned on sorting on the risk score and severity columns. So now they're sorted and filtered via the Some challenges that I foresee with this mapped params system mostly has to do with developer/user discoverability. Every time someone wants to promote a params to a searchable/mapped param, we would need to manually add the param to the mapped params mapping allowlist. Alongside that, how are users going to know if something is searchable? We'd have to document the mapped params system without exposing the field itself. Maybe some UX considerations would be needed (some sort of auto complete?) Now I'm working on making the change to aggregates, will report back with findings. |
Thanks @JiaweiWu !
My understanding was that this was the intended state as we were concerned that if we didn't do this we will end up with a big, hard to maintain, bucket of unrelated params. If we find this is a major blocker to progress, we can treat that as a signal that it is worth while investigating a more expensive, but longer-term, approach.
Yes, I have voiced the same concern. |
Surprisingly, we don't have much to lean on here other than the KQL search bar. We do leverage this For example:
Here's a set of screenshots demonstrating how this looks in Discover: Other than this, we only hint at things like: @mdefazio feel free to add other examples if I missed something |
I can't think of additional relevant examples. But I think the KQL example makes sense. We could add |
As a team, we decided how we are going to manage some of our field in the params attribute of our rule saved object to be searchable and sortable. To achieve this functionality, we are going to create a new attribute
mapped_params
in our rule saved object where each fields inside will be define with a specific schema. Also, we will only add field inmapped_params
, if they exist in the params attributes.mapped_params
will be hidden from our API meaning that our user won't be able to see it. for example imagine that we hadrisk_score
in our params field and we will create a duplicate field in ourmapped_params
, if a user asks to sort onparams.risk_score
behind the scene we will usemapped_params.risk_score
. That's the basic idea how we are going to make rule params searchable/sortable.let's describe, what we need to do to do to get there:
Look at this #123982 (comment) instead
- [ ] Create a migration tool to migrate our selected params to mapped_params in our rule saved object- [ ] Update the API to manage this mapped params (find/get/update/create)- [ ] Validate mapped params like we do for params but since we duplicate them, the params validation should be sufficient- [ ] import/export will have to be updated to take in consideration of this mapped paramsThe text was updated successfully, but these errors were encountered: