V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m22s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m22s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -34,7 +34,8 @@ install_verification() {
|
||||
chroot_script "${TARGET}" "
|
||||
export INITRD=No
|
||||
apt-get install -y --no-install-recommends --no-install-suggests auditd 2>&1 | tee -a ${var_logfile}
|
||||
echo ExitCode of PIPESTATUS[0]: \${PIPESTATUS[0]} >> ${var_logfile}
|
||||
RC=( \${PIPESTATUS[@]} )
|
||||
echo ExitCode of PIPESTATUS[0]: \${RC[0]} >> ${var_logfile}
|
||||
"
|
||||
|
||||
rm -f "${TARGET}/etc/audit/rules.d/audit.rules"
|
||||
@@ -49,7 +50,7 @@ install_verification() {
|
||||
-b 16384
|
||||
|
||||
## This determine how long to wait in burst of events
|
||||
--backlog_wait_time 60000
|
||||
--backlog_wait_time 1024
|
||||
|
||||
## Set failure mode to syslog
|
||||
-f 1
|
||||
@@ -339,26 +340,35 @@ EOF
|
||||
|
||||
chroot_script "${TARGET}" "
|
||||
systemctl enable auditd.service 2>&1 | tee -a ${var_logfile}
|
||||
echo ExitCode of PIPESTATUS[0]: \${PIPESTATUS[0]} >> ${var_logfile}
|
||||
RC=( \${PIPESTATUS[@]} )
|
||||
echo ExitCode of PIPESTATUS[0]: \${RC[0]} >> ${var_logfile}
|
||||
"
|
||||
|
||||
### Validate and build audit rules now; fail early if syntax is wrong.
|
||||
chroot_script "${TARGET}" "
|
||||
if command -v augenrules >/dev/null 2>&1; then
|
||||
|
||||
augenrules --load 2>&1 | tee -a ${var_logfile}
|
||||
echo ExitCode of PIPESTATUS[0]: \${PIPESTATUS[0]} >> ${var_logfile}
|
||||
RC=( \${PIPESTATUS[@]} )
|
||||
echo ExitCode of PIPESTATUS[0]: \${RC[0]} >> ${var_logfile}
|
||||
|
||||
else
|
||||
|
||||
### Fallback: build consolidated rules file without loading into the kernel.
|
||||
if command -v bash >/dev/null 2>&1; then
|
||||
|
||||
bash -lc 'cat /etc/audit/rules.d/*.rules > /etc/audit/audit.rules'
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
"
|
||||
|
||||
chroot_script "${TARGET}" "
|
||||
export INITRD=No
|
||||
apt-get install -y --no-install-recommends --no-install-suggests aide aide-common 2>&1 | tee -a ${var_logfile}
|
||||
echo ExitCode of PIPESTATUS[0]: \${PIPESTATUS[0]} >> ${var_logfile}
|
||||
RC=( \${PIPESTATUS[@]} )
|
||||
echo ExitCode of PIPESTATUS[0]: \${RC[0]} >> ${var_logfile}
|
||||
sed -i 's/Checksums = H/Checksums = sha512/' /etc/aide/aide.conf
|
||||
aideinit > /dev/null 2>> ${var_logfile}
|
||||
"
|
||||
@@ -366,7 +376,8 @@ EOF
|
||||
chroot_script "${TARGET}" "
|
||||
export INITRD=No
|
||||
apt-get install -y --no-install-recommends --no-install-suggests debsums 2>&1 | tee -a ${var_logfile}
|
||||
echo ExitCode of PIPESTATUS[0]: \${PIPESTATUS[0]} >> ${var_logfile}
|
||||
RC=( \${PIPESTATUS[@]} )
|
||||
echo ExitCode of PIPESTATUS[0]: \${RC[0]} >> ${var_logfile}
|
||||
if ! debsums -g >> ${var_logfile} 2>> ${var_logfile}; then
|
||||
printf 'Running debsums -g - encountered errors.' >> ${var_logfile}
|
||||
fi
|
||||
@@ -374,10 +385,13 @@ EOF
|
||||
|
||||
chroot_script "${TARGET}" "
|
||||
rkhunter --propupd 2>&1 | tee -a ${var_logfile}
|
||||
echo ExitCode of PIPESTATUS[0]: \${PIPESTATUS[0]} >> ${var_logfile}
|
||||
RC=( \${PIPESTATUS[@]} )
|
||||
echo ExitCode of PIPESTATUS[0]: \${RC[0]} >> ${var_logfile}
|
||||
"
|
||||
|
||||
guard_dir && return 0
|
||||
}
|
||||
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f install_verification
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
Reference in New Issue
Block a user