inspec 3.0.64 → 3.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +52 -0
- data/inspec.gemspec +51 -0
- data/lib/fetchers/git.rb +1 -1
- data/lib/fetchers/url.rb +4 -2
- data/lib/inspec/base_cli.rb +35 -9
- data/lib/inspec/cli.rb +6 -0
- data/lib/inspec/errors.rb +2 -0
- data/lib/inspec/ui.rb +216 -0
- data/lib/inspec/version.rb +1 -1
- data/lib/resources/mysql_session.rb +1 -1
- metadata +35 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54ccf8c9157dd5a8f7641ef3612d2e2909cafcceaa3c54cd5e6cbfbee95cd71e
|
4
|
+
data.tar.gz: 3080398f8bb9aaa6095c7d6d345b0b6be9e3e0ad97825faeb5f9d3475dfaedd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 064c5a157f5b79bf2c2be616dcf99ac4d4ad850236f16ea0b86aa02ca6e87c1d20bf2db18e43ac1cc487b3aebf9462c9a412b5a7ee2d4d705496dcd3047a201b
|
7
|
+
data.tar.gz: bdf94be09e23b2c7ec9ba244858f01f3de9139f5bb96df207fe69c5543b5d670dc52a90dd06e8d449360eb92243289c7df57d8bcf3de46943be9f7d59a3cf35d
|
data/Gemfile
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
source 'https://rubygems.org'
|
3
|
+
gemspec name: 'inspec'
|
4
|
+
|
5
|
+
gem 'ffi', '>= 1.9.14'
|
6
|
+
gem 'aws-sdk', '~> 2'
|
7
|
+
|
8
|
+
group :test do
|
9
|
+
gem 'bundler', '~> 1.5'
|
10
|
+
gem 'minitest', '~> 5.5'
|
11
|
+
gem 'rake', '>= 10'
|
12
|
+
gem 'rubocop', '= 0.49.1'
|
13
|
+
gem 'simplecov', '~> 0.10'
|
14
|
+
gem 'concurrent-ruby', '~> 1.0'
|
15
|
+
gem 'mocha', '~> 1.1'
|
16
|
+
gem 'ruby-progressbar', '~> 1.8'
|
17
|
+
gem 'webmock', '~> 2.3.2'
|
18
|
+
gem 'jsonschema', '~> 2.0.2'
|
19
|
+
gem 'passgen'
|
20
|
+
gem 'm'
|
21
|
+
gem 'pry-byebug'
|
22
|
+
end
|
23
|
+
|
24
|
+
group :integration do
|
25
|
+
gem 'berkshelf', '~> 5.2'
|
26
|
+
gem 'test-kitchen', '~> 1.6'
|
27
|
+
gem 'kitchen-vagrant'
|
28
|
+
# we need winrm v2 support >= 0.15.1
|
29
|
+
gem 'kitchen-inspec', '>= 0.15.1'
|
30
|
+
gem 'kitchen-ec2'
|
31
|
+
gem 'kitchen-dokken'
|
32
|
+
end
|
33
|
+
|
34
|
+
group :tools do
|
35
|
+
gem 'pry', '~> 0.10'
|
36
|
+
gem 'rb-readline'
|
37
|
+
gem 'license_finder'
|
38
|
+
gem 'git', '~> 1.4'
|
39
|
+
end
|
40
|
+
|
41
|
+
# gems for Maintainers.md generation
|
42
|
+
group :maintenance do
|
43
|
+
gem 'tomlrb'
|
44
|
+
|
45
|
+
# To sync maintainers with github
|
46
|
+
gem 'octokit'
|
47
|
+
gem 'netrc'
|
48
|
+
end
|
49
|
+
|
50
|
+
group :deploy do
|
51
|
+
gem 'inquirer'
|
52
|
+
end
|
data/inspec.gemspec
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'inspec/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'inspec'
|
8
|
+
spec.version = Inspec::VERSION
|
9
|
+
spec.authors = ['Dominik Richter']
|
10
|
+
spec.email = ['dominik.richter@gmail.com']
|
11
|
+
spec.summary = 'Infrastructure and compliance testing.'
|
12
|
+
spec.description = 'InSpec provides a framework for creating end-to-end infrastructure tests. You can use it for integration or even compliance testing. Create fully portable test profiles and use them in your workflow to ensure stability and security. Integrate InSpec in your change lifecycle for local testing, CI/CD, and deployment verification.'
|
13
|
+
spec.homepage = 'https://github.com/inspec/inspec'
|
14
|
+
spec.license = 'Apache-2.0'
|
15
|
+
|
16
|
+
# the gemfile and gemspec are necessary for appbundler so don't remove it
|
17
|
+
spec.files = %w{Gemfile inspec.gemspec README.md LICENSE} + Dir.glob(
|
18
|
+
'{bin,lib,etc}/**/*', File::FNM_DOTMATCH
|
19
|
+
).reject { |f| File.directory?(f) }
|
20
|
+
|
21
|
+
spec.executables = %w{inspec}
|
22
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
23
|
+
spec.require_paths = ['lib']
|
24
|
+
|
25
|
+
spec.required_ruby_version = '>= 2.3'
|
26
|
+
|
27
|
+
spec.add_dependency 'train', '~> 1.5', '>= 1.5.11'
|
28
|
+
spec.add_dependency 'thor', '~> 0.20'
|
29
|
+
spec.add_dependency 'json', '>= 1.8', '< 3.0'
|
30
|
+
spec.add_dependency 'method_source', '~> 0.8'
|
31
|
+
spec.add_dependency 'rubyzip', '~> 1.2', '>= 1.2.2'
|
32
|
+
spec.add_dependency 'rspec', '~> 3'
|
33
|
+
spec.add_dependency 'rspec-its', '~> 1.2'
|
34
|
+
spec.add_dependency 'pry', '~> 0'
|
35
|
+
spec.add_dependency 'hashie', '~> 3.4'
|
36
|
+
spec.add_dependency 'mixlib-log'
|
37
|
+
spec.add_dependency 'sslshake', '~> 1.2'
|
38
|
+
spec.add_dependency 'parallel', '~> 1.9'
|
39
|
+
spec.add_dependency 'faraday', '>=0.9.0'
|
40
|
+
spec.add_dependency 'tty-table', '~> 0.10'
|
41
|
+
spec.add_dependency 'tty-prompt', '~> 0.17'
|
42
|
+
# Used for Azure profile until integrated into train
|
43
|
+
spec.add_dependency 'faraday_middleware', '~> 0.12.2'
|
44
|
+
spec.add_dependency 'tomlrb', '~> 1.2'
|
45
|
+
spec.add_dependency 'addressable', '~> 2.4'
|
46
|
+
spec.add_dependency 'parslet', '~> 1.5'
|
47
|
+
spec.add_dependency 'semverse'
|
48
|
+
spec.add_dependency 'htmlentities'
|
49
|
+
spec.add_dependency 'multipart-post'
|
50
|
+
spec.add_dependency 'term-ansicolor'
|
51
|
+
end
|
data/lib/fetchers/git.rb
CHANGED
@@ -89,7 +89,7 @@ module Fetchers
|
|
89
89
|
def resolve_ref(ref_name)
|
90
90
|
command_string = "git ls-remote \"#{@remote_url}\" \"#{ref_name}*\""
|
91
91
|
cmd = shellout(command_string)
|
92
|
-
raise "Error running '#{command_string}': #{cmd.stderr}" unless cmd.
|
92
|
+
raise "Error running '#{command_string}': #{cmd.stderr}" unless cmd.exitstatus == 0
|
93
93
|
ref = parse_ls_remote(cmd.stdout, ref_name)
|
94
94
|
if !ref
|
95
95
|
raise "Unable to resolve #{ref_name} to a specific git commit for #{@remote_url}"
|
data/lib/fetchers/url.rb
CHANGED
@@ -24,6 +24,8 @@ module Fetchers
|
|
24
24
|
resolve_from_string(target[:url], opts, target[:username], target[:password])
|
25
25
|
elsif target.is_a?(String)
|
26
26
|
resolve_from_string(target, opts)
|
27
|
+
elsif target.is_a?(URI)
|
28
|
+
resolve_from_string(target.to_s, opts)
|
27
29
|
end
|
28
30
|
end
|
29
31
|
|
@@ -94,8 +96,8 @@ module Fetchers
|
|
94
96
|
attr_reader :files, :archive_path
|
95
97
|
|
96
98
|
def initialize(url, opts)
|
97
|
-
@target = url
|
98
|
-
@target_uri = parse_uri(
|
99
|
+
@target = url.to_s
|
100
|
+
@target_uri = url.is_a?(URI) ? url : parse_uri(url)
|
99
101
|
@insecure = opts['insecure']
|
100
102
|
@token = opts['token']
|
101
103
|
@config = opts
|
data/lib/inspec/base_cli.rb
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
require 'thor'
|
6
6
|
require 'inspec/log'
|
7
7
|
require 'inspec/profile_vendor'
|
8
|
+
require 'inspec/ui'
|
8
9
|
|
9
10
|
# Allow end of options during array type parsing
|
10
11
|
# https://github.com/erikhuda/thor/issues/631
|
@@ -99,8 +100,6 @@ module Inspec
|
|
99
100
|
option :reporter, type: :array,
|
100
101
|
banner: 'one two:/output/file/path',
|
101
102
|
desc: 'Enable one or more output reporters: cli, documentation, html, progress, json, json-min, json-rspec, junit, yaml'
|
102
|
-
option :color, type: :boolean,
|
103
|
-
desc: 'Use colors in output.'
|
104
103
|
option :attrs, type: :array,
|
105
104
|
desc: 'Load attributes file (experimental)'
|
106
105
|
option :create_lockfile, type: :boolean,
|
@@ -219,24 +218,51 @@ module Inspec
|
|
219
218
|
# but Thor interprets all methods as subcommands. The no_commands block
|
220
219
|
# treats them as regular methods.
|
221
220
|
no_commands do
|
221
|
+
def ui
|
222
|
+
return @ui if defined?(@ui)
|
223
|
+
|
224
|
+
# Make a new UI object, respecting context
|
225
|
+
if options[:color].nil?
|
226
|
+
enable_color = true # If the command does not support the color option, default to on
|
227
|
+
else
|
228
|
+
enable_color = options[:color]
|
229
|
+
end
|
230
|
+
|
231
|
+
# UI will probe for TTY if nil - just send the raw option value
|
232
|
+
enable_interactivity = options[:interactive]
|
233
|
+
|
234
|
+
@ui = Inspec::UI.new(color: enable_color, interactive: enable_interactivity)
|
235
|
+
end
|
236
|
+
|
237
|
+
# Rationale: converting this to attr_writer breaks Thor
|
238
|
+
def ui=(new_ui) # rubocop: disable Style/TrivialAccessors
|
239
|
+
@ui = new_ui
|
240
|
+
end
|
241
|
+
|
222
242
|
def mark_text(text)
|
223
|
-
|
243
|
+
# TODO: - deprecate, call cli.ui directly
|
244
|
+
# Note that this one doesn't automatically print
|
245
|
+
ui.emphasis(text, print: false)
|
224
246
|
end
|
225
247
|
|
226
248
|
def headline(title)
|
227
|
-
|
249
|
+
# TODO: - deprecate, call cli.ui directly
|
250
|
+
ui.headline(title)
|
228
251
|
end
|
229
252
|
|
230
253
|
def li(entry)
|
231
|
-
|
254
|
+
# TODO: - deprecate, call cli.ui directly
|
255
|
+
ui.list_item(entry)
|
232
256
|
end
|
233
257
|
|
234
|
-
def
|
235
|
-
|
258
|
+
def plain_text(msg)
|
259
|
+
# TODO: - deprecate, call cli.ui directly
|
260
|
+
ui.plain(msg + "\n")
|
236
261
|
end
|
237
262
|
|
238
|
-
def
|
239
|
-
|
263
|
+
def exit(code)
|
264
|
+
# TODO: - deprecate, call cli.ui directly
|
265
|
+
ui.exit code
|
240
266
|
end
|
241
267
|
end
|
242
268
|
|
data/lib/inspec/cli.rb
CHANGED
@@ -26,6 +26,12 @@ class Inspec::InspecCLI < Inspec::BaseCLI
|
|
26
26
|
class_option :diagnose, type: :boolean,
|
27
27
|
desc: 'Show diagnostics (versions, configurations)'
|
28
28
|
|
29
|
+
class_option :color, type: :boolean,
|
30
|
+
desc: 'Use colors in output.'
|
31
|
+
|
32
|
+
class_option :interactive, type: :boolean,
|
33
|
+
desc: 'Allow or disable user interaction'
|
34
|
+
|
29
35
|
desc 'json PATH', 'read all tests in PATH and generate a JSON summary'
|
30
36
|
option :output, aliases: :o, type: :string,
|
31
37
|
desc: 'Save the created profile to a path'
|
data/lib/inspec/errors.rb
CHANGED
data/lib/inspec/ui.rb
ADDED
@@ -0,0 +1,216 @@
|
|
1
|
+
require 'tty-table'
|
2
|
+
require 'tty-prompt'
|
3
|
+
|
4
|
+
module Inspec
|
5
|
+
# Provides simple terminal UI interaction primitives for CLI commands and plugins.
|
6
|
+
class UI
|
7
|
+
ANSI_CODES = {
|
8
|
+
reset: "\e[0m",
|
9
|
+
bold: "\e[1m",
|
10
|
+
color: {
|
11
|
+
red: "\e[38;5;9m", # 256-color light red
|
12
|
+
green: "\e[38;5;41m", # 256-color light green
|
13
|
+
yellow: "\e[33m",
|
14
|
+
cyan: "\e[36m",
|
15
|
+
white: "\e[37m",
|
16
|
+
grey: "\e[38;5;247m", # 256-color medium grey
|
17
|
+
},
|
18
|
+
}.freeze
|
19
|
+
|
20
|
+
GLYPHS = {
|
21
|
+
bullet: '•', # BULLET, Unicode: U+2022, UTF-8: E2 80 A2
|
22
|
+
check: '✔', # HEAVY CHECK MARK, Unicode: U+2714, UTF-8: E2 9C 94
|
23
|
+
swirl: '↺', # ANTICLOCKWISE OPEN CIRCLE ARROW, Unicode U+21BA, UTF-8: E2 86 BA
|
24
|
+
script_x: '×', # MULTIPLICATION SIGN, Unicode: U+00D7, UTF-8: C3 97
|
25
|
+
question: '?', # normal ASCII question mark
|
26
|
+
em_dash: '─', # BOX DRAWINGS LIGHT HORIZONTAL Unicode: U+2500, UTF-8: E2 94 80
|
27
|
+
heavy_dash: '≖', # RING IN EQUAL TO, Unicode: U+2256, UTF-8: E2 89 96
|
28
|
+
vertical_dash: '│', # BOX DRAWINGS LIGHT VERTICAL, Unicode: U+2502, UTF-8: E2 94 82
|
29
|
+
table_corner: '⨀', # N-ARY CIRCLED DOT OPERATOR, Unicode: U+2A00, UTF-8: E2 A8 80
|
30
|
+
}.freeze
|
31
|
+
|
32
|
+
EXIT_NORMAL = 0
|
33
|
+
EXIT_USAGE_ERROR = 1
|
34
|
+
EXIT_PLUGIN_ERROR = 2
|
35
|
+
EXIT_FAILED_TESTS = 100
|
36
|
+
EXIT_SKIPPED_TESTS = 101
|
37
|
+
|
38
|
+
attr_reader :io
|
39
|
+
|
40
|
+
def initialize(opts = {})
|
41
|
+
@color = opts[:color].nil? ? true : opts[:color]
|
42
|
+
@interactive = opts[:interactive].nil? ? $stdout.isatty : opts[:interactive]
|
43
|
+
@io = opts[:io] || $stdout
|
44
|
+
end
|
45
|
+
|
46
|
+
def color?
|
47
|
+
@color
|
48
|
+
end
|
49
|
+
|
50
|
+
def print_or_return(str, print_flag)
|
51
|
+
io.print(str) if print_flag
|
52
|
+
str
|
53
|
+
end
|
54
|
+
|
55
|
+
#=========================================================================#
|
56
|
+
# Low-level formatting methods
|
57
|
+
#=========================================================================#
|
58
|
+
|
59
|
+
def plain(str, opts = { print: true })
|
60
|
+
print_or_return(str.to_s, opts[:print])
|
61
|
+
end
|
62
|
+
|
63
|
+
def plain_line(str, opts = { print: true })
|
64
|
+
print_or_return(str.to_s + "\n", opts[:print])
|
65
|
+
end
|
66
|
+
|
67
|
+
def bold(str, opts = { print: true })
|
68
|
+
result = color? ? io.print(ANSI_CODES[:bold] + str.to_s + ANSI_CODES[:reset]) : str.to_s
|
69
|
+
print_or_return(result, opts[:print])
|
70
|
+
end
|
71
|
+
|
72
|
+
ANSI_CODES[:color].keys.each do |color|
|
73
|
+
define_method(color) do |str, opts = { print: true }|
|
74
|
+
result = color? ? (ANSI_CODES[:color][color] + str.to_s + ANSI_CODES[:reset]) : str.to_s
|
75
|
+
print_or_return(result, opts[:print])
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
#=========================================================================#
|
80
|
+
# High-Level formatting methods
|
81
|
+
#=========================================================================#
|
82
|
+
|
83
|
+
def emphasis(str, opts = { print: true })
|
84
|
+
cyan(str, opts)
|
85
|
+
end
|
86
|
+
|
87
|
+
def headline(str, opts = { print: true })
|
88
|
+
str = str.dup.to_s
|
89
|
+
if str.length < 76
|
90
|
+
dash_length = 80 - str.length - 4 # 4 spaces
|
91
|
+
dash_length /= 2
|
92
|
+
else
|
93
|
+
dash_length = 0
|
94
|
+
end
|
95
|
+
|
96
|
+
result = "\n"
|
97
|
+
result += ' ' + (color? ? GLYPHS[:em_dash] : '-') * dash_length + ' '
|
98
|
+
result += color? ? ANSI_CODES[:bold] + ANSI_CODES[:color][:white] : ''
|
99
|
+
result += str
|
100
|
+
result += color? ? ANSI_CODES[:reset] : ''
|
101
|
+
result += ' ' + (color? ? GLYPHS[:em_dash] : '-') * dash_length + ' '
|
102
|
+
result += "\n\n"
|
103
|
+
|
104
|
+
print_or_return(result, opts[:print])
|
105
|
+
end
|
106
|
+
|
107
|
+
# Issues a one-line message, with 'ERROR: ' prepended in bold red.
|
108
|
+
def error(str, opts = { print: true })
|
109
|
+
str = str.dup.to_s
|
110
|
+
result = ''
|
111
|
+
result += color? ? ANSI_CODES[:bold] + ANSI_CODES[:color][:red] : ''
|
112
|
+
result += 'ERROR:'
|
113
|
+
result += color? ? ANSI_CODES[:reset] : ''
|
114
|
+
result += ' '
|
115
|
+
result += str
|
116
|
+
result += "\n"
|
117
|
+
print_or_return(result, opts[:print])
|
118
|
+
end
|
119
|
+
|
120
|
+
# Issues a one-line message, with 'WARNING: ' prepended in bold yellow.
|
121
|
+
def warning(str, opts = { print: true })
|
122
|
+
str = str.dup.to_s
|
123
|
+
result = ''
|
124
|
+
result += color? ? ANSI_CODES[:bold] + ANSI_CODES[:color][:yellow] : ''
|
125
|
+
result += 'WARNING:'
|
126
|
+
result += color? ? ANSI_CODES[:reset] : ''
|
127
|
+
result += ' '
|
128
|
+
result += str
|
129
|
+
result += "\n"
|
130
|
+
print_or_return(result, opts[:print])
|
131
|
+
end
|
132
|
+
|
133
|
+
# Draws a horizontal line.
|
134
|
+
def line(opts = { print: true })
|
135
|
+
if color?
|
136
|
+
result = ANSI_CODES[:bold] + GLYPHS[:heavy_dash] * 80 + ANSI_CODES[:reset] + "\n"
|
137
|
+
else
|
138
|
+
result = '-' * 80 + "\n"
|
139
|
+
end
|
140
|
+
print_or_return(result, opts[:print])
|
141
|
+
end
|
142
|
+
|
143
|
+
# Makes a bullet point.
|
144
|
+
def list_item(str, opts = { print: true })
|
145
|
+
bullet = color? ? ANSI_CODES[:bold] + ANSI_CODES[:color][:white] + GLYPHS[:bullet] + ANSI_CODES[:reset] : '*'
|
146
|
+
result = ' ' + bullet + ' ' + str.to_s + "\n"
|
147
|
+
print_or_return(result, opts[:print])
|
148
|
+
end
|
149
|
+
|
150
|
+
# Makes a table. Call with a block; block arg will be a TTY::Table object,
|
151
|
+
# with an extension for setting the header.
|
152
|
+
# Typical use:
|
153
|
+
# ui.table do |t|
|
154
|
+
# t.header = ['Name', 'Rank', 'Cereal Number']
|
155
|
+
# t << ['Crunch', 'Captain', 1]
|
156
|
+
# t << ['', '', 1]
|
157
|
+
# end
|
158
|
+
def table(opts = { print: true })
|
159
|
+
the_table = TableHelper.new
|
160
|
+
yield(the_table)
|
161
|
+
|
162
|
+
colorizer = proc do |data, row, _col|
|
163
|
+
if color? && row == 0
|
164
|
+
ANSI_CODES[:bold] + ANSI_CODES[:color][:white] + data.to_s + ANSI_CODES[:reset]
|
165
|
+
else
|
166
|
+
data
|
167
|
+
end
|
168
|
+
end
|
169
|
+
render_mode = color? ? :unicode : :ascii
|
170
|
+
padding = [0, 1, 0, 1] # T R B L
|
171
|
+
result = the_table.render(render_mode, filter: colorizer, padding: padding) + "\n"
|
172
|
+
print_or_return(result, opts[:print])
|
173
|
+
end
|
174
|
+
|
175
|
+
class TableHelper < TTY::Table
|
176
|
+
def header=(ary)
|
177
|
+
cells = ary.dup.map { |label| { value: label, alignment: :center } }
|
178
|
+
@header = TTY::Table::Header.new(cells)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
#=========================================================================#
|
183
|
+
# Exit Codes
|
184
|
+
#=========================================================================#
|
185
|
+
|
186
|
+
def exit(code_sym = :normal)
|
187
|
+
# If it's a number, give them a pass for now.
|
188
|
+
if code_sym.is_a? Numeric
|
189
|
+
code_int = code_sym
|
190
|
+
else
|
191
|
+
code_const = ('EXIT_' + code_sym.to_s.upcase).to_sym
|
192
|
+
unless self.class.const_defined?(code_const)
|
193
|
+
warning("Unrecognized exit constant #{code_const} - exit with code 1")
|
194
|
+
exit(:usage_error)
|
195
|
+
end
|
196
|
+
code_int = self.class.const_get(code_const)
|
197
|
+
end
|
198
|
+
Kernel.exit(code_int)
|
199
|
+
end
|
200
|
+
|
201
|
+
#=========================================================================#
|
202
|
+
# Interactivity
|
203
|
+
#=========================================================================#
|
204
|
+
def interactive?
|
205
|
+
@interactive
|
206
|
+
end
|
207
|
+
|
208
|
+
# This simply returns a TTY::Prompt object, gated on interactivity being enabled.
|
209
|
+
def prompt
|
210
|
+
unless interactive?
|
211
|
+
raise Inspec::UserInteractionRequired, 'Somthing is trying to ask the user a question, but interactivity is disabled.'
|
212
|
+
end
|
213
|
+
@prompt ||= TTY::Prompt.new
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
data/lib/inspec/version.rb
CHANGED
@@ -30,7 +30,7 @@ module Inspec::Resources
|
|
30
30
|
mysql_cmd = create_mysql_cmd(q, db)
|
31
31
|
cmd = inspec.command(mysql_cmd)
|
32
32
|
out = cmd.stdout + "\n" + cmd.stderr
|
33
|
-
if out =~ /Can't connect to .* MySQL server/ || out.downcase =~ /^error/
|
33
|
+
if out =~ /Can't connect to .* MySQL server/ || out.downcase =~ /^error /
|
34
34
|
# skip this test if the server can't run the query
|
35
35
|
warn("Can't connect to MySQL instance for SQL checks.")
|
36
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominik Richter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: train
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '1.5'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.5.
|
22
|
+
version: 1.5.11
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '1.5'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.5.
|
32
|
+
version: 1.5.11
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: thor
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -210,6 +210,34 @@ dependencies:
|
|
210
210
|
- - ">="
|
211
211
|
- !ruby/object:Gem::Version
|
212
212
|
version: 0.9.0
|
213
|
+
- !ruby/object:Gem::Dependency
|
214
|
+
name: tty-table
|
215
|
+
requirement: !ruby/object:Gem::Requirement
|
216
|
+
requirements:
|
217
|
+
- - "~>"
|
218
|
+
- !ruby/object:Gem::Version
|
219
|
+
version: '0.10'
|
220
|
+
type: :runtime
|
221
|
+
prerelease: false
|
222
|
+
version_requirements: !ruby/object:Gem::Requirement
|
223
|
+
requirements:
|
224
|
+
- - "~>"
|
225
|
+
- !ruby/object:Gem::Version
|
226
|
+
version: '0.10'
|
227
|
+
- !ruby/object:Gem::Dependency
|
228
|
+
name: tty-prompt
|
229
|
+
requirement: !ruby/object:Gem::Requirement
|
230
|
+
requirements:
|
231
|
+
- - "~>"
|
232
|
+
- !ruby/object:Gem::Version
|
233
|
+
version: '0.17'
|
234
|
+
type: :runtime
|
235
|
+
prerelease: false
|
236
|
+
version_requirements: !ruby/object:Gem::Requirement
|
237
|
+
requirements:
|
238
|
+
- - "~>"
|
239
|
+
- !ruby/object:Gem::Version
|
240
|
+
version: '0.17'
|
213
241
|
- !ruby/object:Gem::Dependency
|
214
242
|
name: faraday_middleware
|
215
243
|
requirement: !ruby/object:Gem::Requirement
|
@@ -333,10 +361,12 @@ executables:
|
|
333
361
|
extensions: []
|
334
362
|
extra_rdoc_files: []
|
335
363
|
files:
|
364
|
+
- Gemfile
|
336
365
|
- LICENSE
|
337
366
|
- README.md
|
338
367
|
- bin/inspec
|
339
368
|
- etc/plugin_filters.json
|
369
|
+
- inspec.gemspec
|
340
370
|
- lib/bundles/README.md
|
341
371
|
- lib/bundles/inspec-compliance/api.rb
|
342
372
|
- lib/bundles/inspec-compliance/configuration.rb
|
@@ -446,6 +476,7 @@ files:
|
|
446
476
|
- lib/inspec/shell.rb
|
447
477
|
- lib/inspec/shell_detector.rb
|
448
478
|
- lib/inspec/source_reader.rb
|
479
|
+
- lib/inspec/ui.rb
|
449
480
|
- lib/inspec/version.rb
|
450
481
|
- lib/matchers/matchers.rb
|
451
482
|
- lib/plugins/README.md
|