-
Notifications
You must be signed in to change notification settings - Fork 206
Description
Description
What: We introduce manual rule Runs for security solution.
Why: Users will be able to run rule in the past and specify the date range.
Use cases we cover:
- User form rule details page execute manual rule run and specify time rang
- They can go to Executions tab and see the backfill group, with information about how much tasks scheduled and in progress/pending
- They can stop the whole group for manual run
- They can see in execution log result of rule executions and filter by rule type
There additional issue for UX copy: #5265
A little bit of technical background, how it works, which should help with better naming
Let's say we have rule with 5m interval
rule execution log - it represents the results of a single rule execution. it can be running/succeded/failed.
When the user executes Manual rule runs (14:00-16:00)- it creates the Backfill group (we probably need come up with better naming).
Backfill group - it's something, that contains the start and end date range, status of the whole group, and rule info.
Also Backfill group has scheduled entries - it's a list of tasks of potenial rule executions.
When the task manager is free it starts to schedule those tasks - which execute the rule, and then the result of this execution appears in the rule execution log.
scheduled entry - can be pending/running/error/complete
The whole backfill group also can be pending/running/error - depends on status of scheduled entires.
After all scheduled entries are complete - Backfill group is deleted.
We can Delete/Stop only the whole backfill group, but not individual backfill group.
Background & resources
- PRs:
- Backfill groups
- Execution log
- New alert schema fields:
kibana.alert.intended_timestamp:
Add intended timestamp kibana#191717kibana.alert.rule.execution_type: Execution type field kibana#195884
- PR that removes feature flag: Remove feature flag for manual rule run kibana#193833
- Issues/metas:
- Main meta for manual runs: https://github.com/elastic/security-team/issues/2840
- Design change to auto-refresh button: https://github.com/elastic/security-team/issues/9690
- New alert fields: https://github.com/elastic/security-team/issues/10459
- Point of contact: @approksiu @e40pud @nkhristinin
- Test environments: Provided in Slack channel
Which documentation set does this change impact?
ESS and serverless
ESS release
8.15 8.16
Serverless release
Monday, July 29, 2024 Tuesday, October 14, 2024
Feature differences
None
API docs impact
- See comment here
Prerequisites, privileges, feature flags
None
Doc plan
- Update ESS and Serverless UI docs:
- Base functionality
- Limitations and best practices: What we discussed in Slack:
- Manual runs will execute with low priority and limited concurrency, meaning they might take longer to complete, especially if there are many rules to backfill. Scheduled rules has higher priority and some limited concurrency. But limit is higher
- Rule parameters are fixed at the time of manual rule run scheduling, meaning any updates to the rules afterward will not be reflected in the manual rule run. For example:
- We create a rule - Name - "Rule 1", interval - 5 min, query: "*"
- We execute manual rule run, and let's say it's long process taking hours
- Immediately after that we a changing rule name to "Rule 2", interval to 10 hours and query to "host.name:2"
- All rule execution which are planned after manual rule run executed will use original parameters - Name - "Rule 1", interval - 5 min, query: "*"
- Users are responsible for ensuring the correct order of backfill jobs (manual rule runs) if dependencies exist between them. Incorrect scheduling can lead to inconsistent data filling.
- The
kibana.alert.intended_timestampfield has been added to the alert schema. This field appears in documents of alerts that were generated by manual rule runs. They convey the estimated time range of when the alert was created.
- Update rule API docs:
- ESS
- Serverless (Content on the Serverless API reference site is generated from OAS files and maintained/updated by dev teams) - https://www.elastic.co/docs/api/doc/kibana/operation/operation-performrulesbulkaction
- Add known issues (noted in the comments) to the 8.16 release notes - Noted at 8.16.0 Release notes #5941
Doc updates
NOTE: The feature is being released in Tech Preview in 8.15, so will need to use that label/admonition for ESS and Serverless docs.
Execution results: Make the following updates:
- In the intro para, add that users can now see how a rule was executed. Now, rules can be executed manually or auto-executed on a (preset?) schedule.
- Update
rule-execution-logs.png- new image should show the updatedExecution logtable and the newManual runstable. - Add two bullets to the list of controls that allow users to filter what's in the
Execution logtable. The new items are:- Run type - New filter that allows users to display the execution type of a run. The two options are Manual and Scheduled.
- Show source event time range: Toggling this setting on displays the
Source event time rangecolumn. By default, this setting is toggled off.
- Add an item to the list of actions that users can take from the Rules page. A good place might be after the "manage rules" list item.
- Add a new section for manually running rules. The new section should include the following details:
- There are 3 different places where users can manually run a rule:
- The rule's details page (go to the actions menu in the top right and select Manual run)
- On the Rule pages, from the actions menu for an individual rule
- On the Rule page, from the Bulk actions menu (up to 100 rules can be selected for a bulk-run)
- When selecting a range of time to manually run a rule, you can only choose a past date and time.
- If you don't change the default timerange selection, the rule will run today and the start time of the run will be 3hrs in the past.
- Rules must be enabled for you to manually run them.
- To stop a manual run, go to the
Manual runstable and click Stop run in theActionscolumn.
Stop rule run

- There are 3 different places where users can manually run a rule: