Commit Graph

16 Commits

Author SHA1 Message Date
Josh Patterson 69d77382f1 suricata: timestamp each line of reload log output
Route the reload/verify output (ours plus so-common's retry/fail lines)
through a synchronous timestamping pipeline so every line in reload.log
is prefixed with a date/time, and preserve the real exit code via
PIPESTATUS.
2026-07-01 15:12:53 -04:00
Josh Patterson ee36f5f84c suricata: verify reloaded ruleset is newer than the rules file
Treating an in-progress reload as instant success could report success
while Suricata was still running a stale ruleset (the in-flight reload
may have started before the new all-rulesets.rules was written).

Make success conditional on Suricata actually having loaded the current
ruleset: capture the rules-file mtime up front, trigger a blocking
reload-rules, then query ruleset-reload-time and only succeed when
last_reload >= mtime. An in-progress reload now retries (waits for it to
clear so our own fresh reload runs) instead of short-circuiting, and a
ruleset that never catches up within the retry window fails via fail().

Also drop the redundant ruleset-reload-nonblocking call (the verified
blocking reload is authoritative and the async call was what left a
reload running) and log human-readable timestamps.
2026-07-01 09:00:36 -04:00
Josh Patterson 52574e21c6 suricata: treat in-progress rule reload as success
so-suricata-reload-rules failed the surirulereload state when a rule
reload was already running: suricatasc returns
{"message":"Reload already in progress","return":"NOK"}, which never
matched the expected output, so retry looped all 60 attempts (~3 min)
and called fail.

Wrap the suricatasc calls so an in-progress reload is treated as
success (the in-flight reload picks up the new rules) while genuine
container-not-ready conditions still retry and ultimately fail.
2026-06-30 09:40:23 -04:00
Josh Brower c7e865aa1c Remove hardcoded index 2026-03-30 12:42:48 -04:00
Josh Brower a3720219d8 add missing cp 2026-03-10 11:11:11 -04:00
Josh Brower 385726b87c update paths 2026-03-10 11:09:56 -04:00
Josh Patterson 6c7ef622c1 spaces removed from expected output 2025-11-07 17:08:33 -05:00
Doug Burks 27358137f2 FIX: so-suricata-testrule should disable pcap logging #14685 2025-05-30 09:24:41 -04:00
m0duspwnens ba24c5b219 remove -it 2024-09-06 12:26:55 -04:00
m0duspwnens 576d218cd9 dont restart suricata during setup. retry rule reload for 3 minutes 2024-09-06 08:10:59 -04:00
m0duspwnens 6581979506 retry suricata rule reload 2024-09-05 07:33:56 -04:00
Mike Reeves 5811ee5897 Update so-suricata-reload-rules 2024-09-01 10:39:42 -04:00
Mike Reeves b9f817201c Add thresholds to the reload list 2024-08-30 09:15:25 -04:00
Mike Reeves edce5186b9 Add support to relaod rules instead of restart 2024-08-29 12:55:06 -04:00
Mike Reeves cbd1c05929 Sbin Changes 2023-05-04 10:36:03 -04:00
Mike Reeves e60e21d9ff Move files out of common 2023-05-02 09:40:02 -04:00