inspec 2.2.50 → 2.2.54

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18a37b35268f58619b53379d49c9abecf4cd2173ed4f8d007718d98f7438da7d
4
- data.tar.gz: 176561770b98d46ffc5f69ec38ebd0eef169ef9ad770ec921fa1ad16a45d6a92
3
+ metadata.gz: 977bb363360a10af70b26468798171a51e8ac00f4934dc62fe4efba59fdc9e5a
4
+ data.tar.gz: 7915d80127ade0039e184c1b5b6dc56c07ffb87fcbab2da6ef4f7a34d7ec87df
5
5
  SHA512:
6
- metadata.gz: 61c08ae2ca27909e61c788616caf71f9c079d12f10fdd773cdef79cabd5d70b73b569519bac3981e1b68cf478b9cf7215fe773cd15d98063210c53b323e36ae2
7
- data.tar.gz: 6b54b6a415680bec602497fecc81905bdf0a5ad8b31831014d03a8433b1b48c359f56b3e38c0bac9eaf3c71f5e9a9695f88bd545c6f1390ade4c7157d3f97e91
6
+ metadata.gz: add341eb8d92cb1f8ec093ff0bdb7bc22f4f63639e76defba94b1d8e4c823cf4948c845e4a1405b1778210fcd83d1108d7c8d91bc8aeba41d9409b4c79690a9f
7
+ data.tar.gz: 380330555e16c43839401811df31ebb4477a03a2718e89675302317ef61ed9958f4551fb37f79575ae11aa7ec9b732fb9404233a7166a39d0f49f36a8b45a376
@@ -1,32 +1,43 @@
1
1
  # Change Log
2
2
  <!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ -->
3
- <!-- latest_release 2.2.50 -->
4
- ## [v2.2.50](https://github.com/inspec/inspec/tree/v2.2.50) (2018-07-26)
3
+ <!-- latest_release 2.2.54 -->
4
+ ## [v2.2.54](https://github.com/inspec/inspec/tree/v2.2.54) (2018-08-02)
5
5
 
6
6
  #### Enhancements
7
- - Since /proc/xen is an empty dir in Amazon Linux, inspec falsely detects docker instances as platform=&#39;xen&#39; [#3243](https://github.com/inspec/inspec/pull/3243) ([woneill](https://github.com/woneill))
7
+ - Escaping package names for windows packages [#3259](https://github.com/inspec/inspec/pull/3259) ([frezbo](https://github.com/frezbo))
8
8
  <!-- latest_release -->
9
9
 
10
- <!-- release_rollup since=2.2.41 -->
11
- ### Changes since 2.2.41 release
12
-
13
- #### New Features
14
- - windows_feature resource: Add DISM support [#3224](https://github.com/inspec/inspec/pull/3224) ([jerryaldrichiii](https://github.com/jerryaldrichiii)) <!-- 2.2.47 -->
10
+ <!-- release_rollup since=2.2.50 -->
11
+ ### Changes since 2.2.50 release
15
12
 
16
13
  #### Enhancements
17
- - Since /proc/xen is an empty dir in Amazon Linux, inspec falsely detects docker instances as platform=&#39;xen&#39; [#3243](https://github.com/inspec/inspec/pull/3243) ([woneill](https://github.com/woneill)) <!-- 2.2.50 -->
18
- - alpine resource: Fix small style issues [#3238](https://github.com/inspec/inspec/pull/3238) ([jerryaldrichiii](https://github.com/jerryaldrichiii)) <!-- 2.2.45 -->
19
- - Add extra fault checking to git fetcher [#3239](https://github.com/inspec/inspec/pull/3239) ([james-stocks](https://github.com/james-stocks)) <!-- 2.2.44 -->
14
+ - Escaping package names for windows packages [#3259](https://github.com/inspec/inspec/pull/3259) ([frezbo](https://github.com/frezbo)) <!-- 2.2.54 -->
15
+ - Populate report code for merged controls [#3264](https://github.com/inspec/inspec/pull/3264) ([jquick](https://github.com/jquick)) <!-- 2.2.53 -->
16
+ - Bump the chef client version for tests. [#3260](https://github.com/inspec/inspec/pull/3260) ([jquick](https://github.com/jquick)) <!-- 2.2.52 -->
20
17
 
21
18
  #### Merged Pull Requests
22
- - Fix for profile version not being included in the compliance upload c… [#3252](https://github.com/inspec/inspec/pull/3252) ([devoptimist](https://github.com/devoptimist)) <!-- 2.2.49 -->
23
- - Satisfy RuboCop by adding `x` bit to `bin/inspec` [#3249](https://github.com/inspec/inspec/pull/3249) ([jerryaldrichiii](https://github.com/jerryaldrichiii)) <!-- 2.2.48 -->
24
- - cli: Downcase supermarket tool name to match URL [#3242](https://github.com/inspec/inspec/pull/3242) ([jerryaldrichiii](https://github.com/jerryaldrichiii)) <!-- 2.2.46 -->
25
- - Fix the unit tests ssl issue [#3251](https://github.com/inspec/inspec/pull/3251) ([jquick](https://github.com/jquick)) <!-- 2.2.43 -->
26
- - update README.md to fix travis and appveyor&#39;s badges. [#3244](https://github.com/inspec/inspec/pull/3244) ([takahashim](https://github.com/takahashim)) <!-- 2.2.42 -->
19
+ - Ability to render contrib resource pack docs on main website [#3184](https://github.com/inspec/inspec/pull/3184) ([clintoncwolfe](https://github.com/clintoncwolfe)) <!-- 2.2.51 -->
27
20
  <!-- release_rollup -->
28
21
 
29
22
  <!-- latest_stable_release -->
23
+ ## [v2.2.50](https://github.com/inspec/inspec/tree/v2.2.50) (2018-07-26)
24
+
25
+ #### New Features
26
+ - windows_feature resource: Add DISM support [#3224](https://github.com/inspec/inspec/pull/3224) ([jerryaldrichiii](https://github.com/jerryaldrichiii))
27
+
28
+ #### Enhancements
29
+ - Add extra fault checking to git fetcher [#3239](https://github.com/inspec/inspec/pull/3239) ([james-stocks](https://github.com/james-stocks))
30
+ - alpine resource: Fix small style issues [#3238](https://github.com/inspec/inspec/pull/3238) ([jerryaldrichiii](https://github.com/jerryaldrichiii))
31
+ - Since /proc/xen is an empty dir in Amazon Linux, inspec falsely detects docker instances as platform=&#39;xen&#39; [#3243](https://github.com/inspec/inspec/pull/3243) ([woneill](https://github.com/woneill))
32
+
33
+ #### Merged Pull Requests
34
+ - update README.md to fix travis and appveyor&#39;s badges. [#3244](https://github.com/inspec/inspec/pull/3244) ([takahashim](https://github.com/takahashim))
35
+ - Fix the unit tests ssl issue [#3251](https://github.com/inspec/inspec/pull/3251) ([jquick](https://github.com/jquick))
36
+ - cli: Downcase supermarket tool name to match URL [#3242](https://github.com/inspec/inspec/pull/3242) ([jerryaldrichiii](https://github.com/jerryaldrichiii))
37
+ - Satisfy RuboCop by adding `x` bit to `bin/inspec` [#3249](https://github.com/inspec/inspec/pull/3249) ([jerryaldrichiii](https://github.com/jerryaldrichiii))
38
+ - Fix for profile version not being included in the compliance upload c… [#3252](https://github.com/inspec/inspec/pull/3252) ([devoptimist](https://github.com/devoptimist))
39
+ <!-- latest_stable_release -->
40
+
30
41
  ## [v2.2.41](https://github.com/inspec/inspec/tree/v2.2.41) (2018-07-20)
31
42
 
32
43
  #### New Features
@@ -40,7 +51,6 @@
40
51
  #### Merged Pull Requests
41
52
  - docs: Fix formatting/style on InSpec DSL page [#3201](https://github.com/inspec/inspec/pull/3201) ([jerryaldrichiii](https://github.com/jerryaldrichiii))
42
53
  - Update hab package to use psql client [#3234](https://github.com/inspec/inspec/pull/3234) ([jquick](https://github.com/jquick))
43
- <!-- latest_stable_release -->
44
54
 
45
55
  ## [v2.2.35](https://github.com/inspec/inspec/tree/v2.2.35) (2018-07-12)
46
56
 
data/Gemfile CHANGED
@@ -40,6 +40,7 @@ group :tools do
40
40
  gem 'pry', '~> 0.10'
41
41
  gem 'rb-readline'
42
42
  gem 'license_finder'
43
+ gem 'git', '~> 1.4'
43
44
  end
44
45
 
45
46
  # gems for Maintainers.md generation
data/Rakefile CHANGED
@@ -27,6 +27,13 @@ rescue LoadError
27
27
  puts 'docs tasks are unavailable because the ruby-progressbar gem is not available.'
28
28
  end
29
29
 
30
+ begin
31
+ require 'git'
32
+ require_relative 'tasks/contrib'
33
+ rescue LoadError
34
+ puts 'contrib tasks are unavailable because the git gem is not available.'
35
+ end
36
+
30
37
  # Rubocop
31
38
  begin
32
39
  require 'rubocop/rake_task'
@@ -531,6 +531,17 @@ module Inspec
531
531
  source_location: location,
532
532
  }
533
533
 
534
+ # try and grab code text from merge locations
535
+ if controls[id][:code].empty? && Inspec::Rule.merge_count(rule) > 0
536
+ Inspec::Rule.merge_changes(rule).each do |merge_location|
537
+ code = Inspec::MethodSource.code_at(merge_location, source_reader)
538
+ if !code.empty?
539
+ controls[id][:code] = code
540
+ break
541
+ end
542
+ end
543
+ end
544
+
534
545
  groups[file] ||= {
535
546
  title: rule.instance_variable_get(:@__group_title),
536
547
  controls: [],
@@ -44,6 +44,7 @@ module Inspec
44
44
  @__checks = []
45
45
  @__skip_rule = nil
46
46
  @__merge_count = 0
47
+ @__merge_changes = []
47
48
  @__skip_only_if_eval = opts[:skip_only_if_eval]
48
49
 
49
50
  # evaluate the given definition
@@ -181,6 +182,10 @@ module Inspec
181
182
  rule.instance_variable_get(:@__merge_count)
182
183
  end
183
184
 
185
+ def self.merge_changes(rule)
186
+ rule.instance_variable_get(:@__merge_changes)
187
+ end
188
+
184
189
  def self.prepare_checks(rule)
185
190
  msg = skip_status(rule)
186
191
  return checks(rule) unless msg
@@ -211,12 +216,6 @@ module Inspec
211
216
  dst.tag(src.tag) unless src.tag.nil?
212
217
  dst.ref(src.ref) unless src.ref.nil?
213
218
 
214
- # use the most recent source location
215
- dst.instance_variable_set(
216
- :@__source_location,
217
- src.instance_variable_get(:@__source_location),
218
- )
219
-
220
219
  # merge indirect fields
221
220
  # checks defined in the source will completely eliminate
222
221
  # all checks that were defined in the destination
@@ -224,8 +223,13 @@ module Inspec
224
223
  dst.instance_variable_set(:@__checks, sc) unless sc.empty?
225
224
  sr = skip_status(src)
226
225
  set_skip_rule(dst, sr) unless sr.nil?
227
- # increment merge count
226
+
227
+ # Save merge history
228
228
  dst.instance_variable_set(:@__merge_count, merge_count(dst) + 1)
229
+ dst.instance_variable_set(
230
+ :@__merge_changes,
231
+ merge_changes(dst) << src.instance_variable_get(:@__source_location),
232
+ )
229
233
  end
230
234
 
231
235
  private
@@ -4,5 +4,5 @@
4
4
  # author: Christoph Hartmann
5
5
 
6
6
  module Inspec
7
- VERSION = '2.2.50'
7
+ VERSION = '2.2.54'
8
8
  end
@@ -288,7 +288,7 @@ module Inspec::Resources
288
288
  # Find the package
289
289
  cmd = inspec.command <<-EOF.gsub(/^\s*/, '')
290
290
  Get-ItemProperty (@("#{search_paths.join('", "')}") | Where-Object { Test-Path $_ }) |
291
- Where-Object { $_.DisplayName -match "^\\s*#{package_name}\\s*$" -or $_.PSChildName -match "^\\s*#{package_name}\\s*$" } |
291
+ Where-Object { $_.DisplayName -match "^\\s*#{package_name.shellescape}\\s*$" -or $_.PSChildName -match "^\\s*#{package_name.shellescape}\\s*$" } |
292
292
  Select-Object -Property DisplayName,DisplayVersion | ConvertTo-Json
293
293
  EOF
294
294
 
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: 2.2.50
4
+ version: 2.2.54
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-07-26 00:00:00.000000000 Z
11
+ date: 2018-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: train