norad_cli 0.1.6 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f606aeaa79482bbf32e5d7f6afff6e1178a35a5
|
4
|
+
data.tar.gz: 2cd7aef8152ce1623e20bb82fc0670a309f1866c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c461bd847cd10274b816ae1e29b9445e835315d85a296238f9649e809bddb86a20a4f221607be68a19fba687f04c3c919e07f37aa6239bcbd76b70359509be0
|
7
|
+
data.tar.gz: 9264b190fdcbc625b61101142690ce24e2ddbfeaeb55e550ca4fe08e2462ba0ea7baac90fb678f6e1205a265624fef1231a26c1c584ddc70a41ae70ff3efcdd6
|
@@ -25,6 +25,13 @@ class Sectest < Thor
|
|
25
25
|
# Check for the root_dir
|
26
26
|
root_dir?
|
27
27
|
|
28
|
+
# Check for valid test types
|
29
|
+
if !%w(authenticated web_application brute_force ssl_crypto ssh_crypto whole_host).include?(options[:test_type])
|
30
|
+
say("#{options[:test_type]} is not a supported test type", :red)
|
31
|
+
say('Exiting...', :red)
|
32
|
+
exit(1)
|
33
|
+
end
|
34
|
+
|
28
35
|
# Set options for templates
|
29
36
|
options[:name] = sectest_name
|
30
37
|
options[:spec_class_name] = sectest_name.split('-').map { |t| t =~ /\d+/ ? t : t.capitalize! }.join
|
@@ -149,6 +156,7 @@ class Sectest < Thor
|
|
149
156
|
|
150
157
|
desc 'spec:image SECTESTNAME', 'Run the rspec tests for SECTESTNAME'
|
151
158
|
option :verbose, aliases: '-v', type: :boolean, desc: 'Turn on verbose logging'
|
159
|
+
option :debug, aliases: '-d', type: :boolean, desc: 'Turn on debugging'
|
152
160
|
define_method 'spec:image' do |name|
|
153
161
|
# Check for the root_dir
|
154
162
|
root_dir?
|
@@ -158,6 +166,10 @@ class Sectest < Thor
|
|
158
166
|
ENV['ENABLE_LOGS'] = 'true'
|
159
167
|
end
|
160
168
|
|
169
|
+
if options[:debug]
|
170
|
+
ENV['ENABLE_NORAD_DEBUG'] = 'true'
|
171
|
+
end
|
172
|
+
|
161
173
|
ENV['SCAN_ASSESSMENT'] = 'true'
|
162
174
|
ENV['TEST_RESULTS_SERVER_IMAGE'] = 'docker-images-test-results-server'
|
163
175
|
ENV['UBUNTU_SSH_SERVER_IMAGE'] = 'docker-images-test-ubuntu-ssh-server'
|
@@ -168,7 +180,7 @@ class Sectest < Thor
|
|
168
180
|
|
169
181
|
desc 'spec', 'Run all rspec tests for the entire repo (all sectests)'
|
170
182
|
option :verbose, aliases: '-v', type: :boolean, default: false, desc: 'Turn on verbose logging'
|
171
|
-
option :
|
183
|
+
option :debug, aliases: '-d', type: :boolean, desc: 'Turn on debugging'
|
172
184
|
def spec
|
173
185
|
# Check for the root_dir
|
174
186
|
root_dir?
|
@@ -239,7 +251,7 @@ class Sectest < Thor
|
|
239
251
|
def root_dir?
|
240
252
|
%w(base spec sectests).each do |dirrepo_name|
|
241
253
|
if !File.exist?(dirrepo_name)
|
242
|
-
say("Commands must be run from the root
|
254
|
+
say("Commands must be run from the root of the test repository\nExiting....", :red)
|
243
255
|
exit(1)
|
244
256
|
end
|
245
257
|
end
|
@@ -181,7 +181,10 @@ if ENV['SCAN_ASSESSMENT']
|
|
181
181
|
|
182
182
|
define_method :stop_target_machine do |machine|
|
183
183
|
machine.stop
|
184
|
-
|
184
|
+
# Do not delete targets if debugging enabled
|
185
|
+
if !ENV['ENABLE_NORAD_DEBUG']
|
186
|
+
machine.delete(force: true)
|
187
|
+
end
|
185
188
|
machine.id
|
186
189
|
end
|
187
190
|
|
@@ -9,9 +9,12 @@ def run(args)
|
|
9
9
|
['FIXME:TOOL_OPTION', 'FIXME:TOOL_OPTION', 'FIXME:TOOL_OPTION'].flatten,
|
10
10
|
timeout)
|
11
11
|
|
12
|
-
# Execute the runner
|
12
|
+
# Execute the runner, write output to a file, and process
|
13
13
|
runner.execute
|
14
14
|
|
15
|
+
# Or Execute the runner and process stdout
|
16
|
+
# runner.execute(true)
|
17
|
+
|
15
18
|
# Ensure the tool created results
|
16
19
|
runner.parse_results do |fh|
|
17
20
|
############################
|
data/lib/norad_cli/version.rb
CHANGED