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

Fix audit_rules_privileged_commands_unix2_chkpwd #12886

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
@@ -1,5 +1,7 @@
{{%- set unix2_chkpwd_binary="/usr/sbin/unix2_chkpwd" %}}
{{%- if product in ["sle15"] %}}
{{%- set perm_x="-F perm=x " %}}
{{%- set unix2_chkpwd_binary="/sbin/unix2_chkpwd" %}}
{{%- endif %}}

documentation_complete: true
Expand All @@ -13,11 +15,11 @@ description: |-
configured to use the <tt>augenrules</tt> program to read audit rules during
daemon startup (the default), add a line of the following form to a file with
suffix <tt>.rules</tt> in the directory <tt>/etc/audit/rules.d</tt>:
<pre>-a always,exit -F path=/sbin/unix2_chkpwd {{{ perm_x }}}-F auid&gt;={{{ auid }}} -F auid!=unset -F key=privileged</pre>
<pre>-a always,exit -F path={{{ unix2_chkpwd_binary }}} {{{ perm_x }}}-F auid&gt;={{{ auid }}} -F auid!=unset -F key=privileged</pre>
If the <tt>auditd</tt> daemon is configured to use the <tt>auditctl</tt>
utility to read audit rules during daemon startup, add a line of the following
form to <tt>/etc/audit/audit.rules</tt>:
<pre>-a always,exit -F path=/sbin/unix2_chkpwd {{{ perm_x }}}-F auid&gt;={{{ auid }}} -F auid!=unset -F key=privileged</pre>
<pre>-a always,exit -F path={{{ unix2_chkpwd_binary }}} {{{ perm_x }}}-F auid&gt;={{{ auid }}} -F auid!=unset -F key=privileged</pre>
rationale: |-
Misuse of privileged functions, either intentionally or unintentionally by
Expand Down Expand Up @@ -62,4 +64,5 @@ ocil: |-
template:
name: audit_rules_privileged_commands
vars:
path: /sbin/unix2_chkpwd
path: "/usr/sbin/unix2_chkpwd"
path@sle15: "/sbin/unix2_chkpwd"
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/bash
# packages = audit

echo "-a always,exit -F path=/sbin/unix2_chkpwd -F perm=x -F auid>={{{ uid_min }}} -F auid!=unset -F key=privileged" >> /etc/audit/rules.d/privileged.rules
{{%- if 'sl' in product %}}
{{%- set unix2_chkpwd_wrong_binary="/usr/sbin/unix2_chkpwd" %}}
{{%- else %}}
{{%- set unix2_chkpwd_wrong_binary="/sbin/unix2_chkpwd" %}}
{{%- endif %}}
echo "-a always,exit -F path={{{ unix2_chkpwd_wrong_binary }}} -F perm=x -F auid>={{{ uid_min }}} -F auid!=unset -F key=privileged" >> /etc/audit/rules.d/privileged.rules
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{{%- if product in ["fedora", "rhcos4", "sle12", "sle15", "slmicro5", "ubuntu2004", "ubuntu2204", "ubuntu2404"] or 'ol' in families or 'rhel' in product %}} {{%- set perm_x="-F perm=x " %}}
{{%- set unix_chkpwd_binary="/usr/sbin/unix_chkpwd" %}}
{{%- if product in ["fedora", "rhcos4", "sle12", "sle15", "slmicro5", "ubuntu2004", "ubuntu2204", "ubuntu2404"] or 'ol' in families or 'rhel' in product %}}
{{%- set perm_x="-F perm=x " %}}
{{%- set unix_chkpwd_binary="/sbin/unix_chkpwd" %}}
{{%- endif %}}

documentation_complete: true
Expand All @@ -12,11 +15,11 @@ description: |-
configured to use the <tt>augenrules</tt> program to read audit rules during
daemon startup (the default), add a line of the following form to a file with
suffix <tt>.rules</tt> in the directory <tt>/etc/audit/rules.d</tt>:
<pre>-a always,exit -F path=/usr/sbin/unix_chkpwd {{{ perm_x }}}-F auid&gt;={{{ auid }}} -F auid!=unset -F key=privileged</pre>
<pre>-a always,exit -F path={{{ unix_chkpwd_binary }}} {{{ perm_x }}}-F auid&gt;={{{ auid }}} -F auid!=unset -F key=privileged</pre>
If the <tt>auditd</tt> daemon is configured to use the <tt>auditctl</tt>
utility to read audit rules during daemon startup, add a line of the following
form to <tt>/etc/audit/audit.rules</tt>:
<pre>-a always,exit -F path=/usr/sbin/unix_chkpwd {{{ perm_x }}}-F auid&gt;={{{ auid }}} -F auid!=unset -F key=privileged</pre>
<pre>-a always,exit -F path={{{ unix_chkpwd_binary }}} {{{ perm_x }}}-F auid&gt;={{{ auid }}} -F auid!=unset -F key=privileged</pre>
rationale: |-
Misuse of privileged functions, either intentionally or unintentionally by
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/bash
# packages = audit

echo "-a always,exit -F path=/sbin/unix_chkpwd -F perm=x -F auid>={{{ uid_min }}} -F auid!=unset -F key=privileged" >> /etc/audit/rules.d/privileged.rules
{{%- if 'sl' in product %}}
{{%- set unix_chkpwd_wrong_binary="/usr/sbin/unix_chkpwd" %}}
{{%- else %}}
{{%- set unix_chkpwd_wrong_binary="/sbin/unix_chkpwd" %}}
{{%- endif %}}
echo "-a always,exit -F path={{{ unix_chkpwd_wrong_binary }}} -F perm=x -F auid>={{{ uid_min }}} -F auid!=unset -F key=privileged" >> /etc/audit/rules.d/privileged.rules
Loading