mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-18 16:22:33 +01:00
Merge pull request #40 from liron-l/master
Fix CIS 5.8 - Reverse container port and reduce privileged port to 1024
This commit is contained in:
commit
edf0646330
1 changed files with 3 additions and 2 deletions
|
@ -201,11 +201,12 @@ else
|
|||
|
||||
fail=0
|
||||
for c in $containers; do
|
||||
ports=$(docker port "$c" | awk '{print $1}' | cut -d '/' -f1)
|
||||
# Port format is private port -> ip: public port
|
||||
ports=$(docker port "$c" | awk '{print $0}' | cut -d ':' -f2)
|
||||
|
||||
# iterate through port range (line delimited)
|
||||
for port in $ports; do
|
||||
if [ ! -z "$port" ] && [ "0$port" -lt 1025 ]; then
|
||||
if [ ! -z "$port" ] && [ "0$port" -lt 1024 ]; then
|
||||
# If it's the first container, fail the test
|
||||
if [ $fail -eq 0 ]; then
|
||||
warn "$check_5_8"
|
||||
|
|
Loading…
Reference in a new issue