@@ -16,7 +16,7 @@ doc = <<~DOCOPT
16
16
17
17
#{ Paint [ 'Usage:' , '#81c8b6' ] }
18
18
tls-map search <criteria> <term> [-o <output> --force -e -a] [--no-color --debug]
19
- tls-map bulk <criteria> <file> [-q <output> --force] [--no-color --debug]
19
+ tls-map bulk <criteria> <file> [( -q <output> | --audit) --force] [--no-color --debug]
20
20
tls-map export <filename> <format> [--force] [--debug]
21
21
tls-map extract <filename> <format> [--no-color --debug [--only-weak | --hide-weak]]
22
22
tls-map update [--with-extended] [--debug]
@@ -34,6 +34,7 @@ doc = <<~DOCOPT
34
34
<criteria> The type of term. Accepted values: codepoint, iana, openssl, gnutls, nss.
35
35
<file> File containing the cipher algorithm names, one per line.
36
36
-q, --output2 <output> Displayed fields. Accepted values: codepoint, iana, openssl, gnutls, nss. [default: iana]
37
+ --audit Highlight weak (security level equal to weak or insecure) cipher suites. (work only with TLS not SSL).
37
38
38
39
#{ Paint [ 'Export options:' , '#81c8b6' ] } #{ Paint [ '(offline) export the list of all ciphers (mapping) in various formats' , :underline ] }
39
40
<filename> The output file name to write to.
98
99
res = cli . bulk_search ( args [ '<criteria>' ] . to_sym , args [ '<file>' ] , args [ '--output2' ] . to_sym )
99
100
puts Paint [ 'No match found' , :red ] if res . empty?
100
101
res . each do |h |
101
- puts Paint [ h [ args [ '--output2' ] . to_sym ] , :green ]
102
+ cs = h [ args [ '--output2' ] . to_sym ] # cipher suite
103
+ next if cs . nil?
104
+
105
+ if args [ '--audit' ]
106
+ cliext = TLSmap ::CLI ::Extended . new
107
+ ci = TLSmap ::App ::Cipher . new ( :iana , cs , enhanced_data : cliext . enhanced_data )
108
+ if ci . should_i_use?
109
+ print Paint [ cs , :green ]
110
+ else
111
+ print Paint [ cs , :red ]
112
+ print ' -- '
113
+ print Paint [ 'weak' , :red , :bold ]
114
+ end
115
+ puts
116
+ else
117
+ puts Paint [ cs , :green ]
118
+ end
102
119
end
103
120
elsif args [ 'export' ]
104
121
cli = TLSmap ::CLI . new ( args [ '--force' ] )
0 commit comments