suricata: Perform ruleset update every 12 hours.

Message ID 20220508132303.4175-1-stefan.schantl@ipfire.org
State Accepted
Commit 0e48c84c42407fc326bafba6c6166a38a0c3a3a4
Headers
Series suricata: Perform ruleset update every 12 hours. |

Commit Message

Stefan Schantl May 8, 2022, 1:23 p.m. UTC
  Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 config/cron/crontab | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Peter Müller May 8, 2022, 2:23 p.m. UTC | #1
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>

> Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
> ---
>  config/cron/crontab | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/config/cron/crontab b/config/cron/crontab
> index d61d26619..c42104626 100644
> --- a/config/cron/crontab
> +++ b/config/cron/crontab
> @@ -62,8 +62,8 @@ HOME=/
>  # Update location database
>  %hourly,random * [ -f "/var/ipfire/red/active" ] && /usr/local/bin/update-location-database >/dev/null 2>&1
>  
> -# Update surciata rules.
> -%daily,random * [ -f "/var/ipfire/red/active" ] && /usr/local/bin/update-ids-ruleset >/dev/null 2>&1
> +# Perform a surciata rules update every 12 hours.
> +@ 12h [ -f "/var/ipfire/red/active" ] && /usr/local/bin/update-ids-ruleset >/dev/null 2>&1
>  
>  # Retry sending spooled mails regularly
>  %hourly * /usr/sbin/dma -q
  
Michael Tremer May 8, 2022, 4:12 p.m. UTC | #2
Hello Stefan,

What happens to firewalls that do not run 24/7?

Will this job be performed after 12 hours have passed no matter how long? So let’s say I shut down a system for a day, would the job run immediately?

-Michael

> On 8 May 2022, at 14:23, Stefan Schantl <stefan.schantl@ipfire.org> wrote:
> 
> Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
> ---
> config/cron/crontab | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/config/cron/crontab b/config/cron/crontab
> index d61d26619..c42104626 100644
> --- a/config/cron/crontab
> +++ b/config/cron/crontab
> @@ -62,8 +62,8 @@ HOME=/
> # Update location database
> %hourly,random * [ -f "/var/ipfire/red/active" ] && /usr/local/bin/update-location-database >/dev/null 2>&1
> 
> -# Update surciata rules.
> -%daily,random * [ -f "/var/ipfire/red/active" ] && /usr/local/bin/update-ids-ruleset >/dev/null 2>&1
> +# Perform a surciata rules update every 12 hours.
> +@ 12h [ -f "/var/ipfire/red/active" ] && /usr/local/bin/update-ids-ruleset >/dev/null 2>&1
> 
> # Retry sending spooled mails regularly
> %hourly * /usr/sbin/dma -q
> -- 
> 2.30.2
>
  

Patch

diff --git a/config/cron/crontab b/config/cron/crontab
index d61d26619..c42104626 100644
--- a/config/cron/crontab
+++ b/config/cron/crontab
@@ -62,8 +62,8 @@  HOME=/
 # Update location database
 %hourly,random * [ -f "/var/ipfire/red/active" ] && /usr/local/bin/update-location-database >/dev/null 2>&1
 
-# Update surciata rules.
-%daily,random * [ -f "/var/ipfire/red/active" ] && /usr/local/bin/update-ids-ruleset >/dev/null 2>&1
+# Perform a surciata rules update every 12 hours.
+@ 12h [ -f "/var/ipfire/red/active" ] && /usr/local/bin/update-ids-ruleset >/dev/null 2>&1
 
 # Retry sending spooled mails regularly
 %hourly * /usr/sbin/dma -q