norad_cli 0.1.17 → 0.1.18
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/lib/norad_cli/support/sectest_container.rb +13 -4
- data/lib/norad_cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c76972ccc6770677c3120ed70cd195c043141647
|
4
|
+
data.tar.gz: c58525f06bafa832759511b0178a46c677168981
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d476040efc1bef4484ec3791433741cbd7c8d52974b3187cf44ffa7712f4709338e36c4c8c7029b883e2647bfd9eda83216e8fdf112f5cba6981cf92b33cc2d
|
7
|
+
data.tar.gz: c542973a351aec58583a7badb70df367f286152be2ce0e1203ae4dc8228283505336bc04ab8104a6ad92c32539b0fa1a2f2190a9bf6c6547fb38462c22122890
|
@@ -11,6 +11,7 @@ module NoradCli
|
|
11
11
|
attr_accessor :sectest_image
|
12
12
|
attr_accessor :results_server
|
13
13
|
attr_accessor :debug
|
14
|
+
attr_reader :sectest_options
|
14
15
|
|
15
16
|
def initialize(sectest_name, registry, version, options)
|
16
17
|
# Generate a random assessment id
|
@@ -47,10 +48,11 @@ module NoradCli
|
|
47
48
|
end
|
48
49
|
|
49
50
|
# Load the prog_arg format
|
50
|
-
sectest_options ||= YAML.safe_load(File.read("sectests/#{sectest_name}/manifest.yml"))
|
51
|
+
@sectest_options ||= YAML.safe_load(File.read("sectests/#{sectest_name}/manifest.yml"))
|
51
52
|
|
52
|
-
# Load an ssh key if
|
53
|
-
prog_arg_hash[:
|
53
|
+
# Load an ssh key if necessary (default to Norad's key pair)
|
54
|
+
prog_arg_hash[:ssh_user] = 'testuser' if !prog_arg_hash[:ssh_user] && progarg_present?('ssh_user')
|
55
|
+
prog_arg_hash[:ssh_key] = load_ssh_key(prog_arg_hash[:ssh_key]) if progarg_present?('ssh_key')
|
54
56
|
|
55
57
|
# Fill out the prog_args and return
|
56
58
|
begin
|
@@ -65,6 +67,10 @@ module NoradCli
|
|
65
67
|
end
|
66
68
|
end
|
67
69
|
|
70
|
+
def progarg_present?(key)
|
71
|
+
sectest_options['prog_args'].include?("{#{key}}")
|
72
|
+
end
|
73
|
+
|
68
74
|
def start
|
69
75
|
# Start the results server container
|
70
76
|
@results_server.start
|
@@ -123,7 +129,10 @@ module NoradCli
|
|
123
129
|
|
124
130
|
# Replace ssh key file with encoded ssh key
|
125
131
|
def load_ssh_key(ssh_key_file)
|
126
|
-
|
132
|
+
# Check for no ssh_key specified
|
133
|
+
if !ssh_key_file
|
134
|
+
Base64.strict_encode64(File.read(NoradCli.ssh_key_path))
|
135
|
+
elsif File.exist?(ssh_key_file)
|
127
136
|
Base64.strict_encode64(File.read(ssh_key_file))
|
128
137
|
else
|
129
138
|
puts Rainbow("Error: SSH Key file: #{ssh_key_file} does not exist!\nExiting..\n").red
|
data/lib/norad_cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: norad_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Hitchcock
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-03-
|
13
|
+
date: 2017-03-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: git
|