Class: TLSmap::App::Extractor::Sslyze4
- Inherits:
-
Object
- Object
- TLSmap::App::Extractor::Sslyze4
- Defined in:
- lib/tls_map/app/extractor/extractor.rb
Overview
Parsing SSLyze 4.x - 5.x
Class Method Summary collapse
-
.extract_cipher(json_data) ⇒ Array<String>
Extract the ciphers from the sslyze output file.
-
.parse(file) ⇒ Array<String>
Extract the ciphers from the sslyze output file.
Class Method Details
.extract_cipher(json_data) ⇒ Array<String>
Extract the ciphers from the sslyze output file
133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/tls_map/app/extractor/extractor.rb', line 133 def extract_cipher(json_data) ciphers = json_data['server_scan_results'][0]['scan_commands_results'] raw = { 'SSL2.0' => ciphers['ssl_2_0_cipher_suites']['accepted_cipher_suites'], 'SSL3.0' => ciphers['ssl_3_0_cipher_suites']['accepted_cipher_suites'], 'TLS1.0' => ciphers['tls_1_0_cipher_suites']['accepted_cipher_suites'], 'TLS1.1' => ciphers['tls_1_1_cipher_suites']['accepted_cipher_suites'], 'TLS1.2' => ciphers['tls_1_2_cipher_suites']['accepted_cipher_suites'], 'TLS1.3' => ciphers['tls_1_3_cipher_suites']['accepted_cipher_suites'] } raw.transform_values { |v| v.empty? ? v : v.map { |x| x['cipher_suite']['name'] } } end |
.parse(file) ⇒ Array<String>
Extract the ciphers from the sslyze output file
125 126 127 128 |
# File 'lib/tls_map/app/extractor/extractor.rb', line 125 def parse(file) data = Utils.json_load_file(file) extract_cipher(data) end |