mirror of
https://github.com/hardenedlinux/harbian-audit.git
synced 2025-07-31 01:24:58 +02:00
Modified 6.7~6.20 to be compatible with CentOS.
This commit is contained in:
parent
d0a730c321
commit
19b3831baf
@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# harbian audit 7/8/9 Hardening
|
||||
# harbian audit 7/8/9 or CentOS Hardening
|
||||
# Modify by: Samson-W (samson@hardenedlinux.org)
|
||||
#
|
||||
|
||||
#
|
||||
@ -16,9 +17,13 @@ HARDENING_EXCEPTION=http
|
||||
|
||||
# Based on aptitude search '~Phttpd'
|
||||
PACKAGES='nginx apache2 lighttpd micro-httpd mini-httpd yaws boa bozohttpd'
|
||||
PACKAGES_REDHAT='httpd pcp-pmda-nginx'
|
||||
|
||||
# This function will be called if the script status is on enabled / audit mode
|
||||
audit () {
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
PACKAGES=$PACKAGES_REDHAT
|
||||
fi
|
||||
for PACKAGE in $PACKAGES; do
|
||||
is_pkg_installed $PACKAGE
|
||||
if [ $FNRET = 0 ]; then
|
||||
@ -35,6 +40,9 @@ audit () {
|
||||
|
||||
# This function will be called if the script status is on enabled mode
|
||||
apply () {
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
PACKAGES=$PACKAGES_REDHAT
|
||||
fi
|
||||
for PACKAGE in $PACKAGES; do
|
||||
is_pkg_installed $PACKAGE
|
||||
if [ $FNRET = 0 ]; then
|
||||
@ -42,9 +50,13 @@ apply () {
|
||||
warn "$PACKAGE is installed! But the exception is set to true, so don't need any operate."
|
||||
else
|
||||
crit "$PACKAGE is installed, purging it"
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
yum autoremove $PACKAGE
|
||||
else
|
||||
apt-get purge $PACKAGE
|
||||
apt-get autoremove
|
||||
fi
|
||||
fi
|
||||
else
|
||||
ok "$PACKAGE is absent"
|
||||
fi
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# harbian audit 7/8/9 Hardening
|
||||
# harbian audit 7/8/9 or CentOS Hardening
|
||||
#
|
||||
|
||||
#
|
||||
@ -19,6 +19,9 @@ PACKAGES='citadel-server courier-imap cyrus-imapd-2.4 dovecot-imapd mailutils-im
|
||||
|
||||
# This function will be called if the script status is on enabled / audit mode
|
||||
audit () {
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
ok "Redhat or CentOS does not have this check, so PASS"
|
||||
else
|
||||
for PACKAGE in $PACKAGES; do
|
||||
is_pkg_installed $PACKAGE
|
||||
if [ $FNRET = 0 ]; then
|
||||
@ -31,10 +34,14 @@ audit () {
|
||||
ok "$PACKAGE is absent"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# This function will be called if the script status is on enabled mode
|
||||
apply () {
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
ok "Redhat or CentOS does not have this check, so PASS"
|
||||
else
|
||||
for PACKAGE in $PACKAGES; do
|
||||
is_pkg_installed $PACKAGE
|
||||
if [ $FNRET = 0 ]; then
|
||||
@ -49,6 +56,7 @@ apply () {
|
||||
ok "$PACKAGE is absent"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# This function will create the config file for this check with default values
|
||||
|
@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# harbian audit 7/8/9 Hardening
|
||||
# harbian audit 7/8/9 or CentOS Hardening
|
||||
# Modify by: Samson-W (samson@hardenedlinux.org)
|
||||
#
|
||||
|
||||
#
|
||||
@ -41,9 +42,13 @@ apply () {
|
||||
warn "$PACKAGE is installed! But the exception is set to true, so don't need any operate."
|
||||
else
|
||||
crit "$PACKAGE is installed, purging it"
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
yum autoremove $PACKAGE -y
|
||||
else
|
||||
apt-get purge $PACKAGE -y
|
||||
apt-get autoremove
|
||||
fi
|
||||
fi
|
||||
else
|
||||
ok "$PACKAGE is absent"
|
||||
fi
|
||||
|
@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# harbian audit 7/8/9 Hardening
|
||||
# harbian audit 7/8/9 or CentOS Hardening
|
||||
# Modify by: Samson-W (samson@hardenedlinux.org)
|
||||
#
|
||||
|
||||
#
|
||||
@ -15,9 +16,13 @@ HARDENING_LEVEL=3
|
||||
HARDENING_EXCEPTION=http
|
||||
|
||||
PACKAGES='squid3 squid'
|
||||
PACKAGES_REDHAT='squid gssproxy haproxy'
|
||||
|
||||
# This function will be called if the script status is on enabled / audit mode
|
||||
audit () {
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
PACKAGES=$PACKAGES_REDHAT
|
||||
fi
|
||||
for PACKAGE in $PACKAGES; do
|
||||
is_pkg_installed $PACKAGE
|
||||
if [ $FNRET = 0 ]; then
|
||||
@ -34,6 +39,9 @@ audit () {
|
||||
|
||||
# This function will be called if the script status is on enabled mode
|
||||
apply () {
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
PACKAGES=$PACKAGES_REDHAT
|
||||
fi
|
||||
for PACKAGE in $PACKAGES; do
|
||||
is_pkg_installed $PACKAGE
|
||||
if [ $FNRET = 0 ]; then
|
||||
@ -41,9 +49,13 @@ apply () {
|
||||
warn "$PACKAGE is installed! But the exception is set to true, so don't need any operate."
|
||||
else
|
||||
crit "$PACKAGE is installed, purging it"
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
yum autoremove $PACKAGE -y
|
||||
else
|
||||
apt-get purge $PACKAGE -y
|
||||
apt-get autoremove
|
||||
fi
|
||||
fi
|
||||
else
|
||||
ok "$PACKAGE is absent"
|
||||
fi
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# harbian audit 7/8/9 Hardening
|
||||
# harbian audit 7/8/9 or CentOS Hardening
|
||||
#
|
||||
|
||||
#
|
||||
@ -18,6 +18,9 @@ PACKAGES='snmpd'
|
||||
|
||||
# This function will be called if the script status is on enabled / audit mode
|
||||
audit () {
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
ok "Redhat or CentOS does not have this check, so PASS"
|
||||
else
|
||||
for PACKAGE in $PACKAGES; do
|
||||
is_pkg_installed $PACKAGE
|
||||
if [ $FNRET = 0 ]; then
|
||||
@ -30,10 +33,14 @@ audit () {
|
||||
ok "$PACKAGE is absent"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# This function will be called if the script status is on enabled mode
|
||||
apply () {
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
ok "Redhat or CentOS does not have this check, so PASS"
|
||||
else
|
||||
for PACKAGE in $PACKAGES; do
|
||||
is_pkg_installed $PACKAGE
|
||||
if [ $FNRET = 0 ]; then
|
||||
@ -47,6 +54,7 @@ apply () {
|
||||
ok "$PACKAGE is absent"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# This function will create the config file for this check with default values
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# harbian audit 7/8/9 Hardening
|
||||
# harbian audit 7/8/9 or CentOS Hardening
|
||||
#
|
||||
|
||||
#
|
||||
@ -21,6 +21,9 @@ RSYNC_DEFAULT_PATTERN_TO_SEARCH='RSYNC_ENABLE=true'
|
||||
|
||||
# This function will be called if the script status is on enabled / audit mode
|
||||
audit () {
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
ok "Redhat or CentOS does not have this check, so PASS"
|
||||
else
|
||||
is_pkg_installed $PACKAGE
|
||||
if [ $FNRET != 0 ]; then
|
||||
ok "$PACKAGE is not installed"
|
||||
@ -33,10 +36,14 @@ audit () {
|
||||
ok "$RSYNC_DEFAULT_PATTERN found in $RSYNC_DEFAULT_FILE"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# This function will be called if the script status is on enabled mode
|
||||
apply () {
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
ok "Redhat or CentOS does not have this check, so PASS"
|
||||
else
|
||||
is_pkg_installed $PACKAGE
|
||||
if [ $FNRET != 0 ]; then
|
||||
ok "$PACKAGE is not installed"
|
||||
@ -51,6 +58,7 @@ apply () {
|
||||
ok "$RSYNC_DEFAULT_PATTERN found in $RSYNC_DEFAULT_FILE"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# This function will check config parameters required
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#
|
||||
# harbian audit 7/8/9 Hardening
|
||||
#
|
||||
# todo test for centos
|
||||
|
||||
#
|
||||
# 6.17 Ensure virul scan Server is enabled (Scored)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#
|
||||
# harbian audit 9 Hardening
|
||||
#
|
||||
# todo test for centos
|
||||
|
||||
#
|
||||
# 6.18 Ensure virul scan Server update is enabled (Scored)
|
||||
|
@ -1,11 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# harbian audit 7/8/9 Hardening
|
||||
#
|
||||
# harbian audit 7/8/9 or CentOS Hardening
|
||||
# todo base redhat7 v2r3 of STIG
|
||||
|
||||
#
|
||||
# 6.5 Configure Network Time Protocol (NTP) (Scored)
|
||||
# 6.19 Configure Network Time Protocol (NTP) (Scored)
|
||||
# Modify Author : Samson wen, Samson <sccxboy@gmail.com>
|
||||
#
|
||||
|
||||
|
@ -23,6 +23,9 @@ NTP_POOL_CFG='pool 2.debian.pool.ntp.org iburst'
|
||||
|
||||
# This function will be called if the script status is on enabled / audit mode
|
||||
audit () {
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
ok "Redhat or CentOS does not have this check, so PASS"
|
||||
else
|
||||
is_pkg_installed $ANALOGONS_PKG
|
||||
if [ $FNRET = 0 ]; then
|
||||
ok "Analogons pagkage $ANALOGONS_PKG is installed. So pass check."
|
||||
@ -40,10 +43,14 @@ audit () {
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# This function will be called if the script status is on enabled mode
|
||||
apply () {
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
ok "Redhat or CentOS does not have this check, so PASS"
|
||||
else
|
||||
is_pkg_installed $ANALOGONS_PKG
|
||||
if [ $FNRET = 0 ]; then
|
||||
ok "Analogons pagkage $ANALOGONS_PKG is installed. So pass check."
|
||||
@ -66,6 +73,7 @@ apply () {
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# This function will check config parameters required
|
||||
|
@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# harbian audit 7/8/9 Hardening
|
||||
# harbian audit 7/8/9 or CentOS Hardening
|
||||
# Modify by: Samson-W (samson@hardenedlinux.org)
|
||||
#
|
||||
|
||||
#
|
||||
@ -18,6 +19,9 @@ PACKAGES='rpcbind nfs-kernel-server'
|
||||
|
||||
# This function will be called if the script status is on enabled / audit mode
|
||||
audit () {
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
ok "Redhat or CentOS does not have this check, so PASS"
|
||||
else
|
||||
for PACKAGE in $PACKAGES; do
|
||||
is_pkg_installed $PACKAGE
|
||||
if [ $FNRET = 0 ]; then
|
||||
@ -30,10 +34,14 @@ audit () {
|
||||
ok "$PACKAGE is absent"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# This function will be called if the script status is on enabled mode
|
||||
apply () {
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
ok "Redhat or CentOS does not have this check, so PASS"
|
||||
else
|
||||
for PACKAGE in $PACKAGES; do
|
||||
is_pkg_installed $PACKAGE
|
||||
if [ $FNRET = 0 ]; then
|
||||
@ -48,6 +56,7 @@ apply () {
|
||||
ok "$PACKAGE is absent"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# This function will create the config file for this check with default values
|
||||
|
@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# harbian audit 7/8/9 Hardening
|
||||
# harbian audit 7/8/9 or CentOS Hardening
|
||||
# Modify by: Samson-W (samson@hardenedlinux.org)
|
||||
#
|
||||
|
||||
#
|
||||
@ -15,9 +16,13 @@ HARDENING_LEVEL=3
|
||||
HARDENING_EXCEPTION=dns
|
||||
|
||||
PACKAGES='bind9 unbound'
|
||||
PACKAGES_REDHAT='bind unbound'
|
||||
|
||||
# This function will be called if the script status is on enabled / audit mode
|
||||
audit () {
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
PACKAGES=$PACKAGES_REDHAT
|
||||
fi
|
||||
for PACKAGE in $PACKAGES; do
|
||||
is_pkg_installed $PACKAGE
|
||||
if [ $FNRET = 0 ]; then
|
||||
@ -34,6 +39,9 @@ audit () {
|
||||
|
||||
# This function will be called if the script status is on enabled mode
|
||||
apply () {
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
PACKAGES=$PACKAGES_REDHAT
|
||||
fi
|
||||
for PACKAGE in $PACKAGES; do
|
||||
is_pkg_installed $PACKAGE
|
||||
if [ $FNRET = 0 ]; then
|
||||
@ -41,9 +49,13 @@ apply () {
|
||||
warn "$PACKAGE is installed! But the exception is set to true, so don't need any operate."
|
||||
else
|
||||
crit "$PACKAGE is installed, purging it"
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
yum autoremove $PACKAGE -y
|
||||
else
|
||||
apt-get purge $PACKAGE -y
|
||||
apt-get autoremove
|
||||
fi
|
||||
fi
|
||||
else
|
||||
ok "$PACKAGE is absent"
|
||||
fi
|
||||
|
@ -51,7 +51,7 @@ apply () {
|
||||
else
|
||||
crit "$PACKAGE is installed, purging it"
|
||||
if [ $OS_RELEASE -eq 2 ]; then
|
||||
yum remove $PACKAGE -y
|
||||
yum autoremove $PACKAGE -y
|
||||
else
|
||||
apt-get purge $PACKAGE -y
|
||||
apt-get autoremove
|
||||
|
Loading…
x
Reference in New Issue
Block a user