2020-11-27 09:22:47 +01:00
|
|
|
# shellcheck shell=bash
|
2019-02-06 15:19:14 +01:00
|
|
|
# Defines constants for CIS Debian Hardening
|
2016-04-01 09:32:17 +02:00
|
|
|
|
2020-11-23 17:10:37 +01:00
|
|
|
# run-shellcheck
|
2016-04-04 15:05:10 +02:00
|
|
|
# Script and shell commands homogeneity
|
|
|
|
export LANG=C
|
2016-04-01 09:32:17 +02:00
|
|
|
|
2016-04-04 15:05:10 +02:00
|
|
|
#### Useful Color constants settings for loglevels
|
2016-04-01 09:32:17 +02:00
|
|
|
|
|
|
|
# Reset Color (for syslog)
|
2020-12-07 14:53:10 +01:00
|
|
|
# shellcheck disable=2034
|
2016-04-01 09:32:17 +02:00
|
|
|
NC='\033[0m'
|
2020-12-07 14:53:10 +01:00
|
|
|
# shellcheck disable=2034
|
2016-04-01 16:48:31 +02:00
|
|
|
WHITE='\033[0m'
|
2016-04-01 09:32:17 +02:00
|
|
|
# Colors
|
2020-12-07 14:53:10 +01:00
|
|
|
# shellcheck disable=2034
|
2016-04-01 16:48:31 +02:00
|
|
|
RED='\033[0;31m'
|
2020-12-07 14:53:10 +01:00
|
|
|
# shellcheck disable=2034
|
2016-04-01 16:48:31 +02:00
|
|
|
GREEN='\033[0;32m'
|
2020-12-07 14:53:10 +01:00
|
|
|
# shellcheck disable=2034
|
2016-04-01 16:48:31 +02:00
|
|
|
YELLOW='\033[0;33m'
|
2020-12-07 14:53:10 +01:00
|
|
|
# shellcheck disable=2034
|
2020-12-04 14:08:01 +01:00
|
|
|
GRAY='\033[0;40m' # Gray
|
2016-04-01 09:32:17 +02:00
|
|
|
|
|
|
|
# Bold
|
2020-12-07 14:53:10 +01:00
|
|
|
# shellcheck disable=2034
|
|
|
|
BRED='\033[1;31m' # Red
|
|
|
|
# shellcheck disable=2034
|
|
|
|
BGREEN='\033[1;32m' # Green
|
|
|
|
# shellcheck disable=2034
|
2020-12-04 14:08:01 +01:00
|
|
|
BYELLOW='\033[1;33m' # Yellow
|
2020-12-07 14:53:10 +01:00
|
|
|
# shellcheck disable=2034
|
|
|
|
BWHITE='\033[1;37m' # White
|
2021-02-08 13:54:24 +01:00
|
|
|
|
|
|
|
# Debian version variables
|
|
|
|
|
|
|
|
CONTAINER_TYPE=""
|
|
|
|
IS_CONTAINER=0
|
|
|
|
|
|
|
|
if [ "$(is_running_in_container "docker")" != "" ]; then
|
|
|
|
CONTAINER_TYPE="docker"
|
|
|
|
IS_CONTAINER=1
|
|
|
|
fi
|
|
|
|
if [ "$(is_running_in_container "lxc")" != "" ]; then
|
|
|
|
CONTAINER_TYPE="lxc"
|
|
|
|
IS_CONTAINER=1
|
|
|
|
fi
|
|
|
|
if [ "$(is_running_in_container "kubepods")" != "" ]; then
|
|
|
|
# shellcheck disable=SC2034
|
|
|
|
CONTAINER_TYPE="kubepods"
|
|
|
|
# shellcheck disable=SC2034
|
|
|
|
IS_CONTAINER=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
get_distribution
|
|
|
|
|
|
|
|
get_debian_major_version
|
|
|
|
|
|
|
|
# shellcheck disable=SC2034
|
|
|
|
SMALLEST_SUPPORTED_DEBIAN_VERSION=9
|
|
|
|
# shellcheck disable=SC2034
|
|
|
|
HIGHEST_SUPPORTED_DEBIAN_VERSION=10
|