inspec-core 5.22.40 → 5.22.50
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +9 -14
- data/inspec-core.gemspec +6 -0
- data/lib/inspec/fetcher/url.rb +5 -3
- data/lib/inspec/resources/virtualization.rb +1 -1
- data/lib/inspec/utils/profile_ast_helpers.rb +1 -2
- data/lib/inspec/version.rb +1 -1
- data/lib/matchers/matchers.rb +3 -3
- 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: bf0d707c247850a684a024680d641da787207608e7601e617023b29c299d1d2f
|
4
|
+
data.tar.gz: 684b3be8f6b45f7ffa770670f3eb9e281253c3e2c46f47c8d0e50e2d2090d564
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 701450c7309e4d2d637b631f2e409f4d16dea4468771ce5c3a1aa9bf1a3fd75b9c25defde7d19ed21c005e8511134ea624cde373f99d448e79c90385a73da61f
|
7
|
+
data.tar.gz: 3afa092af7a5c77918ec4a6cf7d1904b649cb67e988025e9abbc8011cd13fd5124942b540efdcdafbcb83549a3f5627e85e7dc10e349097a2988803936aac58d
|
data/Gemfile
CHANGED
@@ -27,25 +27,20 @@ group :omnibus do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
group :test do
|
30
|
-
gem "chefstyle"
|
31
|
-
gem "concurrent-ruby"
|
32
|
-
gem "json_schemer"
|
30
|
+
gem "chefstyle"
|
31
|
+
gem "concurrent-ruby"
|
32
|
+
gem "json_schemer"
|
33
33
|
gem "m"
|
34
34
|
gem "minitest-sprint", "~> 1.0"
|
35
35
|
gem "minitest", "5.15.0"
|
36
|
-
gem "mocha"
|
37
|
-
gem "nokogiri"
|
36
|
+
gem "mocha"
|
37
|
+
gem "nokogiri"
|
38
38
|
gem "pry-byebug"
|
39
|
-
gem "pry"
|
40
|
-
gem "rake"
|
41
|
-
gem "simplecov"
|
39
|
+
gem "pry"
|
40
|
+
gem "rake"
|
41
|
+
gem "simplecov"
|
42
42
|
gem "simplecov_json_formatter"
|
43
|
-
gem "webmock"
|
44
|
-
|
45
|
-
if Gem.ruby_version >= Gem::Version.new("3.0.0")
|
46
|
-
# html-proofer has a dep on io-event, which is ruby-3 only
|
47
|
-
gem "html-proofer", "~> 3.19.4", platforms: :ruby # do not attempt to run proofer on windows. Pinned to 3.19.4 as test is breaking in updated versions.
|
48
|
-
end
|
43
|
+
gem "webmock"
|
49
44
|
end
|
50
45
|
|
51
46
|
group :deploy do
|
data/inspec-core.gemspec
CHANGED
@@ -47,5 +47,11 @@ Gem::Specification.new do |spec|
|
|
47
47
|
spec.add_dependency "semverse", "~> 3.0"
|
48
48
|
spec.add_dependency "multipart-post", "~> 2.0"
|
49
49
|
|
50
|
+
# cookstyle support for inspec check
|
51
|
+
# This was initially included in 'inspec.gemspec' to keep 'chef-client' lightweight.
|
52
|
+
# However, it has been moved to 'inspec-core.gemspec' due to a dependency on the 'ast' gem,
|
53
|
+
# which was causing a LoadError ('cannot load such file -- ast') for users/applications using 'inspec-core'.
|
54
|
+
spec.add_dependency "cookstyle"
|
55
|
+
|
50
56
|
spec.add_dependency "train-core", "~> 3.10"
|
51
57
|
end
|
data/lib/inspec/fetcher/url.rb
CHANGED
@@ -93,7 +93,7 @@ module Inspec::Fetcher
|
|
93
93
|
end
|
94
94
|
|
95
95
|
if transformed_target
|
96
|
-
Inspec::Log.
|
96
|
+
Inspec::Log.debug("URL target #{target} transformed to #{transformed_target}. Consider using the git fetcher")
|
97
97
|
transformed_target
|
98
98
|
else
|
99
99
|
target
|
@@ -133,12 +133,14 @@ module Inspec::Fetcher
|
|
133
133
|
class << self
|
134
134
|
def default_ref(match_data, repo_url)
|
135
135
|
remote_url = "#{repo_url}/#{match_data[:user]}/#{match_data[:repo]}.git"
|
136
|
-
command_string = "git remote
|
136
|
+
command_string = "git ls-remote #{remote_url} HEAD"
|
137
137
|
cmd = shellout(command_string)
|
138
138
|
unless cmd.exitstatus == 0
|
139
139
|
raise(Inspec::FetcherFailure, "Profile git dependency failed with default reference - #{remote_url} - error running '#{command_string}': #{cmd.stderr}")
|
140
140
|
else
|
141
|
-
|
141
|
+
# cmd.stdout of "git ls-remote #{remote_url} HEAD" looks like this:
|
142
|
+
# "457d14843ab7c1c3740169eb47cf129a6f417964\tHEAD\n"
|
143
|
+
ref = cmd.stdout.split("\t").first
|
142
144
|
unless ref
|
143
145
|
raise(Inspec::FetcherFailure, "Profile git dependency failed with default reference - #{remote_url} - error running '#{command_string}': NULL reference")
|
144
146
|
end
|
@@ -223,7 +223,7 @@ module Inspec::Resources
|
|
223
223
|
elsif cgroup_content =~ %r{^\d+:[^:]+:/(kubepods)/.+$}
|
224
224
|
@virtualization_data[:system] = $1
|
225
225
|
@virtualization_data[:role] = "guest"
|
226
|
-
elsif /container=podman/.match?(
|
226
|
+
elsif /container=podman/.match?(inspec.file("/proc/1/environ").content)
|
227
227
|
@virtualization_data[:system] = "podman"
|
228
228
|
@virtualization_data[:role] = "guest"
|
229
229
|
elsif lxc_version_exists? && cgroup_content =~ %r{\d:[^:]+:/$}
|
data/lib/inspec/version.rb
CHANGED
data/lib/matchers/matchers.rb
CHANGED
@@ -299,9 +299,9 @@ RSpec::Matchers.define :cmp do |first_expected| # rubocop:disable Metrics/BlockL
|
|
299
299
|
end
|
300
300
|
end
|
301
301
|
|
302
|
-
def format_actual(actual)
|
302
|
+
def format_actual(actual, negate = false)
|
303
303
|
actual = "0%o" % actual if octal?(@expected) && !actual.nil?
|
304
|
-
"\n%s\n got: %s\n\n(compared using `cmp` matcher)\n" % [format_expectation(
|
304
|
+
"\n%s\n got: %s\n\n(compared using `cmp` matcher)\n" % [format_expectation(negate), actual]
|
305
305
|
end
|
306
306
|
|
307
307
|
def format_expectation(negate)
|
@@ -316,7 +316,7 @@ RSpec::Matchers.define :cmp do |first_expected| # rubocop:disable Metrics/BlockL
|
|
316
316
|
end
|
317
317
|
|
318
318
|
failure_message_when_negated do |actual|
|
319
|
-
format_actual actual
|
319
|
+
format_actual actual, true
|
320
320
|
end
|
321
321
|
|
322
322
|
description do
|
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: 5.22.
|
4
|
+
version: 5.22.50
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef InSpec Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-telemetry
|
@@ -364,6 +364,20 @@ dependencies:
|
|
364
364
|
- - "~>"
|
365
365
|
- !ruby/object:Gem::Version
|
366
366
|
version: '2.0'
|
367
|
+
- !ruby/object:Gem::Dependency
|
368
|
+
name: cookstyle
|
369
|
+
requirement: !ruby/object:Gem::Requirement
|
370
|
+
requirements:
|
371
|
+
- - ">="
|
372
|
+
- !ruby/object:Gem::Version
|
373
|
+
version: '0'
|
374
|
+
type: :runtime
|
375
|
+
prerelease: false
|
376
|
+
version_requirements: !ruby/object:Gem::Requirement
|
377
|
+
requirements:
|
378
|
+
- - ">="
|
379
|
+
- !ruby/object:Gem::Version
|
380
|
+
version: '0'
|
367
381
|
- !ruby/object:Gem::Dependency
|
368
382
|
name: train-core
|
369
383
|
requirement: !ruby/object:Gem::Requirement
|
@@ -854,7 +868,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
854
868
|
- !ruby/object:Gem::Version
|
855
869
|
version: '0'
|
856
870
|
requirements: []
|
857
|
-
rubygems_version: 3.
|
871
|
+
rubygems_version: 3.2.3
|
858
872
|
signing_key:
|
859
873
|
specification_version: 4
|
860
874
|
summary: Infrastructure and compliance testing. Core library.
|