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

Unify the RHEL approach for rule file_permissions_var_log_audit #9129

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ else
FILE="/var/log/audit/audit.log"
fi

{{% if product not in ["ol8", "rhel8"] %}}
{{% if product not in ["ol8"] and "rhel" not in product %}}
if LC_ALL=C grep -m 1 -q ^log_group /etc/audit/auditd.conf; then
GROUP=$(awk -F "=" '/log_group/ {print $2}' /etc/audit/auditd.conf | tr -d ' ')
if ! [ "${GROUP}" == 'root' ] ; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<definition class="compliance" id="file_permissions_var_log_audit" version="2">
{{{ oval_metadata("Checks for correct permissions for all audit log files.") }}}
<criteria operator="OR">
{{% if product not in ["ol8", "rhel8"] %}}
{{% if product not in ["ol8"] and "rhel" not in product %}}
<criteria operator="AND" comment="log_file set">
<extend_definition comment="log_file set in auditd.conf" definition_ref="auditd_conf_log_file_not_set" negate="true" />
<criteria operator="AND" comment="log_group in auditd.conf is not root">
Expand Down Expand Up @@ -40,7 +40,7 @@
<filter action="include">state_not_mode_0600</filter>
</unix:file_object>

{{% if product in ["ol8", "rhel8"] %}}
{{% if product in ["ol8"] or "rhel" in product %}}
<unix:file_test check="all" check_existence="at_least_one_exists"
comment="default audit log files mode 0600"
id="test_file_permissions_default_audit_log" version="1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ prodtype: fedora,ol7,ol8,rhcos4,rhel7,rhel8,rhel9,rhv4,sle15,ubuntu2004
title: 'System Audit Logs Must Have Mode 0640 or Less Permissive'

description: |-
{{% if product in ["ol8", "rhel8"] %}}
{{% if product in ["ol8"] or "rhel" in product %}}
Determine where the audit logs are stored with the following command:
<pre>$ sudo grep -iw log_file /etc/audit/auditd.conf
log_file = /var/log/audit/audit.log</pre>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# platform = multi_platform_ol,multi_platform_rhel
# packages = audit

source common_0600.sh

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# platform = multi_platform_ol,multi_platform_rhel
# packages = audit

source common_0600.sh

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# platform = multi_platform_ol,multi_platform_rhel
# packages = audit

source common_0600.sh

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# platform = multi_platform_ol,multi_platform_rhel
# packages = audit

source common_0600.sh

Expand Down