inspec-core 4.24.32 → 4.25.1

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: 35c6838714e546c28371a2e919c989c01eb8b15cfb7b6bd334bfa49530261e7c
4
- data.tar.gz: eb20cc6d19e454489b3bb48e46ab2ec3738578f35a755c9fb4ed6dc475cb1cd6
3
+ metadata.gz: 4db76b09c46f02e91dca61f334693d773d0c0c470104ef8d28b89a443b1b6c55
4
+ data.tar.gz: 9834a18148bf8f2851f7a030e3766b3932f6592e7a3fdfb5a354daf7c8cdfff1
5
5
  SHA512:
6
- metadata.gz: 2ed69ce7800644c8bf4fa48cb2ec1b5612735c9dacc33a2d94a10e867471a2d81e85f38fd8bd71831b3711d68beec781f582ab7f297f960cba0d494dfe943160
7
- data.tar.gz: bc9e4299ae63e74c417080922e481433ff68ae272e44ee3050d1e1cd920a27152db8f3b7f029965fbd462ba624cb2ce202774aec91ca6c85631e99ce9f12eebd
6
+ metadata.gz: 2c8330268f60a8b8d895e33ee3fb75b3076b81be5c3e8816250ad8775ea00d76332796181aba8da27c15c251c0b6ce8379279c693158c969bbe1003e0985bd7a
7
+ data.tar.gz: 3e6e5096e98c3198a650bfa4c6f88a66db84fdbf366d451bae21e38a1e430e0cb77b9d1ebe5a85d03c354390e8eb884bddb586ef28d5ece4d9a57d7830838bb9
data/Gemfile CHANGED
@@ -16,6 +16,10 @@ if Gem.ruby_version.to_s.start_with?("2.5")
16
16
  gem "chef-utils", "< 16.7.23" # TODO: remove when we drop ruby 2.5
17
17
  end
18
18
 
19
+ # inspec tests depend text output that changed in the 3.10 release
20
+ # but our runtime dep is still 3.9+
21
+ gem "rspec", ">= 3.10"
22
+
19
23
  group :omnibus do
20
24
  gem "rb-readline"
21
25
  gem "appbundler"
@@ -27,7 +31,7 @@ group :test do
27
31
  gem "chefstyle", "~> 1.5.7"
28
32
  gem "concurrent-ruby", "~> 1.0"
29
33
  gem "html-proofer", platforms: :ruby # do not attempt to run proofer on windows
30
- gem "json_schemer", ">= 0.2.1", "< 0.2.12"
34
+ gem "json_schemer", ">= 0.2.1", "< 0.2.18"
31
35
  gem "m"
32
36
  gem "minitest-sprint", "~> 1.0"
33
37
  gem "minitest", "~> 5.5"
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_dependency "thor", ">= 0.20", "< 2.0"
29
29
  spec.add_dependency "method_source", ">= 0.8", "< 2.0"
30
30
  spec.add_dependency "rubyzip", ">= 1.2.2", "< 3.0"
31
- spec.add_dependency "rspec", "~> 3.10"
31
+ spec.add_dependency "rspec", ">= 3.9", "< 3.11"
32
32
  spec.add_dependency "rspec-its", "~> 1.2"
33
33
  spec.add_dependency "pry", "~> 0.13"
34
34
  spec.add_dependency "hashie", ">= 3.4", "< 5.0"
@@ -1,4 +1,4 @@
1
- require "thor" unless defined?(Thor)
1
+ require "thor" # rubocop:disable Chef/Ruby/UnlessDefinedRequire
2
2
  require "inspec/log"
3
3
  require "inspec/ui"
4
4
  require "inspec/config"
@@ -7,6 +7,7 @@ module Inspec::Resources
7
7
  class SshConfig < Inspec.resource(1)
8
8
  name "ssh_config"
9
9
  supports platform: "unix"
10
+ supports platform: "windows"
10
11
  desc "Use the `ssh_config` InSpec audit resource to test OpenSSH client configuration data located at `/etc/ssh/ssh_config` on Linux and Unix platforms."
11
12
  example <<~EXAMPLE
12
13
  describe ssh_config do
@@ -19,7 +20,7 @@ module Inspec::Resources
19
20
  include FileReader
20
21
 
21
22
  def initialize(conf_path = nil, type = nil)
22
- @conf_path = conf_path || "/etc/ssh/ssh_config"
23
+ @conf_path = conf_path || ssh_config_file("ssh_config")
23
24
  typename = (@conf_path.include?("sshd") ? "Server" : "Client")
24
25
  @type = type || "SSH #{typename} configuration #{conf_path}"
25
26
  read_content
@@ -75,11 +76,21 @@ module Inspec::Resources
75
76
  )
76
77
  @params = convert_hash(conf.params)
77
78
  end
79
+
80
+ def ssh_config_file(type)
81
+ if inspec.os.windows?
82
+ programdata = inspec.os_env("programdata").content
83
+ return "#{programdata}\\ssh\\#{type}"
84
+ end
85
+
86
+ "/etc/ssh/#{type}"
87
+ end
78
88
  end
79
89
 
80
90
  class SshdConfig < SshConfig
81
91
  name "sshd_config"
82
92
  supports platform: "unix"
93
+ supports platform: "windows"
83
94
  desc "Use the sshd_config InSpec audit resource to test configuration data for the Open SSH daemon located at /etc/ssh/sshd_config on Linux and UNIX platforms. sshd---the Open SSH daemon---listens on dedicated ports, starts a daemon for each incoming connection, and then handles encryption, authentication, key exchanges, command execution, and data exchanges."
84
95
  example <<~EXAMPLE
85
96
  describe sshd_config do
@@ -88,11 +99,22 @@ module Inspec::Resources
88
99
  EXAMPLE
89
100
 
90
101
  def initialize(path = nil)
91
- super(path || "/etc/ssh/sshd_config")
102
+ super(path || ssh_config_file("sshd_config"))
92
103
  end
93
104
 
94
105
  def to_s
95
106
  "SSHD Configuration"
96
107
  end
108
+
109
+ private
110
+
111
+ def ssh_config_file(type)
112
+ if inspec.os.windows?
113
+ programdata = inspec.os_env("programdata").content
114
+ return "#{programdata}\\ssh\\#{type}"
115
+ end
116
+
117
+ "/etc/ssh/#{type}"
118
+ end
97
119
  end
98
120
  end
@@ -1,3 +1,3 @@
1
1
  module Inspec
2
- VERSION = "4.24.32".freeze
2
+ VERSION = "4.25.1".freeze
3
3
  end
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.24.32
4
+ version: 4.25.1
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: 2021-01-12 00:00:00.000000000 Z
11
+ date: 2021-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-telemetry
@@ -108,16 +108,22 @@ dependencies:
108
108
  name: rspec
109
109
  requirement: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - "~>"
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ version: '3.9'
114
+ - - "<"
112
115
  - !ruby/object:Gem::Version
113
- version: '3.10'
116
+ version: '3.11'
114
117
  type: :runtime
115
118
  prerelease: false
116
119
  version_requirements: !ruby/object:Gem::Requirement
117
120
  requirements:
118
- - - "~>"
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '3.9'
124
+ - - "<"
119
125
  - !ruby/object:Gem::Version
120
- version: '3.10'
126
+ version: '3.11'
121
127
  - !ruby/object:Gem::Dependency
122
128
  name: rspec-its
123
129
  requirement: !ruby/object:Gem::Requirement