elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.76k stars 8.17k forks source link

Rule status warnings for errors thrown in check privileges / timestamp not displaying on rule details page #184148

Open dhurley14 opened 4 months ago

dhurley14 commented 4 months ago

On main branch I was testing something and discovered that any error thrown in the section of code we check for privileges and timestamps on source indices will not be displayed on the UI.

Throwing an error anywhere in this try block will result in the following on main. I was attempting to mimic an error thrown within the checkPrivilegesFromEsClient code but throwing an error anywhere in this block will trigger the bug.

throw Error('test error');
const privileges = await checkPrivilegesFromEsClient(esClient, inputIndex);

https://github.com/elastic/kibana/blob/2ec4ec362d21fe03d04d53181fa0a8f7da888eb5/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/create_security_rule_type_wrapper.ts#L259-L301

Rule details page:

rule_no_error_message_test_error

Execution log table:

execution_status_table
elasticmachine commented 4 months ago

Pinging @elastic/security-detections-response (Team:Detections and Resp)