mirror of
https://github.com/ovh/debian-cis.git
synced 2024-11-25 23:11:24 +01:00
CHORE: replace ==
with =
that is bash syntax
This commit is contained in:
parent
41ccd5655a
commit
d05ffaf9d5
@ -33,7 +33,7 @@ audit () {
|
|||||||
if [ "$OWNER" != "$USER" ]; then
|
if [ "$OWNER" != "$USER" ]; then
|
||||||
EXCEP_FOUND=0
|
EXCEP_FOUND=0
|
||||||
for excep in $EXCEPTIONS; do
|
for excep in $EXCEPTIONS; do
|
||||||
if [ "$DIR:$USER:$OWNER" == "$excep" ]; then
|
if [ "$DIR:$USER:$OWNER" = "$excep" ]; then
|
||||||
ok "The home directory ($DIR) of user $USER is owned by $OWNER but is part of exceptions ($DIR:$USER:$OWNER)."
|
ok "The home directory ($DIR) of user $USER is owned by $OWNER but is part of exceptions ($DIR:$USER:$OWNER)."
|
||||||
EXCEP_FOUND=1
|
EXCEP_FOUND=1
|
||||||
break
|
break
|
||||||
|
@ -22,12 +22,12 @@ audit () {
|
|||||||
FILES="$SYSLOG_BASEDIR/syslog-ng.conf $(find $SYSLOG_BASEDIR/conf.d/)"
|
FILES="$SYSLOG_BASEDIR/syslog-ng.conf $(find $SYSLOG_BASEDIR/conf.d/)"
|
||||||
for FILE in $FILES; do
|
for FILE in $FILES; do
|
||||||
does_pattern_exist_in_file_multiline "$FILE" "$PATTERN"
|
does_pattern_exist_in_file_multiline "$FILE" "$PATTERN"
|
||||||
if [ $FNRET == 0 ]; then
|
if [ $FNRET = 0 ]; then
|
||||||
FOUND=1
|
FOUND=1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $FOUND == 1 ]; then
|
if [ $FOUND = 1 ]; then
|
||||||
ok "$PATTERN is present in $FILES"
|
ok "$PATTERN is present in $FILES"
|
||||||
else
|
else
|
||||||
crit "$PATTERN is not present in $FILES"
|
crit "$PATTERN is not present in $FILES"
|
||||||
@ -40,11 +40,11 @@ apply () {
|
|||||||
FILES="$SYSLOG_BASEDIR/syslog-ng.conf $(find $SYSLOG_BASEDIR/conf.d/ -type f)"
|
FILES="$SYSLOG_BASEDIR/syslog-ng.conf $(find $SYSLOG_BASEDIR/conf.d/ -type f)"
|
||||||
for FILE in $FILES; do
|
for FILE in $FILES; do
|
||||||
does_pattern_exist_in_file_multiline "$FILE" "$PATTERN"
|
does_pattern_exist_in_file_multiline "$FILE" "$PATTERN"
|
||||||
if [ $FNRET == 0 ]; then
|
if [ $FNRET = 0 ]; then
|
||||||
FOUND=1
|
FOUND=1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ $FOUND == 1 ]; then
|
if [ $FOUND = 1 ]; then
|
||||||
ok "$PATTERN is present in $FILES"
|
ok "$PATTERN is present in $FILES"
|
||||||
else
|
else
|
||||||
crit "$PATTERN is not present in $FILES, please set a remote host to send your logs"
|
crit "$PATTERN is not present in $FILES, please set a remote host to send your logs"
|
||||||
|
@ -25,11 +25,11 @@ audit () {
|
|||||||
FOUND=0
|
FOUND=0
|
||||||
for FILE in $FILES; do
|
for FILE in $FILES; do
|
||||||
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
does_pattern_exist_in_file "$FILE" "$PATTERN"
|
||||||
if [ "$FNRET" == 0 ]; then
|
if [ "$FNRET" = 0 ]; then
|
||||||
FOUND=1
|
FOUND=1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ $FOUND == 1 ]; then
|
if [ $FOUND = 1 ]; then
|
||||||
ok "$PATTERN is present in $FILES"
|
ok "$PATTERN is present in $FILES"
|
||||||
else
|
else
|
||||||
crit "$PATTERN is not present in $FILES"
|
crit "$PATTERN is not present in $FILES"
|
||||||
|
@ -36,7 +36,7 @@ audit () {
|
|||||||
# previous line will capture actual policy
|
# previous line will capture actual policy
|
||||||
if [[ $ipt =~ $regex ]]; then
|
if [[ $ipt =~ $regex ]]; then
|
||||||
actual_policy=${BASH_REMATCH[1]}
|
actual_policy=${BASH_REMATCH[1]}
|
||||||
if [[ $actual_policy == "$FW_POLICY" ]]; then
|
if [[ $actual_policy = "$FW_POLICY" ]]; then
|
||||||
ok "Policy correctly set to $FW_POLICY for chain $chain"
|
ok "Policy correctly set to $FW_POLICY for chain $chain"
|
||||||
else
|
else
|
||||||
crit "Policy set to $actual_policy for chain $chain, should be ${FW_POLICY}."
|
crit "Policy set to $actual_policy for chain $chain, should be ${FW_POLICY}."
|
||||||
|
Loading…
Reference in New Issue
Block a user