inspec-core 4.7.3 → 4.7.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bundles/inspec-supermarket/api.rb +2 -1
- data/lib/bundles/inspec-supermarket/cli.rb +6 -6
- data/lib/bundles/inspec-supermarket/target.rb +1 -0
- data/lib/fetchers/git.rb +3 -1
- data/lib/fetchers/mock.rb +1 -0
- data/lib/fetchers/url.rb +6 -3
- data/lib/inspec/backend.rb +1 -0
- data/lib/inspec/base_cli.rb +4 -1
- data/lib/inspec/cli.rb +5 -4
- data/lib/inspec/config.rb +9 -1
- data/lib/inspec/control_eval_context.rb +1 -0
- data/lib/inspec/dependencies/cache.rb +1 -0
- data/lib/inspec/dependencies/dependency_set.rb +2 -0
- data/lib/inspec/dependencies/lockfile.rb +1 -0
- data/lib/inspec/dependencies/requirement.rb +8 -7
- data/lib/inspec/dependencies/resolver.rb +3 -3
- data/lib/inspec/describe.rb +1 -0
- data/lib/inspec/dsl.rb +1 -1
- data/lib/inspec/dsl_shared.rb +1 -1
- data/lib/inspec/env_printer.rb +4 -4
- data/lib/inspec/fetcher.rb +4 -2
- data/lib/inspec/file_provider.rb +18 -8
- data/lib/inspec/formatters/base.rb +5 -0
- data/lib/inspec/impact.rb +2 -0
- data/lib/inspec/input_registry.rb +14 -13
- data/lib/inspec/metadata.rb +6 -2
- data/lib/inspec/method_source.rb +1 -1
- data/lib/inspec/objects/control.rb +4 -1
- data/lib/inspec/objects/describe.rb +3 -1
- data/lib/inspec/objects/input.rb +6 -5
- data/lib/inspec/objects/list.rb +2 -0
- data/lib/inspec/objects/test.rb +3 -2
- data/lib/inspec/plugin/v1/plugin_types/resource.rb +7 -0
- data/lib/inspec/plugin/v1/plugins.rb +4 -3
- data/lib/inspec/plugin/v1/registry.rb +3 -2
- data/lib/inspec/plugin/v2.rb +1 -0
- data/lib/inspec/plugin/v2/activator.rb +2 -0
- data/lib/inspec/plugin/v2/config_file.rb +4 -1
- data/lib/inspec/plugin/v2/filter.rb +1 -0
- data/lib/inspec/plugin/v2/installer.rb +9 -7
- data/lib/inspec/plugin/v2/loader.rb +2 -0
- data/lib/inspec/plugin/v2/plugin_base.rb +1 -0
- data/lib/inspec/plugin/v2/plugin_types/cli.rb +2 -2
- data/lib/inspec/plugin/v2/registry.rb +3 -1
- data/lib/inspec/profile.rb +13 -6
- data/lib/inspec/profile_context.rb +4 -2
- data/lib/inspec/reporters/cli.rb +14 -10
- data/lib/inspec/reporters/json.rb +1 -0
- data/lib/inspec/reporters/json_automate.rb +3 -0
- data/lib/inspec/reporters/json_min.rb +2 -0
- data/lib/inspec/resource.rb +2 -0
- data/lib/inspec/resources/aide_conf.rb +4 -3
- data/lib/inspec/resources/apache_conf.rb +1 -1
- data/lib/inspec/resources/apt.rb +2 -0
- data/lib/inspec/resources/auditd.rb +19 -18
- data/lib/inspec/resources/bridge.rb +5 -2
- data/lib/inspec/resources/chocolatey_package.rb +2 -0
- data/lib/inspec/resources/command.rb +1 -1
- data/lib/inspec/resources/crontab.rb +9 -8
- data/lib/inspec/resources/csv.rb +1 -1
- data/lib/inspec/resources/dh_params.rb +6 -0
- data/lib/inspec/resources/docker.rb +37 -34
- data/lib/inspec/resources/docker_container.rb +1 -0
- data/lib/inspec/resources/docker_image.rb +1 -0
- data/lib/inspec/resources/docker_plugin.rb +1 -0
- data/lib/inspec/resources/docker_service.rb +1 -0
- data/lib/inspec/resources/elasticsearch.rb +24 -24
- data/lib/inspec/resources/etc_fstab.rb +8 -7
- data/lib/inspec/resources/etc_group.rb +4 -0
- data/lib/inspec/resources/etc_hosts.rb +4 -4
- data/lib/inspec/resources/etc_hosts_allow_deny.rb +5 -3
- data/lib/inspec/resources/file.rb +4 -1
- data/lib/inspec/resources/filesystem.rb +5 -3
- data/lib/inspec/resources/firewalld.rb +7 -4
- data/lib/inspec/resources/groups.rb +6 -4
- data/lib/inspec/resources/grub_conf.rb +3 -0
- data/lib/inspec/resources/host.rb +5 -3
- data/lib/inspec/resources/http.rb +6 -4
- data/lib/inspec/resources/iis_app.rb +1 -0
- data/lib/inspec/resources/iis_app_pool.rb +1 -1
- data/lib/inspec/resources/iis_site.rb +4 -3
- data/lib/inspec/resources/interface.rb +10 -7
- data/lib/inspec/resources/json.rb +1 -1
- data/lib/inspec/resources/kernel_module.rb +1 -1
- data/lib/inspec/resources/kernel_parameter.rb +2 -1
- data/lib/inspec/resources/key_rsa.rb +5 -0
- data/lib/inspec/resources/mount.rb +3 -1
- data/lib/inspec/resources/mysql_conf.rb +3 -1
- data/lib/inspec/resources/mysql_session.rb +2 -0
- data/lib/inspec/resources/nginx.rb +1 -0
- data/lib/inspec/resources/nginx_conf.rb +10 -6
- data/lib/inspec/resources/ntp_conf.rb +1 -0
- data/lib/inspec/resources/oneget.rb +1 -1
- data/lib/inspec/resources/oracledb_session.rb +4 -2
- data/lib/inspec/resources/os_env.rb +1 -0
- data/lib/inspec/resources/package.rb +10 -6
- data/lib/inspec/resources/packages.rb +7 -5
- data/lib/inspec/resources/passwd.rb +7 -7
- data/lib/inspec/resources/pip.rb +2 -0
- data/lib/inspec/resources/port.rb +22 -8
- data/lib/inspec/resources/postgres.rb +2 -1
- data/lib/inspec/resources/postgres_conf.rb +2 -0
- data/lib/inspec/resources/postgres_hba_conf.rb +6 -6
- data/lib/inspec/resources/postgres_ident_conf.rb +3 -3
- data/lib/inspec/resources/processes.rb +16 -15
- data/lib/inspec/resources/rabbitmq_config.rb +2 -0
- data/lib/inspec/resources/registry_key.rb +8 -3
- data/lib/inspec/resources/security_identifier.rb +3 -1
- data/lib/inspec/resources/security_policy.rb +2 -1
- data/lib/inspec/resources/service.rb +13 -1
- data/lib/inspec/resources/shadow.rb +1 -0
- data/lib/inspec/resources/ssh_config.rb +2 -0
- data/lib/inspec/resources/ssl.rb +12 -11
- data/lib/inspec/resources/users.rb +29 -19
- data/lib/inspec/resources/virtualization.rb +10 -0
- data/lib/inspec/resources/windows_feature.rb +1 -1
- data/lib/inspec/resources/windows_hotfix.rb +2 -0
- data/lib/inspec/resources/windows_task.rb +4 -0
- data/lib/inspec/resources/wmi.rb +2 -1
- data/lib/inspec/resources/x509_certificate.rb +8 -0
- data/lib/inspec/resources/xinetd_conf.rb +10 -9
- data/lib/inspec/resources/yum.rb +15 -11
- data/lib/inspec/resources/zfs_dataset.rb +4 -2
- data/lib/inspec/resources/zfs_pool.rb +2 -1
- data/lib/inspec/rule.rb +11 -1
- data/lib/inspec/runner.rb +9 -6
- data/lib/inspec/runner_rspec.rb +10 -8
- data/lib/inspec/schema.rb +1 -0
- data/lib/inspec/secrets.rb +1 -0
- data/lib/inspec/secrets/yaml.rb +1 -0
- data/lib/inspec/shell.rb +20 -19
- data/lib/inspec/shell_detector.rb +1 -1
- data/lib/inspec/source_reader.rb +2 -0
- data/lib/inspec/ui.rb +1 -0
- data/lib/inspec/utils/deprecation/config_file.rb +8 -4
- data/lib/inspec/utils/erlang_parser.rb +2 -0
- data/lib/inspec/utils/file_reader.rb +1 -1
- data/lib/inspec/utils/filter.rb +16 -3
- data/lib/inspec/utils/find_files.rb +2 -2
- data/lib/inspec/utils/object_traversal.rb +1 -0
- data/lib/inspec/utils/parser.rb +2 -0
- data/lib/inspec/utils/simpleconfig.rb +4 -1
- data/lib/inspec/utils/telemetry/global_methods.rb +1 -0
- data/lib/inspec/version.rb +1 -1
- data/lib/matchers/matchers.rb +4 -1
- data/lib/plugins/inspec-artifact/lib/inspec-artifact/base.rb +12 -11
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/api.rb +15 -11
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/api/login.rb +4 -2
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/cli.rb +13 -12
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/http.rb +3 -0
- data/lib/plugins/inspec-habitat/lib/inspec-habitat/profile.rb +1 -1
- data/lib/plugins/inspec-init/lib/inspec-init/cli_profile.rb +2 -2
- data/lib/plugins/inspec-init/lib/inspec-init/renderer.rb +1 -0
- data/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb +6 -5
- data/lib/plugins/shared/core_plugin_test_helper.rb +1 -0
- data/lib/source_readers/flat.rb +1 -0
- data/lib/source_readers/inspec.rb +1 -0
- metadata +2 -2
@@ -45,6 +45,7 @@ module InspecPlugins
|
|
45
45
|
def self.post_file(url, headers, file_path, insecure)
|
46
46
|
uri = _parse_url(url)
|
47
47
|
raise "Unable to parse URL: #{url}" if uri.nil? || uri.host.nil?
|
48
|
+
|
48
49
|
http = Net::HTTP.new(uri.host, uri.port)
|
49
50
|
|
50
51
|
# set connection flags
|
@@ -69,6 +70,7 @@ module InspecPlugins
|
|
69
70
|
def self.post_multipart_file(url, headers, file_path, insecure)
|
70
71
|
uri = _parse_url(url)
|
71
72
|
raise "Unable to parse URL: #{url}" if uri.nil? || uri.host.nil?
|
73
|
+
|
72
74
|
http = Net::HTTP.new(uri.host, uri.port)
|
73
75
|
|
74
76
|
# set connection flags
|
@@ -93,6 +95,7 @@ module InspecPlugins
|
|
93
95
|
opts[:verify_mode] = OpenSSL::SSL::VERIFY_NONE if insecure
|
94
96
|
|
95
97
|
raise "Unable to parse URI: #{uri}" if uri.nil? || uri.host.nil?
|
98
|
+
|
96
99
|
res = Net::HTTP.start(uri.host, uri.port, opts) do |http|
|
97
100
|
http.request(req)
|
98
101
|
end
|
@@ -194,7 +194,7 @@ module InspecPlugins
|
|
194
194
|
FileUtils.mkdir_p(File.dirname(file))
|
195
195
|
template_path = File.join(__dir__, "../../templates/habitat", template)
|
196
196
|
contents = ERB.new(File.read(template_path))
|
197
|
-
|
197
|
+
.result(OpenStruct.new(vars).instance_eval { binding })
|
198
198
|
File.write(file, contents)
|
199
199
|
end
|
200
200
|
|
@@ -21,12 +21,12 @@ module InspecPlugins
|
|
21
21
|
|
22
22
|
desc "profile [OPTIONS] NAME", "Generate a new profile"
|
23
23
|
option :platform, default: "os", type: :string, aliases: [:p],
|
24
|
-
desc: "Which platform to generate a profile for: choose from #{valid_profile_platforms.join(
|
24
|
+
desc: "Which platform to generate a profile for: choose from #{valid_profile_platforms.join(", ")}"
|
25
25
|
option :overwrite, type: :boolean, default: false,
|
26
26
|
desc: "Overwrites existing directory"
|
27
27
|
def profile(new_profile_name)
|
28
28
|
unless valid_profile_platforms.include?(options[:platform])
|
29
|
-
ui.error "Unable to generate profile: No template available for platform '#{options[:platform]}' (expected one of: #{valid_profile_platforms.join(
|
29
|
+
ui.error "Unable to generate profile: No template available for platform '#{options[:platform]}' (expected one of: #{valid_profile_platforms.join(", ")})"
|
30
30
|
ui.exit(:usage_error)
|
31
31
|
end
|
32
32
|
template_path = File.join("profiles", options[:platform])
|
@@ -54,6 +54,7 @@ module InspecPlugins
|
|
54
54
|
Dir.glob(template_glob) do |source_file|
|
55
55
|
relative_destination_item_path = Pathname.new(source_file).relative_path_from(Pathname.new(source_dir)).to_s
|
56
56
|
next if skip_files.include? relative_destination_item_path
|
57
|
+
|
57
58
|
relative_destination_item_path = file_rename_map[relative_destination_item_path] || relative_destination_item_path
|
58
59
|
full_destination_item_path = Pathname.new(full_destination_path).join(relative_destination_item_path)
|
59
60
|
if File.directory?(source_file)
|
@@ -20,7 +20,7 @@ module InspecPlugins
|
|
20
20
|
option :all, desc: "Include plugins shipped with #{PRODUCT_NAME} as well.", type: :boolean, aliases: [:a]
|
21
21
|
def list
|
22
22
|
plugin_statuses = Inspec::Plugin::V2::Registry.instance.plugin_statuses
|
23
|
-
plugin_statuses.reject! { |s|
|
23
|
+
plugin_statuses.reject! { |s| %i{core bundle}.include?(s.installation_type) } unless options[:all]
|
24
24
|
|
25
25
|
# TODO: ui object support
|
26
26
|
puts
|
@@ -353,7 +353,7 @@ module InspecPlugins
|
|
353
353
|
puts(red { "Plugin already installed at latest version" } + " - plugin #{plugin_name} #{requested_version} - refusing to install.")
|
354
354
|
else
|
355
355
|
# There are existing versions installed, but none of them are what was requested
|
356
|
-
puts(red { "Update required" } + " - plugin #{plugin_name}, requested #{requested_version}, have #{pre_installed_versions.join(
|
356
|
+
puts(red { "Update required" } + " - plugin #{plugin_name}, requested #{requested_version}, have #{pre_installed_versions.join(", ")}; use `inspec plugin update` - refusing to install.")
|
357
357
|
end
|
358
358
|
|
359
359
|
exit 2
|
@@ -370,6 +370,7 @@ module InspecPlugins
|
|
370
370
|
exit 2
|
371
371
|
rescue Inspec::Plugin::V2::InstallError
|
372
372
|
raise if Inspec::Log.level == :debug
|
373
|
+
|
373
374
|
results = installer.search(plugin_name, exact: true)
|
374
375
|
if results.empty?
|
375
376
|
puts(red { "No such plugin gem " } + plugin_name + " could be found on rubygems.org - installation failed.")
|
@@ -433,9 +434,9 @@ module InspecPlugins
|
|
433
434
|
# TODO: this is naive, and assumes the latest version is the one that will be used. Logged on #3317
|
434
435
|
# In fact, the logic to determine "what version would be used" belongs in the Loader.
|
435
436
|
Inspec::Plugin::V2::Loader.list_installed_plugin_gems
|
436
|
-
|
437
|
-
|
438
|
-
|
437
|
+
.select { |spec| spec.name == status.name.to_s }
|
438
|
+
.sort_by(&:version)
|
439
|
+
.last.version
|
439
440
|
when :path
|
440
441
|
"src"
|
441
442
|
end
|
@@ -126,6 +126,7 @@ module CorePluginFunctionalHelper
|
|
126
126
|
plugin_name = project_dir.basename
|
127
127
|
entry_point = File.join(project_dir.to_s, "lib", plugin_name.to_s + ".rb")
|
128
128
|
raise "Could not find plugin entry point" unless File.exist?(entry_point)
|
129
|
+
|
129
130
|
entry_point
|
130
131
|
end
|
131
132
|
|
data/lib/source_readers/flat.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inspec-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.7.
|
4
|
+
version: 4.7.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominik Richter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: train-core
|