mirror of
https://github.com/ovh/debian-cis.git
synced 2025-06-22 02:33:42 +02:00
Added basic Configuration files and skeleton scripts
This commit is contained in:
7
lib/common.sh
Normal file
7
lib/common.sh
Normal file
@ -0,0 +1,7 @@
|
||||
# CIS Debian 7 Hardening common functions
|
||||
|
||||
logger() {
|
||||
test -z "$SCRIPT_NAME" && SCRIPT_NAME=$(basename $0)
|
||||
logger -i -t "$SCRIPT_NAME" -p "user.info" "$(date +%Y.%m.%d-%H:%M:%S) $*"
|
||||
test -t 1 && echo "$(date +%Z-%Y.%m.%d-%H:%M:%S) $*"
|
||||
}
|
33
lib/constants.sh
Normal file
33
lib/constants.sh
Normal file
@ -0,0 +1,33 @@
|
||||
# Defines constants for CIS Debian 7 Hardening
|
||||
|
||||
#
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#### Useful Colot constants settings for loglevels
|
||||
|
||||
# Reset Color (for syslog)
|
||||
NC='\033[0m'
|
||||
|
||||
# Colors
|
||||
RED='\033[1;31m'
|
||||
GREEN='\033[1;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
|
||||
# Bold
|
||||
BRED='\033[1;31m' # Red
|
||||
BGREEN='\033[1;32m' # Green
|
||||
BYELLOW='\033[1;33m' # Yellow
|
18
lib/utils.sh
Normal file
18
lib/utils.sh
Normal file
@ -0,0 +1,18 @@
|
||||
# CIS Debian 7 Hardening Utility functions
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Return if a package is installed
|
||||
# @param $1 package name
|
||||
#
|
||||
is_installed()
|
||||
{
|
||||
PKG_NAME=$1
|
||||
if `dpkg -s $PKG_NAME 2> /dev/null | grep -q '^Status: install '` ; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user