From d9efc55bea1d0b9bb326d700c31a033ec8862a2c Mon Sep 17 00:00:00 2001 From: Gabriel Becker Date: Wed, 10 Dec 2025 15:08:36 +0100 Subject: [PATCH 1/7] Fix rsyslog rules due to change in how the configuration files are written. rsyslog_files_groupownership rsyslog_files_ownership rsyslog_files_permissions Most likely this is what caused the change: https://gitlab.com/redhat/centos-stream/rpms/rsyslog/-/merge_requests/49/diffs --- .../rsyslog_logfiles_attributes_modify/oval.template | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shared/templates/rsyslog_logfiles_attributes_modify/oval.template b/shared/templates/rsyslog_logfiles_attributes_modify/oval.template index dcca7cb92ec..f1b801529ed 100644 --- a/shared/templates/rsyslog_logfiles_attributes_modify/oval.template +++ b/shared/templates/rsyslog_logfiles_attributes_modify/oval.template @@ -82,9 +82,11 @@ * contains at least one slash '/' character, and simultaneously doesn't contain any of ';', ':' and space characters, * the chunk was retrieved from a row not starting with space, '#', or '$' characters + * for newer versions of Rsyslog, there is now only the RainerScript syntax and the + regex now matches both syntaxes. --> ^\s*[^(\s|#|\$)]+\s+.*(?:\bFile="|\s|\/|-)(\/[^:;\s"]+).*$ + operation="pattern match">^\s*[^#$].*?(?:[Ff]ile="([^"\s]+)"|[\s]+-?(\/[^:;\s]+)).*$ 1 state_{{{ _RULE_ID }}}_ignore_include_paths @@ -96,7 +98,7 @@ Their properties don't need to be as required for log files, thus, lets exclude them from the list of objects found. --> (?:file="[^\s;]+"|\$IncludeConfig[\s]+[^\s;]+|\/dev\/.*) + operation="pattern match">(?:include\([\n\s]*file="[^\s;]+"|\$IncludeConfig[\s]+[^\s;]+|\/dev\/.*) ^\s*[^#$].*?(?:[Ff]ile="([^"\s]+)"|[\s]+-?(\/[^:;\s]+)).*$ + operation="pattern match">^\s*[^#$].*?(?:\b[Ff]ile="([^"\s]+)"|[\s]+-?(\/[^:;\s]+)).*$ 1 state_{{{ _RULE_ID }}}_ignore_include_paths @@ -96,9 +96,10 @@ + from the list of objects found. Also exclude lines that are part of multiline include + statements (lines starting with whitespace followed by file=) and /dev/* device files. --> (?:include\([\n\s]*file="[^\s;]+"|\$IncludeConfig[\s]+[^\s;]+|\/dev\/.*) + operation="pattern match">(?:include\([\n\s]*\b[Ff]ile="[^\s;]+"|\$IncludeConfig[\s]+[^\s;]+|^\s+\b[Ff]ile="|\/dev\/.*)