Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] Fix coverage overview console errors (elastic#178126
) **Fixes: elastic#164846 ## Summary This PR fixes MITRE ATT&CK® Coverage Overview dashboard console errors when the page loads or filter is changed. ## Details An error message `Exception list is null when it never should be. This indicates potentially that saved object migrations did not run correctly. Returning empty exception list` appears each time MITRE ATT&CK® Coverage Overview dashboard is loaded or filter is changed (which lead to data reloading). If one tried to find the source of the console error message it lead to [kibana/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_exceptions_list.ts](https://github.com/elastic/kibana/blob/6cb73aaec15b230a65d2e17a9d6ef970a1061709/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/saved_object_references/inject_exceptions_list.ts#L30-L33). It happens whenever there is an attempt to inject rule exceptions from SO references. This operations happens for every rule wrapped in `securityRuleTypeWrapper` and registered in `alerting` plugin. Whenever such rule if fetched via `rulesClient.find()` it invokes registered `useSavedObjectReferences.injectReferences` finally invoking mentioned above `inject_exceptions_list.ts`. Coverage Overview API endpoint fetches only necessary set of rule fields (`name`, `enabled`, `params.threat`) to reduce transferring unnecessary data. It's not hard to guess that `params.exceptionsList` is missed and it ends up to be `undefined` (it's always an array in a SO) when the validation happens in `inject_exceptions_list.ts`. So it leads to the warning message appearing. This PR removes redundant `exceptionsList` injection validation. (cherry picked from commit cd16d03)
- Loading branch information