Merge pull request #22 in IAAS/cis-hardening from dev/thibault.dewailly/fix to master

* commit '1bb8c5b387673e2c069a41ca4fc793b1d4c0869b':
  Fixed replace in file function with proper substitution
  tripwire : fixed typo on postinstall helper
  fix 99.1 Apply TMOUT Variable
This commit is contained in:
Kevin Tanguy 2016-05-03 11:27:39 +02:00
commit 4d6a5e7a60
3 changed files with 2 additions and 3 deletions

View File

@ -12,7 +12,7 @@ set -e # One error, it's over
set -u # One variable unset, it's over
USER='root'
PATTERN='^TMOUT='
PATTERN='TMOUT='
VALUE='600'
FILES_TO_SEARCH='/etc/bash.bashrc /etc/profile.d/* /etc/profile'
FILE='/etc/profile.d/CIS_99.1_timeout.sh'

View File

@ -17,4 +17,3 @@ echo "Generating Local database with newly created key..."
/usr/sbin/twadmin --create-cfgfile -S /etc/tripwire/site.key /etc/tripwire/twcfg.txt # Init database with generated local key file
echo "Testing tripwire database update"
tripwire -m i # Test configuration update
~

View File

@ -138,7 +138,7 @@ replace_in_file() {
backup_file "$FILE"
debug "Replacing $SOURCE to $DESTINATION in $FILE"
SOURCE=$(sed 's@/@\\\/@g' <<< $PATTERN)
SOURCE=$(sed 's@/@\\\/@g' <<< $SOURCE)
debug "sed -i 's/$SOURCE/$DESTINATION/g' $FILE"
sed -i "s/$SOURCE/$DESTINATION/g" $FILE
FNRET=0