sslscan_steps 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/README.md +48 -0
- data/Rakefile +14 -0
- data/lib/sslscan_steps/report_steps.rb +75 -0
- data/lib/sslscan_steps/scanner_steps.rb +31 -0
- data/lib/sslscan_steps.rb +2 -0
- metadata +106 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5d0dd9e80db7cb94e7db6e9da21cb0cc6a0de83a811df51e5ab6574d20b7614f
|
4
|
+
data.tar.gz: dafaf2277f509417581f4622281d86ad64e88b58d6ea7ccc8479bbf6cea8c79a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c38bcfc529fe37b6a98c9ab905d3931b6fddb339bf72a04cef143464bdd274cef8639a6299c39139aff6c1db09f7ef4318b44f7b60ab137ff7489ad95de7ab08
|
7
|
+
data.tar.gz: 1df6ec2430ec5475554211ef50fb0d7387edaf4b7ef403ec7591f88f84cff9502844d4cf520a83dae5945393c4c9245fa86e4580e88a0e8bccc770bec6cfced0
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/sslscan_steps.svg)](https://badge.fury.io/rb/sslscan_steps)
|
2
|
+
|
3
|
+
# sslscan\_steps
|
4
|
+
|
5
|
+
sslscan\_steps provides cucumber step definitions for executing
|
6
|
+
SSL/TLS protocol scans with the sslscan tool.
|
7
|
+
|
8
|
+
* [rbsec/sslscan at GitHub](https://github.com/rbsec/sslscan)
|
9
|
+
|
10
|
+
It uses the sslscan\_wrapper gem for interaction with sslscan.
|
11
|
+
|
12
|
+
## Usage
|
13
|
+
|
14
|
+
In your Gemfile:
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
gem 'sslscan_steps'
|
18
|
+
```
|
19
|
+
|
20
|
+
In your support/env.rb:
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
require 'sslscan_steps'
|
24
|
+
```
|
25
|
+
|
26
|
+
Use the steps in your feature files:
|
27
|
+
|
28
|
+
```gherkin
|
29
|
+
Feature: SSL/TLS protocol parameters
|
30
|
+
To be a responsible site operator my website must support
|
31
|
+
state-of-the-art encryption protocols.
|
32
|
+
|
33
|
+
Scenario: Host must support strong encryption
|
34
|
+
Given the target host for sslscan is markusbenning.de
|
35
|
+
And the target port for sslscan is 443
|
36
|
+
When the sslscan is executed
|
37
|
+
Then the scanned hostname is markusbenning.de
|
38
|
+
Then the scanned host certificate signature algorithm is sha256WithRSAEncryption
|
39
|
+
Then the scanned host certificate is not self-signed
|
40
|
+
Then the scanned host certificate is not expired
|
41
|
+
Then the scanned host is not vulnerable to heartbleed
|
42
|
+
Then the scanned host must support the cipher ECDHE-RSA-AES128-GCM-SHA256
|
43
|
+
Then the scanned host must support sslversion TLSv1.2
|
44
|
+
```
|
45
|
+
|
46
|
+
## More Examples
|
47
|
+
|
48
|
+
See [features/](tree/master/features).
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rake/clean'
|
2
|
+
require 'rubygems'
|
3
|
+
require 'rubygems/package_task'
|
4
|
+
require 'rdoc/task'
|
5
|
+
|
6
|
+
spec = eval(File.read('sslscan_steps.gemspec'))
|
7
|
+
Gem::PackageTask.new(spec) do |pkg|
|
8
|
+
end
|
9
|
+
|
10
|
+
Rake::RDocTask.new do |rd|
|
11
|
+
rd.rdoc_files.include("lib/**/*.rb","bin/**/*")
|
12
|
+
rd.title = 'Cucumber step definitions for sslscan'
|
13
|
+
end
|
14
|
+
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require 'sslscan_wrapper'
|
2
|
+
|
3
|
+
Given /^the sslscan report file is (.*)$/ do |path|
|
4
|
+
@sslscan_filename = path
|
5
|
+
end
|
6
|
+
|
7
|
+
When /^the sslscan report is read from the file$/ do
|
8
|
+
content = File.read(@sslscan_filename)
|
9
|
+
@sslscan_report = SslscanWrapper::Report.new(content)
|
10
|
+
expect(@sslscan_report).to be_a(SslscanWrapper::Report)
|
11
|
+
end
|
12
|
+
|
13
|
+
Then /^the scanned hostname is (.*)$/ do |hostname|
|
14
|
+
expect(@sslscan_report.host).to eq(hostname)
|
15
|
+
end
|
16
|
+
|
17
|
+
Then /^the scanned port is (\d+)$/ do |port|
|
18
|
+
expect(@sslscan_report.port.to_i).to eq(port.to_i)
|
19
|
+
end
|
20
|
+
|
21
|
+
Then /^the scanned host supports (no )?compression$/ do |negate|
|
22
|
+
expect(@sslscan_report.compression_supported?).to eq(negate.nil? ? true : false)
|
23
|
+
end
|
24
|
+
|
25
|
+
Then /^the scanned host supports (no )?renegotiation$/ do |negate|
|
26
|
+
expect(@sslscan_report.renegotiation_supported?).to eq(negate.nil? ? true : false)
|
27
|
+
end
|
28
|
+
|
29
|
+
Then /^the scanned host supports (no )?secure renegotiation$/ do |negate|
|
30
|
+
expect(@sslscan_report.renegotiation_secure?).to eq(negate.nil? ? true : false)
|
31
|
+
end
|
32
|
+
|
33
|
+
Then /^the scanned host certificate signature algorithm is (.*)$/ do |alg|
|
34
|
+
expect(@sslscan_report.signature_algorithm).to eq(alg)
|
35
|
+
end
|
36
|
+
|
37
|
+
Then /^the scanned host certificate subject is (.*)$/ do |subject|
|
38
|
+
expect(@sslscan_report.subject).to eq(subject)
|
39
|
+
end
|
40
|
+
|
41
|
+
Then /^the scanned host certificate subject altnames are (.*)$/ do |altnames|
|
42
|
+
altnames = nil if altnames == 'empty'
|
43
|
+
expect(@sslscan_report.altnames).to eq(altnames)
|
44
|
+
end
|
45
|
+
|
46
|
+
Then /^the scanned host certificate issuer is (.*)$/ do |issuer|
|
47
|
+
expect(@sslscan_report.issuer).to eq(issuer)
|
48
|
+
end
|
49
|
+
|
50
|
+
Then /^the scanned host certificate is (not )?self-signed$/ do |negate|
|
51
|
+
expect(@sslscan_report.self_signed?).to eq(negate.nil? ? true : false)
|
52
|
+
end
|
53
|
+
|
54
|
+
Then /^the scanned host certificate is (not )?expired$/ do |negate|
|
55
|
+
expect(@sslscan_report.expired?).to eq(negate.nil? ? true : false)
|
56
|
+
end
|
57
|
+
|
58
|
+
Then /^the scanned host is (not )?vulnerable to heartbleed$/ do |negate|
|
59
|
+
expect(@sslscan_report.heartbleed_vulnerable?).to eq(negate.nil? ? true : false)
|
60
|
+
end
|
61
|
+
|
62
|
+
Then /^the scanned host must (|not )support the cipher (\S+)$/ do |negate,cipher|
|
63
|
+
expect(@sslscan_report.support_cipher?(cipher)).to eq(negate =~ /not/ ? false : true)
|
64
|
+
end
|
65
|
+
|
66
|
+
Then /^the scanned host must (|not )support ciphers like (.*)$/ do |negate,regex|
|
67
|
+
list = @sslscan_report.ciphers.select do |cipher|
|
68
|
+
cipher.match(regex)
|
69
|
+
end
|
70
|
+
expect(list.count > 0).to eq(negate =~ /not/ ? false : true)
|
71
|
+
end
|
72
|
+
|
73
|
+
Then /^the scanned host must (|not )support sslversion (\S+)$/ do |negate,sslversion|
|
74
|
+
expect(@sslscan_report.support_sslversion?(sslversion)).to eq(negate =~ /not/ ? false : true)
|
75
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'sslscan_wrapper'
|
2
|
+
|
3
|
+
Given /^the target host for sslscan is (\S+)$/ do |hostname|
|
4
|
+
@sslscan_host = hostname
|
5
|
+
end
|
6
|
+
|
7
|
+
Given /^the target port for sslscan is (\d+)$/ do |port|
|
8
|
+
@sslscan_port = port
|
9
|
+
end
|
10
|
+
|
11
|
+
Given /^the option flag (\S+) for sslscan is set$/ do |flag|
|
12
|
+
@sslscan_flags ||= []
|
13
|
+
@sslscan_flags << flag
|
14
|
+
end
|
15
|
+
|
16
|
+
Given /^the option parameter (\S+) for sslscan is set to (.*)$/ do |option,value|
|
17
|
+
@sslscan_options ||= {}
|
18
|
+
@sslscan_options[option] = value
|
19
|
+
end
|
20
|
+
|
21
|
+
When /^the sslscan is executed/ do
|
22
|
+
scanner = SslscanWrapper::Scanner.new
|
23
|
+
@sslscan_options.to_h.each do |k,v|
|
24
|
+
scanner.send("#{k}=", v)
|
25
|
+
end
|
26
|
+
@sslscan_flags.to_a.each do |flag|
|
27
|
+
scanner.send("#{flag}=", true)
|
28
|
+
end
|
29
|
+
@sslscan_report = scanner.scan(@sslscan_host, @sslscan_port)
|
30
|
+
end
|
31
|
+
|
metadata
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sslscan_steps
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Markus Benning
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-04-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: aruba
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '12'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '12'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rdoc
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '6'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '6'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sslscan_wrapper
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description:
|
70
|
+
email: ich@markusbenning.de
|
71
|
+
executables: []
|
72
|
+
extensions: []
|
73
|
+
extra_rdoc_files: []
|
74
|
+
files:
|
75
|
+
- Gemfile
|
76
|
+
- README.md
|
77
|
+
- Rakefile
|
78
|
+
- lib/sslscan_steps.rb
|
79
|
+
- lib/sslscan_steps/report_steps.rb
|
80
|
+
- lib/sslscan_steps/scanner_steps.rb
|
81
|
+
homepage: https://github.com/benningm/sslscan_steps
|
82
|
+
licenses:
|
83
|
+
- MIT
|
84
|
+
metadata: {}
|
85
|
+
post_install_message:
|
86
|
+
rdoc_options: []
|
87
|
+
require_paths:
|
88
|
+
- lib
|
89
|
+
- lib
|
90
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
requirements: []
|
101
|
+
rubyforge_project:
|
102
|
+
rubygems_version: 2.7.6
|
103
|
+
signing_key:
|
104
|
+
specification_version: 4
|
105
|
+
summary: Cucumber step file definitions for sslscan
|
106
|
+
test_files: []
|