mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-31 14:22:33 +01:00
added cgroup_enable=memory and swapaccount=1 to check for memory enforcement using cgroups
Signed-off-by: Salman Baset <sabaset@us.ibm.com>
This commit is contained in:
parent
3571e2738e
commit
7fbec23d14
1 changed files with 21 additions and 0 deletions
|
@ -271,3 +271,24 @@ else
|
||||||
info "$check_1_18"
|
info "$check_1_18"
|
||||||
info " * File not found"
|
info " * File not found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# 1.19
|
||||||
|
check_1_19="1.19 (extra) - Check cgroup limit for memory and swap"
|
||||||
|
file="/proc/cmdline"
|
||||||
|
if [ -f "$file" ]; then
|
||||||
|
swaplimit=`cat $file | grep "swapaccount=1"`
|
||||||
|
s_ret=$?
|
||||||
|
cgroup_mem=`cat $file | grep "cgroup_enable=memory"`
|
||||||
|
c_ret=$?
|
||||||
|
|
||||||
|
if [ $s_ret -eq 0 ] && [ $c_ret -eq 0 ]; then
|
||||||
|
pass "$check_1_19"
|
||||||
|
else
|
||||||
|
warn "$check_1_19"
|
||||||
|
info " * swapaccount=1 or cgroup_enable=memory not present in /etc/default/grub"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
info "$check_1_19"
|
||||||
|
info " * File not found"
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue