-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check_2_3 doesnt appear to account for log-level default value #552
Comments
yeah, you're absolutley correct. if |
are you seen an situation where it doesn't work?
|
@konstruktoid Yeah, I have a test instance where it fails. I found the problem ... the result of It's the output from
docker-bench-security/functions/helper_lib.sh Line 126 in 2311026
:( Hacked up the check_2_3 function to confirm:
Results:
|
nice catch, want to send a PR? |
Could add Example:
That would be the simplest solution, but would require a refactor of all other tests that use the function. |
Found a solution that appears to work. I can submit a PR, but I'm not able to do any sort of regression testing to see if the change impacts any other tests.
It checks if the specified option exists and outputs the value of that option if it does, or an empty string if it doesn't. An empty string is the same as null in bash, so it works. |
do some basic testing and then submit a PR, and we'll go from there |
Haven't been able to get back to this, but should be able to soon. |
Thanks @spedersen-emailage, PR merged |
Pulled the latest version of master and tested; looks good! Thanks! |
CIS Docker Benchmark v1.6.0 recommendation 2.3, "Ensure the logging level is set to 'info' (Manual)," states that
log-level
should be set toinfo
.check_2_3()
accounts forlog-level
being explicitly set via command-line options-l
and--log-level
and checks the contents of several possible config files, but doesn't appear to take into account that the defaultlog-level
for Docker is alreadyinfo
.docker-bench-security/tests/2_docker_daemon_configuration.sh
Lines 46 to 81 in 2311026
Reference: https://docs.docker.com/reference/cli/dockerd/
Since this is a default value, it's not set explicitly and doesn't appear in any config files. In order for this check to be more accurate, should it assume that if no alternate value for
log-level
is found, the default is used, and the check has passed?Of course, a work-around to pass the check is to explicitly set the
log-level
toinfo
.Thoughts?
The text was updated successfully, but these errors were encountered: