Please sign in to comment.
Improve docker-bench-security json output
Add a test object for each test performed by the script. Each object has an id N.M, a desc property describing the test, and the result. Some tests include additional information about the test e.g. "No TLS Certificate Found". That can be found in an optional details property of the test object. Also, some tests might also return a list of containers, images, users, etc. This is included in an optional items property of the test object. Instead of having all test results as top-level objects, break the test results into sections. Each section has an id + description e.g. "1" and "Host Configuration". The tests for that section are an array below that object. All of the additional json output is implemented by adding new functions startsectionjson(), endsectionjson(), starttestjson(), and resulttestjson() that take the id/desc/etc as arguments and print the proper json properties. It also required adding an "end" test to each script that calls endsectionjson(). Signed-off-by: Mark Stemm <email@example.com>
- Loading branch information...
Showing with 1,006 additions and 427 deletions.
- +1 −3 docker-bench-security.sh
- +8 −0 functions_lib.sh
- +30 −4 output_lib.sh
- +126 −65 tests/1_host_configuration.sh
- +159 −77 tests/2_docker_daemon_configuration.sh
- +169 −81 tests/3_docker_daemon_configuration_files.sh
- +91 −32 tests/4_container_images.sh
- +304 −119 tests/5_container_runtime.sh
- +23 −7 tests/6_docker_security_operations.sh
- +84 −36 tests/7_docker_swarm_configuration.sh
- +11 −3 tests/99_community_checks.sh
Oops, something went wrong.