Fix some bugs.
This commit is contained in:
parent
81d6f39b8a
commit
6fab8a8c2d
|
@ -19,8 +19,8 @@ FILENAME1='shosts.equiv'
|
||||||
|
|
||||||
# This function will be called if the script status is on enabled / audit mode
|
# This function will be called if the script status is on enabled / audit mode
|
||||||
audit () {
|
audit () {
|
||||||
COUNT=$(find / -name "${FILENAME}" | wc -l)
|
COUNT=$(find / -xdev -name "${FILENAME}" | wc -l)
|
||||||
COUNT1=$(find / -name "${FILENAME1}" | wc -l)
|
COUNT1=$(find / -xdev -name "${FILENAME1}" | wc -l)
|
||||||
if [ "$COUNT" -ne 0 -o "$COUNT1" -ne 0 ]; then
|
if [ "$COUNT" -ne 0 -o "$COUNT1" -ne 0 ]; then
|
||||||
crit "$FILENAME or $FILENAME1 file is exist on system."
|
crit "$FILENAME or $FILENAME1 file is exist on system."
|
||||||
FNRET=1
|
FNRET=1
|
||||||
|
|
|
@ -7,9 +7,10 @@
|
||||||
#
|
#
|
||||||
# 12.10 Find SUID System Executables (Not Scored)
|
# 12.10 Find SUID System Executables (Not Scored)
|
||||||
#
|
#
|
||||||
|
# set -e # One error, it's over, for some user to audit desktop evn
|
||||||
|
|
||||||
set -e # One error, it's over
|
# One variable unset, it's over
|
||||||
set -u # One variable unset, it's over
|
set -u
|
||||||
|
|
||||||
HARDENING_LEVEL=2
|
HARDENING_LEVEL=2
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,10 @@
|
||||||
# 12.11 Find SGID System Executables (Not Scored)
|
# 12.11 Find SGID System Executables (Not Scored)
|
||||||
#
|
#
|
||||||
|
|
||||||
set -e # One error, it's over
|
#set -e # One error, it's over, for some user to audit desktop evn
|
||||||
set -u # One variable unset, it's over
|
|
||||||
|
# One variable unset, it's over
|
||||||
|
set -u
|
||||||
|
|
||||||
HARDENING_LEVEL=2
|
HARDENING_LEVEL=2
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ set -u # One variable unset, it's over
|
||||||
HARDENING_LEVEL=4
|
HARDENING_LEVEL=4
|
||||||
|
|
||||||
|
|
||||||
AUDIT_PARAMS="-a always,exit -F path=$(find / -name "ssh-keysign") -F perm=x -F auid>=1000 -F auid!=4294967295 -k privileged-ssh
|
AUDIT_PARAMS="-a always,exit -F path=$(find /usr/ -name "ssh-keysign") -F perm=x -F auid>=1000 -F auid!=4294967295 -k privileged-ssh
|
||||||
-a always,exit -F path=$(which ssh-agent 2>/dev/null) -F perm=x -F auid>=1000 -F auid!=4294967295 -k privileged-ssh"
|
-a always,exit -F path=$(which ssh-agent 2>/dev/null) -F perm=x -F auid>=1000 -F auid!=4294967295 -k privileged-ssh"
|
||||||
|
|
||||||
set -e # One error, it's over
|
set -e # One error, it's over
|
||||||
|
|
|
@ -13,13 +13,13 @@ set -u # One variable unset, it's over
|
||||||
|
|
||||||
HARDENING_LEVEL=4
|
HARDENING_LEVEL=4
|
||||||
|
|
||||||
AUDIT_PARAMS='-a always,exit -F path=$(find / -name audisp-remote.conf) -F perm=wa -k config_file_change
|
AUDIT_PARAMS='-a always,exit -F path=$(find /etc/ -name audisp-remote.conf) -F perm=wa -k config_file_change
|
||||||
-a always,exit -F path=$(find / -name auditd.conf) -F perm=wa -k config_file_change
|
-a always,exit -F path=$(find /etc/ -name auditd.conf) -F perm=wa -k config_file_change
|
||||||
-a always,exit -F dir=$(find /etc/audit/ -name rules.d) -F perm=wa -k config_file_change
|
-a always,exit -F dir=$(find /etc/audit/ -name rules.d) -F perm=wa -k config_file_change
|
||||||
-a always,exit -F path=$(find / -name grub) -F perm=wa -k config_file_change
|
-a always,exit -F path=$(find /etc/ -name grub) -F perm=wa -k config_file_change
|
||||||
-a always,exit -F path=$(find / -name fstab) -F perm=wa -k config_file_change
|
-a always,exit -F path=$(find /etc/ -name fstab) -F perm=wa -k config_file_change
|
||||||
-a always,exit -F path=$(find / -name hosts.deny) -F perm=wa -k config_file_change
|
-a always,exit -F path=$(find /etc/ -name hosts.deny) -F perm=wa -k config_file_change
|
||||||
-a always,exit -F path=$(find / -name login.defs) -F perm=wa -k config_file_change
|
-a always,exit -F path=$(find /etc/ -name login.defs) -F perm=wa -k config_file_change
|
||||||
-a always,exit -F dir=/etc/pam.d/ -F perm=wa -k config_file_change
|
-a always,exit -F dir=/etc/pam.d/ -F perm=wa -k config_file_change
|
||||||
-a always,exit -F path=/etc/profile -F perm=wa -k config_file_change
|
-a always,exit -F path=/etc/profile -F perm=wa -k config_file_change
|
||||||
-a always,exit -F dir=/etc/profile.d/ -F perm=wa -k config_file_change
|
-a always,exit -F dir=/etc/profile.d/ -F perm=wa -k config_file_change
|
||||||
|
|
Loading…
Reference in New Issue