[Security Solution] Rule filters: strict schema #147438
Labels
Feature:Rule Management
Security Solution Detection Rule Management area
Team:Detection Rule Management
Security Detection Rule Management Team
Team:Detections and Resp
Security Detection Response Team
Team: SecuritySolution
Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc.
technical debt
Improvement of the software architecture and operational architecture
Epic: #138606
Related to: #147441
Summary
Currently, query filters stored in rules of selected types are typed as an array of
t.unknown
values which allows a user to store anything in there via the API.kibana/x-pack/plugins/security_solution/common/detection_engine/rule_schema/model/common_attributes/misc_attributes.ts
Lines 100 to 105 in 47ad5ed
For example, for the Custom Query rules, filters are defined here:
kibana/x-pack/plugins/security_solution/common/detection_engine/rule_schema/model/rule_schemas.ts
Line 303 in 47ad5ed
kibana/x-pack/plugins/security_solution/server/lib/detection_engine/rule_schema/model/rule_schemas.ts
Line 175 in 47ad5ed
If a user stores an invalid value instead of a valid instance of a filter model, it might break both the UI (e.g. rule Creation and Details pages) and the BE logic (rule executors).
Let's implement a strict io-ts schema for filters and validate them on-write.
To do
Let's do the following:
t.unknown
with it inRuleFilterArray
.The text was updated successfully, but these errors were encountered: