8000 Add Rule,Remediation and Test for SLES-15-030770 by yarunachalam · Pull Request #6933 · ComplianceAsCode/content · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add Rule,Remediation and Test for SLES-15-030770 #6933

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

Merged
merged 4 commits into from
May 12, 2021
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
@@ -0,0 +1,8 @@
# platform = multi_platform_sle
# reboot = true
# strategy = restrict
# complexity = low
# disruption = low

{{{ ansible_audit_augenrules_add_watch_rule(path='/var/log/wtmp', permissions='wa', key='session') }}}
{{{ ansible_audit_auditctl_add_watch_rule(path='/var/log/wtmp', permissions='wa', key='session') }}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# platform = multi_platform_sle

# Include source function library.
. /usr/share/scap-security-guide/remediation_functions

# Perform the remediation
# Perform the remediation for both possible tools: 'auditctl' and 'augenrules'
fix_audit_watch_rule "auditctl" "/var/log/wtmp" "wa" "session"
fix_audit_watch_rule "augenrules" "/var/log/wtmp" "wa" "session"
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
documentation_complete: true

prodtype: sle15

title: 'Record Attempts to Alter Process and Session Initiation Information wtmp'

description: |-
The audit system already collects process information for all
users and root. If the <tt>auditd</tt> daemon is configured to use the
<tt>augenrules</tt> program to read audit rules during daemon startup (the
default), add the following lines to a file with suffix <tt>.rules</tt> in the
directory <tt>/etc/audit/rules.d</tt> in order to watch for attempted manual
edits of files involved in storing such process information:
<pre> -w /var/log/wtmp -p wa -k session</pre>
If the <tt>auditd</tt> daemon is configured to use the <tt>auditctl</tt>
utility to read audit rules during daemon startup, add the following lines to
<tt>/etc/audit/audit.rules</tt> file in order to watch for attempted manual
edits of files involved in storing such process information:
<pre> -w /var/log/wtmp -p wa -k session</pre>

rationale: |-
Manual editing of these files may indicate nefarious activity, such
as an attacker attempting to remove evidence of an intrusion.

severity: medium

identifiers:
cce@sle15: CCE-85757-3

references:
stigid@sle15: SLES-15-030770
srg: SRG-OS-000472-GPOS-00217
disa: CCI-000172
nist: AU-12(c),AU-12.1(iv)

ocil_clause: 'Audit rule is not present'

ocil: |-
Check that the file is being audited by performing the following command:
<pre> sudo auditctl -l | grep -w '/var/log/wtmp'</pre>

template:
name: audit_rules_login_events
vars:
path: /var/log/wtmp
backends:
ansible: "off"
bash: "off"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

echo "-w /var/log/wtmp -p wa -k logins" >> /etc/audit/audit.rules
sed -i "s%^ExecStartPost=.*%ExecStartPost=-/sbin/auditctl%" /usr/lib/systemd/system/auditd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

rm -f /etc/audit/audit.rules
sed -i "s%^ExecStartPost=.*%ExecStartPost=-/sbin/auditctl%" /usr/lib/systemd/system/auditd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

echo "-w /var/log/something -p wa -k logins" >> /etc/audit/audit.rules
sed -i "s%^ExecStartPost=.*%ExecStartPost=-/sbin/auditctl%" /usr/lib/systemd/system/auditd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash


mkdir -p /etc/audit/rules.d
echo "-w /var/log/wtmp -p wa -k logins" >> /etc/audit/rules.d/login.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash


mkdir -p /etc/audit/rules.d
rm -f /etc/audit/rules.d/*
> /etc/audit/audit.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash


mkdir -p /etc/audit/rules.d
echo "-w /var/log/something -p wa -k logins" >> /etc/audit/rules.d/login.rules
1 change: 1 addition & 0 deletions sle15/profiles/stig.profile
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ selections:
- audit_rules_privileged_commands_sudoedit
- audit_rules_privileged_commands_umount
- audit_rules_session_events_utmp
- audit_rules_session_events_wtmp
- audit_rules_suid_privilege_function
- audit_rules_sysadmin_actions
- audit_rules_unsuccessful_file_modification_creat
Expand Down
0