mirror of
https://github.com/ovh/debian-cis.git
synced 2024-11-22 21:47:02 +01:00
65f92a7556
renamed: bin/hardening/8.2.2_enable_syslog-ng.sh -> bin/hardening/4.2.2.1_enable_syslog-ng.sh renamed: bin/hardening/8.2.3_configure_syslog-ng.sh -> bin/hardening/4.2.2.2_configure_syslog-ng.sh new file: bin/hardening/4.2.2.3_syslog_ng_logfiles_perm.sh renamed: bin/hardening/8.2.5_syslog-ng_remote_host.sh -> bin/hardening/4.2.2.4_syslog-ng_remote_host.sh renamed: bin/hardening/8.2.6_remote_syslog-ng_acl.sh -> bin/hardening/4.2.2.5_remote_syslog-ng_acl.sh renamed: tests/hardening/8.2.6_remote_syslog-ng_acl.sh -> tests/hardening/4.2.2.1_enable_syslog-ng.sh renamed: tests/hardening/8.2.3_configure_syslog-ng.sh -> tests/hardening/4.2.2.2_configure_syslog-ng.sh renamed: tests/hardening/8.2.2_enable_syslog-ng.sh -> tests/hardening/4.2.2.3_syslog_ng_logfiles_perm.sh renamed: tests/hardening/8.2.5_syslog-ng_remote_host.sh -> tests/hardening/4.2.2.4_syslog-ng_remote_host.sh new file: tests/hardening/4.2.2.5_remote_syslog-ng_acl.sh
47 lines
1.4 KiB
Bash
47 lines
1.4 KiB
Bash
# run-shellcheck
|
|
test_audit() {
|
|
|
|
describe Running on blank host
|
|
register_test retvalshouldbe 1
|
|
# shellcheck disable=2154
|
|
run blank /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
|
|
|
cp -a /etc/syslog-ng/syslog-ng.conf /tmp/syslog-ng.conf.bak
|
|
|
|
echo "destination mySyslog tcp (\"syslog.example.tld\")" >> /etc/syslog-ng/syslog-ng.conf
|
|
grep syslog.example.tld /etc/syslog-ng/syslog-ng.conf
|
|
|
|
describe Checking one line conf
|
|
register_test retvalshouldbe 0
|
|
run oneline /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
|
|
|
|
|
cp -a /tmp/syslog-ng.conf.bak /etc/syslog-ng/syslog-ng.conf
|
|
cat >> /etc/syslog-ng/syslog-ng.conf <<EOF
|
|
destination mySyslog {
|
|
tcp ("syslog.example.tld"),
|
|
port(1234),
|
|
EOF
|
|
|
|
describe Checking mutliline conf
|
|
register_test retvalshouldbe 0
|
|
run multiline /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
|
|
|
mv /tmp/syslog-ng.conf.bak /etc/syslog-ng/syslog-ng.conf
|
|
|
|
#echo "#Sample conf" >/etc/syslog-ng/conf.d/1_tcp_destination
|
|
echo "destination mySyslog tcp (\"syslog.example.tld\")" >> /etc/syslog-ng/conf.d/1_tcp_destination
|
|
cat /etc/syslog-ng/conf.d/1_tcp_destination
|
|
|
|
|
|
describe Checking file in subdirectory
|
|
register_test retvalshouldbe 0
|
|
run subfile /opt/debian-cis/bin/hardening/"${script}".sh --audit-all
|
|
|
|
|
|
|
|
# Cleanup
|
|
rm /etc/syslog-ng/conf.d/1_tcp_destination
|
|
|
|
}
|