Skip to content

Commit

Permalink
Ensure code consistency by using aide_conf_path var
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmcanonical committed Jun 14, 2024
1 parent 1956744 commit b846594
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ vuldiscussion: |-
checktext: |-
Check that AIDE is properly configured to protect the integrity of the audit tools with the following command:
$ sudo cat /etc/aide.conf | grep /usr/sbin/au
$ sudo cat {{{ aide_conf_path }}} | grep /usr/sbin/au
/usr/sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512
/usr/sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512
Expand All @@ -39,7 +39,7 @@ checktext: |-
If any of the audit tools listed above do not have a corresponding line, ask the SA to indicate what cryptographic mechanisms are being used to protect the integrity of the audit tools. If there is no evidence of integrity protection, this is a finding.
fixtext: |-
Add or update the following lines to "/etc/aide.conf", to protect the integrity of the audit tools.
Add or update the following lines to {{{ aide_conf_path }}}, to protect the integrity of the audit tools.
/usr/sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512
/usr/sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ ocil: |-
If one or more lines are missing, this is a finding.
fixtext: |-
Add or update the following lines to "/etc/aide.conf", to protect the integrity of the audit tools.
Add or update the following lines to {{{ aide_conf_path }}}, to protect the integrity of the audit tools.
<pre>
{{{ aide_files() }}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_ubuntu
# packages = aide

aide --init


declare -a bins
bins=('/usr/sbin/auditctl' '/usr/sbin/auditd' '/usr/sbin/augenrules' '/usr/sbin/aureport' '/usr/sbin/ausearch' '/usr/sbin/autrace' '/usr/sbin/rsyslogd')
bins=('/usr/sbin/auditctl' '/usr/sbin/auditd' '/usr/sbin/augenrules' '/usr/sbin/aureport' '/usr/sbin/ausearch' '/usr/sbin/autrace' '/usr/sbin/rsyslogd' '/usr/sbin/audispd')

for theFile in "${bins[@]}"
do
echo "$theFile p+i+n+u+g+s+b+acl+xattrs+sha512" >> /etc/aide.conf
echo "$theFile p+i+n+u+g+s+b+acl+xattrs+sha512" >> {{{ aide_conf_path }}}
done
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_ubuntu
# packages = aide

declare -a bins
bins=('/usr/sbin/auditctl' '/usr/sbin/auditd' '/usr/sbin/augenrules' '/usr/sbin/aureport' '/usr/sbin/ausearch' '/usr/sbin/autrace' '/usr/sbin/rsyslogd')
bins=('/usr/sbin/auditctl' '/usr/sbin/auditd' '/usr/sbin/augenrules' '/usr/sbin/aureport' '/usr/sbin/ausearch' '/usr/sbin/autrace' '/usr/sbin/rsyslogd' '/usr/sbin/audispd')

for theFile in "${bins[@]}"
do
echo "$theFile p+i+n+u+g+s+b+acl+selinux+xattrs+sha512" >> /etc/aide.conf
echo "$theFile p+i+n+u+g+s+b+acl+selinux+xattrs+sha512" >> {{{ aide_conf_path }}}
done
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_ubuntu
# packages = aide

declare -a bins
bins=('/usr/sbin/auditctl' '/usr/sbin/auditd' '/usr/sbin/augenrules' '/usr/sbin/aureport' '/usr/sbin/ausearch' '/usr/sbin/autrace' '/usr/sbin/rsyslogd')
bins=('/usr/sbin/auditctl' '/usr/sbin/auditd' '/usr/sbin/augenrules' '/usr/sbin/aureport' '/usr/sbin/ausearch' '/usr/sbin/autrace' '/usr/sbin/rsyslogd' '/usr/sbin/audispd')

for theFile in "${bins[@]}"
do
echo "$theFile p+i+n+u+g+s+b+acl+selinux+xattrs+sha5122" >> /etc/aide.conf
echo "$theFile p+i+n+u+g+s+b+acl+selinux+xattrs+sha5122" >> {{{ aide_conf_path }}}
done
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel
# platform = multi_platform_fedora,multi_platform_ol,multi_platform_rhel,multi_platform_ubuntu
# packages = aide

aide --init

declare -a bins
bins=('/usr/sbin/auditctl' '/usr/sbin/auditd' '/usr/sbin/augenrules' '/usr/sbin/aureport' '/usr/sbin/ausearch' '/usr/sbin/autrace' '/usr/sbin/rsyslogd')
bins=('/usr/sbin/auditctl' '/usr/sbin/auditd' '/usr/sbin/augenrules' '/usr/sbin/aureport' '/usr/sbin/ausearch' '/usr/sbin/autrace' '/usr/sbin/rsyslogd' '/usr/sbin/audispd')

for theFile in "${bins[@]}"
do
echo sed -i "s#^.*${theFile}.*##g" /etc/aide.conf
echo sed -i "s#^.*${theFile}.*##g" {{{ aide_conf_path }}}
done

0 comments on commit b846594

Please sign in to comment.