Class: SSLyze::XML
- Inherits:
-
Object
- Object
- SSLyze::XML
- Includes:
- Attributes::Title, Types
- Defined in:
- lib/sslyze/xml.rb,
lib/sslyze/xml/reneg.rb,
lib/sslyze/xml/resum.rb,
lib/sslyze/xml/types.rb,
lib/sslyze/xml/plugin.rb,
lib/sslyze/xml/target.rb,
lib/sslyze/xml/certinfo.rb,
lib/sslyze/xml/fallback.rb,
lib/sslyze/xml/protocol.rb,
lib/sslyze/xml/heartbleed.rb,
lib/sslyze/xml/resum_rate.rb,
lib/sslyze/xml/compression.rb,
lib/sslyze/xml/openssl_ccs.rb,
lib/sslyze/xml/http_headers.rb,
lib/sslyze/xml/invalid_target.rb,
lib/sslyze/xml/attributes/error.rb,
lib/sslyze/xml/attributes/title.rb,
lib/sslyze/xml/attributes/exception.rb,
lib/sslyze/xml/certinfo/certificate.rb,
lib/sslyze/xml/protocol/cipher_suite.rb,
lib/sslyze/xml/certinfo/ocsp_stapling.rb,
lib/sslyze/xml/attributes/is_supported.rb,
lib/sslyze/xml/attributes/is_vulnerable.rb,
lib/sslyze/xml/certinfo/has_certificates.rb,
lib/sslyze/xml/fallback/tls_fallback_scsv.rb,
lib/sslyze/xml/reneg/session_renegotiation.rb,
lib/sslyze/xml/heartbleed/openssl_heartbleed.rb,
lib/sslyze/xml/compression/compression_method.rb,
lib/sslyze/xml/certinfo/certificate_validation.rb,
lib/sslyze/xml/openssl_ccs/openssl_ccs_injection.rb,
lib/sslyze/xml/protocol/cipher_suite/key_exchange.rb,
lib/sslyze/xml/certinfo/received_certificate_chain.rb,
lib/sslyze/xml/certinfo/ocsp_stapling/ocsp_response.rb,
lib/sslyze/xml/http_headers/http_public_key_pinning.rb,
lib/sslyze/xml/resum/session_resumption_with_session_ids.rb,
lib/sslyze/xml/resum/session_resumption_with_tls_tickets.rb,
lib/sslyze/xml/http_headers/http_strict_transport_security.rb,
lib/sslyze/xml/certinfo/certificate_validation/path_validation.rb,
lib/sslyze/xml/certinfo/certificate_validation/hostname_validation.rb,
lib/sslyze/xml/certinfo/certificate_validation/verified_certificate_chain.rb
Overview
Represents the XML output from sslyze.
Defined Under Namespace
Modules: Attributes, Types Classes: Certinfo, Compression, Fallback, HTTPHeaders, Heartbleed, InvalidTarget, OpenSSLCCS, Plugin, Protocol, Reneg, Resum, ResumRate, Target
Constant Summary
Constants included from Types
Class Method Summary collapse
-
.open(path) ⇒ XML
Opens the XML file.
-
.parse(xml) ⇒ XML
Parses the XML.
Instance Method Summary collapse
-
#each_invalid_target {|invalidtarget| ... } ⇒ Enumerator
Enumerates over each invalid target.
-
#each_target {|target| ... } ⇒ Enumerator
(also: #each)
Enumerates over each target.
-
#initialize(doc) ⇒ XML
constructor
Initializes the XML.
- #invalid_targets ⇒ Array<InvalidTarget>
-
#network_timeout ⇒ Integer
The default timeout used.
-
#target ⇒ Target?
The first target.
- #targets ⇒ Array<Target>
-
#total_scan_time ⇒ Float
Duration of the scan.
-
#version ⇒ String
The version of the XML output.
Methods included from Attributes::Title
Constructor Details
#initialize(doc) ⇒ XML
Initializes the XML.
25 26 27 |
# File 'lib/sslyze/xml.rb', line 25 def initialize(doc) @doc = doc end |
Class Method Details
.open(path) ⇒ XML
Opens the XML file.
49 50 51 |
# File 'lib/sslyze/xml.rb', line 49 def self.open(path) new(File.open(path) { |file| Nokogiri::XML(file) }) end |
.parse(xml) ⇒ XML
Parses the XML.
37 38 39 |
# File 'lib/sslyze/xml.rb', line 37 def self.parse(xml) new(Nokogiri::XML.parse(xml)) end |
Instance Method Details
#each_invalid_target {|invalidtarget| ... } ⇒ Enumerator
Enumerates over each invalid target.
92 93 94 95 96 97 98 |
# File 'lib/sslyze/xml.rb', line 92 def each_invalid_target return enum_for(__method__) unless block_given? @doc.xpath('/document/invalidTargets/invalidTarget').each do |inval| yield InvalidTarget.new(inval) end end |
#each_target {|target| ... } ⇒ Enumerator Also known as: each
Enumerates over each target.
120 121 122 123 124 125 126 |
# File 'lib/sslyze/xml.rb', line 120 def each_target return enum_for(__method__) unless block_given? @doc.xpath('/document/results/target').each do |target| yield Target.new(target) end end |
#invalid_targets ⇒ Array<InvalidTarget>
107 108 109 |
# File 'lib/sslyze/xml.rb', line 107 def invalid_targets each_invalid_target.to_a end |
#network_timeout ⇒ Integer
The default timeout used.
69 70 71 |
# File 'lib/sslyze/xml.rb', line 69 def network_timeout @default_time ||= @doc.at_xpath('/document/results/@networkTimeout').value.to_i end |
#target ⇒ Target?
The first target.
144 145 146 |
# File 'lib/sslyze/xml.rb', line 144 def target each_target.first end |
#targets ⇒ Array<Target>
135 136 137 |
# File 'lib/sslyze/xml.rb', line 135 def targets each_target.to_a end |
#total_scan_time ⇒ Float
Duration of the scan.
78 79 80 |
# File 'lib/sslyze/xml.rb', line 78 def total_scan_time @start_tls ||= @doc.at_xpath('/document/results/@totalScanTime').value.to_f end |
#version ⇒ String
The version of the XML output.
58 59 60 |
# File 'lib/sslyze/xml.rb', line 58 def version @version ||= @doc.at_xpath('/document/@SSLyzeVersion').value end |