Fix Synology NAS ruleset field names and dead storage-fault rule - #90
Conversation
|
Hi @leonfullxr — I know this is still a draft, so this is early feedback to help it along:
Nits: base rule 100400 (level 3) fires on the benign "Test message from Synology Syslog Client" heartbeat — consider a dedicated low-noise/ignore rule; and 100409 combines drive-removed and volume-degraded into one rule, so its description always mentions both with one left empty. |
The login rules interpolated $(synology_user), but the decoders write the username to the standard user field, so every authentication alert showed an empty username. Use $(user) in rules 100401-100404. Rule 100409 used <match>was removed|was degraded</match>. <match> is a literal substring test, so the pipe was matched literally and the rule could never fire. Split it into 100409 for a removed drive and 100410 for a degraded volume, which also fixes the description: a single event populates only one of synology_drive and synology_volume, so the combined description always had an empty field. Also correct the README, which advertised alerting on 2FA failures while the ruleset matches only the 2FA success message.
Summary
Fixes three defects in the Synology NAS ruleset that made its alerts incomplete or unreachable.
The integration files themselves already landed on
main, so this branch was rebuilt on top ofmainand now carries only the fixes. The diff isrules/nas_synology_rules.xmlplus one README line.Fixes
Empty usernames in every authentication alert. Rules 100401 to 100404 interpolated
$(synology_user), but the decoders write the username to the standarduserfield:synology_useris never populated, so login failure, 2FA, sign-in and logout alerts all rendereduser ''. Now$(user).Storage-fault rule could never fire. Rule 100409 used
<match>was removed|was degraded</match>.<match>is a literal substring test, so the|was compared literally and no Synology log line containswas removed|was degraded. Drive removal and volume degradation, the two highest-severity events in the ruleset at level 10, produced no alert.Split into two rules rather than switching to
<regex>, because one rule cannot describe both events correctly: a drive event populatessynology_driveand a volume event populatessynology_volume, so the old combined description always left one field empty.was removed$(synology_drive)was removedwas degraded$(synology_volume)is degraded ($(synology_status))README overstated coverage. It advertised alerting on "2FA failures" while the ruleset matches only the 2FA success message (
successfully passed the first authentication of 2FA). Reworded to what the rules actually cover. No 2FA failure rule was added, since neither the decoders norsample_logs.txtcontain that log format and inventing one unverified would be worse than documenting the real coverage.Verification
No Wazuh manager was available, so verification was static, checking the two properties that failed here against
sample_logs.txt:<match>string occurs in at least one sample log line, treating<match>as a substring test with no alternation.$(field)interpolated in a description appears in some decoder's<order>.Before the fix this reported the five real defects and nothing else:
After the fix all 11 rules resolve, covering all 14 sample log lines, with every interpolated field decoded. Both XML files parse cleanly.
Not exercised against a live manager: confirming with
wazuh-logteston a real Synology feed is still worth doing before this leaves draft.Notes on the decoders
The decoders are unchanged and were reviewed as correct. The regexes may read as unescaped, but they follow OS_Regex rather than PCRE, where
\.is the any-character class and[is a literal, so\d+.\d+.\d+.\d+correctly matches a dotted IP. Other decoders in this repository use the same convention.