graylog-deploy/rules/rule91_a10_session_timeout.json
byrsapty c382cb6b72 Fix DSL string-escaping bug breaking compilation of 2 A10 rules
Both rule89 (a10_session_opened) and rule91 (a10_session_timeout)
failed to compile live: \\" (two backslashes before a quote) is
read by Graylog's rule DSL as an escaped backslash followed by an
unescaped string terminator, not an escaped quote - so the regex()
string literal ended early and everything after it parsed as
garbage ("Unknown function S", "mismatched input '('", etc).

Fix: exactly one backslash before each quote (\") so the DSL treats
it as an escaped quote character, matching the \S/\d/\. occurrences
elsewhere in the same pattern which correctly use two backslashes
(DSL-decodes to one, which is what the regex engine needs). The
other 4 new A10 rules didn't have this issue and already compiled
successfully on the user's first live run.
2026-08-28 13:29:20 +03:00

5 lines
831 B
JSON

{
"title": "a10_session_timeout",
"description": "A10: admin session timed out from inactivity (the detailed line naming session id/user/src_ip - the generic preceding 'Session timed out' line is a duplicate summary of the same event and is deliberately left unclassified). Built from real captured A10 syslog output.",
"source": "rule \"a10_session_timeout\"\nwhen\n contains(to_string($message.message), \"has timed out\")\nthen\n set_field(\"vendor\", \"a10\");\n set_field(\"event_type\", \"session_timeout\");\n let m = regex(\"Session ID (\\\\d+) for user \\\"(\\\\S+)\\\" from (\\\\S+) has timed out\", to_string($message.message), [\"session_id\",\"user\",\"src_ip\"]);\n set_field(\"a10_session_id\", m[\"session_id\"]);\n set_field(\"a10_user\", m[\"user\"]);\n set_field(\"src_ip\", m[\"src_ip\"]);\nend"
}