Skip to content

Commit 91ad583

Browse files
authored
Merge pull request #13328 from jan-cerny/rsyslog_remote_tls_cacert
Update CA file path
2 parents 3699c3c + 3207a8d commit 91ad583

37 files changed

+43
-8
lines changed

linux_os/guide/system/logging/rsyslog_sending_messages/rsyslog_remote_tls_cacert/rule.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
documentation_complete: true
22

3-
43
title: 'Configure CA certificate for rsyslog remote logging'
54

65
description: |-
76
Configure CA certificate for <tt>rsyslog</tt> logging
87
to remote server using Transport Layer Security (TLS)
98
using correct path for the <tt>DefaultNetstreamDriverCAFile</tt>
109
global option in <tt>/etc/rsyslog.conf</tt>, for example with the following command:
11-
<pre>echo 'global(DefaultNetstreamDriverCAFile="/etc/pki/tls/cert.pem")' >> /etc/rsyslog.conf</pre>
12-
Replace the <tt>/etc/pki/tls/cert.pem</tt> in the above command with the path to the file with CA certificate generated for the purpose of remote logging.
10+
<pre>echo 'global(DefaultNetstreamDriverCAFile="{{{ rsyslog_cafile }}}")' >> /etc/rsyslog.conf</pre>
11+
Replace the <tt>{{{ rsyslog_cafile }}}</tt> in the above command with the path to the file with CA certificate generated for the purpose of remote logging.
1312
1413
rationale: |-
1514
The CA certificate needs to be set or <tt>rsyslog.service</tt>
@@ -36,8 +35,8 @@ ocil: |-
3635
configured for its TLS connections to remote server, run the following command:
3736
<pre>$ grep DefaultNetstreamDriverCAFile /etc/rsyslog.conf /etc/rsyslog.d/*.conf</pre>
3837
The output should include record similar to
39-
<pre>global(DefaultNetstreamDriverCAFile="/etc/pki/tls/cert.pem")</pre>
40-
where the path to the CA file (<tt>/etc/pki/tls/cert.pem</tt> in case above) must point to the correct CA certificate.
38+
<pre>global(DefaultNetstreamDriverCAFile="{{{ rsyslog_cafile }}}")</pre>
39+
where the path to the CA file (<tt>{{{ rsyslog_cafile }}}</tt> in case above) must point to the correct CA certificate.
4140
4241
warnings:
4342
- general: |-
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
echo 'global(DefaultNetstreamDriverCAFile="/etc/pki/tls/cert.pem")' >> /etc/rsyslog.conf
3+
echo 'global(DefaultNetstreamDriverCAFile="{{{ rsyslog_cafile }}}")' >> /etc/rsyslog.conf
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22
# remediation = none
33

4-
echo 'global(DefaultNetstreamDriverCAFile="/etc/pki/tls/cert.pem") *.*' >> /etc/rsyslog.conf
4+
echo 'global(DefaultNetstreamDriverCAFile="{{{ rsyslog_cafile }}}") *.*' >> /etc/rsyslog.conf

products/fedora/product.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,4 @@ platform_package_overrides:
9494
login_defs: "shadow-utils"
9595

9696
journald_conf_dir_path: /etc/systemd/journald.conf.d
97+
rsyslog_cafile: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem

products/ol10/product.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ platform_package_overrides:
4646

4747
reference_uris:
4848
cis: ''
49+
rsyslog_cafile: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem

products/rhel10/product.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,4 @@ reference_uris:
5353

5454
journald_conf_dir_path: /etc/systemd/journald.conf.d
5555
audit_watches_style: modern
56+
rsyslog_cafile: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem

ssg/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@
463463
DEFAULT_AIDE_CONF_PATH = '/etc/aide.conf'
464464
DEFAULT_AIDE_BIN_PATH = '/usr/sbin/aide'
465465
DEFAULT_AUDIT_WATCHES_STYLE = 'legacy'
466+
DEFAULT_RSYSLOG_CAFILE = '/etc/pki/tls/cert.pem'
466467
DEFAULT_FAILLOCK_PATH = '/var/run/faillock'
467468
DEFAULT_SSH_DISTRIBUTED_CONFIG = 'false'
468469
DEFAULT_PRODUCT = 'example'

ssg/products.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
DEFAULT_AIDE_CONF_PATH,
1616
DEFAULT_AIDE_BIN_PATH,
1717
DEFAULT_AUDIT_WATCHES_STYLE,
18+
DEFAULT_RSYSLOG_CAFILE,
1819
DEFAULT_SSH_DISTRIBUTED_CONFIG,
1920
DEFAULT_CHRONY_CONF_PATH,
2021
DEFAULT_CHRONY_D_PATH,
@@ -100,6 +101,9 @@ def _get_implied_properties(existing_properties):
100101
if "audit_watches_style" not in existing_properties:
101102
result["audit_watches_style"] = DEFAULT_AUDIT_WATCHES_STYLE
102103

104+
if "rsyslog_cafile" not in existing_properties:
105+
result["rsyslog_cafile"] = DEFAULT_RSYSLOG_CAFILE
106+
103107
if "sshd_distributed_config" not in existing_properties:
104108
result["sshd_distributed_config"] = DEFAULT_SSH_DISTRIBUTED_CONFIG
105109

tests/data/product_stability/alinux2.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ reference_uris:
7474
pcidss4: https://docs-prv.pcisecuritystandards.org/PCI%20DSS/Standard/PCI-DSS-v4_0.pdf
7575
stigid: https://public.cyber.mil/stigs/downloads/?_dl_facet_stigs=operating-systems%2Cunix-linux
7676
stigref: https://public.cyber.mil/stigs/srg-stig-tools/
77+
rsyslog_cafile: /etc/pki/tls/cert.pem
7778
sshd_distributed_config: 'false'
7879
sysctl_remediate_drop_in_file: 'false'
7980
type: platform

tests/data/product_stability/alinux3.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ reference_uris:
7474
pcidss4: https://docs-prv.pcisecuritystandards.org/PCI%20DSS/Standard/PCI-DSS-v4_0.pdf
7575
stigid: https://public.cyber.mil/stigs/downloads/?_dl_facet_stigs=operating-systems%2Cunix-linux
7676
stigref: https://public.cyber.mil/stigs/srg-stig-tools/
77+
rsyslog_cafile: /etc/pki/tls/cert.pem
7778
sshd_distributed_config: 'false'
7879
sysctl_remediate_drop_in_file: 'false'
7980
type: platform

0 commit comments

Comments
 (0)