mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-19 00:32:34 +01:00
replace contains with grep
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
This commit is contained in:
parent
7eeb6890ff
commit
e78f1b8045
1 changed files with 3 additions and 1 deletions
|
@ -127,7 +127,9 @@ else
|
||||||
# Go over each directory in sensitive dir and see if they exist in the volumes
|
# Go over each directory in sensitive dir and see if they exist in the volumes
|
||||||
for v in $sensitive_dirs; do
|
for v in $sensitive_dirs; do
|
||||||
sensitive=0
|
sensitive=0
|
||||||
contains "$volumes" "$v" && sensitive=1
|
if echo "$volumes" | grep -e "{.*\s$v\s.*true\s}" 2>/tmp/null 1>&2; then
|
||||||
|
sensitive=1
|
||||||
|
fi
|
||||||
if [ $sensitive -eq 1 ]; then
|
if [ $sensitive -eq 1 ]; then
|
||||||
# If it's the first container, fail the test
|
# If it's the first container, fail the test
|
||||||
if [ $fail -eq 0 ]; then
|
if [ $fail -eq 0 ]; then
|
||||||
|
|
Loading…
Reference in a new issue