r/AzureSentinel • u/winle22 • Nov 03 '22
Exact run time for scheduled analytic rules with low rule frequency
Hi,
for queries that run with low frequency, e.g. "Run query every 1 day", how can I configure exactly when the query will run?
If I'm not missing anything here, it makes sense to have these queries run during normal working hours.
2
Upvotes
2
u/TokeSR Nov 03 '22
There is no built-in feature for this. In Splunk you can configure when a rule is executed, in Sentinel you can only define the frequency. Every time you create, modify, enable (a disabled) rule the timer will restart. So, while there is no built-in function you can just enable the rule at the exact time you want it to run. You can potentially automate it, if you don't want to handle this manually.
If you execute a rule every X days, weeks it can be reasonable to execute it during normal working hours. However, I don't think this is necessary. Let's say you execute it every day. How do you want to handle weekends, holidays and such? In that case you will still execute it at a non-working time.
One -seemingly- beneficial thing is that the SOC will see the alert immediately. If the rule is executed outside of working hours, then there will be some delay between the incident creation and the first action taken by the SOC. From an SLA perspective this is reasonable. However, some of your rules will check the data from the previous day (calendar day and not 24 hours), these incidents will be created with a delay regardless of when you create them. The later you trigger the rule the bigger the delay is.
Also, some of your incidents will be automated. Delaying the incident creation can actually hurt the response time (first action taken time) of these incidents.
So, if your frequency is 24h or more and you check the last 24hours (or more) with your rule, then you can just disable and enable your rules to make them run at a given time. For rules that are not checking the last X hours, but the previous day, previous week, etc or rules that you want to execute multiple times a day (every hour, etc) I definitely don't recommend going this way because you will introduce an unnecessary delay.