mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-18 16:22:33 +01:00
fix: allow combining include and exclude
Signed-off-by: wilmardo <info@wilmardenouden.nl>
This commit is contained in:
parent
c35d71f533
commit
1b37a1e6bc
1 changed files with 9 additions and 1 deletions
|
@ -144,7 +144,15 @@ main () {
|
|||
else
|
||||
for i in $(echo "$check" | sed "s/,/ /g"); do
|
||||
if command -v "$i" 2>/dev/null 1>&2; then
|
||||
"$i"
|
||||
if [ "$checkexclude" ]; then
|
||||
checkexcluded="$(echo ",$checkexclude" | sed -e 's/^/\^/g' -e 's/,/\$|/g' -e 's/$/\$/g')"
|
||||
included_checks=$(sed -ne "/$i() {/,/}/{/check/p}" functions_lib.sh | grep -vE "$checkexcluded")
|
||||
for check in $included_checks; do
|
||||
"$check"
|
||||
done
|
||||
else
|
||||
"$i"
|
||||
fi
|
||||
else
|
||||
echo "Check \"$i\" doesn't seem to exist."
|
||||
continue
|
||||
|
|
Loading…
Reference in a new issue