yawast 0.6.0.beta3 → 0.6.0.beta4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.codeclimate.yml +3 -12
- data/CHANGELOG.md +2 -0
- data/README.md +25 -524
- data/bin/yawast +0 -11
- data/lib/scanner/plugins/ssl/ssl_labs/analyze.rb +34 -0
- data/lib/scanner/plugins/ssl/ssl_labs/info.rb +33 -0
- data/lib/scanner/ssl_labs.rb +185 -163
- data/lib/shared/http.rb +5 -5
- data/lib/version.rb +1 -1
- data/test/data/ssl_labs_analyze_data.json +6458 -0
- data/test/data/ssl_labs_analyze_start.json +11 -0
- data/test/data/ssl_labs_info.json +10 -0
- data/test/test_internalssl.rb +2 -2
- data/test/test_shared_http.rb +1 -1
- data/test/test_ssl_labs_analyze.rb +48 -0
- data/test/test_ssl_labs_info.rb +20 -0
- data/yawast.gemspec +0 -1
- metadata +14 -18
- data/lib/commands/cert.rb +0 -10
- data/lib/scanner/cert.rb +0 -99
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
module Yawast
|
4
|
+
module Scanner
|
5
|
+
module Plugins
|
6
|
+
module SSL
|
7
|
+
module SSLLabs
|
8
|
+
class Analyze
|
9
|
+
def self.scan(endpoint, target, startNew)
|
10
|
+
uri = endpoint.copy
|
11
|
+
uri.path = '/api/v3/analyze'
|
12
|
+
|
13
|
+
if startNew
|
14
|
+
uri.query = "host=#{target}&publish=off&startNew=on&all=done&ignoreMismatch=on"
|
15
|
+
else
|
16
|
+
uri.query = "host=#{target}&publish=off&all=done&ignoreMismatch=on"
|
17
|
+
end
|
18
|
+
|
19
|
+
body = Yawast::Shared::Http.get uri
|
20
|
+
|
21
|
+
return body
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.extract_status(body)
|
25
|
+
json = JSON.parse body
|
26
|
+
|
27
|
+
return json['status']
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'json'
|
2
|
+
|
3
|
+
module Yawast
|
4
|
+
module Scanner
|
5
|
+
module Plugins
|
6
|
+
module SSL
|
7
|
+
module SSLLabs
|
8
|
+
class Info
|
9
|
+
def self.call_info(endpoint)
|
10
|
+
uri = endpoint.copy
|
11
|
+
uri.path = '/api/v3/info'
|
12
|
+
|
13
|
+
body = Yawast::Shared::Http.get uri
|
14
|
+
|
15
|
+
return body
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.extract_msg(body)
|
19
|
+
ret = Array.new
|
20
|
+
json = JSON.parse body
|
21
|
+
|
22
|
+
json['messages'].each do |msg|
|
23
|
+
ret.push msg
|
24
|
+
end
|
25
|
+
|
26
|
+
return ret
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|