docker / docker-bench-security

The Docker Bench for Security is a script that checks for dozens of common best-practices around deploying Docker containers in production.
Apache License 2.0
9.17k stars 1.02k forks source link

Sed error when specifying checks to include and exclude when runnning on a Mac #503

Closed gavinmporter closed 10 months ago

gavinmporter commented 2 years ago

I'm using docker-bench-security on a Mac to check images.

Using parameters that specify both checks to include and exclude results in a sed error on BSD systems. For example,

$ sh docker-bench-security.sh -c container_images -e check_4_5
sed: 1: "/container_images() {/, ...": extra characters at the end of p command

sed_bsd_p_fix.txt

This can be fixed by modifying the sed command to add an explicit semi-colon after the p, see attached patch.

konstruktoid commented 2 years ago

Hi @gavinmporter and thanks for opening this issue. Can you create an PR with that patch?