mirror of
https://github.com/ovh/debian-cis.git
synced 2024-11-22 13:37:02 +01:00
parent
334d743125
commit
9a2e3a0e0d
@ -31,7 +31,7 @@ audit() {
|
|||||||
debug "$FILE_SEARCHED is a directory"
|
debug "$FILE_SEARCHED is a directory"
|
||||||
# shellcheck disable=2044
|
# shellcheck disable=2044
|
||||||
for file_in_dir in $(find "$FILE_SEARCHED" -type f); do
|
for file_in_dir in $(find "$FILE_SEARCHED" -type f); do
|
||||||
does_pattern_exist_in_file "$file_in_dir" "^$PATTERN"
|
does_pattern_exist_in_file "$file_in_dir" "$PATTERN"
|
||||||
if [ "$FNRET" != 0 ]; then
|
if [ "$FNRET" != 0 ]; then
|
||||||
debug "$PATTERN is not present in $FILE_SEARCHED/$file_in_dir"
|
debug "$PATTERN is not present in $FILE_SEARCHED/$file_in_dir"
|
||||||
else
|
else
|
||||||
@ -41,7 +41,7 @@ audit() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
does_pattern_exist_in_file "$FILE_SEARCHED" "^$PATTERN"
|
does_pattern_exist_in_file "$FILE_SEARCHED" "$PATTERN"
|
||||||
if [ "$FNRET" != 0 ]; then
|
if [ "$FNRET" != 0 ]; then
|
||||||
debug "$PATTERN is not present in $FILE_SEARCHED"
|
debug "$PATTERN is not present in $FILE_SEARCHED"
|
||||||
else
|
else
|
||||||
@ -64,7 +64,7 @@ apply() {
|
|||||||
debug "$FILE_SEARCHED is a directory"
|
debug "$FILE_SEARCHED is a directory"
|
||||||
# shellcheck disable=2044
|
# shellcheck disable=2044
|
||||||
for file_in_dir in $(find "$FILE_SEARCHED" -type f); do
|
for file_in_dir in $(find "$FILE_SEARCHED" -type f); do
|
||||||
does_pattern_exist_in_file "$FILE_SEARCHED/$file_in_dir" "^$PATTERN"
|
does_pattern_exist_in_file "$FILE_SEARCHED/$file_in_dir" "$PATTERN"
|
||||||
if [ "$FNRET" != 0 ]; then
|
if [ "$FNRET" != 0 ]; then
|
||||||
debug "$PATTERN is not present in $FILE_SEARCHED/$file_in_dir"
|
debug "$PATTERN is not present in $FILE_SEARCHED/$file_in_dir"
|
||||||
else
|
else
|
||||||
@ -74,7 +74,7 @@ apply() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
does_pattern_exist_in_file "$FILE_SEARCHED" "^$PATTERN"
|
does_pattern_exist_in_file "$FILE_SEARCHED" "$PATTERN"
|
||||||
if [ "$FNRET" != 0 ]; then
|
if [ "$FNRET" != 0 ]; then
|
||||||
debug "$PATTERN is not present in $FILE_SEARCHED"
|
debug "$PATTERN is not present in $FILE_SEARCHED"
|
||||||
else
|
else
|
||||||
@ -87,8 +87,7 @@ apply() {
|
|||||||
warn "$PATTERN is not present in $FILES_TO_SEARCH"
|
warn "$PATTERN is not present in $FILES_TO_SEARCH"
|
||||||
touch "$FILE"
|
touch "$FILE"
|
||||||
chmod 644 "$FILE"
|
chmod 644 "$FILE"
|
||||||
add_end_of_file "$FILE" "$PATTERN$VALUE"
|
add_end_of_file "$FILE" "readonly $PATTERN$VALUE"
|
||||||
add_end_of_file "$FILE" "readonly TMOUT"
|
|
||||||
add_end_of_file "$FILE" "export TMOUT"
|
add_end_of_file "$FILE" "export TMOUT"
|
||||||
else
|
else
|
||||||
ok "$PATTERN is present in $FILES_TO_SEARCH"
|
ok "$PATTERN is present in $FILES_TO_SEARCH"
|
||||||
|
Loading…
Reference in New Issue
Block a user