From 0c20b21fc2635716a4018f823c17cfb37cca9253 Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 26 Nov 2020 13:02:10 +0100 Subject: [PATCH 01/22] Better order, "command not found added" --- t/{20_baseline_ipv4_http.t => 10_baseline_ipv4_http.t} | 0 ...line_ipv6_http.t.DISABLED => 11_baseline_ipv6_http.t.DISABLED} | 0 t/{25_baseline_starttls.t => 21_baseline_starttls.t} | 0 t/{07_isJSON_valid.t => 31_isJSON_valid.t} | 0 t/{08_isHTML_valid.t => 32_isHTML_valid.t} | 0 ...JSON_severitylevel_valid.t => 33_isJSON_severitylevel_valid.t} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename t/{20_baseline_ipv4_http.t => 10_baseline_ipv4_http.t} (100%) rename t/{21_baseline_ipv6_http.t.DISABLED => 11_baseline_ipv6_http.t.DISABLED} (100%) rename t/{25_baseline_starttls.t => 21_baseline_starttls.t} (100%) rename t/{07_isJSON_valid.t => 31_isJSON_valid.t} (100%) rename t/{08_isHTML_valid.t => 32_isHTML_valid.t} (100%) rename t/{09_isJSON_severitylevel_valid.t => 33_isJSON_severitylevel_valid.t} (100%) diff --git a/t/20_baseline_ipv4_http.t b/t/10_baseline_ipv4_http.t similarity index 100% rename from t/20_baseline_ipv4_http.t rename to t/10_baseline_ipv4_http.t diff --git a/t/21_baseline_ipv6_http.t.DISABLED b/t/11_baseline_ipv6_http.t.DISABLED similarity index 100% rename from t/21_baseline_ipv6_http.t.DISABLED rename to t/11_baseline_ipv6_http.t.DISABLED diff --git a/t/25_baseline_starttls.t b/t/21_baseline_starttls.t similarity index 100% rename from t/25_baseline_starttls.t rename to t/21_baseline_starttls.t diff --git a/t/07_isJSON_valid.t b/t/31_isJSON_valid.t similarity index 100% rename from t/07_isJSON_valid.t rename to t/31_isJSON_valid.t diff --git a/t/08_isHTML_valid.t b/t/32_isHTML_valid.t similarity index 100% rename from t/08_isHTML_valid.t rename to t/32_isHTML_valid.t diff --git a/t/09_isJSON_severitylevel_valid.t b/t/33_isJSON_severitylevel_valid.t similarity index 100% rename from t/09_isJSON_severitylevel_valid.t rename to t/33_isJSON_severitylevel_valid.t From 191efddaeef7c191c795360879e3e572268ce4a5 Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 26 Nov 2020 13:07:49 +0100 Subject: [PATCH 02/22] document changes from previous commits --- t/Readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/Readme.md b/t/Readme.md index 56ba9c5..234c313 100644 --- a/t/Readme.md +++ b/t/Readme.md @@ -1,8 +1,8 @@ ### Naming scheme * 00-05: Does the bare testssl.sh work at all? -* 06-09: Does the reporting work at all? -* 20-39: Do scans work fine (client side)? +* 10-29: Do scans work fine (client side)? +* 30-39: Does reporting work? * 50-69: Are the results what I expect (server side)? Please help to write Travis/CI tests! Documentation can be found [here](https://perldoc.perl.org/Test/More.html). From 49d321cfbbcc94ce4adf870d56be8946d29cd35c Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 26 Nov 2020 13:41:44 +0100 Subject: [PATCH 03/22] Add "command not found" --- t/10_baseline_ipv4_http.t | 4 ++-- t/11_baseline_ipv6_http.t.DISABLED | 4 ++-- t/21_baseline_starttls.t | 4 ++-- t/23_client_simulation.t | 4 ++-- t/31_isJSON_valid.t | 4 ++-- t/Readme.md | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/t/10_baseline_ipv4_http.t b/t/10_baseline_ipv4_http.t index 575a262..06d61ad 100755 --- a/t/10_baseline_ipv4_http.t +++ b/t/10_baseline_ipv4_http.t @@ -20,8 +20,8 @@ my $uri="google.com"; my $socket_out=""; my $openssl_out=""; # Blacklists we use to trigger an error: -my $socket_regex_bl='(e|E)rror|\.\/testssl\.sh: line |(f|F)atal'; -my $openssl_regex_bl='(e|E)rror|(f|F)atal|\.\/testssl\.sh: line |Oops|s_client connect problem'; +my $socket_regex_bl='(e|E)rror|\.\/testssl\.sh: line |(f|F)atal|(c|C)ommand not found'; +my $openssl_regex_bl='(e|E)rror|(f|F)atal|\.\/testssl\.sh: line |Oops|s_client connect problem|(c|C)ommand not found'; my $json_regex_bl='(id".*:\s"scanProblem"|severity".*:\s"FATAL"|"Scan interrupted")'; my $socket_json=""; diff --git a/t/11_baseline_ipv6_http.t.DISABLED b/t/11_baseline_ipv6_http.t.DISABLED index 2043f50..e8253f8 100755 --- a/t/11_baseline_ipv6_http.t.DISABLED +++ b/t/11_baseline_ipv6_http.t.DISABLED @@ -20,8 +20,8 @@ my $uri=""; my $socket_out=""; my $openssl_out=""; # Blacklists we use to trigger an error: -my $socket_regex_bl='(e|E)rror|\.\/testssl\.sh: line |(f|F)atal'; -my $openssl_regex_bl='(e|E)rror|(f|F)atal|\.\/testssl\.sh: line |Oops|s_client connect problem'; +my $socket_regex_bl='(e|E)rror|\.\/testssl\.sh: line |(f|F)atal|(c|C)ommand not found'; +my $openssl_regex_bl='(e|E)rror|(f|F)atal|\.\/testssl\.sh: line |Oops|s_client connect problem|(c|C)ommand not found'; # my $socket_json=""; # my $openssl_json=""; diff --git a/t/21_baseline_starttls.t b/t/21_baseline_starttls.t index efb795e..3182df8 100755 --- a/t/21_baseline_starttls.t +++ b/t/21_baseline_starttls.t @@ -23,8 +23,8 @@ my $uri=""; my $socket_out=""; my $openssl_out=""; # Blacklists we use to trigger an error: -my $socket_regex_bl='(e|E)rror|\.\/testssl\.sh: line |(f|F)atal'; -my $openssl_regex_bl='(e|E)rror|(f|F)atal|\.\/testssl\.sh: line |Oops|s_client connect problem'; +my $socket_regex_bl='(e|E)rror|\.\/testssl\.sh: line |(f|F)atal|(c|C)ommand not found'; +my $openssl_regex_bl='(e|E)rror|(f|F)atal|\.\/testssl\.sh: line |Oops|s_client connect problem|(c|C)ommand not found'; # my $socket_json=""; # my $openssl_json=""; diff --git a/t/23_client_simulation.t b/t/23_client_simulation.t index 60ab990..897df5d 100755 --- a/t/23_client_simulation.t +++ b/t/23_client_simulation.t @@ -18,8 +18,8 @@ my $uri=""; my $socket_out=""; my $openssl_out=""; # Blacklists we use to trigger an error: -my $socket_regex_bl='(e|E)rror|\.\/testssl\.sh: line |(f|F)atal'; -my $openssl_regex_bl='(e|E)rror|(f|F)atal|\.\/testssl\.sh: line |Oops|s_client connect problem'; +my $socket_regex_bl='(e|E)rror|\.\/testssl\.sh: line |(f|F)atal|(c|C)ommand not found'; +my $openssl_regex_bl='(e|E)rror|(f|F)atal|\.\/testssl\.sh: line |Oops|s_client connect problem|(c|C)ommand not found'; # my $socket_json=""; # my $openssl_json=""; diff --git a/t/31_isJSON_valid.t b/t/31_isJSON_valid.t index 26814b8..695da0c 100755 --- a/t/31_isJSON_valid.t +++ b/t/31_isJSON_valid.t @@ -14,8 +14,8 @@ my $uri=""; my $json=""; my $out=""; # Blacklists we use to trigger an error: -my $socket_regex_bl='(e|E)rror|\.\/testssl\.sh: line |(f|F)atal'; -my $openssl_regex_bl='(e|E)rror|(f|F)atal|\.\/testssl\.sh: line |Oops|s_client connect problem'; +my $socket_regex_bl='(e|E)rror|\.\/testssl\.sh: line |(f|F)atal|(c|C)ommand not found'; +my $openssl_regex_bl='(e|E)rror|(f|F)atal|\.\/testssl\.sh: line |Oops|s_client connect problem|(c|C)ommand not found'; die "Unable to open $prg" unless -f $prg; diff --git a/t/Readme.md b/t/Readme.md index 234c313..272372b 100644 --- a/t/Readme.md +++ b/t/Readme.md @@ -6,5 +6,5 @@ * 50-69: Are the results what I expect (server side)? Please help to write Travis/CI tests! Documentation can be found [here](https://perldoc.perl.org/Test/More.html). -You can consult the existing code here. Feel free to use `20_baseline_ipv4_http.t` or `23_client_simulation.t` as a +You can consult the existing code here. Feel free to use `10_baseline_ipv4_http.t` or `23_client_simulation.t` as a template. From a98ede0720d14f782299f889d5994fe8d12a095f Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 26 Nov 2020 15:58:13 +0100 Subject: [PATCH 04/22] Finalize first diff check for travis --- t/61_diff_testsslsh.t | 66 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 t/61_diff_testsslsh.t diff --git a/t/61_diff_testsslsh.t b/t/61_diff_testsslsh.t new file mode 100755 index 0000000..6a13c96 --- /dev/null +++ b/t/61_diff_testsslsh.t @@ -0,0 +1,66 @@ +#!/usr/bin/env perl + +# Baseline diff test against testssl, (csv output) +# +# We don't use a full run yet and omiy the certificate section. +# There we would need to blacklist at least: +# cert_serialNumber, cert_fingerprintSHA1, cert_fingerprintSHA256, cert +# cert_expirationStatus, cert_notBefore, cert_notAfter, cert_caIssuers, intermediate_cert +# +# help is apreciated here + +use strict; +use Test::More; +use Data::Dumper; +use File::Compare; +use Text::Diff; + +my $tests = 0; +my $prg="./testssl.sh"; +my $master_socket_csv="./t/baseline_data/default_testssl.csvfile"; +my $socket_csv="tmp.csv"; + my $check2run="-p -s -P --fs -h -U -c -q --ip=one --color 0 --csvfile $socket_csv"; +#my $check2run="-p --color 0 --csvfile $socket_csv"; +my $uri="testssl.sh"; +my $diff=""; + +die "Unable to open $prg" unless -f $prg; +die "Unable to open $master_socket_csv" unless -f $master_socket_csv; + + +# Provide proper start conditions +unlink "tmp.csv"; + +# Title +printf "\n%s\n", "Diff unit test IPv4 against \"$uri\""; + +#1 run +`$prg $check2run $uri 2>&1`; + + +$diff = diff $socket_csv, $master_socket_csv; + +$socket_csv=`cat tmp.csv`; +$master_socket_csv=`cat $master_socket_csv`; + +# Filter, for now only HTTP_clock_skew +$socket_csv=~ s/HTTP_clock_skew.*\n//g; +$master_socket_csv=~ s/HTTP_clock_skew.*\n//g; + +# Compare and print the differences if there are some +# Filtering takes place later, so if ther will be a difference detected +# it'll also show HTTP_clock_skew +# +cmp_ok($socket_csv, "eq", $master_socket_csv, "Check whether CSV output matches master file from $uri") and + printf "\n%s\n", "$diff"; + +$tests++; + +unlink "tmp.csv"; + +done_testing($tests); +printf "\n"; + + +# vim:tw=95:ts=5:sw=5:et + From 1b63760bc34cd198c1d576c8535e73223e6e9c51 Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 26 Nov 2020 16:05:08 +0100 Subject: [PATCH 05/22] Add baseline master file for testssl.sh --- t/baseline_data/default_testssl.csvfile | 137 ++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 t/baseline_data/default_testssl.csvfile diff --git a/t/baseline_data/default_testssl.csvfile b/t/baseline_data/default_testssl.csvfile new file mode 100644 index 0000000..9c89f61 --- /dev/null +++ b/t/baseline_data/default_testssl.csvfile @@ -0,0 +1,137 @@ +"id","fqdn/ip","port","severity","finding","cve","cwe" +"service","testssl.sh/81.169.166.184","443","INFO","HTTP","","" +"pre_128cipher","testssl.sh/81.169.166.184","443","INFO","No 128 cipher limit bug","","" +"SSLv2","testssl.sh/81.169.166.184","443","OK","not offered","","" +"SSLv3","testssl.sh/81.169.166.184","443","OK","not offered","","" +"TLS1","testssl.sh/81.169.166.184","443","LOW","offered (deprecated)","","" +"TLS1_1","testssl.sh/81.169.166.184","443","LOW","offered (deprecated)","","" +"TLS1_2","testssl.sh/81.169.166.184","443","OK","offered","","" +"TLS1_3","testssl.sh/81.169.166.184","443","OK","offered with final","","" +"NPN","testssl.sh/81.169.166.184","443","INFO","offered with h2, http/1.1 (advertised)","","" +"ALPN_HTTP2","testssl.sh/81.169.166.184","443","OK","h2","","" +"ALPN","testssl.sh/81.169.166.184","443","INFO","http/1.1","","" +"cipherlist_NULL","testssl.sh/81.169.166.184","443","OK","not offered","","CWE-327" +"cipherlist_aNULL","testssl.sh/81.169.166.184","443","OK","not offered","","CWE-327" +"cipherlist_EXPORT","testssl.sh/81.169.166.184","443","OK","not offered","","CWE-327" +"cipherlist_LOW","testssl.sh/81.169.166.184","443","OK","not offered","","CWE-327" +"cipherlist_3DES_IDEA","testssl.sh/81.169.166.184","443","INFO","not offered","","CWE-310" +"cipherlist_AVERAGE","testssl.sh/81.169.166.184","443","LOW","offered","","CWE-310" +"cipherlist_GOOD","testssl.sh/81.169.166.184","443","OK","offered","","" +"cipherlist_STRONG","testssl.sh/81.169.166.184","443","OK","offered","","" +"cipher_order","testssl.sh/81.169.166.184","443","OK","server","","" +"protocol_negotiated","testssl.sh/81.169.166.184","443","OK","Default protocol TLS1.3","","" +"cipher_negotiated","testssl.sh/81.169.166.184","443","OK","TLS_AES_256_GCM_SHA384, 253 bit ECDH (X25519)","","" +"cipher-tls1_xc014","testssl.sh/81.169.166.184","443","LOW","TLSv1 xc014 ECDHE-RSA-AES256-SHA ECDH 256 AES 256 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA","","" +"cipher-tls1_xc013","testssl.sh/81.169.166.184","443","LOW","TLSv1 xc013 ECDHE-RSA-AES128-SHA ECDH 256 AES 128 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA","","" +"cipher-tls1_x88","testssl.sh/81.169.166.184","443","LOW","TLSv1 x88 DHE-RSA-CAMELLIA256-SHA DH 2048 Camellia 256 TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA","","" +"cipher-tls1_x45","testssl.sh/81.169.166.184","443","LOW","TLSv1 x45 DHE-RSA-CAMELLIA128-SHA DH 2048 Camellia 128 TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA","","" +"cipher-tls1_x39","testssl.sh/81.169.166.184","443","LOW","TLSv1 x39 DHE-RSA-AES256-SHA DH 2048 AES 256 TLS_DHE_RSA_WITH_AES_256_CBC_SHA","","" +"cipher-tls1_x33","testssl.sh/81.169.166.184","443","LOW","TLSv1 x33 DHE-RSA-AES128-SHA DH 2048 AES 128 TLS_DHE_RSA_WITH_AES_128_CBC_SHA","","" +"cipher-tls1_x35","testssl.sh/81.169.166.184","443","LOW","TLSv1 x35 AES256-SHA RSA AES 256 TLS_RSA_WITH_AES_256_CBC_SHA","","" +"cipherorder_TLSv1","testssl.sh/81.169.166.184","443","INFO","ECDHE-RSA-AES256-SHA ECDHE-RSA-AES128-SHA DHE-RSA-CAMELLIA256-SHA DHE-RSA-CAMELLIA128-SHA DHE-RSA-AES256-SHA DHE-RSA-AES128-SHA AES256-SHA","","" +"cipher-tls1_1_xc014","testssl.sh/81.169.166.184","443","LOW","TLSv1.1 xc014 ECDHE-RSA-AES256-SHA ECDH 256 AES 256 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA","","" +"cipher-tls1_1_xc013","testssl.sh/81.169.166.184","443","LOW","TLSv1.1 xc013 ECDHE-RSA-AES128-SHA ECDH 256 AES 128 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA","","" +"cipher-tls1_1_x88","testssl.sh/81.169.166.184","443","LOW","TLSv1.1 x88 DHE-RSA-CAMELLIA256-SHA DH 2048 Camellia 256 TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA","","" +"cipher-tls1_1_x45","testssl.sh/81.169.166.184","443","LOW","TLSv1.1 x45 DHE-RSA-CAMELLIA128-SHA DH 2048 Camellia 128 TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA","","" +"cipher-tls1_1_x39","testssl.sh/81.169.166.184","443","LOW","TLSv1.1 x39 DHE-RSA-AES256-SHA DH 2048 AES 256 TLS_DHE_RSA_WITH_AES_256_CBC_SHA","","" +"cipher-tls1_1_x33","testssl.sh/81.169.166.184","443","LOW","TLSv1.1 x33 DHE-RSA-AES128-SHA DH 2048 AES 128 TLS_DHE_RSA_WITH_AES_128_CBC_SHA","","" +"cipher-tls1_1_x35","testssl.sh/81.169.166.184","443","LOW","TLSv1.1 x35 AES256-SHA RSA AES 256 TLS_RSA_WITH_AES_256_CBC_SHA","","" +"cipherorder_TLSv1_1","testssl.sh/81.169.166.184","443","INFO","ECDHE-RSA-AES256-SHA ECDHE-RSA-AES128-SHA DHE-RSA-CAMELLIA256-SHA DHE-RSA-CAMELLIA128-SHA DHE-RSA-AES256-SHA DHE-RSA-AES128-SHA AES256-SHA","","" +"cipher-tls1_2_xc030","testssl.sh/81.169.166.184","443","OK","TLSv1.2 xc030 ECDHE-RSA-AES256-GCM-SHA384 ECDH 256 AESGCM 256 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384","","" +"cipher-tls1_2_xc02f","testssl.sh/81.169.166.184","443","OK","TLSv1.2 xc02f ECDHE-RSA-AES128-GCM-SHA256 ECDH 256 AESGCM 128 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256","","" +"cipher-tls1_2_x9f","testssl.sh/81.169.166.184","443","OK","TLSv1.2 x9f DHE-RSA-AES256-GCM-SHA384 DH 2048 AESGCM 256 TLS_DHE_RSA_WITH_AES_256_GCM_SHA384","","" +"cipher-tls1_2_x9e","testssl.sh/81.169.166.184","443","OK","TLSv1.2 x9e DHE-RSA-AES128-GCM-SHA256 DH 2048 AESGCM 128 TLS_DHE_RSA_WITH_AES_128_GCM_SHA256","","" +"cipher-tls1_2_xc028","testssl.sh/81.169.166.184","443","LOW","TLSv1.2 xc028 ECDHE-RSA-AES256-SHA384 ECDH 256 AES 256 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384","","" +"cipher-tls1_2_xc014","testssl.sh/81.169.166.184","443","LOW","TLSv1.2 xc014 ECDHE-RSA-AES256-SHA ECDH 256 AES 256 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA","","" +"cipher-tls1_2_xc013","testssl.sh/81.169.166.184","443","LOW","TLSv1.2 xc013 ECDHE-RSA-AES128-SHA ECDH 256 AES 128 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA","","" +"cipher-tls1_2_x88","testssl.sh/81.169.166.184","443","LOW","TLSv1.2 x88 DHE-RSA-CAMELLIA256-SHA DH 2048 Camellia 256 TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA","","" +"cipher-tls1_2_x45","testssl.sh/81.169.166.184","443","LOW","TLSv1.2 x45 DHE-RSA-CAMELLIA128-SHA DH 2048 Camellia 128 TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA","","" +"cipher-tls1_2_x6b","testssl.sh/81.169.166.184","443","LOW","TLSv1.2 x6b DHE-RSA-AES256-SHA256 DH 2048 AES 256 TLS_DHE_RSA_WITH_AES_256_CBC_SHA256","","" +"cipher-tls1_2_x39","testssl.sh/81.169.166.184","443","LOW","TLSv1.2 x39 DHE-RSA-AES256-SHA DH 2048 AES 256 TLS_DHE_RSA_WITH_AES_256_CBC_SHA","","" +"cipher-tls1_2_x67","testssl.sh/81.169.166.184","443","LOW","TLSv1.2 x67 DHE-RSA-AES128-SHA256 DH 2048 AES 128 TLS_DHE_RSA_WITH_AES_128_CBC_SHA256","","" +"cipher-tls1_2_x33","testssl.sh/81.169.166.184","443","LOW","TLSv1.2 x33 DHE-RSA-AES128-SHA DH 2048 AES 128 TLS_DHE_RSA_WITH_AES_128_CBC_SHA","","" +"cipher-tls1_2_x9d","testssl.sh/81.169.166.184","443","OK","TLSv1.2 x9d AES256-GCM-SHA384 RSA AESGCM 256 TLS_RSA_WITH_AES_256_GCM_SHA384","","" +"cipher-tls1_2_x9c","testssl.sh/81.169.166.184","443","OK","TLSv1.2 x9c AES128-GCM-SHA256 RSA AESGCM 128 TLS_RSA_WITH_AES_128_GCM_SHA256","","" +"cipher-tls1_2_x3d","testssl.sh/81.169.166.184","443","LOW","TLSv1.2 x3d AES256-SHA256 RSA AES 256 TLS_RSA_WITH_AES_256_CBC_SHA256","","" +"cipher-tls1_2_x35","testssl.sh/81.169.166.184","443","LOW","TLSv1.2 x35 AES256-SHA RSA AES 256 TLS_RSA_WITH_AES_256_CBC_SHA","","" +"cipherorder_TLSv1_2","testssl.sh/81.169.166.184","443","INFO","ECDHE-RSA-AES256-GCM-SHA384 ECDHE-RSA-AES128-GCM-SHA256 DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES128-GCM-SHA256 ECDHE-RSA-AES256-SHA384 ECDHE-RSA-AES256-SHA ECDHE-RSA-AES128-SHA DHE-RSA-CAMELLIA256-SHA DHE-RSA-CAMELLIA128-SHA DHE-RSA-AES256-SHA256 DHE-RSA-AES256-SHA DHE-RSA-AES128-SHA256 DHE-RSA-AES128-SHA AES256-GCM-SHA384 AES128-GCM-SHA256 AES256-SHA256 AES256-SHA","","" +"cipher-tls1_3_x1302","testssl.sh/81.169.166.184","443","OK","TLSv1.3 x1302 TLS_AES_256_GCM_SHA384 ECDH 253 AESGCM 256 TLS_AES_256_GCM_SHA384","","" +"cipher-tls1_3_x1303","testssl.sh/81.169.166.184","443","OK","TLSv1.3 x1303 TLS_CHACHA20_POLY1305_SHA256 ECDH 253 ChaCha20 256 TLS_CHACHA20_POLY1305_SHA256","","" +"cipher-tls1_3_x1301","testssl.sh/81.169.166.184","443","OK","TLSv1.3 x1301 TLS_AES_128_GCM_SHA256 ECDH 253 AESGCM 128 TLS_AES_128_GCM_SHA256","","" +"cipherorder_TLSv1_3","testssl.sh/81.169.166.184","443","INFO","TLS_AES_256_GCM_SHA384 TLS_CHACHA20_POLY1305_SHA256 TLS_AES_128_GCM_SHA256","","" +"FS","testssl.sh/81.169.166.184","443","OK","offered","","" +"FS_ciphers","testssl.sh/81.169.166.184","443","INFO","TLS_AES_256_GCM_SHA384 TLS_CHACHA20_POLY1305_SHA256 ECDHE-RSA-AES256-GCM-SHA384 ECDHE-RSA-AES256-SHA384 ECDHE-RSA-AES256-SHA DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA256 DHE-RSA-AES256-SHA DHE-RSA-CAMELLIA256-SHA TLS_AES_128_GCM_SHA256 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-RSA-AES128-SHA DHE-RSA-AES128-GCM-SHA256 DHE-RSA-AES128-SHA256 DHE-RSA-AES128-SHA DHE-RSA-CAMELLIA128-SHA","","" +"FS_ECDHE_curves","testssl.sh/81.169.166.184","443","OK","prime256v1 secp384r1 secp521r1 X25519 X448","","" +"DH_groups","testssl.sh/81.169.166.184","443","OK","Unknown DH group (2048 bits)","","" +"HTTP_status_code","testssl.sh/81.169.166.184","443","INFO","200 OK ('/')","","" +"HTTP_clock_skew","testssl.sh/81.169.166.184","443","INFO","0 seconds from localtime","","" +"HSTS_time","testssl.sh/81.169.166.184","443","OK","362 days (=31337000 seconds) > 15465600 seconds","","" +"HSTS_subdomains","testssl.sh/81.169.166.184","443","INFO","only for this domain","","" +"HSTS_preload","testssl.sh/81.169.166.184","443","INFO","domain is NOT marked for preloading","","" +"HPKP","testssl.sh/81.169.166.184","443","INFO","No support for HTTP Public Key Pinning","","" +"banner_server","testssl.sh/81.169.166.184","443","INFO","Never trust a banner","","" +"banner_application","testssl.sh/81.169.166.184","443","INFO","X-Powered-By: A portion of humor","","" +"cookie_count","testssl.sh/81.169.166.184","443","INFO","0 at '/'","","" +"X-Frame-Options","testssl.sh/81.169.166.184","443","OK","DENY","","" +"X-Content-Type-Options","testssl.sh/81.169.166.184","443","OK","nosniff","","" +"Content-Security-Policy","testssl.sh/81.169.166.184","443","OK","script-src 'unsafe-inline'; style-src 'unsafe-inline' 'self'; default-src 'self' ; child-src 'none'; object-src 'self'; frame-ancestors 'self'; upgrade-insecure-requests","","" +"Expect-CT","testssl.sh/81.169.166.184","443","OK","max-age=86400, enforce","","" +"X-XSS-Protection","testssl.sh/81.169.166.184","443","INFO","1; mode=block","","" +"banner_reverseproxy","testssl.sh/81.169.166.184","443","INFO","--","","CWE-200" +"heartbleed","testssl.sh/81.169.166.184","443","OK","not vulnerable, no heartbeat extension","CVE-2014-0160","CWE-119" +"CCS","testssl.sh/81.169.166.184","443","OK","not vulnerable","CVE-2014-0224","CWE-310" +"ticketbleed","testssl.sh/81.169.166.184","443","OK","no session ticket extension","CVE-2016-9244","CWE-200" +"ROBOT","testssl.sh/81.169.166.184","443","OK","not vulnerable","CVE-2017-17382 CVE-2017-17427 CVE-2017-17428 CVE-2017-13098 CVE-2017-1000385 CVE-2017-13099 CVE-2016-6883 CVE-2012-5081 CVE-2017-6168","CWE-203" +"secure_renego","testssl.sh/81.169.166.184","443","OK","supported","","CWE-310" +"secure_client_renego","testssl.sh/81.169.166.184","443","OK","not vulnerable","CVE-2011-1473","CWE-310" +"CRIME_TLS","testssl.sh/81.169.166.184","443","OK","not vulnerable","CVE-2012-4929","CWE-310" +"BREACH","testssl.sh/81.169.166.184","443","OK","not vulnerable, no gzip/deflate/compress/br HTTP compression - only supplied '/' tested","CVE-2013-3587","CWE-310" +"POODLE_SSL","testssl.sh/81.169.166.184","443","OK","not vulnerable, no SSLv3","CVE-2014-3566","CWE-310" +"fallback_SCSV","testssl.sh/81.169.166.184","443","OK","supported","","" +"SWEET32","testssl.sh/81.169.166.184","443","OK","not vulnerable","CVE-2016-2183 CVE-2016-6329","CWE-327" +"FREAK","testssl.sh/81.169.166.184","443","OK","not vulnerable","CVE-2015-0204","CWE-310" +"DROWN","testssl.sh/81.169.166.184","443","OK","not vulnerable on this host and port","CVE-2016-0800 CVE-2016-0703","CWE-310" +"DROWN_hint","testssl.sh/81.169.166.184","443","INFO","Make sure you don't use this certificate elsewhere with SSLv2 enabled services, see https://censys.io/ipv4?q=B95B85E87BA020CD25A95DF53CDD16C7DCEA96EFE7FEF9411529D511B39015B3","CVE-2016-0800 CVE-2016-0703","CWE-310" +"LOGJAM","testssl.sh/81.169.166.184","443","OK","not vulnerable, no DH EXPORT ciphers,","CVE-2015-4000","CWE-310" +"LOGJAM-common_primes","testssl.sh/81.169.166.184","443","OK","--","CVE-2015-4000","CWE-310" +"BEAST_CBC_TLS1","testssl.sh/81.169.166.184","443","MEDIUM","ECDHE-RSA-AES256-SHA ECDHE-RSA-AES128-SHA DHE-RSA-CAMELLIA256-SHA DHE-RSA-CAMELLIA128-SHA DHE-RSA-AES256-SHA DHE-RSA-AES128-SHA AES256-SHA","CVE-2011-3389","CWE-20" +"BEAST","testssl.sh/81.169.166.184","443","LOW","VULNERABLE -- but also supports higher protocols TLSv1.1 TLSv1.2 (likely mitigated)","CVE-2011-3389","CWE-20" +"LUCKY13","testssl.sh/81.169.166.184","443","LOW","potentially vulnerable, uses TLS CBC ciphers","CVE-2013-0169","CWE-310" +"winshock","testssl.sh/81.169.166.184","443","OK","not vulnerable","CVE-2014-6321","CWE-94" +"RC4","testssl.sh/81.169.166.184","443","OK","not vulnerable","CVE-2013-2566 CVE-2015-2808","CWE-310" +"clientsimulation-android_442","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384","","" +"clientsimulation-android_500","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256","","" +"clientsimulation-android_60","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 ECDHE-RSA-AES128-GCM-SHA256","","" +"clientsimulation-android_70","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384","","" +"clientsimulation-android_81","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384","","" +"clientsimulation-android_90","testssl.sh/81.169.166.184","443","INFO","TLSv1.3 TLS_AES_256_GCM_SHA384","","" +"clientsimulation-android_X","testssl.sh/81.169.166.184","443","INFO","TLSv1.3 TLS_AES_256_GCM_SHA384","","" +"clientsimulation-chrome_74_win10","testssl.sh/81.169.166.184","443","INFO","TLSv1.3 TLS_AES_256_GCM_SHA384","","" +"clientsimulation-chrome_79_win10","testssl.sh/81.169.166.184","443","INFO","TLSv1.3 TLS_AES_256_GCM_SHA384","","" +"clientsimulation-firefox_66_win81","testssl.sh/81.169.166.184","443","INFO","TLSv1.3 TLS_AES_256_GCM_SHA384","","" +"clientsimulation-firefox_71_win10","testssl.sh/81.169.166.184","443","INFO","TLSv1.3 TLS_AES_256_GCM_SHA384","","" +"clientsimulation-ie_6_xp","testssl.sh/81.169.166.184","443","INFO","No connection","","" +"clientsimulation-ie_8_win7","testssl.sh/81.169.166.184","443","INFO","TLSv1.0 ECDHE-RSA-AES256-SHA","","" +"clientsimulation-ie_8_xp","testssl.sh/81.169.166.184","443","INFO","No connection","","" +"clientsimulation-ie_11_win7","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 DHE-RSA-AES256-GCM-SHA384","","" +"clientsimulation-ie_11_win81","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 DHE-RSA-AES256-GCM-SHA384","","" +"clientsimulation-ie_11_winphone81","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 ECDHE-RSA-AES256-SHA","","" +"clientsimulation-ie_11_win10","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384","","" +"clientsimulation-edge_15_win10","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384","","" +"clientsimulation-edge_17_win10","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384","","" +"clientsimulation-opera_66_win10","testssl.sh/81.169.166.184","443","INFO","TLSv1.3 TLS_AES_256_GCM_SHA384","","" +"clientsimulation-safari_9_ios9","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384","","" +"clientsimulation-safari_9_osx1011","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384","","" +"clientsimulation-safari_10_osx1012","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384","","" +"clientsimulation-safari_121_ios_122","testssl.sh/81.169.166.184","443","INFO","TLSv1.3 TLS_AES_256_GCM_SHA384","","" +"clientsimulation-safari_130_osx_10146","testssl.sh/81.169.166.184","443","INFO","TLSv1.3 TLS_AES_256_GCM_SHA384","","" +"clientsimulation-apple_ats_9_ios9","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384","","" +"clientsimulation-java_6u45","testssl.sh/81.169.166.184","443","INFO","No connection","","" +"clientsimulation-java_7u25","testssl.sh/81.169.166.184","443","INFO","TLSv1.0 ECDHE-RSA-AES128-SHA","","" +"clientsimulation-java_8u161","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384","","" +"clientsimulation-java1102","testssl.sh/81.169.166.184","443","INFO","TLSv1.3 TLS_AES_256_GCM_SHA384","","" +"clientsimulation-java1201","testssl.sh/81.169.166.184","443","INFO","TLSv1.3 TLS_AES_256_GCM_SHA384","","" +"clientsimulation-openssl_102e","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384","","" +"clientsimulation-openssl_110l","testssl.sh/81.169.166.184","443","INFO","TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384","","" +"clientsimulation-openssl_111d","testssl.sh/81.169.166.184","443","INFO","TLSv1.3 TLS_AES_256_GCM_SHA384","","" +"clientsimulation-thunderbird_68_3_1","testssl.sh/81.169.166.184","443","INFO","TLSv1.3 TLS_AES_256_GCM_SHA384","","" From 665209bf60cea9837378073459dccb39697ab5d5 Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 26 Nov 2020 16:27:40 +0100 Subject: [PATCH 06/22] typos --- t/61_diff_testsslsh.t | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/t/61_diff_testsslsh.t b/t/61_diff_testsslsh.t index 6a13c96..65b584e 100755 --- a/t/61_diff_testsslsh.t +++ b/t/61_diff_testsslsh.t @@ -1,8 +1,8 @@ #!/usr/bin/env perl -# Baseline diff test against testssl, (csv output) +# Baseline diff test against testssl.sh (csv output) # -# We don't use a full run yet and omiy the certificate section. +# We don't use a full run yet and only the certificate section. # There we would need to blacklist at least: # cert_serialNumber, cert_fingerprintSHA1, cert_fingerprintSHA256, cert # cert_expirationStatus, cert_notBefore, cert_notAfter, cert_caIssuers, intermediate_cert @@ -12,7 +12,6 @@ use strict; use Test::More; use Data::Dumper; -use File::Compare; use Text::Diff; my $tests = 0; @@ -47,9 +46,8 @@ $master_socket_csv=`cat $master_socket_csv`; $socket_csv=~ s/HTTP_clock_skew.*\n//g; $master_socket_csv=~ s/HTTP_clock_skew.*\n//g; -# Compare and print the differences if there are some -# Filtering takes place later, so if ther will be a difference detected -# it'll also show HTTP_clock_skew +# Compare the differences to the master file -- and print differences if there were detected. +# Filtering takes place later, so if there will be a difference detected it'll also show HTTP_clock_skew :-( # cmp_ok($socket_csv, "eq", $master_socket_csv, "Check whether CSV output matches master file from $uri") and printf "\n%s\n", "$diff"; From 96d4b4f08b68511a797f613597159bfa5955217e Mon Sep 17 00:00:00 2001 From: Dirk Wetter Date: Fri, 27 Nov 2020 13:19:52 +0100 Subject: [PATCH 07/22] Trying to reduced the runtime of travis Often in the past travis was hitting a limit (50min?). This is a try to make reasonable cuts to the unit tests: - For STARTTLS some checks with OPenSSL are skipped - For JSON and HTML outputs --ids-friendly was added assumming we don't change the output of ticketbleed, CCSI, HeartBleed and ROBOT any more. - There's also not point to run those checks against badssl - for the diff check we switch to 'or diag' to display a dfifference --- t/21_baseline_starttls.t | 44 ++++++++++++++++++------------- t/23_client_simulation.t | 12 +++++---- t/31_isJSON_valid.t | 4 +-- t/32_isHTML_valid.t | 2 +- t/33_isJSON_severitylevel_valid.t | 4 +-- t/51_badssl.com.t | 2 +- t/61_diff_testsslsh.t | 6 ++--- 7 files changed, 42 insertions(+), 32 deletions(-) diff --git a/t/21_baseline_starttls.t b/t/21_baseline_starttls.t index 3182df8..57c3663 100755 --- a/t/21_baseline_starttls.t +++ b/t/21_baseline_starttls.t @@ -17,7 +17,7 @@ use Data::Dumper; my $tests = 0; my $prg="./testssl.sh"; -my $check2run_smtp="--protocols --standard --fs --server-preference --headers --vulnerable --each-cipher -q --ip=one --color 0"; +my $check2run_smtp="--protocols --standard --fs --server-preference --headers --vulnerable -q --ip=one --color 0"; my $check2run="-q --ip=one --color 0"; my $uri=""; my $socket_out=""; @@ -60,12 +60,14 @@ $socket_out = `./testssl.sh $check2run -t pop3 $uri 2>&1`; unlike($socket_out, qr/$socket_regex_bl/, ""); $tests++; +# commented out, bc of travis' limits +# +#printf "\n%s\n", "STARTTLS POP3 unit tests via OpenSSL --> $uri ..."; # unlink "tmp.json"; -printf "\n%s\n", "STARTTLS POP3 unit tests via OpenSSL --> $uri ..."; -$openssl_out = `./testssl.sh --ssl-native $check2run -t pop3 $uri 2>&1`; +#$openssl_out = `./testssl.sh --ssl-native $check2run -t pop3 $uri 2>&1`; # $openssl_json = json('tmp.json'); -unlike($openssl_out, qr/$openssl_regex_bl/, ""); -$tests++; +#unlike($openssl_out, qr/$openssl_regex_bl/, ""); +#$tests++; $uri="imap.gmx.net:143"; @@ -93,11 +95,13 @@ $socket_out = `./testssl.sh $check2run -t xmpp $uri 2>&1`; unlike($openssl_out, qr/$openssl_regex_bl/, ""); $tests++; -printf "\n%s\n", "STARTTLS XMPP unit tests via OpenSSL --> $uri ..."; -$openssl_out = `./testssl.sh --ssl-native $check2run -t xmpp $uri 2>&1`; +# commented out, bc of travis' limits +# +#printf "\n%s\n", "STARTTLS XMPP unit tests via OpenSSL --> $uri ..."; +#$openssl_out = `./testssl.sh --ssl-native $check2run -t xmpp $uri 2>&1`; # $openssl_json = json('tmp.json'); -unlike($openssl_out, qr/$openssl_regex_bl/, ""); -$tests++; +#unlike($openssl_out, qr/$openssl_regex_bl/, ""); +#$tests++; # $uri="jabber.ccc.de:5269"; # printf "\n%s\n", "Quick STARTTLS XMPP S2S unit tests via sockets --> $uri ..."; @@ -118,13 +122,15 @@ $socket_out =~ s/ error querying OCSP responder .*\n//g; unlike($socket_out, qr/$socket_regex_bl/, ""); $tests++; -printf "\n%s\n", "STARTTLS FTP unit tests via OpenSSL --> $uri ..."; -$openssl_out = `./testssl.sh --ssl-native $check2run -t ftp $uri 2>&1`; +# commented out, bc of travis' limits +# +# printf "\n%s\n", "STARTTLS FTP unit tests via OpenSSL --> $uri ..."; +# $openssl_out = `./testssl.sh --ssl-native $check2run -t ftp $uri 2>&1`; # $openssl_json = json('tmp.json'); # OCSP stapling fails sometimes with: 'offered, error querying OCSP responder (ERROR: No Status found)' -$openssl_out =~ s/ error querying OCSP responder .*\n//g; -unlike($openssl_out, qr/$openssl_regex_bl/, ""); -$tests++; +# $openssl_out =~ s/ error querying OCSP responder .*\n//g; +# unlike($openssl_out, qr/$openssl_regex_bl/, ""); +# $tests++; # https://ldapwiki.com/wiki/Public%20LDAP%20Servers @@ -146,11 +152,13 @@ $socket_out = `./testssl.sh $check2run -t nntp $uri 2>&1`; unlike($socket_out, qr/$socket_regex_bl/, ""); $tests++; -printf "\n%s\n", "STARTTLS NNTP unit tests via OpenSSL --> $uri ..."; -$openssl_out = `./testssl.sh --ssl-native $check2run -t nntp $uri 2>&1`; +# commented out, bc of travis' limits +# +#printf "\n%s\n", "STARTTLS NNTP unit tests via OpenSSL --> $uri ..."; +#$openssl_out = `./testssl.sh --ssl-native $check2run -t nntp $uri 2>&1`; # $openssl_json = json('tmp.json'); -unlike($openssl_out, qr/$openssl_regex_bl/, ""); -$tests++; +#unlike($openssl_out, qr/$openssl_regex_bl/, ""); +#$tests++; # IRC: missing diff --git a/t/23_client_simulation.t b/t/23_client_simulation.t index 897df5d..c241132 100755 --- a/t/23_client_simulation.t +++ b/t/23_client_simulation.t @@ -53,12 +53,14 @@ $socket_out = `./testssl.sh $check2run -t smtp $uri 2>&1`; unlike($socket_out, qr/$socket_regex_bl/, ""); $tests++; +# commented out, bc of travis' limits +# # unlink "tmp.json"; -printf "\n%s\n", "STARTTLS: Client simulations unit test via OpenSSL --> $uri ..."; -$openssl_out = `./testssl.sh --ssl-native $check2run -t smtp $uri 2>&1`; -# $openssl_json = json('tmp.json'); -unlike($openssl_out, qr/$openssl_regex_bl/, ""); -$tests++; +#printf "\n%s\n", "STARTTLS: Client simulations unit test via OpenSSL --> $uri ..."; +#$openssl_out = `./testssl.sh --ssl-native $check2run -t smtp $uri 2>&1`; +## $openssl_json = json('tmp.json'); +#unlike($openssl_out, qr/$openssl_regex_bl/, ""); +#$tests++; done_testing($tests); unlink "tmp.json"; diff --git a/t/31_isJSON_valid.t b/t/31_isJSON_valid.t index 695da0c..5a84bed 100755 --- a/t/31_isJSON_valid.t +++ b/t/31_isJSON_valid.t @@ -9,7 +9,7 @@ use JSON; my $tests = 0; my $prg="./testssl.sh"; -my $check2run ="--ip=one -q --color 0"; +my $check2run ="--ip=one --ids-friendly -q --color 0"; my $uri=""; my $json=""; my $out=""; @@ -44,7 +44,7 @@ $tests++; #3 -# This testss.sh run deliberately does NOT work as travis-ci.org blocks port 25 egress. +# This testssl.sh run deliberately does NOT work as travis-ci.org blocks port 25 egress. # but the output should be fine. The idea is to have a unit test for a failed connection. printf "%s\n", ".. plain JSON for a failed run: '--mx $uri' ..."; $out = `./testssl.sh --ssl-native --openssl-timeout=10 $check2run --jsonfile tmp.json --mx $uri`; diff --git a/t/32_isHTML_valid.t b/t/32_isHTML_valid.t index 294661a..a1aa819 100755 --- a/t/32_isHTML_valid.t +++ b/t/32_isHTML_valid.t @@ -15,7 +15,7 @@ my $out=""; my $html=""; my $debughtml=""; my $edited_html=""; -my $check2run="--ip=one --color 0 --htmlfile tmp.html"; +my $check2run="--ip=one --ids-friendly --color 0 --htmlfile tmp.html"; my $diff=""; die "Unable to open $prg" unless -f $prg; diff --git a/t/33_isJSON_severitylevel_valid.t b/t/33_isJSON_severitylevel_valid.t index e39d6ab..234efc0 100755 --- a/t/33_isJSON_severitylevel_valid.t +++ b/t/33_isJSON_severitylevel_valid.t @@ -21,7 +21,7 @@ unlink 'tmp.json'; #1 pass(" .. running testssl.sh against badssl.com to create a JSON report with severity level equal greater than LOW (may take 2~3 minutes)"); $tests++; -$out = `./testssl.sh -S -e -U --jsonfile tmp.json --severity LOW --color 0 badssl.com`; +$out = `./testssl.sh -S -e -U --ids-friendly --jsonfile tmp.json --severity LOW --color 0 badssl.com`; $json = json('tmp.json'); unlink 'tmp.json'; $found = 0; @@ -36,7 +36,7 @@ is($found,0,"We should not have any finding with INFO level"); $tests++; #2 pass(" .. running testssl.sh against badssl.com to create a JSON-PRETTY report with severity level equal greater than LOW (may take 2~3 minutes)"); $tests++; -$out = `./testssl.sh -S -e -U --jsonfile-pretty tmp.json --severity LOW --color 0 badssl.com`; +$out = `./testssl.sh -S -e -U --ids-friendly --jsonfile-pretty tmp.json --severity LOW --color 0 badssl.com`; $json_pretty = json('tmp.json'); unlink 'tmp.json'; $found = 0; diff --git a/t/51_badssl.com.t b/t/51_badssl.com.t index 16c5aed..b66f756 100755 --- a/t/51_badssl.com.t +++ b/t/51_badssl.com.t @@ -14,7 +14,7 @@ my ( ); # OK pass("Running testssl.sh against badssl.com to create a baseline (may take 2~3 minutes)"); $tests++; -my $okout = `./testssl.sh -S -e --freak --logjam --drown --rc4 --sweet32 --breach --crime --jsonfile tmp.json --color 0 badssl.com`; +my $okout = `./testssl.sh -S -e --freak --logjam --drown --rc4 --sweet32 --breach --winshock --crime --jsonfile tmp.json --color 0 badssl.com`; my $okjson = json('tmp.json'); unlink 'tmp.json'; cmp_ok(@$okjson,'>',10,"We have more then 10 findings"); $tests++; diff --git a/t/61_diff_testsslsh.t b/t/61_diff_testsslsh.t index 65b584e..f7afe79 100755 --- a/t/61_diff_testsslsh.t +++ b/t/61_diff_testsslsh.t @@ -18,7 +18,7 @@ my $tests = 0; my $prg="./testssl.sh"; my $master_socket_csv="./t/baseline_data/default_testssl.csvfile"; my $socket_csv="tmp.csv"; - my $check2run="-p -s -P --fs -h -U -c -q --ip=one --color 0 --csvfile $socket_csv"; +my $check2run="-p -s -P --fs -h -U -c -q --ip=one --color 0 --csvfile $socket_csv"; #my $check2run="-p --color 0 --csvfile $socket_csv"; my $uri="testssl.sh"; my $diff=""; @@ -49,8 +49,8 @@ $master_socket_csv=~ s/HTTP_clock_skew.*\n//g; # Compare the differences to the master file -- and print differences if there were detected. # Filtering takes place later, so if there will be a difference detected it'll also show HTTP_clock_skew :-( # -cmp_ok($socket_csv, "eq", $master_socket_csv, "Check whether CSV output matches master file from $uri") and - printf "\n%s\n", "$diff"; +cmp_ok($socket_csv, "eq", $master_socket_csv, "Check whether CSV output matches master file from $uri") or + diag ("\n%s\n", "$diff"); $tests++; From 1a7e4f1e925da8ba196afe155ce87ee6a585fa34 Mon Sep 17 00:00:00 2001 From: Dirk Wetter Date: Fri, 27 Nov 2020 16:33:23 +0100 Subject: [PATCH 08/22] consolidate docker sections in Readme.md and Dockerfile.md see #1791 --- Dockerfile.md | 29 ++++++++++++++++++++++------- Readme.md | 16 ++++++---------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/Dockerfile.md b/Dockerfile.md index bbdf371..ff79277 100644 --- a/Dockerfile.md +++ b/Dockerfile.md @@ -1,6 +1,21 @@ -## Usage: +## Usage + +### From git directory + +``` +docker build . +``` + +Catch is when you run without image tags you need to catch the ID when building + +``` +[..] +---> 889fa2f99933 +Successfully built 889fa2f99933 +``` + +More comfortable is -(in git directory): ``` docker build -t mytestssl . docker run --rm -t mytestssl example.com @@ -13,18 +28,18 @@ docker run -t mytestssl --help docker run --rm -t mytestssl -p --header example.com ``` -or pull the image from dockerhub and run: +### From dockerhub + +You can pull the image from dockerhub and run: ``` -docker run --rm -t drwetter/testssl.sh --pfs example.com +docker run --rm -t drwetter/testssl.sh --fs example.com ``` -Tags supported are: ``latest``, ``stable`` which _for now_ are all the same and point to ``3.0``. +Tags supported are: ``3.1dev`` and ``latest`` are the same, i.e. is the rolling release. ``3.0`` is the latest stable version from git which might have a few improvements over the released 3.0.X. ``docker run --rm -t drwetter/testssl.sh:stable example.com``. -And for the indomitable users who prefer to run old stuff you can use the tag ``2.9.5``. Please note ``2.9dev`` should not be used anymore. - Keep in mind that any output file (--log, --html, --json etc.) will be created in the container. If you wish to have this created in a local directory you can mount a volume into the container and change the output prefix where the container user has write access to, e.g.: ``` diff --git a/Readme.md b/Readme.md index b9833c7..3c128b3 100644 --- a/Readme.md +++ b/Readme.md @@ -40,7 +40,7 @@ to get bugfixes, other feedback and more contributions. Testssl.sh is working on every Linux/BSD distribution out of the box. Latest by 2.9dev most of the limitations of disabled features from the openssl client are gone due to bash-socket-based checks. As a result you can also use e.g. LibreSSL or OpenSSL >= -1.1.1 . testssl.sh also works on other unixoid system out of the box, supposed they have +1.1.1 . testssl.sh also works on other unixoid systems out of the box, supposed they have `/bin/bash` >= version 3.2 and standard tools like sed and awk installed. An implicit (silent) check for binaries is done when you start testssl.sh . System V needs probably to have GNU grep installed. MacOS X and Windows (using MSYS2, Cygwin or WSL) work too. @@ -53,11 +53,11 @@ You can download testssl.sh branch 3.1dev just by cloning this git repository: git clone --depth 1 https://github.com/drwetter/testssl.sh.git -Think of 3.1dev like a rolling release, see below. For the stable version help yourself by downloading the [ZIP](https://github.com/drwetter/testssl.sh/archive/3.0.2.zip) or [tar.gz](https://github.com/drwetter/testssl.sh/archive/3.0.2.zip) archive. Just ``cd`` to the directory created (=INSTALLDIR) and run it off there. +Think of 3.1dev like a rolling release, see below. For the stable version help yourself by downloading the [ZIP](https://codeload.github.com/drwetter/testssl.sh/zip/3.0.4) or [tar.gz](https://codeload.github.com/drwetter/testssl.sh/tar.gz/3.0.4) archive. Just ``cd`` to the directory created (=INSTALLDIR) and run it off there. #### Docker -Testssl.sh has minimal requirements. As stated you don't have to install or build anything. You can just run it from the pulled/cloned directory. Still if you don't want to pull the github repo to your directory of choice you can pull a container from dockerhub and run it: +Testssl.sh has minimal requirements. As stated you don't have to install or build anything. You can just run it from the pulled/cloned directory. Still if you don't want to pull the github repo to your directory of choice you can pull a container from dockerhub and run it: ``` docker run --rm -ti drwetter/testssl.sh:3.1dev @@ -65,21 +65,17 @@ docker run --rm -ti drwetter/testssl.sh:3.1dev Or if you have cloned this repo you also can just ``cd`` to the INSTALLDIR and run ``` -docker build . +docker build . -t imagefoo && docker run --rm -t imagefoo example.com ``` -followed by ``docker run -ti `` where ``ID`` is the identifier in the last line from the build command like +For more please consult [Dockerfile.md](https://github.com/drwetter/testssl.sh/blob/3.1dev/Dockerfile.md). -``` - ---> 889fa2f99933 -Successfully built 889fa2f99933 -``` ### Status We're currently in the development phase, version 3.1dev. 3.1dev will eventually become 3.2. Bigger features are developed in a separate branch before merged into 3.1dev to avoid hiccups or inconsistencies. Albeit we try to keep 3.1dev as solid as possible things will certainly change in 3.1dev. So if you need stability the 3.0 branch is better for you. Think of the 3.1dev branch like a rolling release. -Support for 2.9.5 has been dropped. Supported is 3.0.x only. +Support for 2.9.5 has been dropped. Supported is >= 3.0.x only. ### Documentation From 2655e91255ab9d14e3375dff0c23caab45b8a14e Mon Sep 17 00:00:00 2001 From: Dirk Wetter Date: Fri, 27 Nov 2020 17:00:34 +0100 Subject: [PATCH 09/22] Update Readme.md --- Readme.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index 3c128b3..c8fbbf7 100644 --- a/Readme.md +++ b/Readme.md @@ -60,7 +60,7 @@ Think of 3.1dev like a rolling release, see below. For the stable version help y Testssl.sh has minimal requirements. As stated you don't have to install or build anything. You can just run it from the pulled/cloned directory. Still if you don't want to pull the github repo to your directory of choice you can pull a container from dockerhub and run it: ``` -docker run --rm -ti drwetter/testssl.sh:3.1dev +docker run --rm -ti drwetter/testssl.sh ``` Or if you have cloned this repo you also can just ``cd`` to the INSTALLDIR and run @@ -73,7 +73,9 @@ For more please consult [Dockerfile.md](https://github.com/drwetter/testssl.sh/b ### Status -We're currently in the development phase, version 3.1dev. 3.1dev will eventually become 3.2. Bigger features are developed in a separate branch before merged into 3.1dev to avoid hiccups or inconsistencies. Albeit we try to keep 3.1dev as solid as possible things will certainly change in 3.1dev. So if you need stability the 3.0 branch is better for you. Think of the 3.1dev branch like a rolling release. +We're currently in the development phase, version 3.1dev. 3.1dev will eventually become 3.2. Bigger features are developed in a separate branch before merged into 3.1dev to avoid hiccups or inconsistencies. Albeit we try to keep 3.1dev as solid as possible things will certainly change in 3.1dev. Think of the 3.1dev branch like a rolling release. So if you need stability the 3.0 branch is better for you. + +Version 3.0.X receives bugfixes, labeled as 3.0.1, 3.0.2 and so on. This will happen until 3.2 is released. Support for 2.9.5 has been dropped. Supported is >= 3.0.x only. @@ -86,7 +88,7 @@ Support for 2.9.5 has been dropped. Supported is >= 3.0.x only. ### Contributing -Contributions are welcome! See [CONTRIBUTING.md](https://github.com/drwetter/testssl.sh/blob/3.0/CONTRIBUTING.md) for details. +Contributions are welcome! See [CONTRIBUTING.md](https://github.com/drwetter/testssl.sh/blob/3.1dev/CONTRIBUTING.md) for details. Please also have a look at the [Coding Convention](https://github.com/drwetter/testssl.sh/blob/3.1dev/Coding_Convention.md}. ### Bug reports From c88d22a0f06cbfdcc5a7237dba32d23ee1e5c5a4 Mon Sep 17 00:00:00 2001 From: Dirk Wetter Date: Fri, 27 Nov 2020 17:05:03 +0100 Subject: [PATCH 10/22] Update Dockerfile.md --- Dockerfile.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile.md b/Dockerfile.md index ff79277..1eed4e3 100644 --- a/Dockerfile.md +++ b/Dockerfile.md @@ -36,14 +36,14 @@ You can pull the image from dockerhub and run: docker run --rm -t drwetter/testssl.sh --fs example.com ``` -Tags supported are: ``3.1dev`` and ``latest`` are the same, i.e. is the rolling release. ``3.0`` is the latest stable version from git which might have a few improvements over the released 3.0.X. +Supported tages are: ``3.1dev`` and ``latest`, which are the same, i.e. the rolling release. ``3.0`` is the latest stable version from git which might have a few improvements (see git log) over the released version 3.0.X. ``docker run --rm -t drwetter/testssl.sh:stable example.com``. -Keep in mind that any output file (--log, --html, --json etc.) will be created in the container. If you wish to have this created in a local directory you can mount a volume into the container and change the output prefix where the container user has write access to, e.g.: +Keep in mind that any output file (--log, --html, --json etc.) will be created within the container. If you wish to have this created in a local directory on your host you can mount a volume into the container and change the output prefix where the container user has write access to, e.g.: ``` docker run --rm -t -v /tmp:/data drwetter/testssl.sh --htmlfile /data/ example.com ``` -which writes the output to ``/tmp/example.com_p443--