mirror of
https://github.com/ovh/debian-cis.git
synced 2025-06-22 18:53:42 +02:00
IMP: add multiple Improvements
* add new kernel module detection (enable & listing) with detection of monolithic kernel * change way to detect if file system type is disabled * add global IS_CONTAINER variable * disable test for 3.4.x to be consistent with others * add cli options to override configuration loglevel
This commit is contained in:
@ -113,11 +113,36 @@ sudo_wrapper() {
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# detect if container based on cgroup detection
|
||||
#
|
||||
is_running_in_container() {
|
||||
awk -F/ '$2 == "'"$1"'"' /proc/self/cgroup
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
#
|
||||
# Math functions
|
||||
#
|
||||
|
||||
function div() {
|
||||
div() {
|
||||
local _d=${3:-2}
|
||||
local _n=0000000000
|
||||
_n=${_n:0:$_d}
|
||||
|
Reference in New Issue
Block a user