octool 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/octool +7 -5
- data/lib/octool.rb +2 -0
- data/lib/octool/constants.rb +5 -2
- data/lib/octool/parser.rb +3 -3
- data/lib/octool/ssp.rb +4 -0
- data/lib/octool/system.rb +2 -0
- data/lib/octool/version.rb +3 -1
- data/octool.rdoc +2 -2
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b4309625dcbe93d28161179e763a38c4d4c25bd46f75b8a717e314167984356
|
4
|
+
data.tar.gz: eb021712e5165c88df02c1ecb40b6017c4c1abbe9c05c7ef77e074255b04298a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4534786fd6fbb5a0e1be118872e9a0fba4cb50b87d05b59ba4262b6cf6fc884d3f81b9dd48690cb382c5f5cc347228e37497dc2a4c02ecc9bdb2c1290b4268b1
|
7
|
+
data.tar.gz: a715d521b431f1f20770bba0df3ac1eb2091f837a1902c017bc15d881f09a9301c3eef794f54c18d7eccc9b8836b8d347a0d71819a1a7b688590f5fb14f4a9be
|
data/bin/octool
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
require 'gli'
|
3
5
|
require 'octool'
|
4
6
|
|
@@ -37,14 +39,13 @@ class App
|
|
37
39
|
arg_name 'path/to/system/config.yaml'
|
38
40
|
command :ssp do |s|
|
39
41
|
s.desc 'where to store outputs'
|
40
|
-
s.default_value
|
42
|
+
s.default_value OCTool::DEFAULT_OUTPUT_DIR
|
41
43
|
s.long_desc 'Default output directory respects env vars TMPDIR, TMP, TEMP'
|
42
44
|
s.arg_name 'path/to/output/dir'
|
43
45
|
s.flag [:d, :dir]
|
44
46
|
|
45
47
|
s.action do |global_options, options, args|
|
46
48
|
export_dir = options[:dir]
|
47
|
-
FileUtils.mkdir_p export_dir unless File.directory?(export_dir)
|
48
49
|
config_file = find_config(args)
|
49
50
|
system = OCTool::Parser.new(config_file).load_system
|
50
51
|
Dir.chdir File.dirname(config_file) do
|
@@ -75,12 +76,13 @@ class App
|
|
75
76
|
# Error logic here
|
76
77
|
# Return false to skip default error handling.
|
77
78
|
if ENV['DEBUG']
|
78
|
-
puts exception.
|
79
|
+
STDERR.puts exception.message
|
80
|
+
STDERR.puts exception.backtrace
|
79
81
|
pp exception
|
80
82
|
false
|
81
|
-
else
|
82
|
-
true
|
83
83
|
end
|
84
|
+
STDERR.puts '[FAIL]'
|
85
|
+
true
|
84
86
|
end
|
85
87
|
end
|
86
88
|
|
data/lib/octool.rb
CHANGED
data/lib/octool/constants.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module OCTool
|
2
|
-
LATEST_SCHEMA_VERSION = 'v1.0.0'
|
4
|
+
LATEST_SCHEMA_VERSION = 'v1.0.0'
|
3
5
|
BASE_SCHEMA_DIR = File.join(File.dirname(__FILE__), '..', '..', 'schemas').freeze
|
4
6
|
ERB_DIR = File.join(File.dirname(__FILE__), '..', '..', 'templates').freeze
|
5
|
-
DEFAULT_CONFIG_FILENAME = 'config.yaml'
|
7
|
+
DEFAULT_CONFIG_FILENAME = 'config.yaml'
|
8
|
+
DEFAULT_OUTPUT_DIR = '/data'
|
6
9
|
end
|
data/lib/octool/parser.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module OCTool
|
2
4
|
# Custom error to show validation errors.
|
3
5
|
class ValidationError < StandardError
|
@@ -56,9 +58,7 @@ module OCTool
|
|
56
58
|
end
|
57
59
|
|
58
60
|
def schema_dir
|
59
|
-
@schema_dir ||=
|
60
|
-
File.join(BASE_SCHEMA_DIR, schema_version).freeze
|
61
|
-
end
|
61
|
+
@schema_dir ||= File.join(BASE_SCHEMA_DIR, schema_version)
|
62
62
|
end
|
63
63
|
|
64
64
|
def schema_version
|
data/lib/octool/ssp.rb
CHANGED
data/lib/octool/system.rb
CHANGED
data/lib/octool/version.rb
CHANGED
data/octool.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
== octool - Open Compliance Tool
|
2
2
|
|
3
|
-
v0.0.
|
3
|
+
v0.0.3
|
4
4
|
|
5
5
|
=== Global Options
|
6
6
|
=== --help
|
@@ -33,7 +33,7 @@ generate System Security Plan
|
|
33
33
|
|
34
34
|
where to store outputs
|
35
35
|
|
36
|
-
[Default Value] /
|
36
|
+
[Default Value] /data
|
37
37
|
Default output directory respects env vars TMPDIR, TMP, TEMP
|
38
38
|
|
39
39
|
==== Command: <tt>validate </tt>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Morgan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -64,6 +64,20 @@ dependencies:
|
|
64
64
|
- - '='
|
65
65
|
- !ruby/object:Gem::Version
|
66
66
|
version: 0.2.2
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: etc
|
69
|
+
requirement: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - '='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: 1.1.0
|
74
|
+
type: :runtime
|
75
|
+
prerelease: false
|
76
|
+
version_requirements: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - '='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: 1.1.0
|
67
81
|
- !ruby/object:Gem::Dependency
|
68
82
|
name: gli
|
69
83
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,7 +179,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
165
179
|
requirements:
|
166
180
|
- - ">="
|
167
181
|
- !ruby/object:Gem::Version
|
168
|
-
version: '
|
182
|
+
version: '2.4'
|
169
183
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
184
|
requirements:
|
171
185
|
- - ">="
|