inspec-core 4.24.8 → 4.24.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -12
- data/inspec-core.gemspec +8 -8
- data/lib/bundles/inspec-supermarket/api.rb +2 -2
- data/lib/bundles/inspec-supermarket/target.rb +1 -1
- data/lib/inspec/archive/tar.rb +1 -1
- data/lib/inspec/archive/zip.rb +3 -3
- data/lib/inspec/base_cli.rb +1 -1
- data/lib/inspec/cached_fetcher.rb +1 -1
- data/lib/inspec/cli.rb +1 -1
- data/lib/inspec/config.rb +5 -5
- data/lib/inspec/dependencies/cache.rb +1 -1
- data/lib/inspec/env_printer.rb +2 -2
- data/lib/inspec/fetcher/git.rb +3 -3
- data/lib/inspec/fetcher/local.rb +1 -1
- data/lib/inspec/fetcher/url.rb +4 -4
- data/lib/inspec/file_provider.rb +4 -4
- data/lib/inspec/input.rb +3 -0
- data/lib/inspec/input_registry.rb +5 -3
- data/lib/inspec/metadata.rb +1 -1
- data/lib/inspec/plugin/v1/plugins.rb +2 -2
- data/lib/inspec/plugin/v2.rb +5 -0
- data/lib/inspec/plugin/v2/config_file.rb +1 -1
- data/lib/inspec/plugin/v2/filter.rb +2 -2
- data/lib/inspec/plugin/v2/installer.rb +5 -5
- data/lib/inspec/plugin/v2/loader.rb +1 -1
- data/lib/inspec/plugin/v2/registry.rb +2 -2
- data/lib/inspec/profile.rb +3 -3
- data/lib/inspec/profile_context.rb +1 -1
- data/lib/inspec/reporters/automate.rb +2 -2
- data/lib/inspec/reporters/json.rb +1 -1
- data/lib/inspec/reporters/json_automate.rb +1 -1
- data/lib/inspec/resources.rb +5 -5
- data/lib/inspec/resources/apt.rb +1 -1
- data/lib/inspec/resources/auditd.rb +1 -1
- data/lib/inspec/resources/csv.rb +1 -1
- data/lib/inspec/resources/dh_params.rb +1 -1
- data/lib/inspec/resources/file.rb +1 -1
- data/lib/inspec/resources/http.rb +1 -1
- data/lib/inspec/resources/iis_website.rb +1 -1
- data/lib/inspec/resources/interfaces.rb +1 -1
- data/lib/inspec/resources/json.rb +2 -2
- data/lib/inspec/resources/key_rsa.rb +1 -1
- data/lib/inspec/resources/mssql_session.rb +5 -1
- data/lib/inspec/resources/mysql_session.rb +1 -1
- data/lib/inspec/resources/nginx.rb +1 -1
- data/lib/inspec/resources/nginx_conf.rb +1 -1
- data/lib/inspec/resources/npm.rb +1 -1
- data/lib/inspec/resources/oracledb_session.rb +1 -1
- data/lib/inspec/resources/parse_config.rb +5 -2
- data/lib/inspec/resources/port.rb +1 -1
- data/lib/inspec/resources/postgres_session.rb +1 -1
- data/lib/inspec/resources/ppa.rb +1 -1
- data/lib/inspec/resources/processes.rb +1 -1
- data/lib/inspec/resources/rabbitmq_conf.rb +1 -1
- data/lib/inspec/resources/registry_key.rb +1 -1
- data/lib/inspec/resources/sshd_config.rb +1 -1
- data/lib/inspec/resources/ssl.rb +2 -2
- data/lib/inspec/resources/toml.rb +1 -1
- data/lib/inspec/resources/vbscript.rb +1 -1
- data/lib/inspec/resources/windows_registry_key.rb +1 -1
- data/lib/inspec/resources/wmi.rb +1 -1
- data/lib/inspec/resources/x509_certificate.rb +1 -1
- data/lib/inspec/resources/xml.rb +1 -1
- data/lib/inspec/runner.rb +2 -2
- data/lib/inspec/schema.rb +1 -1
- data/lib/inspec/schema/output_schema.rb +1 -1
- data/lib/inspec/schema/primitives.rb +1 -1
- data/lib/inspec/shell_detector.rb +2 -2
- data/lib/inspec/utils/command_wrapper.rb +1 -1
- data/lib/inspec/utils/deprecation/config_file.rb +2 -2
- data/lib/inspec/utils/json_log.rb +1 -1
- data/lib/inspec/utils/telemetry/collector.rb +1 -1
- data/lib/inspec/utils/telemetry/data_series.rb +1 -1
- data/lib/inspec/version.rb +1 -1
- data/lib/plugins/inspec-artifact/lib/inspec-artifact/base.rb +5 -5
- data/lib/plugins/inspec-compliance/README.md +1 -1
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/api.rb +3 -3
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/http.rb +2 -2
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/target.rb +2 -2
- data/lib/plugins/inspec-habitat/lib/inspec-habitat/profile.rb +3 -3
- data/lib/plugins/inspec-init/lib/inspec-init/cli.rb +1 -1
- data/lib/plugins/inspec-init/lib/inspec-init/cli_profile.rb +1 -1
- data/lib/plugins/inspec-init/lib/inspec-init/renderer.rb +2 -2
- data/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb +3 -3
- data/lib/plugins/inspec-reporter-html2/lib/inspec-reporter-html2/reporter.rb +1 -1
- data/lib/plugins/inspec-reporter-json-min/lib/inspec-reporter-json-min/reporter.rb +1 -1
- data/lib/plugins/inspec-reporter-junit/lib/inspec-reporter-junit/reporter.rb +1 -1
- data/lib/plugins/shared/core_plugin_test_helper.rb +6 -6
- metadata +40 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfed5976ebd618d37b1fbf0058fbd9389b243dbd5070444fda7558cf309392c3
|
4
|
+
data.tar.gz: 3b894051f2f56e249af59acf0de10c50d8a826d3af1755eaf60100a7a4934dab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1d9b3598a4bc81085d95b5a4b254ac57001aa301e4371394b8b8b307b54ed26644784ccf9dafd2e52d4e2553e5c1ff77ae821691ef738e542f13d892f692f81
|
7
|
+
data.tar.gz: 54f9be8adc1870127be3e825e809499270717d395fa26d11408f186a66fdb61ca7db0ac78fd73143652893bd482acf2d1009c3343609e8b34bcd3ff3eb0aaa0c
|
data/Gemfile
CHANGED
@@ -24,7 +24,7 @@ group :omnibus do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
group :test do
|
27
|
-
gem "chefstyle", "~> 1.
|
27
|
+
gem "chefstyle", "~> 1.5.7"
|
28
28
|
gem "concurrent-ruby", "~> 1.0"
|
29
29
|
gem "html-proofer", platforms: :ruby # do not attempt to run proofer on windows
|
30
30
|
gem "json_schemer", ">= 0.2.1", "< 0.2.12"
|
@@ -37,19 +37,10 @@ group :test do
|
|
37
37
|
gem "pry", "~> 0.10"
|
38
38
|
gem "rake", ">= 10"
|
39
39
|
gem "ruby-progressbar", "~> 1.8"
|
40
|
-
gem "simplecov",
|
40
|
+
gem "simplecov", "~> 0.18"
|
41
41
|
gem "webmock", "~> 3.0"
|
42
42
|
end
|
43
43
|
|
44
|
-
group :integration do
|
45
|
-
gem "berkshelf"
|
46
|
-
gem "test-kitchen", ">= 2.8"
|
47
|
-
gem "kitchen-vagrant", ">= 1.7"
|
48
|
-
gem "kitchen-inspec", ">= 2.0"
|
49
|
-
gem "kitchen-dokken", ">= 2.11"
|
50
|
-
gem "git"
|
51
|
-
end
|
52
|
-
|
53
44
|
group :deploy do
|
54
45
|
gem "inquirer"
|
55
|
-
end
|
46
|
+
end
|
data/inspec-core.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
lib = File.expand_path("
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
3
|
require "inspec/version"
|
4
4
|
|
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.license = "Apache-2.0"
|
14
14
|
spec.require_paths = ["lib"]
|
15
15
|
|
16
|
-
spec.required_ruby_version = "
|
16
|
+
spec.required_ruby_version = ">= 2.5"
|
17
17
|
|
18
18
|
# the gemfile and gemspec are necessary for appbundler so don't remove it
|
19
19
|
spec.files =
|
@@ -27,20 +27,20 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_dependency "license-acceptance", ">= 0.2.13", "< 3.0"
|
28
28
|
spec.add_dependency "thor", ">= 0.20", "< 2.0"
|
29
29
|
spec.add_dependency "method_source", ">= 0.8", "< 2.0"
|
30
|
-
spec.add_dependency "rubyzip", "
|
31
|
-
spec.add_dependency "rspec", "~> 3.
|
30
|
+
spec.add_dependency "rubyzip", ">= 1.2.2", "< 3.0"
|
31
|
+
spec.add_dependency "rspec", "~> 3.10"
|
32
32
|
spec.add_dependency "rspec-its", "~> 1.2"
|
33
33
|
spec.add_dependency "pry", "~> 0.13"
|
34
|
-
spec.add_dependency "hashie", "
|
34
|
+
spec.add_dependency "hashie", ">= 3.4", "< 5.0"
|
35
35
|
spec.add_dependency "mixlib-log", "~> 3.0"
|
36
36
|
spec.add_dependency "sslshake", "~> 1.2"
|
37
37
|
spec.add_dependency "parallel", "~> 1.9"
|
38
|
-
spec.add_dependency "faraday", ">= 0.9.0", "< 1.
|
38
|
+
spec.add_dependency "faraday", ">= 0.9.0", "< 1.2"
|
39
39
|
spec.add_dependency "tty-table", "~> 0.10"
|
40
40
|
spec.add_dependency "tty-prompt", "~> 0.17"
|
41
|
-
spec.add_dependency "tomlrb", "
|
41
|
+
spec.add_dependency "tomlrb", ">= 1.2", "< 2.1"
|
42
42
|
spec.add_dependency "addressable", "~> 2.4"
|
43
|
-
spec.add_dependency "parslet", "
|
43
|
+
spec.add_dependency "parslet", ">= 1.5", "< 3.0"
|
44
44
|
spec.add_dependency "semverse", "~> 3.0"
|
45
45
|
spec.add_dependency "multipart-post", "~> 2.0"
|
46
46
|
|
data/lib/inspec/archive/tar.rb
CHANGED
data/lib/inspec/archive/zip.rb
CHANGED
data/lib/inspec/base_cli.rb
CHANGED
data/lib/inspec/cli.rb
CHANGED
data/lib/inspec/config.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# Represents InSpec configuration. Merges defaults, config file options,
|
2
2
|
# and CLI arguments.
|
3
3
|
|
4
|
-
require "pp"
|
5
|
-
require "stringio"
|
6
|
-
require "forwardable"
|
7
|
-
require "thor"
|
8
|
-
require "base64"
|
4
|
+
require "pp" unless defined?(PP)
|
5
|
+
require "stringio" unless defined?(StringIO)
|
6
|
+
require "forwardable" unless defined?(Forwardable)
|
7
|
+
require "thor" unless defined?(Thor)
|
8
|
+
require "base64" unless defined?(Base64)
|
9
9
|
require "inspec/plugin/v2/filter"
|
10
10
|
|
11
11
|
module Inspec
|
data/lib/inspec/env_printer.rb
CHANGED
data/lib/inspec/fetcher/git.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require "tmpdir"
|
2
|
-
require "fileutils"
|
3
|
-
require "mixlib/shellout"
|
1
|
+
require "tmpdir" unless defined?(Dir.mktmpdir)
|
2
|
+
require "fileutils" unless defined?(FileUtils)
|
3
|
+
require "mixlib/shellout" unless defined?(Mixlib::ShellOut)
|
4
4
|
require "inspec/log"
|
5
5
|
|
6
6
|
module Inspec::Fetcher
|
data/lib/inspec/fetcher/local.rb
CHANGED
data/lib/inspec/fetcher/url.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require "uri"
|
2
|
-
require "openssl"
|
3
|
-
require "tempfile"
|
4
|
-
require "open-uri"
|
1
|
+
require "uri" unless defined?(URI)
|
2
|
+
require "openssl" unless defined?(OpenSSL)
|
3
|
+
require "tempfile" unless defined?(Tempfile)
|
4
|
+
require "open-uri" unless defined?(OpenURI)
|
5
5
|
|
6
6
|
module Inspec::Fetcher
|
7
7
|
class Url < Inspec.fetcher(1)
|
data/lib/inspec/file_provider.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require "rubygems/package"
|
2
|
-
require "pathname"
|
3
|
-
require "zlib"
|
4
|
-
require "zip"
|
1
|
+
require "rubygems/package" unless defined?(Gem::Package)
|
2
|
+
require "pathname" unless defined?(Pathname)
|
3
|
+
require "zlib" unless defined?(Zlib)
|
4
|
+
require "zip" unless defined?(Zip)
|
5
5
|
|
6
6
|
module Inspec
|
7
7
|
class FileProvider
|
data/lib/inspec/input.rb
CHANGED
@@ -14,14 +14,17 @@ module Inspec
|
|
14
14
|
class Input
|
15
15
|
|
16
16
|
class Error < Inspec::Error; end
|
17
|
+
|
17
18
|
class ValidationError < Error
|
18
19
|
attr_accessor :input_name
|
19
20
|
attr_accessor :input_value
|
20
21
|
attr_accessor :input_type
|
21
22
|
end
|
23
|
+
|
22
24
|
class TypeError < Error
|
23
25
|
attr_accessor :input_type
|
24
26
|
end
|
27
|
+
|
25
28
|
class RequiredError < Error
|
26
29
|
attr_accessor :input_name
|
27
30
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require "forwardable"
|
2
|
-
require "singleton"
|
1
|
+
require "forwardable" unless defined?(Forwardable)
|
2
|
+
require "singleton" unless defined?(Singleton)
|
3
3
|
require "inspec/input"
|
4
4
|
require "inspec/secrets"
|
5
5
|
require "inspec/exceptions"
|
@@ -14,9 +14,11 @@ module Inspec
|
|
14
14
|
extend Forwardable
|
15
15
|
|
16
16
|
class Error < Inspec::Error; end
|
17
|
+
|
17
18
|
class ProfileLookupError < Error
|
18
19
|
attr_accessor :profile_name
|
19
20
|
end
|
21
|
+
|
20
22
|
class InputLookupError < Error
|
21
23
|
attr_accessor :profile_name
|
22
24
|
attr_accessor :input_name
|
@@ -199,7 +201,7 @@ module Inspec
|
|
199
201
|
value = YAML.load(value)
|
200
202
|
rescue Psych::SyntaxError => yaml_error
|
201
203
|
# It could be that we just tried to run JSON through the YAML parser.
|
202
|
-
require "json"
|
204
|
+
require "json" unless defined?(JSON)
|
203
205
|
begin
|
204
206
|
value = JSON.parse(value)
|
205
207
|
rescue JSON::ParserError => json_error
|
data/lib/inspec/metadata.rb
CHANGED
@@ -216,7 +216,7 @@ module Inspec
|
|
216
216
|
end
|
217
217
|
|
218
218
|
def self.from_yaml(ref, content, profile_id, logger = nil)
|
219
|
-
require "erb"
|
219
|
+
require "erb" unless defined?(Erb)
|
220
220
|
res = Metadata.new(ref, logger)
|
221
221
|
res.params = YAML.load(ERB.new(content).result)
|
222
222
|
res.content = content
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require "forwardable"
|
1
|
+
require "forwardable" unless defined?(Forwardable)
|
2
2
|
|
3
3
|
module Inspec
|
4
4
|
# Resource Plugins
|
@@ -36,7 +36,7 @@ module Inspec
|
|
36
36
|
.flatten
|
37
37
|
|
38
38
|
# load bundled plugins
|
39
|
-
bundled_dir =
|
39
|
+
bundled_dir = __dir__
|
40
40
|
@paths += Dir[File.join(bundled_dir, "..", "bundles", "inspec-*.rb")].flatten
|
41
41
|
|
42
42
|
# map paths to names
|
data/lib/inspec/plugin/v2.rb
CHANGED
@@ -6,17 +6,22 @@ module Inspec
|
|
6
6
|
class Exception < Inspec::Error; end
|
7
7
|
class ConfigError < Inspec::Plugin::V2::Exception; end
|
8
8
|
class LoadError < Inspec::Plugin::V2::Exception; end
|
9
|
+
|
9
10
|
class GemActionError < Inspec::Plugin::V2::Exception
|
10
11
|
attr_accessor :plugin_name
|
11
12
|
attr_accessor :version
|
12
13
|
end
|
14
|
+
|
13
15
|
class InstallError < Inspec::Plugin::V2::GemActionError; end
|
16
|
+
|
14
17
|
class PluginExcludedError < Inspec::Plugin::V2::InstallError
|
15
18
|
attr_accessor :details
|
16
19
|
end
|
20
|
+
|
17
21
|
class UpdateError < Inspec::Plugin::V2::GemActionError
|
18
22
|
attr_accessor :from_version, :to_version
|
19
23
|
end
|
24
|
+
|
20
25
|
class UnInstallError < Inspec::Plugin::V2::GemActionError; end
|
21
26
|
class SearchError < Inspec::Plugin::V2::GemActionError; end
|
22
27
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# This file is not required by default.
|
2
2
|
|
3
|
-
require "singleton"
|
4
|
-
require "forwardable"
|
5
|
-
require "fileutils"
|
6
|
-
require "uri"
|
3
|
+
require "singleton" unless defined?(Singleton)
|
4
|
+
require "forwardable" unless defined?(Forwardable)
|
5
|
+
require "fileutils" unless defined?(FileUtils)
|
6
|
+
require "uri" unless defined?(URI)
|
7
7
|
|
8
8
|
# Gem extensions for doing unusual things - not loaded by Gem default
|
9
|
-
require "rubygems/package"
|
9
|
+
require "rubygems/package" unless defined?(Gem::Package)
|
10
10
|
require "rubygems/name_tuple"
|
11
11
|
require "rubygems/uninstaller"
|
12
12
|
require "rubygems/remote_fetcher"
|
@@ -130,7 +130,7 @@ module Inspec::Plugin::V2
|
|
130
130
|
end
|
131
131
|
|
132
132
|
def self.plugin_gem_path
|
133
|
-
require "rbconfig"
|
133
|
+
require "rbconfig" unless defined?(RbConfig)
|
134
134
|
ruby_abi_version = RbConfig::CONFIG["ruby_version"]
|
135
135
|
# TODO: why are we installing under the api directory for plugins?
|
136
136
|
base_dir = Inspec.config_dir
|
data/lib/inspec/profile.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Copyright 2015 Dominik Richter
|
2
2
|
|
3
|
-
require "forwardable"
|
4
|
-
require "openssl"
|
5
|
-
require "pathname"
|
3
|
+
require "forwardable" unless defined?(Forwardable)
|
4
|
+
require "openssl" unless defined?(OpenSSL)
|
5
|
+
require "pathname" unless defined?(Pathname)
|
6
6
|
require "inspec/input_registry"
|
7
7
|
require "inspec/cached_fetcher" # TODO: split or rename
|
8
8
|
require "inspec/source_reader"
|
@@ -4,7 +4,7 @@ require "inspec/resource"
|
|
4
4
|
require "inspec/library_eval_context"
|
5
5
|
require "inspec/control_eval_context"
|
6
6
|
require "inspec/require_loader"
|
7
|
-
require "securerandom"
|
7
|
+
require "securerandom" unless defined?(SecureRandom)
|
8
8
|
require "inspec/input_registry"
|
9
9
|
|
10
10
|
module Inspec
|
data/lib/inspec/resources.rb
CHANGED
@@ -16,11 +16,11 @@ inspec_core_only = ENV["NO_AWS"] || !File.exist?(File.join(File.dirname(__FILE__
|
|
16
16
|
# Do not attempt to load cloud resources if we are in inspec-core mode
|
17
17
|
unless inspec_core_only
|
18
18
|
require "resource_support/aws"
|
19
|
-
require "resources/azure/azure_backend
|
20
|
-
require "resources/azure/azure_generic_resource
|
21
|
-
require "resources/azure/azure_resource_group
|
22
|
-
require "resources/azure/azure_virtual_machine
|
23
|
-
require "resources/azure/azure_virtual_machine_data_disk
|
19
|
+
require "resources/azure/azure_backend"
|
20
|
+
require "resources/azure/azure_generic_resource"
|
21
|
+
require "resources/azure/azure_resource_group"
|
22
|
+
require "resources/azure/azure_virtual_machine"
|
23
|
+
require "resources/azure/azure_virtual_machine_data_disk"
|
24
24
|
end
|
25
25
|
|
26
26
|
require "inspec/resources/aide_conf"
|
data/lib/inspec/resources/apt.rb
CHANGED