inspec 1.18.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +2 -2
- data/Rakefile +1 -1
- data/docs/resources/dh_params.md +191 -0
- data/docs/resources/ssl.md.erb +1 -1
- data/inspec.gemspec +0 -1
- data/lib/inspec/resource.rb +1 -0
- data/lib/inspec/rspec_json_formatter.rb +42 -32
- data/lib/inspec/version.rb +1 -1
- data/lib/resources/apache_conf.rb +1 -0
- data/lib/resources/dh_params.rb +84 -0
- metadata +4 -21
- data/examples/inheritance/inspec.lock +0 -11
- data/examples/meta-profile/inspec.lock +0 -18
- data/examples/meta-profile/vendor/74b3437714871cca4505d9fc445c805968d56bc674855112bab187a5166f5a2d.tar.gz +0 -0
- data/examples/meta-profile/vendor/e25d521fb1093b4c23b31a7dc8f41b5540236f4a433960b151bc427523662ab6.tar.gz +0 -0
- data/examples/meta-profile/vendor/eb00c95846aeb3f1cbc5106537dcbf550c910d65986d21a62f7deb69ea060dee.tar.gz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5279ef93dcdde7d8809a8cf3aa6691c272e7c08d
|
4
|
+
data.tar.gz: 7021974fa808776c82d606cc3aab5decaa62068e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67291eb500e95d346b90f3e722f46709c804b143bbd08add330079483d9b4abdcb3c59307196941909e915a050d05970913862c382bf01cbe11daa719e714ecd
|
7
|
+
data.tar.gz: '09aabaf3494f99e2c9b77d5d9684dee87a948bed94b5f9900bda874b4a4f30e007d53d747c947759a2bed06c15c3ac7cef095145b66281806308a5598d702554'
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v1.19.0](https://github.com/chef/inspec/tree/v1.19.0) (2017-04-04)
|
4
|
+
[Full Changelog](https://github.com/chef/inspec/compare/v1.18.0...v1.19.0)
|
5
|
+
|
6
|
+
**Implemented enhancements:**
|
7
|
+
|
8
|
+
- dh\_params resource \(proposed\) [\#1617](https://github.com/chef/inspec/issues/1617)
|
9
|
+
- Allow apache\_conf to include symlinked configuration files [\#1406](https://github.com/chef/inspec/pull/1406) ([carldjohnston](https://github.com/carldjohnston))
|
10
|
+
|
11
|
+
**Merged pull requests:**
|
12
|
+
|
13
|
+
- Fix protocols matcher text on ssl resource docs [\#1622](https://github.com/chef/inspec/pull/1622) ([adamleff](https://github.com/adamleff))
|
14
|
+
- Replace Nokogiri with REXML in the JUnit formatter [\#1621](https://github.com/chef/inspec/pull/1621) ([adamleff](https://github.com/adamleff))
|
15
|
+
- obvious fix in README.md [\#1619](https://github.com/chef/inspec/pull/1619) ([lucky-sideburn](https://github.com/lucky-sideburn))
|
16
|
+
|
3
17
|
## [v1.18.0](https://github.com/chef/inspec/tree/v1.18.0) (2017-03-30)
|
4
18
|
[Full Changelog](https://github.com/chef/inspec/compare/v1.17.0...v1.18.0)
|
5
19
|
|
data/README.md
CHANGED
@@ -264,7 +264,7 @@ Which will provide you with:
|
|
264
264
|
Remote Targets
|
265
265
|
|
266
266
|
Platform | Versions | Architectures
|
267
|
-
|
267
|
+
--- | --- | ---
|
268
268
|
AIX | 6.1, 7.1, 7.2 | ppc64
|
269
269
|
CentOS | 5, 6, 7 | i386, x86_64
|
270
270
|
Debian | 7, 8 | i386, x86_64
|
@@ -289,7 +289,7 @@ HP-UX | 11.31 | ia64
|
|
289
289
|
In addition, runtime support is provided for:
|
290
290
|
|
291
291
|
Platform | Versions
|
292
|
-
---- |
|
292
|
+
---- | ----
|
293
293
|
Debian | 8
|
294
294
|
RHEL | 6, 7
|
295
295
|
Ubuntu | 12.04+
|
data/Rakefile
CHANGED
@@ -140,7 +140,7 @@ end
|
|
140
140
|
desc 'Generate the changelog'
|
141
141
|
task :changelog do
|
142
142
|
require_relative 'lib/inspec/version'
|
143
|
-
system "github_changelog_generator -u chef -p inspec --future-release #{Inspec::VERSION} --since-tag 0.7.0"
|
143
|
+
system "github_changelog_generator -u chef -p inspec --future-release v#{Inspec::VERSION} --since-tag 0.7.0"
|
144
144
|
end
|
145
145
|
|
146
146
|
# Update the version of this gem and create an updated
|
@@ -0,0 +1,191 @@
|
|
1
|
+
---
|
2
|
+
title: The dh_params Resource
|
3
|
+
---
|
4
|
+
|
5
|
+
# dh_params
|
6
|
+
|
7
|
+
Use the `dh_params` InSpec audit resource to test Diffie-Hellman (DH) parameters.
|
8
|
+
|
9
|
+
|
10
|
+
## Syntax
|
11
|
+
|
12
|
+
A `dh_params` resource block declares a parameter file to be tested.
|
13
|
+
|
14
|
+
describe dh_params('/path/to/file.dh_pem') do
|
15
|
+
it { should be_dh_params }
|
16
|
+
it { should be_valid }
|
17
|
+
its('generator') { should eq 2 }
|
18
|
+
its('modulus') { should eq '00:91:a0:15:89:e5:bc:38:93:12:02:fc:...' }
|
19
|
+
its('prime_length') { should eq 2048 }
|
20
|
+
its('pem') { should eq '-----BEGIN DH PARAMETERS...' }
|
21
|
+
its('text') { should eq 'PKCS#3 DH Parameters: (2048 bit)...' }
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
## Supported Properties
|
26
|
+
|
27
|
+
### dh_params?
|
28
|
+
|
29
|
+
Verify whether file contains DH parameters:
|
30
|
+
|
31
|
+
describe dh_params('/path/to/file.dh_pem') do
|
32
|
+
it { should be_dh_params }
|
33
|
+
end
|
34
|
+
|
35
|
+
### valid?
|
36
|
+
|
37
|
+
Verify whether DH parameters are valid:
|
38
|
+
|
39
|
+
describe dh_params('/path/to/file.dh_pem') do
|
40
|
+
it { should be_valid }
|
41
|
+
end
|
42
|
+
|
43
|
+
### generator (Integer)
|
44
|
+
|
45
|
+
Verify generator used for the Diffie-Hellman operation:
|
46
|
+
|
47
|
+
describe dh_params('/path/to/file.dh_pem') do
|
48
|
+
its('generator') { should eq 2 }
|
49
|
+
end
|
50
|
+
|
51
|
+
### modulus (String)
|
52
|
+
|
53
|
+
Verify prime modulus used for the Diffie-Hellman operation:
|
54
|
+
|
55
|
+
describe dh_params('/path/to/file.dh_pem') do
|
56
|
+
its('modulus') { should eq '00:91:a0:15:89:e5:bc:38:93:12:02:fc:...' }
|
57
|
+
end
|
58
|
+
|
59
|
+
Example using multi-line string:
|
60
|
+
|
61
|
+
describe dh_params('/path/to/file.dh_pem') do
|
62
|
+
its('modulus') do
|
63
|
+
# regex removes all whitespace
|
64
|
+
should eq <<-EOF.gsub(/[[:space:]]+/, '')
|
65
|
+
00:91:a0:15:89:e5:bc:38:93:12:02:fc:91:a2:85:
|
66
|
+
f7:f7:29:63:2e:d3:4e:7a:86:f7:ee:84:fe:42:d0:
|
67
|
+
48:bc:9c:91:d5:54:f8:78:1d:c0:41:78:a2:c4:ac:
|
68
|
+
1a:24:8b:9d:88:55:98:0b:ac:a7:23:eb:c2:aa:2b:
|
69
|
+
2e:a9:f9:af:d4:8e:4e:11:bc:7f:35:a2:ac:da:3a:
|
70
|
+
ef:f0:25:6c:9a:a4:fd:00:28:76:86:2c:57:87:67:
|
71
|
+
30:5d:b1:d6:5b:22:8f:72:a1:ea:de:8b:ef:9e:33:
|
72
|
+
1a:40:92:68:85:02:54:02:09:fa:c0:60:c1:3c:4e:
|
73
|
+
28:26:db:ed:25:8e:38:21:56:40:dc:c0:c0:66:1f:
|
74
|
+
2b:32:c3:b4:78:a9:26:94:ea:f7:41:28:b2:f5:5b:
|
75
|
+
01:38:0c:46:09:85:26:4d:69:12:8d:95:0f:35:e2:
|
76
|
+
e6:4e:47:3a:86:dd:8a:b2:fe:45:15:27:d8:59:c2:
|
77
|
+
3c:f4:62:ff:5f:74:e9:77:92:50:47:36:2b:05:57:
|
78
|
+
60:ee:7b:a1:60:cc:1c:7a:2b:77:18:8a:37:f7:c7:
|
79
|
+
31:3e:15:cb:15:7f:7b:66:96:fb:c6:be:7d:d6:03:
|
80
|
+
5e:0d:60:75:2b:5b:62:2a:a3:37:b6:34:f9:fe:96:
|
81
|
+
4c:f6:c5:e3:a1:52:af:01:c1:4f:c7:42:a0:be:ed:
|
82
|
+
cd:13
|
83
|
+
EOF
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
### prime_length (Integer)
|
88
|
+
|
89
|
+
Verify length of prime modulus used for the Diffie-Hellman operation:
|
90
|
+
|
91
|
+
describe dh_params('/path/to/file.dh_pem') do
|
92
|
+
its('prime_length') { should eq 2048 }
|
93
|
+
end
|
94
|
+
|
95
|
+
### pem (String)
|
96
|
+
|
97
|
+
Verify `pem` output of DH parameters:
|
98
|
+
|
99
|
+
describe dh_params('/path/to/file.dh_pem') do
|
100
|
+
its('pem') { should eq '-----BEGIN DH PARAMETERS...' }
|
101
|
+
end
|
102
|
+
|
103
|
+
Example using multi-line string:
|
104
|
+
|
105
|
+
its('pem') do
|
106
|
+
# regex removes all leading spaces
|
107
|
+
should eq <<-EOF.gsub(/^[[:blank:]]+/, '')
|
108
|
+
-----BEGIN DH PARAMETERS-----
|
109
|
+
MIIBCAKCAQEAkaAVieW8OJMSAvyRooX39yljLtNOeob37oT+QtBIvJyR1VT4eB3A
|
110
|
+
QXiixKwaJIudiFWYC6ynI+vCqisuqfmv1I5OEbx/NaKs2jrv8CVsmqT9ACh2hixX
|
111
|
+
h2cwXbHWWyKPcqHq3ovvnjMaQJJohQJUAgn6wGDBPE4oJtvtJY44IVZA3MDAZh8r
|
112
|
+
MsO0eKkmlOr3QSiy9VsBOAxGCYUmTWkSjZUPNeLmTkc6ht2Ksv5FFSfYWcI89GL/
|
113
|
+
X3Tpd5JQRzYrBVdg7nuhYMwceit3GIo398cxPhXLFX97Zpb7xr591gNeDWB1K1ti
|
114
|
+
KqM3tjT5/pZM9sXjoVKvAcFPx0Kgvu3NEwIBAg==
|
115
|
+
-----END DH PARAMETERS-----
|
116
|
+
EOF
|
117
|
+
end
|
118
|
+
|
119
|
+
Verify via `openssl dhparam` command:
|
120
|
+
|
121
|
+
$ openssl dhparam -in /path/to/file.dh_pem
|
122
|
+
-----BEGIN DH PARAMETERS-----
|
123
|
+
MIIBCAKCAQEAkaAVieW8OJMSAvyRooX39yljLtNOeob37oT+QtBIvJyR1VT4eB3A
|
124
|
+
QXiixKwaJIudiFWYC6ynI+vCqisuqfmv1I5OEbx/NaKs2jrv8CVsmqT9ACh2hixX
|
125
|
+
h2cwXbHWWyKPcqHq3ovvnjMaQJJohQJUAgn6wGDBPE4oJtvtJY44IVZA3MDAZh8r
|
126
|
+
MsO0eKkmlOr3QSiy9VsBOAxGCYUmTWkSjZUPNeLmTkc6ht2Ksv5FFSfYWcI89GL/
|
127
|
+
X3Tpd5JQRzYrBVdg7nuhYMwceit3GIo398cxPhXLFX97Zpb7xr591gNeDWB1K1ti
|
128
|
+
KqM3tjT5/pZM9sXjoVKvAcFPx0Kgvu3NEwIBAg==
|
129
|
+
-----END DH PARAMETERS-----
|
130
|
+
|
131
|
+
### text (String)
|
132
|
+
|
133
|
+
Verify human-readable text output of DH parameters:
|
134
|
+
|
135
|
+
describe dh_params('/path/to/file.dh_pem') do
|
136
|
+
its('text') { should eq 'PKCS#3 DH Parameters: (2048 bit)...' }
|
137
|
+
end
|
138
|
+
|
139
|
+
Example using multi-line string:
|
140
|
+
|
141
|
+
its('text') do
|
142
|
+
# regex removes 2 leading spaces
|
143
|
+
should eq <<-EOF.gsub(/^[[:blank:]]{2}/, '')
|
144
|
+
PKCS#3 DH Parameters: (2048 bit)
|
145
|
+
prime:
|
146
|
+
00:91:a0:15:89:e5:bc:38:93:12:02:fc:91:a2:85:
|
147
|
+
f7:f7:29:63:2e:d3:4e:7a:86:f7:ee:84:fe:42:d0:
|
148
|
+
48:bc:9c:91:d5:54:f8:78:1d:c0:41:78:a2:c4:ac:
|
149
|
+
1a:24:8b:9d:88:55:98:0b:ac:a7:23:eb:c2:aa:2b:
|
150
|
+
2e:a9:f9:af:d4:8e:4e:11:bc:7f:35:a2:ac:da:3a:
|
151
|
+
ef:f0:25:6c:9a:a4:fd:00:28:76:86:2c:57:87:67:
|
152
|
+
30:5d:b1:d6:5b:22:8f:72:a1:ea:de:8b:ef:9e:33:
|
153
|
+
1a:40:92:68:85:02:54:02:09:fa:c0:60:c1:3c:4e:
|
154
|
+
28:26:db:ed:25:8e:38:21:56:40:dc:c0:c0:66:1f:
|
155
|
+
2b:32:c3:b4:78:a9:26:94:ea:f7:41:28:b2:f5:5b:
|
156
|
+
01:38:0c:46:09:85:26:4d:69:12:8d:95:0f:35:e2:
|
157
|
+
e6:4e:47:3a:86:dd:8a:b2:fe:45:15:27:d8:59:c2:
|
158
|
+
3c:f4:62:ff:5f:74:e9:77:92:50:47:36:2b:05:57:
|
159
|
+
60:ee:7b:a1:60:cc:1c:7a:2b:77:18:8a:37:f7:c7:
|
160
|
+
31:3e:15:cb:15:7f:7b:66:96:fb:c6:be:7d:d6:03:
|
161
|
+
5e:0d:60:75:2b:5b:62:2a:a3:37:b6:34:f9:fe:96:
|
162
|
+
4c:f6:c5:e3:a1:52:af:01:c1:4f:c7:42:a0:be:ed:
|
163
|
+
cd:13
|
164
|
+
generator: 2 (0x2)
|
165
|
+
EOF
|
166
|
+
end
|
167
|
+
|
168
|
+
Verify via `openssl dhparam` command:
|
169
|
+
|
170
|
+
$ openssl dhparam -in /path/to/file.dh_pem -noout -text
|
171
|
+
PKCS#3 DH Parameters: (2048 bit)
|
172
|
+
prime:
|
173
|
+
00:91:a0:15:89:e5:bc:38:93:12:02:fc:91:a2:85:
|
174
|
+
f7:f7:29:63:2e:d3:4e:7a:86:f7:ee:84:fe:42:d0:
|
175
|
+
48:bc:9c:91:d5:54:f8:78:1d:c0:41:78:a2:c4:ac:
|
176
|
+
1a:24:8b:9d:88:55:98:0b:ac:a7:23:eb:c2:aa:2b:
|
177
|
+
2e:a9:f9:af:d4:8e:4e:11:bc:7f:35:a2:ac:da:3a:
|
178
|
+
ef:f0:25:6c:9a:a4:fd:00:28:76:86:2c:57:87:67:
|
179
|
+
30:5d:b1:d6:5b:22:8f:72:a1:ea:de:8b:ef:9e:33:
|
180
|
+
1a:40:92:68:85:02:54:02:09:fa:c0:60:c1:3c:4e:
|
181
|
+
28:26:db:ed:25:8e:38:21:56:40:dc:c0:c0:66:1f:
|
182
|
+
2b:32:c3:b4:78:a9:26:94:ea:f7:41:28:b2:f5:5b:
|
183
|
+
01:38:0c:46:09:85:26:4d:69:12:8d:95:0f:35:e2:
|
184
|
+
e6:4e:47:3a:86:dd:8a:b2:fe:45:15:27:d8:59:c2:
|
185
|
+
3c:f4:62:ff:5f:74:e9:77:92:50:47:36:2b:05:57:
|
186
|
+
60:ee:7b:a1:60:cc:1c:7a:2b:77:18:8a:37:f7:c7:
|
187
|
+
31:3e:15:cb:15:7f:7b:66:96:fb:c6:be:7d:d6:03:
|
188
|
+
5e:0d:60:75:2b:5b:62:2a:a3:37:b6:34:f9:fe:96:
|
189
|
+
4c:f6:c5:e3:a1:52:af:01:c1:4f:c7:42:a0:be:ed:
|
190
|
+
cd:13
|
191
|
+
generator: 2 (0x2)
|
data/docs/resources/ssl.md.erb
CHANGED
data/inspec.gemspec
CHANGED
@@ -39,7 +39,6 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_dependency 'mixlib-log'
|
40
40
|
spec.add_dependency 'sslshake', '~> 1'
|
41
41
|
spec.add_dependency 'parallel', '~> 1.9'
|
42
|
-
spec.add_dependency 'nokogiri', '~> 1.6'
|
43
42
|
spec.add_dependency 'faraday', '>=0.9.0'
|
44
43
|
spec.add_dependency 'toml', '~> 0.1'
|
45
44
|
spec.add_dependency 'addressable', '~> 2.5'
|
data/lib/inspec/resource.rb
CHANGED
@@ -795,51 +795,61 @@ class InspecRspecJUnit < InspecRspecJson
|
|
795
795
|
|
796
796
|
#
|
797
797
|
# This is the last method is invoked through the formatter interface.
|
798
|
-
# Converts the junit formatter constructed output_hash into
|
798
|
+
# Converts the junit formatter constructed output_hash into REXML generated
|
799
799
|
# XML and writes it to output.
|
800
800
|
#
|
801
801
|
def close(_notification)
|
802
|
-
require '
|
803
|
-
xml_output =
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
802
|
+
require 'rexml/document'
|
803
|
+
xml_output = REXML::Document.new
|
804
|
+
xml_output.add(REXML::XMLDecl.new)
|
805
|
+
|
806
|
+
testsuites = REXML::Element.new('testsuites')
|
807
|
+
xml_output.add(testsuites)
|
808
|
+
|
809
|
+
@output_hash[:profiles].each do |profile|
|
810
|
+
testsuites.add(build_profile_xml(profile))
|
811
|
+
end
|
812
|
+
|
813
|
+
formatter = REXML::Formatters::Pretty.new
|
814
|
+
formatter.compact = true
|
815
|
+
output.puts formatter.write(xml_output.xml_decl, '')
|
816
|
+
output.puts formatter.write(xml_output.root, '')
|
811
817
|
end
|
812
818
|
|
813
819
|
private
|
814
820
|
|
815
|
-
def build_profile_xml(
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
821
|
+
def build_profile_xml(profile)
|
822
|
+
profile_xml = REXML::Element.new('testsuite')
|
823
|
+
profile_xml.add_attribute('name', profile[:name])
|
824
|
+
profile_xml.add_attribute('tests', count_profile_tests(profile))
|
825
|
+
profile_xml.add_attribute('failed', count_profile_failed_tests(profile))
|
826
|
+
|
827
|
+
profile[:controls].each do |control|
|
828
|
+
next if control[:results].nil?
|
829
|
+
|
830
|
+
control[:results].each do |result|
|
831
|
+
profile_xml.add(build_result_xml(control, result))
|
823
832
|
end
|
824
833
|
end
|
825
|
-
end
|
826
834
|
|
827
|
-
|
828
|
-
return if control[:results].nil?
|
829
|
-
control[:results].each do |result|
|
830
|
-
build_result_xml(xml, control, result)
|
831
|
-
end
|
835
|
+
profile_xml
|
832
836
|
end
|
833
837
|
|
834
|
-
def build_result_xml(
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
838
|
+
def build_result_xml(control, result)
|
839
|
+
result_xml = REXML::Element.new('testcase')
|
840
|
+
result_xml.add_attribute('name', result[:code_desc])
|
841
|
+
result_xml.add_attribute('class', control[:title].nil? ? 'Anonymous' : control[:id])
|
842
|
+
result_xml.add_attribute('time', result[:run_time])
|
843
|
+
|
844
|
+
if result[:status] == 'failed'
|
845
|
+
failure_element = REXML::Element.new('failure')
|
846
|
+
failure_element.add_attribute('message', result[:message])
|
847
|
+
result_xml.add(failure_element)
|
848
|
+
elsif result[:status] == 'skipped'
|
849
|
+
result_xml.add_element('skipped')
|
842
850
|
end
|
851
|
+
|
852
|
+
result_xml
|
843
853
|
end
|
844
854
|
|
845
855
|
def count_profile_tests(profile)
|
data/lib/inspec/version.rb
CHANGED
@@ -107,6 +107,7 @@ module Inspec::Resources
|
|
107
107
|
(include_files + include_files_optional).each do |f|
|
108
108
|
id = Pathname.new(f).absolute? ? f : File.join(@conf_dir, f)
|
109
109
|
files = find_files(id, depth: 1, type: 'file')
|
110
|
+
files += find_files(id, depth: 1, type: 'link')
|
110
111
|
|
111
112
|
includes.push(files) if files
|
112
113
|
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# author: Doc Walker
|
3
|
+
|
4
|
+
require 'openssl'
|
5
|
+
|
6
|
+
class DhParams < Inspec.resource(1)
|
7
|
+
name 'dh_params'
|
8
|
+
|
9
|
+
desc '
|
10
|
+
Use the `dh_params` InSpec audit resource to test Diffie-Hellman (DH)
|
11
|
+
parameters.
|
12
|
+
'
|
13
|
+
|
14
|
+
example "
|
15
|
+
describe dh_params('/path/to/file.dh_pem') do
|
16
|
+
it { should be_dh_params }
|
17
|
+
it { should be_valid }
|
18
|
+
its('generator') { should eq 2 }
|
19
|
+
its('modulus') { should eq '00:91:a0:15:89:e5:bc:38:93:12:02:fc:...' }
|
20
|
+
its('prime_length') { should eq 2048 }
|
21
|
+
its('pem') { should eq '-----BEGIN DH PARAMETERS...' }
|
22
|
+
its('text') { should eq 'PKCS#3 DH Parameters: (2048 bit)...' }
|
23
|
+
end
|
24
|
+
"
|
25
|
+
|
26
|
+
def initialize(filename)
|
27
|
+
@dh_params_path = filename
|
28
|
+
file = inspec.file(@dh_params_path)
|
29
|
+
return skip_resource 'Unable to find DH parameters file ' \
|
30
|
+
"#{@dh_params_path}" unless file.exist?
|
31
|
+
|
32
|
+
begin
|
33
|
+
@dh_params = OpenSSL::PKey::DH.new file.content
|
34
|
+
rescue
|
35
|
+
@dh_params = nil
|
36
|
+
return skip_resource "Unable to load DH parameters #{@dh_params_path}"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# it { should be_dh_params }
|
41
|
+
def dh_params?
|
42
|
+
!@dh_params.nil?
|
43
|
+
end
|
44
|
+
|
45
|
+
# its('generator') { should eq 2 }
|
46
|
+
def generator
|
47
|
+
return if @dh_params.nil?
|
48
|
+
@dh_params.g.to_i
|
49
|
+
end
|
50
|
+
|
51
|
+
# its('modulus') { should eq '00:91:a0:15:89:e5:bc:38:93:12:02:fc:...' }
|
52
|
+
def modulus
|
53
|
+
return if @dh_params.nil?
|
54
|
+
'00:' + @dh_params.p.to_s(16).downcase.scan(/.{2}/).join(':')
|
55
|
+
end
|
56
|
+
|
57
|
+
# its('pem') { should eq '-----BEGIN DH PARAMETERS...' }
|
58
|
+
def pem
|
59
|
+
return if @dh_params.nil?
|
60
|
+
@dh_params.to_pem
|
61
|
+
end
|
62
|
+
|
63
|
+
# its('prime_length') { should be 2048 }
|
64
|
+
def prime_length
|
65
|
+
return if @dh_params.nil?
|
66
|
+
@dh_params.p.num_bits
|
67
|
+
end
|
68
|
+
|
69
|
+
# its('text') { should eq 'human-readable-text' }
|
70
|
+
def text
|
71
|
+
return if @dh_params.nil?
|
72
|
+
@dh_params.to_text
|
73
|
+
end
|
74
|
+
|
75
|
+
# it { should be_valid }
|
76
|
+
def valid?
|
77
|
+
return if @dh_params.nil?
|
78
|
+
@dh_params.params_ok?
|
79
|
+
end
|
80
|
+
|
81
|
+
def to_s
|
82
|
+
"dh_params #{@dh_params_path}"
|
83
|
+
end
|
84
|
+
end
|
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.
|
4
|
+
version: 1.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominik Richter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: train
|
@@ -204,20 +204,6 @@ dependencies:
|
|
204
204
|
- - "~>"
|
205
205
|
- !ruby/object:Gem::Version
|
206
206
|
version: '1.9'
|
207
|
-
- !ruby/object:Gem::Dependency
|
208
|
-
name: nokogiri
|
209
|
-
requirement: !ruby/object:Gem::Requirement
|
210
|
-
requirements:
|
211
|
-
- - "~>"
|
212
|
-
- !ruby/object:Gem::Version
|
213
|
-
version: '1.6'
|
214
|
-
type: :runtime
|
215
|
-
prerelease: false
|
216
|
-
version_requirements: !ruby/object:Gem::Requirement
|
217
|
-
requirements:
|
218
|
-
- - "~>"
|
219
|
-
- !ruby/object:Gem::Version
|
220
|
-
version: '1.6'
|
221
207
|
- !ruby/object:Gem::Dependency
|
222
208
|
name: faraday
|
223
209
|
requirement: !ruby/object:Gem::Requirement
|
@@ -304,6 +290,7 @@ files:
|
|
304
290
|
- docs/resources/command.md.erb
|
305
291
|
- docs/resources/crontab.md.erb
|
306
292
|
- docs/resources/csv.md.erb
|
293
|
+
- docs/resources/dh_params.md
|
307
294
|
- docs/resources/directory.md.erb
|
308
295
|
- docs/resources/etc_group.md.erb
|
309
296
|
- docs/resources/etc_passwd.md.erb
|
@@ -376,7 +363,6 @@ files:
|
|
376
363
|
- examples/README.md
|
377
364
|
- examples/inheritance/README.md
|
378
365
|
- examples/inheritance/controls/example.rb
|
379
|
-
- examples/inheritance/inspec.lock
|
380
366
|
- examples/inheritance/inspec.yml
|
381
367
|
- examples/kitchen-ansible/.kitchen.yml
|
382
368
|
- examples/kitchen-ansible/Gemfile
|
@@ -402,11 +388,7 @@ files:
|
|
402
388
|
- examples/kitchen-puppet/test/integration/default/web_spec.rb
|
403
389
|
- examples/meta-profile/README.md
|
404
390
|
- examples/meta-profile/controls/example.rb
|
405
|
-
- examples/meta-profile/inspec.lock
|
406
391
|
- examples/meta-profile/inspec.yml
|
407
|
-
- examples/meta-profile/vendor/74b3437714871cca4505d9fc445c805968d56bc674855112bab187a5166f5a2d.tar.gz
|
408
|
-
- examples/meta-profile/vendor/e25d521fb1093b4c23b31a7dc8f41b5540236f4a433960b151bc427523662ab6.tar.gz
|
409
|
-
- examples/meta-profile/vendor/eb00c95846aeb3f1cbc5106537dcbf550c910d65986d21a62f7deb69ea060dee.tar.gz
|
410
392
|
- examples/profile-attribute.yml
|
411
393
|
- examples/profile-attribute/README.md
|
412
394
|
- examples/profile-attribute/controls/example.rb
|
@@ -527,6 +509,7 @@ files:
|
|
527
509
|
- lib/resources/command.rb
|
528
510
|
- lib/resources/crontab.rb
|
529
511
|
- lib/resources/csv.rb
|
512
|
+
- lib/resources/dh_params.rb
|
530
513
|
- lib/resources/directory.rb
|
531
514
|
- lib/resources/etc_group.rb
|
532
515
|
- lib/resources/file.rb
|
@@ -1,11 +0,0 @@
|
|
1
|
-
---
|
2
|
-
lockfile_version: 1
|
3
|
-
depends:
|
4
|
-
- name: profile
|
5
|
-
resolved_source:
|
6
|
-
path: "/Users/aleff/projects/inspec/examples/profile"
|
7
|
-
version_constraints: ">= 0"
|
8
|
-
- name: profile-attribute
|
9
|
-
resolved_source:
|
10
|
-
path: "/Users/aleff/projects/inspec/examples/profile-attribute"
|
11
|
-
version_constraints: ">= 0"
|
@@ -1,18 +0,0 @@
|
|
1
|
-
---
|
2
|
-
lockfile_version: 1
|
3
|
-
depends:
|
4
|
-
- name: dev-sec/ssh-baseline
|
5
|
-
resolved_source:
|
6
|
-
url: https://github.com/dev-sec/ssh-baseline/archive/master.tar.gz
|
7
|
-
sha256: e25d521fb1093b4c23b31a7dc8f41b5540236f4a433960b151bc427523662ab6
|
8
|
-
version_constraints: ">= 0"
|
9
|
-
- name: ssl-benchmark
|
10
|
-
resolved_source:
|
11
|
-
url: https://github.com/dev-sec/ssl-benchmark/archive/master.tar.gz
|
12
|
-
sha256: 74b3437714871cca4505d9fc445c805968d56bc674855112bab187a5166f5a2d
|
13
|
-
version_constraints: ">= 0"
|
14
|
-
- name: windows-patch-benchmark
|
15
|
-
resolved_source:
|
16
|
-
url: https://github.com/chris-rock/windows-patch-benchmark/archive/master.tar.gz
|
17
|
-
sha256: eb00c95846aeb3f1cbc5106537dcbf550c910d65986d21a62f7deb69ea060dee
|
18
|
-
version_constraints: ">= 0"
|
Binary file
|
Binary file
|