inspec 4.23.4 → 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 +16 -33
- data/inspec.gemspec +3 -3
- data/lib/plugins/inspec-init/templates/profiles/aws/README.md +1 -1
- data/lib/resource_support/aws/aws_resource_mixin.rb +1 -1
- data/lib/resources/aws/aws_billing_report.rb +1 -3
- data/lib/resources/aws/aws_ebs_volume.rb +1 -1
- data/lib/resources/aws/aws_ec2_instance.rb +1 -1
- data/lib/resources/aws/aws_ecs_cluster.rb +11 -12
- data/lib/resources/aws/aws_iam_password_policy.rb +1 -1
- data/lib/resources/aws/aws_iam_policy.rb +3 -3
- data/lib/resources/aws/aws_iam_root_user.rb +1 -1
- data/lib/resources/aws/aws_security_group.rb +2 -2
- data/lib/resources/aws/aws_sqs_queue.rb +1 -1
- data/lib/resources/azure/azure_virtual_machine_data_disk.rb +1 -1
- metadata +14 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be5768a960a2f1c9972d9fe1e6b5dfd785d3df2d121d45c6a2d757a525b28af8
|
4
|
+
data.tar.gz: 2fd650afd210bc5074bef623a6ce128a4d8979bdd744aadcbf2e1cda3554043d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07e76e5279b846f48885f192b09745684acbe9affaba38d1d700bbe763a858ce01b6b2fd360efbc7d6d6a8cdfee09b9a4359d102ed90cd2601fd7fb8ed217581
|
7
|
+
data.tar.gz: f3d1a9d78c4510d55b29be8f54f58f9a835f7c4d5bb83582a75889858aa132291a9a4e3d8471e0e497c7c2a07057897cefeba9e9018f37e0aaad1356cf130915
|
data/Gemfile
CHANGED
@@ -11,6 +11,11 @@ gem "inspec-bin", path: "./inspec-bin"
|
|
11
11
|
|
12
12
|
gem "ffi", ">= 1.9.14", "!= 1.13.0"
|
13
13
|
|
14
|
+
if Gem.ruby_version.to_s.start_with?("2.5")
|
15
|
+
# 16.7.23 required ruby 2.6+
|
16
|
+
gem "chef-utils", "< 16.7.23" # TODO: remove when we drop ruby 2.5
|
17
|
+
end
|
18
|
+
|
14
19
|
group :omnibus do
|
15
20
|
gem "rb-readline"
|
16
21
|
gem "appbundler"
|
@@ -19,45 +24,23 @@ group :omnibus do
|
|
19
24
|
end
|
20
25
|
|
21
26
|
group :test do
|
22
|
-
gem "chefstyle", "~> 1.
|
23
|
-
gem "minitest", "~> 5.5"
|
24
|
-
gem "minitest-sprint", "~> 1.0"
|
25
|
-
gem "rake", ">= 10"
|
26
|
-
gem "simplecov", ["~> 0.10", "<=0.18.2"]
|
27
|
+
gem "chefstyle", "~> 1.5.7"
|
27
28
|
gem "concurrent-ruby", "~> 1.0"
|
29
|
+
gem "html-proofer", platforms: :ruby # do not attempt to run proofer on windows
|
30
|
+
gem "json_schemer", ">= 0.2.1", "< 0.2.12"
|
31
|
+
gem "m"
|
32
|
+
gem "minitest-sprint", "~> 1.0"
|
33
|
+
gem "minitest", "~> 5.5"
|
28
34
|
gem "mocha", "~> 1.1"
|
35
|
+
gem "nokogiri", "~> 1.9"
|
36
|
+
gem "pry-byebug"
|
37
|
+
gem "pry", "~> 0.10"
|
38
|
+
gem "rake", ">= 10"
|
29
39
|
gem "ruby-progressbar", "~> 1.8"
|
40
|
+
gem "simplecov", "~> 0.18"
|
30
41
|
gem "webmock", "~> 3.0"
|
31
|
-
gem "m"
|
32
|
-
gem "pry", "~> 0.10"
|
33
|
-
gem "pry-byebug"
|
34
|
-
gem "html-proofer", platforms: :ruby # do not attempt to run proofer on windows
|
35
|
-
end
|
36
|
-
|
37
|
-
group :integration do
|
38
|
-
gem "berkshelf"
|
39
|
-
gem "test-kitchen"
|
40
|
-
gem "kitchen-vagrant"
|
41
|
-
gem "chef", "< 15"
|
42
|
-
gem "chef-zero", "< 15"
|
43
|
-
gem "kitchen-inspec"
|
44
|
-
gem "kitchen-ec2"
|
45
|
-
gem "kitchen-dokken"
|
46
|
-
gem "git"
|
47
|
-
end
|
48
|
-
|
49
|
-
# gems for Maintainers.md generation
|
50
|
-
group :maintenance do
|
51
|
-
gem "tomlrb"
|
52
|
-
|
53
|
-
# To sync maintainers with github
|
54
|
-
gem "octokit"
|
55
|
-
gem "netrc"
|
56
42
|
end
|
57
43
|
|
58
44
|
group :deploy do
|
59
45
|
gem "inquirer"
|
60
46
|
end
|
61
|
-
|
62
|
-
# add these additional dependencies into Gemfile.local
|
63
|
-
eval_gemfile(__FILE__ + ".local") if File.exist?(__FILE__ + ".local")
|
data/inspec.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
|
# ONLY the aws/azure/gcp files. The rest will come in from inspec-core
|
19
19
|
# the gemspec is necessary for appbundler so don't remove it
|
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_dependency "train", "~> 3.0"
|
28
28
|
|
29
29
|
# Used for Azure profile until integrated into train
|
30
|
-
spec.add_dependency "faraday_middleware", "
|
30
|
+
spec.add_dependency "faraday_middleware", ">= 0.12.2", "< 1.1"
|
31
31
|
|
32
32
|
# Train plugins we ship with InSpec
|
33
33
|
spec.add_dependency "train-habitat", "~> 0.1"
|
@@ -26,7 +26,7 @@ Creating new profile at /Users/spaterson/my-profile
|
|
26
26
|
aws_vpc_id: 'custom-vpc-id'
|
27
27
|
```
|
28
28
|
|
29
|
-
The related control will simply be skipped if this is not provided. See the [InSpec DSL documentation](https://
|
29
|
+
The related control will simply be skipped if this is not provided. See the [InSpec DSL documentation](https://docs.chef.io/inspec/dsl_inspec/) for more details on conditional execution using `only_if`.
|
30
30
|
|
31
31
|
## Run the tests
|
32
32
|
|
@@ -61,7 +61,7 @@ module AwsResourceMixin
|
|
61
61
|
rescue Aws::Errors::MissingCredentialsError
|
62
62
|
# The AWS error here is unhelpful:
|
63
63
|
# "unable to sign request without credentials set"
|
64
|
-
Inspec::Log.error "It appears that you have not set your AWS credentials. You may set them using environment variables, or using the 'aws://region/aws_credentials_profile' target. See https://
|
64
|
+
Inspec::Log.error "It appears that you have not set your AWS credentials. You may set them using environment variables, or using the 'aws://region/aws_credentials_profile' target. See https://docs.chef.io/inspec/platforms/ for details."
|
65
65
|
fail_resource("No AWS credentials available")
|
66
66
|
rescue Aws::Errors::ServiceError => e
|
67
67
|
fail_resource e.message
|
@@ -1,9 +1,7 @@
|
|
1
1
|
require "resource_support/aws/aws_singular_resource_mixin"
|
2
2
|
require "resource_support/aws/aws_backend_base"
|
3
3
|
|
4
|
-
require "
|
5
|
-
require "resource_support/aws/aws_backend_base"
|
6
|
-
require "aws-sdk-costandusagereportservice.rb"
|
4
|
+
require "aws-sdk-costandusagereportservice"
|
7
5
|
|
8
6
|
class AwsBillingReport < Inspec.resource(1)
|
9
7
|
name "aws_billing_report"
|
@@ -34,7 +34,7 @@ class AwsEbsVolume < Inspec.resource(1)
|
|
34
34
|
rescue Aws::Errors::MissingCredentialsError
|
35
35
|
# The AWS error here is unhelpful:
|
36
36
|
# "unable to sign request without credentials set"
|
37
|
-
Inspec::Log.error "It appears that you have not set your AWS credentials. You may set them using environment variables, or using the 'aws://region/aws_credentials_profile' target. See https://
|
37
|
+
Inspec::Log.error "It appears that you have not set your AWS credentials. You may set them using environment variables, or using the 'aws://region/aws_credentials_profile' target. See https://docs.chef.io/inspec/platforms/ for details."
|
38
38
|
fail_resource("No AWS credentials available")
|
39
39
|
rescue Aws::Errors::ServiceError => e
|
40
40
|
fail_resource(e.message)
|
@@ -35,7 +35,7 @@ class AwsEc2Instance < Inspec.resource(1)
|
|
35
35
|
rescue Aws::Errors::MissingCredentialsError
|
36
36
|
# The AWS error here is unhelpful:
|
37
37
|
# "unable to sign request without credentials set"
|
38
|
-
Inspec::Log.error "It appears that you have not set your AWS credentials. You may set them using environment variables, or using the 'aws://region/aws_credentials_profile' target. See https://
|
38
|
+
Inspec::Log.error "It appears that you have not set your AWS credentials. You may set them using environment variables, or using the 'aws://region/aws_credentials_profile' target. See https://docs.chef.io/inspec/platforms/ for details."
|
39
39
|
fail_resource("No AWS credentials available")
|
40
40
|
rescue Aws::Errors::ServiceError => e
|
41
41
|
fail_resource e.message
|
@@ -37,19 +37,18 @@ class AwsEcsCluster < Inspec.resource(1)
|
|
37
37
|
|
38
38
|
def fetch_from_api
|
39
39
|
backend = BackendFactory.create(inspec_runner)
|
40
|
-
begin
|
41
|
-
# Use default cluster if no cluster name is specified
|
42
|
-
params = cluster_name.nil? ? {} : { clusters: [cluster_name] }
|
43
|
-
clusters = backend.describe_clusters(params).clusters
|
44
40
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
41
|
+
# Use default cluster if no cluster name is specified
|
42
|
+
params = cluster_name.nil? ? {} : { clusters: [cluster_name] }
|
43
|
+
clusters = backend.describe_clusters(params).clusters
|
44
|
+
|
45
|
+
# Cluster name is unique, we either get back one cluster, or none
|
46
|
+
if clusters.length == 1
|
47
|
+
@exists = true
|
48
|
+
unpack_describe_clusters_response(clusters.first)
|
49
|
+
else
|
50
|
+
@exists = false
|
51
|
+
populate_as_missing
|
53
52
|
end
|
54
53
|
end
|
55
54
|
|
@@ -43,7 +43,7 @@ class AwsIamPasswordPolicy < Inspec.resource(1)
|
|
43
43
|
rescue Aws::Errors::MissingCredentialsError
|
44
44
|
# The AWS error here is unhelpful:
|
45
45
|
# "unable to sign request without credentials set"
|
46
|
-
Inspec::Log.error "It appears that you have not set your AWS credentials. You may set them using environment variables, or using the 'aws://region/aws_credentials_profile' target. See https://
|
46
|
+
Inspec::Log.error "It appears that you have not set your AWS credentials. You may set them using environment variables, or using the 'aws://region/aws_credentials_profile' target. See https://docs.chef.io/inspec/platforms/ for details."
|
47
47
|
fail_resource("No AWS credentials available")
|
48
48
|
rescue Aws::Errors::ServiceError => e
|
49
49
|
fail_resource e.message
|
@@ -2,9 +2,9 @@ require "resource_support/aws/aws_singular_resource_mixin"
|
|
2
2
|
require "resource_support/aws/aws_backend_base"
|
3
3
|
require "aws-sdk-iam"
|
4
4
|
|
5
|
-
require "json"
|
6
|
-
require "set"
|
7
|
-
require "uri"
|
5
|
+
require "json" unless defined?(JSON)
|
6
|
+
require "set" unless defined?(Set)
|
7
|
+
require "uri" unless defined?(URI)
|
8
8
|
|
9
9
|
class AwsIamPolicy < Inspec.resource(1)
|
10
10
|
name "aws_iam_policy"
|
@@ -24,7 +24,7 @@ class AwsIamRootUser < Inspec.resource(1)
|
|
24
24
|
rescue Aws::Errors::MissingCredentialsError
|
25
25
|
# The AWS error here is unhelpful:
|
26
26
|
# "unable to sign request without credentials set"
|
27
|
-
Inspec::Log.error "It appears that you have not set your AWS credentials. You may set them using environment variables, or using the 'aws://region/aws_credentials_profile' target. See https://
|
27
|
+
Inspec::Log.error "It appears that you have not set your AWS credentials. You may set them using environment variables, or using the 'aws://region/aws_credentials_profile' target. See https://docs.chef.io/inspec/platforms/ for details."
|
28
28
|
fail_resource("No AWS credentials available")
|
29
29
|
rescue Aws::Errors::ServiceError => e
|
30
30
|
fail_resource e.message
|
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: 4.
|
4
|
+
version: 4.24.26
|
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: 2020-
|
11
|
+
date: 2020-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inspec-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.
|
19
|
+
version: 4.24.26
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.
|
26
|
+
version: 4.24.26
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: train
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,16 +42,22 @@ dependencies:
|
|
42
42
|
name: faraday_middleware
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 0.12.2
|
48
|
+
- - "<"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '1.1'
|
48
51
|
type: :runtime
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
51
54
|
requirements:
|
52
|
-
- - "
|
55
|
+
- - ">="
|
53
56
|
- !ruby/object:Gem::Version
|
54
57
|
version: 0.12.2
|
58
|
+
- - "<"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '1.1'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: train-habitat
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -186,9 +192,9 @@ require_paths:
|
|
186
192
|
- lib
|
187
193
|
required_ruby_version: !ruby/object:Gem::Requirement
|
188
194
|
requirements:
|
189
|
-
- - "
|
195
|
+
- - ">="
|
190
196
|
- !ruby/object:Gem::Version
|
191
|
-
version: '2.
|
197
|
+
version: '2.5'
|
192
198
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
199
|
requirements:
|
194
200
|
- - ">="
|