Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create option to configure action() on a single line. #203

Open
bschonec opened this issue Jul 19, 2022 · 0 comments
Open

Create option to configure action() on a single line. #203

bschonec opened this issue Jul 19, 2022 · 0 comments

Comments

@bschonec
Copy link
Contributor

What are you seeing

CIS/STIG products that audit rsyslog configurations use regular expression checks that expect the action() configuration to be on a single line. Regex such as:

^\s*([^#]+\s+)?action\(([^#]+\s+)?\btarget="?[^#"]+"?\b
and

^\s*\*\.\*\s+@
will fail even if the configuration is correct but spans multiple lines. For example, the following configuration will fail the regex even though the configuration is correct:

# all_logs_to_siem
  *.*;local6.none                action(type="omfwd" 
                                             target="siem-01.example.com"
                                           protocol="udp"
                                           port="514"

[root@cis-01d rsyslog.d]# egrep '^\s*([^#]+\s+)?action\(([^#]+\s+)?\btarget="?[^#"]+"?\b' siem.conf

However, if the configuration for action, 'omfwd' were on a single line, the regex would pass.

[root@cis-01d rsyslog.d]# cat siem.conf
# all_logs_to_siem
  *.*;local6.none                action(type="omfwd" target="siem-01.example.com" protocol="udp" port="514")
[root@cis-01d rsyslog.d]# egrep '^\s*([^#]+\s+)?action\(([^#]+\s+)?\btarget="?[^#"]+"?\b' siem.conf
  *.*;local6.none                action(type="omfwd" target="siem-01.example.com" protocol="udp" port="514")
[root@cis-01d rsyslog.d]# 

I propose modifying the action.epp template so that it's possible to configure the action() section to be on a single line when desired.
Perhaps parameterizing this integer or this integer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant