|
139 | 139 |
|
140 | 140 | # 3.9 |
141 | 141 | check_3_9="3.9 - Verify that TLS CA certificate file ownership is set to root:root" |
142 | | -if get_docker_configuration_file_args 'tlscacert' 2>/dev/null 1>&2; then |
| 142 | +if ! [ -z $(get_docker_configuration_file_args 'tlscacert') ]; then |
143 | 143 | tlscacert=$(get_docker_configuration_file_args 'tlscacert') |
144 | 144 | else |
145 | 145 | tlscacert=$(get_docker_effective_command_line_args '--tlscacert' | sed -n 's/.*tlscacert=\([^s]\)/\1/p' | sed 's/--/ --/g' | cut -d " " -f 1) |
|
158 | 158 |
|
159 | 159 | # 3.10 |
160 | 160 | check_3_10="3.10 - Verify that TLS CA certificate file permissions are set to 444 or more restrictive" |
161 | | -if get_docker_configuration_file_args 'tlscacert' 2>/dev/null 1>&2; then |
| 161 | +if ! [ -z $(get_docker_configuration_file_args 'tlscacert') ]; then |
162 | 162 | tlscacert=$(get_docker_configuration_file_args 'tlscacert') |
163 | 163 | else |
164 | 164 | tlscacert=$(get_docker_effective_command_line_args '--tlscacert' | sed -n 's/.*tlscacert=\([^s]\)/\1/p' | sed 's/--/ --/g' | cut -d " " -f 1) |
|
177 | 177 |
|
178 | 178 | # 3.11 |
179 | 179 | check_3_11="3.11 - Verify that Docker server certificate file ownership is set to root:root" |
180 | | -if get_docker_configuration_file_args 'tlscert' 2>/dev/null 1>&2; then |
| 180 | +if ! [ -z $(get_docker_configuration_file_args 'tlscert') ]; then |
181 | 181 | tlscert=$(get_docker_configuration_file_args 'tlscert') |
182 | 182 | else |
183 | 183 | tlscert=$(get_docker_effective_command_line_args '--tlscert' | sed -n 's/.*tlscert=\([^s]\)/\1/p' | sed 's/--/ --/g' | cut -d " " -f 1) |
|
196 | 196 |
|
197 | 197 | # 3.12 |
198 | 198 | check_3_12="3.12 - Verify that Docker server certificate file permissions are set to 444 or more restrictive" |
199 | | -if get_docker_configuration_file_args 'tlscert' 2>/dev/null 1>&2; then |
| 199 | +if ! [ -z $(get_docker_configuration_file_args 'tlscert') ]; then |
200 | 200 | tlscert=$(get_docker_configuration_file_args 'tlscert') |
201 | 201 | else |
202 | 202 | tlscert=$(get_docker_effective_command_line_args '--tlscert' | sed -n 's/.*tlscert=\([^s]\)/\1/p' | sed 's/--/ --/g' | cut -d " " -f 1) |
|
215 | 215 |
|
216 | 216 | # 3.13 |
217 | 217 | check_3_13="3.13 - Verify that Docker server key file ownership is set to root:root" |
218 | | -if get_docker_configuration_file_args 'tlskey' 2>/dev/null 1>&2; then |
| 218 | +if ! [ -z $(get_docker_configuration_file_args 'tlskey') ]; then |
219 | 219 | tlskey=$(get_docker_configuration_file_args 'tlskey') |
220 | 220 | else |
221 | 221 | tlskey=$(get_docker_effective_command_line_args '--tlskey' | sed -n 's/.*tlskey=\([^s]\)/\1/p' | sed 's/--/ --/g' | cut -d " " -f 1) |
|
234 | 234 |
|
235 | 235 | # 3.14 |
236 | 236 | check_3_14="3.14 - Verify that Docker server key file permissions are set to 400 or more restrictive" |
237 | | -if get_docker_configuration_file_args 'tlskey' 2>/dev/null 1>&2; then |
| 237 | +if ! [ -z $(get_docker_configuration_file_args 'tlskey') ]; then |
238 | 238 | tlskey=$(get_docker_configuration_file_args 'tlskey') |
239 | 239 | else |
240 | 240 | tlskey=$(get_docker_effective_command_line_args '--tlskey' | sed -n 's/.*tlskey=\([^s]\)/\1/p' | sed 's/--/ --/g' | cut -d " " -f 1) |
|
0 commit comments