inspec 1.7.1 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -2
- data/lib/bundles/inspec-compliance/target.rb +32 -23
- data/lib/inspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8af69e7763f2f41cea47b857805512d1987e8565
|
4
|
+
data.tar.gz: 74e15150e9b1f2b6ad90040f3f7e1d07da788e3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 615bfc38930bc317de961e0d8d48a4f4f0e7143a010417d8fd3af9db2d62ee0ade358d1e5d182e5d1dcc73c142ec46d14c9bcc4588c4ffde81a98b878418fca6
|
7
|
+
data.tar.gz: e40becad8f8b2277293c1bea194863a97b425d2c757f64394a542b264d8ea82cd33a091209d48792202767a0f2c67318b535c760cbfdc0d48ecc9d36e9f183de
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [1.7.
|
4
|
-
[Full Changelog](https://github.com/chef/inspec/compare/v1.7.
|
3
|
+
## [1.7.2](https://github.com/chef/inspec/tree/1.7.2) (2016-12-08)
|
4
|
+
[Full Changelog](https://github.com/chef/inspec/compare/v1.7.1...1.7.2)
|
5
|
+
|
6
|
+
**Fixed bugs:**
|
7
|
+
|
8
|
+
- use cached profile for compliance dependencies if vendored [\#1348](https://github.com/chef/inspec/pull/1348) ([chris-rock](https://github.com/chris-rock))
|
9
|
+
|
10
|
+
## [v1.7.1](https://github.com/chef/inspec/tree/v1.7.1) (2016-12-03)
|
11
|
+
[Full Changelog](https://github.com/chef/inspec/compare/v1.7.0...v1.7.1)
|
5
12
|
|
6
13
|
**Implemented enhancements:**
|
7
14
|
|
@@ -13,7 +13,7 @@ module Compliance
|
|
13
13
|
class Fetcher < Fetchers::Url
|
14
14
|
name 'compliance'
|
15
15
|
priority 500
|
16
|
-
def self.resolve(target) # rubocop:disable PerceivedComplexity
|
16
|
+
def self.resolve(target) # rubocop:disable PerceivedComplexity, Metrics/CyclomaticComplexity
|
17
17
|
uri = if target.is_a?(String) && URI(target).scheme == 'compliance'
|
18
18
|
URI(target)
|
19
19
|
elsif target.respond_to?(:key?) && target.key?(:compliance)
|
@@ -22,17 +22,22 @@ module Compliance
|
|
22
22
|
|
23
23
|
return nil if uri.nil?
|
24
24
|
|
25
|
-
#
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
25
|
+
# we have detailed information available in our lockfile, no need to ask the server
|
26
|
+
if target.respond_to?(:key?) && target.key?(:url)
|
27
|
+
profile_fetch_url = target[:url]
|
28
|
+
config = {}
|
29
|
+
else
|
30
|
+
# check if we have a compliance token
|
31
|
+
config = Compliance::Configuration.new
|
32
|
+
if config['token'].nil?
|
33
|
+
if config['server_type'] == 'automate'
|
34
|
+
server = 'automate'
|
35
|
+
msg = 'inspec compliance login_automate https://your_automate_server --user USER --ent ENT --dctoken DCTOKEN or --usertoken USERTOKEN'
|
36
|
+
else
|
37
|
+
server = 'compliance'
|
38
|
+
msg = "inspec compliance login https://your_compliance_server --user admin --insecure --token 'PASTE TOKEN HERE' "
|
39
|
+
end
|
40
|
+
fail Inspec::FetcherFailure, <<EOF
|
36
41
|
|
37
42
|
Cannot fetch #{uri} because your #{server} token has not been
|
38
43
|
configured.
|
@@ -41,14 +46,16 @@ Please login using
|
|
41
46
|
|
42
47
|
#{msg}
|
43
48
|
EOF
|
44
|
-
|
49
|
+
end
|
45
50
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
51
|
+
# verifies that the target e.g base/ssh exists
|
52
|
+
profile = uri.host + uri.path
|
53
|
+
if !Compliance::API.exist?(config, profile)
|
54
|
+
fail Inspec::FetcherFailure, "The compliance profile #{profile} was not found on the configured compliance server"
|
55
|
+
end
|
56
|
+
profile_fetch_url = target_url(profile, config)
|
50
57
|
end
|
51
|
-
new(
|
58
|
+
new(profile_fetch_url, config)
|
52
59
|
rescue URI::Error => _e
|
53
60
|
nil
|
54
61
|
end
|
@@ -63,12 +70,14 @@ EOF
|
|
63
70
|
target
|
64
71
|
end
|
65
72
|
|
66
|
-
#
|
67
73
|
# We want to save compliance: in the lockfile rather than url: to
|
68
|
-
# make sure we go back through the
|
69
|
-
#
|
74
|
+
# make sure we go back through the Compliance API handling.
|
70
75
|
def resolved_source
|
71
|
-
|
76
|
+
@resolved_source ||= {
|
77
|
+
compliance: compliance_profile_name,
|
78
|
+
url: @target,
|
79
|
+
sha256: sha256,
|
80
|
+
}
|
72
81
|
end
|
73
82
|
|
74
83
|
def to_s
|
@@ -77,7 +86,7 @@ EOF
|
|
77
86
|
|
78
87
|
private
|
79
88
|
|
80
|
-
def
|
89
|
+
def compliance_profile_name
|
81
90
|
m = %r{^#{@config['server']}/owners/(?<owner>[^/]+)/compliance/(?<id>[^/]+)/tar$}.match(@target)
|
82
91
|
"#{m[:owner]}/#{m[:id]}"
|
83
92
|
end
|
data/lib/inspec/version.rb
CHANGED
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: 1.7.
|
4
|
+
version: 1.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominik Richter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: train
|