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.18k stars 1.02k forks source link

add label filtering config #531

Closed lekpamartin closed 1 year ago

lekpamartin commented 1 year ago

Add an option to filter checked container and image by settings coma separated labels. For exemple to filter on two labels --filter label=key1 --filter label=key2=value2 You have to define -t key1,key2=value2 Thx

lekpamartin commented 1 year ago

@konstruktoid Have you had time to watch the PR?

lekpamartin commented 1 year ago

Hi,

I will push and update of the documentation.

Before it I am looking for a bug when label value contain space. For example -t maintainer=My name

Thx

konstruktoid commented 1 year ago
  It is a mistake in the help definition. The purpose is to include images/containers with defined label.

But all containers and images are included by default, or is it to test only those with the defined label?

lekpamartin commented 1 year ago

It test only images/containers with defined label

konstruktoid commented 1 year ago

@lekpamartin can you rewrite the help text? See the review.

lekpamartin commented 1 year ago

@konstruktoid I updated the doc.

konstruktoid commented 1 year ago

Seems "include from" is still present in the documentation.

-t LABEL optional Comma delimited list of labels within a container or image to include from check

lekpamartin commented 1 year ago

Sorry.

Updated

konstruktoid commented 1 year ago

Sorry.

Updated

The text should read Comma delimited list of labels within a container or image to check

konstruktoid commented 1 year ago

Thanks @lekpamartin !