Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] Make rule schema forward-compatible (#170861)
**Resolves: elastic/security-team#6888 ## Summary The transition from io-ts to Zod has led to a new approach in request validation where extra fields are allowed. Now, any unknown fields in data structures sent to our API are stripped away silently, without triggering validation errors. This change ensures the rule schema is forward-compatible, facilitating scenarios such as: - Users exporting a rule with a new field from the latest Kibana version and importing it into the previous Kibana without issues. - The TRADE team can avoid backporting rules with new fields for out-of-band updates, as these fields will be ignored during the rule installation process. Forward-compatible rule schemas are supported by: - All Rule CRUD operations - All Bulk Rule CRUD operations - Rule Import/Export functionality ### How to test this PR 1. In Kibana UI. Export a rule, append extra fields at any level, and re-import it. All additional fields should be omitted in the final rule. 2. On the API level. Include extra fields in any CRUD rule request. Then retrieve the rule, all extra fields should be missing. ### Note Not all rule fields are validated; some fields are defined as `Record<string, unknown>` like `RuleActionParams` or `RuleActionAlertsFilter`. Any extra fields added to these structures will be preserved.
- Loading branch information