inspec 0.34.1 → 0.35.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 +171 -6
- data/examples/meta-profile/inspec.yml +2 -4
- data/lib/inspec/control_eval_context.rb +4 -2
- data/lib/inspec/dependencies/requirement.rb +18 -17
- data/lib/inspec/dependencies/resolver.rb +1 -1
- data/lib/inspec/fetcher.rb +25 -1
- data/lib/inspec/profile.rb +23 -2
- data/lib/inspec/profile_context.rb +10 -2
- data/lib/inspec/rule.rb +45 -2
- data/lib/inspec/runner.rb +8 -20
- 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: 861e8a137418a30cb36c3e9d51a32bb9e2e2ae2d
|
|
4
|
+
data.tar.gz: eeafd3a870d05e4f2ae67b3e299382eb6462d8b8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5f728850451314b6e5239013cf3bedabb5244b5e752c9b637d8655ea519310ed595c6e999aac09fb81d286c307a9ef0ef16cbbaf3ef11d9dbd2073d9bf5f8ca7
|
|
7
|
+
data.tar.gz: 5f0b35587277223728798d5de80c4bf8621558ec1af73fca28f23d7be08b39024f5ec90e06167baf7f5aef9df80d47b2b30745162224d0567bb475d7e332c19f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,33 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## [0.
|
|
4
|
-
[Full Changelog](https://github.com/chef/inspec/compare/v0.34.
|
|
3
|
+
## [0.35.0](https://github.com/chef/inspec/tree/0.35.0) (2016-09-16)
|
|
4
|
+
[Full Changelog](https://github.com/chef/inspec/compare/v0.34.1...0.35.0)
|
|
5
|
+
|
|
6
|
+
**Fixed bugs:**
|
|
7
|
+
|
|
8
|
+
- resource dsl not loded properly inside describe blocks [\#1074](https://github.com/chef/inspec/issues/1074)
|
|
9
|
+
|
|
10
|
+
**Closed issues:**
|
|
11
|
+
|
|
12
|
+
- online demo: check style of tutorial text [\#1054](https://github.com/chef/inspec/issues/1054)
|
|
13
|
+
- online demo: clear \(linux\) and cls \(windows\) command to clear the terminal [\#1052](https://github.com/chef/inspec/issues/1052)
|
|
14
|
+
- respect inspec.yml supports with include\_controls [\#1049](https://github.com/chef/inspec/issues/1049)
|
|
15
|
+
- Simplify dependency in inspec.yml [\#1048](https://github.com/chef/inspec/issues/1048)
|
|
16
|
+
|
|
17
|
+
**Merged pull requests:**
|
|
18
|
+
|
|
19
|
+
- Process transitive dependencies from lock file [\#1079](https://github.com/chef/inspec/pull/1079) ([stevendanna](https://github.com/stevendanna))
|
|
20
|
+
- Don't gpg-sign commits during tests [\#1077](https://github.com/chef/inspec/pull/1077) ([stevendanna](https://github.com/stevendanna))
|
|
21
|
+
- Ensure resources are visible inside its blocks [\#1076](https://github.com/chef/inspec/pull/1076) ([stevendanna](https://github.com/stevendanna))
|
|
22
|
+
- add gulp build pipeline to online demo [\#1075](https://github.com/chef/inspec/pull/1075) ([arlimus](https://github.com/arlimus))
|
|
23
|
+
- inspec simulator [\#1073](https://github.com/chef/inspec/pull/1073) ([chris-rock](https://github.com/chris-rock))
|
|
24
|
+
- Skip controls from profiles that don't support the current platform [\#1072](https://github.com/chef/inspec/pull/1072) ([stevendanna](https://github.com/stevendanna))
|
|
25
|
+
- add tutorials \(references\) to the site skeleton [\#1068](https://github.com/chef/inspec/pull/1068) ([arlimus](https://github.com/arlimus))
|
|
26
|
+
- Vj/improve demo [\#1065](https://github.com/chef/inspec/pull/1065) ([vjeffrey](https://github.com/vjeffrey))
|
|
27
|
+
- Provide inspec.yml shortcut syntax [\#1064](https://github.com/chef/inspec/pull/1064) ([stevendanna](https://github.com/stevendanna))
|
|
28
|
+
|
|
29
|
+
## [v0.34.1](https://github.com/chef/inspec/tree/v0.34.1) (2016-09-13)
|
|
30
|
+
[Full Changelog](https://github.com/chef/inspec/compare/v0.34.0...v0.34.1)
|
|
5
31
|
|
|
6
32
|
**Fixed bugs:**
|
|
7
33
|
|
|
@@ -254,7 +280,6 @@
|
|
|
254
280
|
**Implemented enhancements:**
|
|
255
281
|
|
|
256
282
|
- port\(\) could convert string parameter to integer [\#867](https://github.com/chef/inspec/issues/867)
|
|
257
|
-
- InSpec output for summary needs to count controls [\#852](https://github.com/chef/inspec/issues/852)
|
|
258
283
|
- add params and content method to parse\_config [\#876](https://github.com/chef/inspec/pull/876) ([chris-rock](https://github.com/chris-rock))
|
|
259
284
|
- Activate centos, debian and oracle linux in our travis tests [\#869](https://github.com/chef/inspec/pull/869) ([chris-rock](https://github.com/chris-rock))
|
|
260
285
|
|
|
@@ -866,7 +891,6 @@
|
|
|
866
891
|
|
|
867
892
|
- 0.15.0 [\#528](https://github.com/chef/inspec/pull/528) ([arlimus](https://github.com/arlimus))
|
|
868
893
|
- 0.14.9 [\#525](https://github.com/chef/inspec/pull/525) ([arlimus](https://github.com/arlimus))
|
|
869
|
-
- 0.14.8 [\#520](https://github.com/chef/inspec/pull/520) ([arlimus](https://github.com/arlimus))
|
|
870
894
|
|
|
871
895
|
## [v0.14.8](https://github.com/chef/inspec/tree/v0.14.8) (2016-03-04)
|
|
872
896
|
[Full Changelog](https://github.com/chef/inspec/compare/v0.14.7...v0.14.8)
|
|
@@ -877,6 +901,7 @@
|
|
|
877
901
|
|
|
878
902
|
**Merged pull requests:**
|
|
879
903
|
|
|
904
|
+
- 0.14.8 [\#520](https://github.com/chef/inspec/pull/520) ([arlimus](https://github.com/arlimus))
|
|
880
905
|
- expose control impacts in json [\#519](https://github.com/chef/inspec/pull/519) ([arlimus](https://github.com/arlimus))
|
|
881
906
|
|
|
882
907
|
## [v0.14.7](https://github.com/chef/inspec/tree/v0.14.7) (2016-03-01)
|
|
@@ -1027,7 +1052,6 @@
|
|
|
1027
1052
|
|
|
1028
1053
|
**Fixed bugs:**
|
|
1029
1054
|
|
|
1030
|
-
- Inspec iptables should have\_rule tests not working [\#420](https://github.com/chef/inspec/issues/420)
|
|
1031
1055
|
- Windows 2008 isn't being detected. [\#346](https://github.com/chef/inspec/issues/346)
|
|
1032
1056
|
- Fix two minor logging and config bugs in CLI [\#452](https://github.com/chef/inspec/pull/452) ([srenatus](https://github.com/srenatus))
|
|
1033
1057
|
- bugfix: verify the target resolver before using it [\#449](https://github.com/chef/inspec/pull/449) ([arlimus](https://github.com/arlimus))
|
|
@@ -1050,6 +1074,7 @@
|
|
|
1050
1074
|
**Fixed bugs:**
|
|
1051
1075
|
|
|
1052
1076
|
- File stats are not always working properly [\#430](https://github.com/chef/inspec/issues/430)
|
|
1077
|
+
- Inspec iptables should have\_rule tests not working [\#420](https://github.com/chef/inspec/issues/420)
|
|
1053
1078
|
- Integration test for apache config [\#406](https://github.com/chef/inspec/issues/406)
|
|
1054
1079
|
- rework auditd\_rules resource [\#312](https://github.com/chef/inspec/issues/312)
|
|
1055
1080
|
- resource/auditd\_rules: update rule list format [\#309](https://github.com/chef/inspec/issues/309)
|
|
@@ -1111,7 +1136,6 @@
|
|
|
1111
1136
|
- ec2 name tag instances for easier cleanup [\#418](https://github.com/chef/inspec/pull/418) ([alexpop](https://github.com/alexpop))
|
|
1112
1137
|
- add an simple describe for profile example [\#416](https://github.com/chef/inspec/pull/416) ([chris-rock](https://github.com/chris-rock))
|
|
1113
1138
|
- enable to configure the logger via cli [\#405](https://github.com/chef/inspec/pull/405) ([chris-rock](https://github.com/chris-rock))
|
|
1114
|
-
- 0.9.11 [\#402](https://github.com/chef/inspec/pull/402) ([chris-rock](https://github.com/chris-rock))
|
|
1115
1139
|
- remove os check exposure in file resource [\#398](https://github.com/chef/inspec/pull/398) ([arlimus](https://github.com/arlimus))
|
|
1116
1140
|
|
|
1117
1141
|
## [v0.9.11](https://github.com/chef/inspec/tree/v0.9.11) (2016-01-29)
|
|
@@ -1131,6 +1155,7 @@
|
|
|
1131
1155
|
|
|
1132
1156
|
**Merged pull requests:**
|
|
1133
1157
|
|
|
1158
|
+
- 0.9.11 [\#402](https://github.com/chef/inspec/pull/402) ([chris-rock](https://github.com/chris-rock))
|
|
1134
1159
|
- Readme fixes [\#390](https://github.com/chef/inspec/pull/390) ([jzohrab](https://github.com/jzohrab))
|
|
1135
1160
|
|
|
1136
1161
|
## [v0.9.10](https://github.com/chef/inspec/tree/v0.9.10) (2016-01-25)
|
|
@@ -1380,6 +1405,8 @@
|
|
|
1380
1405
|
- Not using git in the gemspec file [\#217](https://github.com/chef/inspec/pull/217) ([tyler-ball](https://github.com/tyler-ball))
|
|
1381
1406
|
- Updating Gemfile grouped dependencies to match what is already in the ChefDK [\#216](https://github.com/chef/inspec/pull/216) ([tyler-ball](https://github.com/tyler-ball))
|
|
1382
1407
|
- Fix contain / should match confusion [\#214](https://github.com/chef/inspec/pull/214) ([zmalone](https://github.com/zmalone))
|
|
1408
|
+
- Fix doc typos [\#213](https://github.com/chef/inspec/pull/213) ([juliandunn](https://github.com/juliandunn))
|
|
1409
|
+
- Add test-kitchen example reference to readme [\#212](https://github.com/chef/inspec/pull/212) ([chris-rock](https://github.com/chris-rock))
|
|
1383
1410
|
- Massively improve README [\#208](https://github.com/chef/inspec/pull/208) ([echohack](https://github.com/echohack))
|
|
1384
1411
|
|
|
1385
1412
|
## [0.9.1](https://github.com/chef/inspec/tree/0.9.1) (2015-11-04)
|
|
@@ -1415,7 +1442,10 @@
|
|
|
1415
1442
|
|
|
1416
1443
|
**Merged pull requests:**
|
|
1417
1444
|
|
|
1445
|
+
- 0.9.0 [\#200](https://github.com/chef/inspec/pull/200) ([arlimus](https://github.com/arlimus))
|
|
1446
|
+
- bugfix: dont skip controls during json generation [\#199](https://github.com/chef/inspec/pull/199) ([arlimus](https://github.com/arlimus))
|
|
1418
1447
|
- Fix typo and warning in command exist? check [\#198](https://github.com/chef/inspec/pull/198) ([arlimus](https://github.com/arlimus))
|
|
1448
|
+
- rename rule to control [\#197](https://github.com/chef/inspec/pull/197) ([chris-rock](https://github.com/chris-rock))
|
|
1419
1449
|
- improvement: fail properly if os is not supported [\#196](https://github.com/chef/inspec/pull/196) ([chris-rock](https://github.com/chris-rock))
|
|
1420
1450
|
- bugfix: relax fail for command.exist? for inspec check command [\#195](https://github.com/chef/inspec/pull/195) ([chris-rock](https://github.com/chris-rock))
|
|
1421
1451
|
- api: introduce control keyword [\#194](https://github.com/chef/inspec/pull/194) ([arlimus](https://github.com/arlimus))
|
|
@@ -1426,6 +1456,7 @@
|
|
|
1426
1456
|
- formatting, mostly ... also package =\> oneget [\#189](https://github.com/chef/inspec/pull/189) ([jamescott](https://github.com/jamescott))
|
|
1427
1457
|
- bugfix: ignore delivery when building the gem [\#186](https://github.com/chef/inspec/pull/186) ([arlimus](https://github.com/arlimus))
|
|
1428
1458
|
- api: change `--disable-sudo` to `--sudo` [\#185](https://github.com/chef/inspec/pull/185) ([arlimus](https://github.com/arlimus))
|
|
1459
|
+
- use new internal structure for inspect check [\#184](https://github.com/chef/inspec/pull/184) ([chris-rock](https://github.com/chris-rock))
|
|
1429
1460
|
- remove dup method users, use usernames, fix example [\#183](https://github.com/chef/inspec/pull/183) ([chris-rock](https://github.com/chris-rock))
|
|
1430
1461
|
- Update docs [\#181](https://github.com/chef/inspec/pull/181) ([chris-rock](https://github.com/chris-rock))
|
|
1431
1462
|
- do not expose stderr method via os\_env [\#179](https://github.com/chef/inspec/pull/179) ([chris-rock](https://github.com/chris-rock))
|
|
@@ -1440,8 +1471,34 @@
|
|
|
1440
1471
|
- add draft version of InSpec DSL topic [\#165](https://github.com/chef/inspec/pull/165) ([jamescott](https://github.com/jamescott))
|
|
1441
1472
|
- sync words [\#164](https://github.com/chef/inspec/pull/164) ([jamescott](https://github.com/jamescott))
|
|
1442
1473
|
- Improve docs [\#163](https://github.com/chef/inspec/pull/163) ([chris-rock](https://github.com/chris-rock))
|
|
1474
|
+
- Don't resolve `send` calls with dot-notation [\#162](https://github.com/chef/inspec/pull/162) ([arlimus](https://github.com/arlimus))
|
|
1475
|
+
- Align profile structure [\#161](https://github.com/chef/inspec/pull/161) ([arlimus](https://github.com/arlimus))
|
|
1443
1476
|
- update docs [\#160](https://github.com/chef/inspec/pull/160) ([chris-rock](https://github.com/chris-rock))
|
|
1444
1477
|
- resource =\> audit resource [\#159](https://github.com/chef/inspec/pull/159) ([jamescott](https://github.com/jamescott))
|
|
1478
|
+
- update readme [\#158](https://github.com/chef/inspec/pull/158) ([chris-rock](https://github.com/chris-rock))
|
|
1479
|
+
- add apache base config [\#157](https://github.com/chef/inspec/pull/157) ([chris-rock](https://github.com/chris-rock))
|
|
1480
|
+
- update to new kitchen-inspect [\#156](https://github.com/chef/inspec/pull/156) ([chris-rock](https://github.com/chris-rock))
|
|
1481
|
+
- consistently set an empty logger in non-verbose mode [\#155](https://github.com/chef/inspec/pull/155) ([arlimus](https://github.com/arlimus))
|
|
1482
|
+
- update query syntax [\#154](https://github.com/chef/inspec/pull/154) ([jamescott](https://github.com/jamescott))
|
|
1483
|
+
- bugfixes for json dummy module [\#153](https://github.com/chef/inspec/pull/153) ([arlimus](https://github.com/arlimus))
|
|
1484
|
+
- bugfix: correctly remove prefix from folder [\#152](https://github.com/chef/inspec/pull/152) ([arlimus](https://github.com/arlimus))
|
|
1485
|
+
- Rename vulcanosec -\> inspec [\#151](https://github.com/chef/inspec/pull/151) ([arlimus](https://github.com/arlimus))
|
|
1486
|
+
- feature: bring back profile check [\#150](https://github.com/chef/inspec/pull/150) ([arlimus](https://github.com/arlimus))
|
|
1487
|
+
- Metadata [\#149](https://github.com/chef/inspec/pull/149) ([arlimus](https://github.com/arlimus))
|
|
1488
|
+
- ignore local bundle config [\#148](https://github.com/chef/inspec/pull/148) ([arlimus](https://github.com/arlimus))
|
|
1489
|
+
- simplify auditd name [\#147](https://github.com/chef/inspec/pull/147) ([chris-rock](https://github.com/chris-rock))
|
|
1490
|
+
- Json [\#146](https://github.com/chef/inspec/pull/146) ([arlimus](https://github.com/arlimus))
|
|
1491
|
+
- bugfix: delivery only build necessary gems [\#145](https://github.com/chef/inspec/pull/145) ([arlimus](https://github.com/arlimus))
|
|
1492
|
+
- fix travis builds for 1.9.3 [\#144](https://github.com/chef/inspec/pull/144) ([arlimus](https://github.com/arlimus))
|
|
1493
|
+
- more integration tests [\#143](https://github.com/chef/inspec/pull/143) ([chris-rock](https://github.com/chris-rock))
|
|
1494
|
+
- json =\> exec [\#141](https://github.com/chef/inspec/pull/141) ([jamescott](https://github.com/jamescott))
|
|
1495
|
+
- add InSpec CLI reference topic [\#140](https://github.com/chef/inspec/pull/140) ([jamescott](https://github.com/jamescott))
|
|
1496
|
+
- encryptiong =\> encryption [\#139](https://github.com/chef/inspec/pull/139) ([jamescott](https://github.com/jamescott))
|
|
1497
|
+
- edit out words [\#138](https://github.com/chef/inspec/pull/138) ([jamescott](https://github.com/jamescott))
|
|
1498
|
+
- remove old docs file [\#136](https://github.com/chef/inspec/pull/136) ([chris-rock](https://github.com/chris-rock))
|
|
1499
|
+
- Integration tests [\#135](https://github.com/chef/inspec/pull/135) ([chris-rock](https://github.com/chris-rock))
|
|
1500
|
+
- add audit\_policy resource [\#134](https://github.com/chef/inspec/pull/134) ([jamescott](https://github.com/jamescott))
|
|
1501
|
+
- add file resource + lots of matchers [\#132](https://github.com/chef/inspec/pull/132) ([jamescott](https://github.com/jamescott))
|
|
1445
1502
|
|
|
1446
1503
|
## [0.8.0](https://github.com/chef/inspec/tree/0.8.0) (2015-10-21)
|
|
1447
1504
|
[Full Changelog](https://github.com/chef/inspec/compare/0.7.0...0.8.0)
|
|
@@ -1464,6 +1521,114 @@
|
|
|
1464
1521
|
- ensure all resources have a proper to\_s method [\#98](https://github.com/chef/inspec/issues/98)
|
|
1465
1522
|
- Escape commands before we execute them [\#70](https://github.com/chef/inspec/issues/70)
|
|
1466
1523
|
|
|
1524
|
+
**Merged pull requests:**
|
|
1525
|
+
|
|
1526
|
+
- 0.8.0 [\#131](https://github.com/chef/inspec/pull/131) ([chris-rock](https://github.com/chris-rock))
|
|
1527
|
+
- more CentOS support [\#128](https://github.com/chef/inspec/pull/128) ([chris-rock](https://github.com/chris-rock))
|
|
1528
|
+
- add more usage headers [\#127](https://github.com/chef/inspec/pull/127) ([chris-rock](https://github.com/chris-rock))
|
|
1529
|
+
- add test-kitchen example [\#126](https://github.com/chef/inspec/pull/126) ([chris-rock](https://github.com/chris-rock))
|
|
1530
|
+
- fix the header structure [\#124](https://github.com/chef/inspec/pull/124) ([jamescott](https://github.com/jamescott))
|
|
1531
|
+
- add resources, sync matcher patterns [\#123](https://github.com/chef/inspec/pull/123) ([jamescott](https://github.com/jamescott))
|
|
1532
|
+
- move markdown docs to rst [\#122](https://github.com/chef/inspec/pull/122) ([chris-rock](https://github.com/chris-rock))
|
|
1533
|
+
- delivery: select build node on new fqdn [\#119](https://github.com/chef/inspec/pull/119) ([arlimus](https://github.com/arlimus))
|
|
1534
|
+
- add first round of audit resource docs [\#118](https://github.com/chef/inspec/pull/118) ([jamescott](https://github.com/jamescott))
|
|
1535
|
+
- Add support for `expect` [\#117](https://github.com/chef/inspec/pull/117) ([arlimus](https://github.com/arlimus))
|
|
1536
|
+
- test: group resource tests [\#116](https://github.com/chef/inspec/pull/116) ([arlimus](https://github.com/arlimus))
|
|
1537
|
+
- Fixes [\#115](https://github.com/chef/inspec/pull/115) ([chris-rock](https://github.com/chris-rock))
|
|
1538
|
+
- simplify yum implementation [\#114](https://github.com/chef/inspec/pull/114) ([chris-rock](https://github.com/chris-rock))
|
|
1539
|
+
- take care of ruby warnings [\#112](https://github.com/chef/inspec/pull/112) ([arlimus](https://github.com/arlimus))
|
|
1540
|
+
- Train [\#111](https://github.com/chef/inspec/pull/111) ([arlimus](https://github.com/arlimus))
|
|
1541
|
+
- make default rake tasks test+lint [\#110](https://github.com/chef/inspec/pull/110) ([arlimus](https://github.com/arlimus))
|
|
1542
|
+
- make default rake tasks test+lint [\#109](https://github.com/chef/inspec/pull/109) ([arlimus](https://github.com/arlimus))
|
|
1543
|
+
- make default rake tasks test+lint [\#108](https://github.com/chef/inspec/pull/108) ([arlimus](https://github.com/arlimus))
|
|
1544
|
+
- Improve unit tests [\#106](https://github.com/chef/inspec/pull/106) ([chris-rock](https://github.com/chris-rock))
|
|
1545
|
+
- add to\_s methods to resources, fixes \#98 [\#105](https://github.com/chef/inspec/pull/105) ([chris-rock](https://github.com/chris-rock))
|
|
1546
|
+
- 0.7.0 release [\#104](https://github.com/chef/inspec/pull/104) ([chris-rock](https://github.com/chris-rock))
|
|
1547
|
+
- implement iptables resource [\#103](https://github.com/chef/inspec/pull/103) ([chris-rock](https://github.com/chris-rock))
|
|
1548
|
+
- bugfix: return function if data is already cached [\#102](https://github.com/chef/inspec/pull/102) ([chris-rock](https://github.com/chris-rock))
|
|
1549
|
+
- implement apt resource [\#101](https://github.com/chef/inspec/pull/101) ([chris-rock](https://github.com/chris-rock))
|
|
1550
|
+
- improve shell [\#100](https://github.com/chef/inspec/pull/100) ([chris-rock](https://github.com/chris-rock))
|
|
1551
|
+
- implement host resource [\#99](https://github.com/chef/inspec/pull/99) ([chris-rock](https://github.com/chris-rock))
|
|
1552
|
+
- implement bridge resource [\#97](https://github.com/chef/inspec/pull/97) ([chris-rock](https://github.com/chris-rock))
|
|
1553
|
+
- interactive shell [\#95](https://github.com/chef/inspec/pull/95) ([arlimus](https://github.com/arlimus))
|
|
1554
|
+
- interface resource [\#94](https://github.com/chef/inspec/pull/94) ([chris-rock](https://github.com/chris-rock))
|
|
1555
|
+
- lint: dont use undefined vars [\#93](https://github.com/chef/inspec/pull/93) ([arlimus](https://github.com/arlimus))
|
|
1556
|
+
- fix delivery dependencies [\#92](https://github.com/chef/inspec/pull/92) ([arlimus](https://github.com/arlimus))
|
|
1557
|
+
- improvement: add default print method to resources [\#91](https://github.com/chef/inspec/pull/91) ([arlimus](https://github.com/arlimus))
|
|
1558
|
+
- extend os backend helper [\#90](https://github.com/chef/inspec/pull/90) ([chris-rock](https://github.com/chris-rock))
|
|
1559
|
+
- integrate docs [\#89](https://github.com/chef/inspec/pull/89) ([chris-rock](https://github.com/chris-rock))
|
|
1560
|
+
- integrate docs [\#88](https://github.com/chef/inspec/pull/88) ([chris-rock](https://github.com/chris-rock))
|
|
1561
|
+
- script resource [\#87](https://github.com/chef/inspec/pull/87) ([chris-rock](https://github.com/chris-rock))
|
|
1562
|
+
- implement group resource [\#85](https://github.com/chef/inspec/pull/85) ([chris-rock](https://github.com/chris-rock))
|
|
1563
|
+
- add author header [\#84](https://github.com/chef/inspec/pull/84) ([chris-rock](https://github.com/chris-rock))
|
|
1564
|
+
- Resource bugfix [\#83](https://github.com/chef/inspec/pull/83) ([arlimus](https://github.com/arlimus))
|
|
1565
|
+
- Resource in resource [\#80](https://github.com/chef/inspec/pull/80) ([arlimus](https://github.com/arlimus))
|
|
1566
|
+
- ignore local delivery config [\#77](https://github.com/chef/inspec/pull/77) ([arlimus](https://github.com/arlimus))
|
|
1567
|
+
- bugfix user resource for windows [\#76](https://github.com/chef/inspec/pull/76) ([chris-rock](https://github.com/chris-rock))
|
|
1568
|
+
- activate lint in travis [\#75](https://github.com/chef/inspec/pull/75) ([arlimus](https://github.com/arlimus))
|
|
1569
|
+
- Simplify SSL configuration [\#69](https://github.com/chef/inspec/pull/69) ([arlimus](https://github.com/arlimus))
|
|
1570
|
+
- implement user resource [\#67](https://github.com/chef/inspec/pull/67) ([chris-rock](https://github.com/chris-rock))
|
|
1571
|
+
- switch from open4 -\> mixlib-shellout [\#66](https://github.com/chef/inspec/pull/66) ([arlimus](https://github.com/arlimus))
|
|
1572
|
+
- WinRM path [\#63](https://github.com/chef/inspec/pull/63) ([arlimus](https://github.com/arlimus))
|
|
1573
|
+
- bugfix: catch cases where oneget returns an array [\#62](https://github.com/chef/inspec/pull/62) ([chris-rock](https://github.com/chris-rock))
|
|
1574
|
+
- extend delivery tests to extra docker images [\#61](https://github.com/chef/inspec/pull/61) ([arlimus](https://github.com/arlimus))
|
|
1575
|
+
- rename --key-file to --key on cli [\#60](https://github.com/chef/inspec/pull/60) ([arlimus](https://github.com/arlimus))
|
|
1576
|
+
- Simpleconfig groups [\#57](https://github.com/chef/inspec/pull/57) ([arlimus](https://github.com/arlimus))
|
|
1577
|
+
- OS detection tests [\#56](https://github.com/chef/inspec/pull/56) ([arlimus](https://github.com/arlimus))
|
|
1578
|
+
- Start Linting remaining resources [\#55](https://github.com/chef/inspec/pull/55) ([arlimus](https://github.com/arlimus))
|
|
1579
|
+
- fix various robocop lint issues [\#54](https://github.com/chef/inspec/pull/54) ([chris-rock](https://github.com/chris-rock))
|
|
1580
|
+
- overhaul rule structure [\#53](https://github.com/chef/inspec/pull/53) ([arlimus](https://github.com/arlimus))
|
|
1581
|
+
- Verify ssh transport backend [\#51](https://github.com/chef/inspec/pull/51) ([arlimus](https://github.com/arlimus))
|
|
1582
|
+
- Unit test for service resource [\#50](https://github.com/chef/inspec/pull/50) ([chris-rock](https://github.com/chris-rock))
|
|
1583
|
+
- Ssh backend tests [\#49](https://github.com/chef/inspec/pull/49) ([arlimus](https://github.com/arlimus))
|
|
1584
|
+
- Docker concurrency [\#48](https://github.com/chef/inspec/pull/48) ([arlimus](https://github.com/arlimus))
|
|
1585
|
+
- unit tests for package resource [\#47](https://github.com/chef/inspec/pull/47) ([chris-rock](https://github.com/chris-rock))
|
|
1586
|
+
- Docker runner test [\#46](https://github.com/chef/inspec/pull/46) ([arlimus](https://github.com/arlimus))
|
|
1587
|
+
- add port resource [\#45](https://github.com/chef/inspec/pull/45) ([chris-rock](https://github.com/chris-rock))
|
|
1588
|
+
- bugfix: windows server 2008 detection [\#44](https://github.com/chef/inspec/pull/44) ([arlimus](https://github.com/arlimus))
|
|
1589
|
+
- Add detect command [\#43](https://github.com/chef/inspec/pull/43) ([arlimus](https://github.com/arlimus))
|
|
1590
|
+
- unit test mock os [\#42](https://github.com/chef/inspec/pull/42) ([chris-rock](https://github.com/chris-rock))
|
|
1591
|
+
- let travis do dockerized resource tests [\#41](https://github.com/chef/inspec/pull/41) ([arlimus](https://github.com/arlimus))
|
|
1592
|
+
- docker test run [\#40](https://github.com/chef/inspec/pull/40) ([arlimus](https://github.com/arlimus))
|
|
1593
|
+
- bugfix: detect os via unames [\#38](https://github.com/chef/inspec/pull/38) ([arlimus](https://github.com/arlimus))
|
|
1594
|
+
- run kitchen test instead of converge [\#37](https://github.com/chef/inspec/pull/37) ([arlimus](https://github.com/arlimus))
|
|
1595
|
+
- bugfix: local file owner [\#36](https://github.com/chef/inspec/pull/36) ([arlimus](https://github.com/arlimus))
|
|
1596
|
+
- bugfix: backend description for local + docker [\#35](https://github.com/chef/inspec/pull/35) ([arlimus](https://github.com/arlimus))
|
|
1597
|
+
- implement fake os method for mock backend \(for now\) [\#34](https://github.com/chef/inspec/pull/34) ([chris-rock](https://github.com/chris-rock))
|
|
1598
|
+
- add Windows feature resource [\#33](https://github.com/chef/inspec/pull/33) ([chris-rock](https://github.com/chris-rock))
|
|
1599
|
+
- add linux kernel resources [\#32](https://github.com/chef/inspec/pull/32) ([chris-rock](https://github.com/chris-rock))
|
|
1600
|
+
- Exist vs exists [\#31](https://github.com/chef/inspec/pull/31) ([arlimus](https://github.com/arlimus))
|
|
1601
|
+
- File formats [\#30](https://github.com/chef/inspec/pull/30) ([chris-rock](https://github.com/chris-rock))
|
|
1602
|
+
- OS detection and resource [\#29](https://github.com/chef/inspec/pull/29) ([arlimus](https://github.com/arlimus))
|
|
1603
|
+
- bugfix: fix simplified runner configuration [\#28](https://github.com/chef/inspec/pull/28) ([chris-rock](https://github.com/chris-rock))
|
|
1604
|
+
- improvement: simplify runner configuration [\#27](https://github.com/chef/inspec/pull/27) ([arlimus](https://github.com/arlimus))
|
|
1605
|
+
- bugfix: catch cases, where no service is available [\#26](https://github.com/chef/inspec/pull/26) ([chris-rock](https://github.com/chris-rock))
|
|
1606
|
+
- support package for windows [\#25](https://github.com/chef/inspec/pull/25) ([chris-rock](https://github.com/chris-rock))
|
|
1607
|
+
- implement service for FreeBSD [\#24](https://github.com/chef/inspec/pull/24) ([chris-rock](https://github.com/chris-rock))
|
|
1608
|
+
- move integration dependencies to Gemfile [\#23](https://github.com/chef/inspec/pull/23) ([chris-rock](https://github.com/chris-rock))
|
|
1609
|
+
- add oracle linux docker tests [\#22](https://github.com/chef/inspec/pull/22) ([arlimus](https://github.com/arlimus))
|
|
1610
|
+
- Support FreeBSD [\#21](https://github.com/chef/inspec/pull/21) ([arlimus](https://github.com/arlimus))
|
|
1611
|
+
- Service resource [\#20](https://github.com/chef/inspec/pull/20) ([chris-rock](https://github.com/chris-rock))
|
|
1612
|
+
- Improvements [\#19](https://github.com/chef/inspec/pull/19) ([chris-rock](https://github.com/chris-rock))
|
|
1613
|
+
- bugfix: set host for ssh config in specinfra [\#18](https://github.com/chef/inspec/pull/18) ([chris-rock](https://github.com/chris-rock))
|
|
1614
|
+
- improve readme [\#17](https://github.com/chef/inspec/pull/17) ([chris-rock](https://github.com/chris-rock))
|
|
1615
|
+
- Integration tests for the backend runner [\#16](https://github.com/chef/inspec/pull/16) ([arlimus](https://github.com/arlimus))
|
|
1616
|
+
- Fix specinfra OS detection [\#15](https://github.com/chef/inspec/pull/15) ([arlimus](https://github.com/arlimus))
|
|
1617
|
+
- Os detection [\#14](https://github.com/chef/inspec/pull/14) ([chris-rock](https://github.com/chris-rock))
|
|
1618
|
+
- bugfix: require specinfra backend [\#13](https://github.com/chef/inspec/pull/13) ([chris-rock](https://github.com/chris-rock))
|
|
1619
|
+
- improve docker test runner structure [\#12](https://github.com/chef/inspec/pull/12) ([arlimus](https://github.com/arlimus))
|
|
1620
|
+
- Concurrent integrationtest [\#11](https://github.com/chef/inspec/pull/11) ([arlimus](https://github.com/arlimus))
|
|
1621
|
+
- add oneget resource [\#10](https://github.com/chef/inspec/pull/10) ([chris-rock](https://github.com/chris-rock))
|
|
1622
|
+
- Winrm [\#9](https://github.com/chef/inspec/pull/9) ([chris-rock](https://github.com/chris-rock))
|
|
1623
|
+
- bugfix: linux file stat parameters and mount [\#8](https://github.com/chef/inspec/pull/8) ([arlimus](https://github.com/arlimus))
|
|
1624
|
+
- Mysql conf [\#7](https://github.com/chef/inspec/pull/7) ([arlimus](https://github.com/arlimus))
|
|
1625
|
+
- Lint update [\#6](https://github.com/chef/inspec/pull/6) ([arlimus](https://github.com/arlimus))
|
|
1626
|
+
- SSH PTY [\#5](https://github.com/chef/inspec/pull/5) ([arlimus](https://github.com/arlimus))
|
|
1627
|
+
- Start Docker + SSH backends [\#4](https://github.com/chef/inspec/pull/4) ([arlimus](https://github.com/arlimus))
|
|
1628
|
+
- travis checks [\#3](https://github.com/chef/inspec/pull/3) ([chris-rock](https://github.com/chris-rock))
|
|
1629
|
+
- Package [\#2](https://github.com/chef/inspec/pull/2) ([chris-rock](https://github.com/chris-rock))
|
|
1630
|
+
- shared linux file handling + specinfra config + cleanup [\#1](https://github.com/chef/inspec/pull/1) ([arlimus](https://github.com/arlimus))
|
|
1631
|
+
|
|
1467
1632
|
|
|
1468
1633
|
|
|
1469
1634
|
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
|
@@ -7,12 +7,10 @@ license: Apache 2
|
|
|
7
7
|
summary: InSpec Profile that is only consuming dependencies
|
|
8
8
|
version: 0.2.0
|
|
9
9
|
depends:
|
|
10
|
-
- name: ssh-hardening
|
|
11
|
-
supermarket: hardening/ssh-hardening
|
|
10
|
+
- name: hardening/ssh-hardening # defaults to supermarket
|
|
12
11
|
- name: os-hardening
|
|
13
12
|
url: https://github.com/dev-sec/tests-os-hardening/archive/master.zip
|
|
14
|
-
-
|
|
15
|
-
git: https://github.com/dev-sec/ssl-benchmark.git
|
|
13
|
+
- git: https://github.com/dev-sec/ssl-benchmark.git
|
|
16
14
|
- name: windows-patch-benchmark
|
|
17
15
|
git: https://github.com/chris-rock/windows-patch-benchmark.git
|
|
18
16
|
- name: linux
|
|
@@ -23,7 +23,7 @@ module Inspec
|
|
|
23
23
|
require 'rspec/core/dsl'
|
|
24
24
|
Class.new(Inspec::Rule) do
|
|
25
25
|
include RSpec::Core::DSL
|
|
26
|
-
|
|
26
|
+
with_resource_dsl resources_dsl
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
@@ -107,7 +107,9 @@ module Inspec
|
|
|
107
107
|
end
|
|
108
108
|
|
|
109
109
|
define_method :register_control do |control, &block|
|
|
110
|
-
|
|
110
|
+
if @skip_profile || !profile_context_owner.profile_supports_os?
|
|
111
|
+
::Inspec::Rule.set_skip_rule(control, true)
|
|
112
|
+
end
|
|
111
113
|
|
|
112
114
|
profile_context_owner.register_rule(control, &block) unless control.nil?
|
|
113
115
|
end
|
|
@@ -9,14 +9,9 @@ module Inspec
|
|
|
9
9
|
# appropriate we delegate to Inspec::Profile directly.
|
|
10
10
|
#
|
|
11
11
|
class Requirement
|
|
12
|
-
attr_reader :name, :dep, :cwd, :opts
|
|
13
|
-
attr_writer :dependencies
|
|
14
|
-
|
|
15
12
|
def self.from_metadata(dep, vendor_index, opts)
|
|
16
13
|
fail 'Cannot load empty dependency.' if dep.nil? || dep.empty?
|
|
17
|
-
name
|
|
18
|
-
version = dep[:version]
|
|
19
|
-
new(name, version, vendor_index, opts[:cwd], opts.merge(dep))
|
|
14
|
+
new(dep[:name], dep[:version], vendor_index, opts[:cwd], opts.merge(dep))
|
|
20
15
|
end
|
|
21
16
|
|
|
22
17
|
def self.from_lock_entry(entry, cwd, vendor_index, backend)
|
|
@@ -27,35 +22,41 @@ module Inspec
|
|
|
27
22
|
entry[:resolved_source].merge(backend: backend))
|
|
28
23
|
|
|
29
24
|
locked_deps = []
|
|
30
|
-
Array(entry[
|
|
25
|
+
Array(entry[:dependencies]).each do |dep_entry|
|
|
31
26
|
locked_deps << Inspec::Requirement.from_lock_entry(dep_entry, cwd, vendor_index, backend)
|
|
32
27
|
end
|
|
33
28
|
req.lock_deps(locked_deps)
|
|
34
29
|
req
|
|
35
30
|
end
|
|
36
31
|
|
|
32
|
+
attr_reader :cwd, :opts, :required_version
|
|
37
33
|
def initialize(name, version_constraints, vendor_index, cwd, opts)
|
|
38
34
|
@name = name
|
|
39
|
-
@
|
|
40
|
-
@dep = Gem::Dependency.new(name, @version_requirement, :runtime)
|
|
35
|
+
@required_version = Gem::Requirement.new(Array(version_constraints))
|
|
41
36
|
@vendor_index = vendor_index
|
|
42
37
|
@backend = opts[:backend]
|
|
43
38
|
@opts = opts
|
|
44
39
|
@cwd = cwd
|
|
45
40
|
end
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
#
|
|
43
|
+
# A dependency can be renamed in inspec.yml/inspec.lock. Prefer
|
|
44
|
+
# the name the user gave this dependency over the profile name.
|
|
45
|
+
#
|
|
46
|
+
def name
|
|
47
|
+
@name || profile.name
|
|
49
48
|
end
|
|
50
49
|
|
|
51
50
|
def source_version
|
|
52
|
-
profile.
|
|
51
|
+
profile.version
|
|
53
52
|
end
|
|
54
53
|
|
|
55
54
|
def source_satisfies_spec?
|
|
56
|
-
name
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
gem_dep.match?(profile.name, profile.version)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def gem_dep
|
|
59
|
+
@gem_dep ||= Gem::Dependency.new(profile.name, required_version, :runtime)
|
|
59
60
|
end
|
|
60
61
|
|
|
61
62
|
def resolved_source
|
|
@@ -66,7 +67,7 @@ module Inspec
|
|
|
66
67
|
h = {
|
|
67
68
|
'name' => name,
|
|
68
69
|
'resolved_source' => resolved_source,
|
|
69
|
-
'version_constraints' =>
|
|
70
|
+
'version_constraints' => required_version.to_s,
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
if !dependencies.empty?
|
|
@@ -103,7 +104,7 @@ module Inspec
|
|
|
103
104
|
end
|
|
104
105
|
|
|
105
106
|
def to_s
|
|
106
|
-
"#{
|
|
107
|
+
"#{name ? name : '<unfetched>'} (#{resolved_source})"
|
|
107
108
|
end
|
|
108
109
|
|
|
109
110
|
def profile
|
|
@@ -50,7 +50,7 @@ module Inspec
|
|
|
50
50
|
def resolve(deps, top_level = true, seen_items = {}, path_string = '') # rubocop:disable Metrics/AbcSize
|
|
51
51
|
graph = {}
|
|
52
52
|
if top_level
|
|
53
|
-
Inspec::Log.debug("Starting traversal of dependencies #{deps.map(&:
|
|
53
|
+
Inspec::Log.debug("Starting traversal of dependencies #{deps.map(&:to_s)}")
|
|
54
54
|
else
|
|
55
55
|
Inspec::Log.debug("Traversing dependency tree of transitive dependency #{deps.map(&:name)}")
|
|
56
56
|
end
|
data/lib/inspec/fetcher.rb
CHANGED
|
@@ -6,7 +6,31 @@ require 'inspec/plugins'
|
|
|
6
6
|
require 'utils/plugin_registry'
|
|
7
7
|
|
|
8
8
|
module Inspec
|
|
9
|
-
|
|
9
|
+
class FetcherRegistry < PluginRegistry
|
|
10
|
+
def resolve(target)
|
|
11
|
+
if fetcher_specified?(target)
|
|
12
|
+
super(target)
|
|
13
|
+
else
|
|
14
|
+
Inspec::Log.debug("Assuming default supermarket source for #{target}")
|
|
15
|
+
super(with_default_fetcher(target))
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
NON_FETCHER_KEYS = [:name, :version_constraint, :cwd, :backend, :cache].freeze
|
|
20
|
+
def fetcher_specified?(target)
|
|
21
|
+
# Only set a default for Hash-based (i.e. from
|
|
22
|
+
# inspec.yml/inspec.lock) targets
|
|
23
|
+
|
|
24
|
+
return true if !target.respond_to?(:keys)
|
|
25
|
+
!(target.keys - NON_FETCHER_KEYS).empty?
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def with_default_fetcher(target)
|
|
29
|
+
target.merge({ supermarket: target[:name] })
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
Fetcher = FetcherRegistry.new
|
|
10
34
|
|
|
11
35
|
def self.fetcher(version)
|
|
12
36
|
if version != 1
|
data/lib/inspec/profile.rb
CHANGED
|
@@ -51,8 +51,7 @@ module Inspec
|
|
|
51
51
|
for_path(resolve_target(target, opts[:cache]), opts.merge(target: target))
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
attr_reader :source_reader
|
|
55
|
-
attr_accessor :runner_context
|
|
54
|
+
attr_reader :source_reader, :backend, :runner_context
|
|
56
55
|
def_delegator :@source_reader, :tests
|
|
57
56
|
def_delegator :@source_reader, :libraries
|
|
58
57
|
def_delegator :@source_reader, :metadata
|
|
@@ -77,6 +76,28 @@ module Inspec
|
|
|
77
76
|
metadata.params[:name]
|
|
78
77
|
end
|
|
79
78
|
|
|
79
|
+
def version
|
|
80
|
+
metadata.params[:version]
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
#
|
|
84
|
+
# Is this profile is supported on the current platform of the
|
|
85
|
+
# backend machine and the current inspec version.
|
|
86
|
+
#
|
|
87
|
+
# @returns [TrueClass, FalseClass]
|
|
88
|
+
#
|
|
89
|
+
def supported?
|
|
90
|
+
supports_os? && supports_runtime?
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def supports_os?
|
|
94
|
+
metadata.supports_transport?(@backend)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def supports_runtime?
|
|
98
|
+
metadata.supports_runtime?
|
|
99
|
+
end
|
|
100
|
+
|
|
80
101
|
def params
|
|
81
102
|
@params ||= load_params
|
|
82
103
|
end
|
|
@@ -59,6 +59,12 @@ module Inspec
|
|
|
59
59
|
@control_eval_context = nil
|
|
60
60
|
end
|
|
61
61
|
|
|
62
|
+
def profile_supports_os?
|
|
63
|
+
return true if @conf['profile'].nil?
|
|
64
|
+
|
|
65
|
+
@conf['profile'].supports_os?
|
|
66
|
+
end
|
|
67
|
+
|
|
62
68
|
def all_rules
|
|
63
69
|
ret = @rules.values
|
|
64
70
|
ret += @subcontexts.map(&:all_rules).flatten
|
|
@@ -122,10 +128,12 @@ module Inspec
|
|
|
122
128
|
@rules.delete(full_id(@profile_id, id))
|
|
123
129
|
end
|
|
124
130
|
|
|
131
|
+
attr_reader :current_load
|
|
132
|
+
|
|
125
133
|
def register_rule(r)
|
|
126
134
|
# get the full ID
|
|
127
|
-
r.instance_variable_set(:@__file,
|
|
128
|
-
r.instance_variable_set(:@__group_title,
|
|
135
|
+
r.instance_variable_set(:@__file, current_load[:file])
|
|
136
|
+
r.instance_variable_set(:@__group_title, current_load[:title])
|
|
129
137
|
|
|
130
138
|
# add the rule to the registry
|
|
131
139
|
fid = full_id(Inspec::Rule.profile_id(r), Inspec::Rule.rule_id(r))
|
data/lib/inspec/rule.rb
CHANGED
|
@@ -12,6 +12,24 @@ module Inspec
|
|
|
12
12
|
class Rule # rubocop:disable Metrics/ClassLength
|
|
13
13
|
include ::RSpec::Matchers
|
|
14
14
|
|
|
15
|
+
#
|
|
16
|
+
# Include any resources from the given resource DSL. The passed
|
|
17
|
+
# resource_dsl will also be included in any Inspec::Expect objects
|
|
18
|
+
# we make.
|
|
19
|
+
#
|
|
20
|
+
# @params resource_dsl [Module]
|
|
21
|
+
# @returns [TrueClass]
|
|
22
|
+
#
|
|
23
|
+
def self.with_resource_dsl(resource_dsl)
|
|
24
|
+
include resource_dsl
|
|
25
|
+
@resource_dsl = resource_dsl
|
|
26
|
+
true
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.resource_dsl # rubocop:disable Style/TrivialAccessors
|
|
30
|
+
@resource_dsl
|
|
31
|
+
end
|
|
32
|
+
|
|
15
33
|
def initialize(id, profile_id, _opts, &block)
|
|
16
34
|
@impact = nil
|
|
17
35
|
@title = nil
|
|
@@ -106,12 +124,12 @@ module Inspec
|
|
|
106
124
|
include dsl
|
|
107
125
|
end.new(method(:__add_check))
|
|
108
126
|
else
|
|
109
|
-
__add_check('describe', values, block)
|
|
127
|
+
__add_check('describe', values, with_dsl(block))
|
|
110
128
|
end
|
|
111
129
|
end
|
|
112
130
|
|
|
113
131
|
def expect(value, &block)
|
|
114
|
-
target = Inspec::Expect.new(value, &block)
|
|
132
|
+
target = Inspec::Expect.new(value, &with_dsl(block))
|
|
115
133
|
__add_check('expect', [value], target)
|
|
116
134
|
target
|
|
117
135
|
end
|
|
@@ -188,6 +206,31 @@ module Inspec
|
|
|
188
206
|
@__checks.push([describe_or_expect, values, block])
|
|
189
207
|
end
|
|
190
208
|
|
|
209
|
+
#
|
|
210
|
+
# Takes a block and returns a block that will run the given block
|
|
211
|
+
# with access to the resource_dsl of the current class. This is to
|
|
212
|
+
# ensure that inside the constructed Rspec::ExampleGroup users
|
|
213
|
+
# have access to DSL methods. Previous this was done in
|
|
214
|
+
# Inspec::Runner before sending the example groups to rspec. It
|
|
215
|
+
# was moved here to ensure that code inside `its` blocks hae the
|
|
216
|
+
# same visibility into resources as code outside its blocks.
|
|
217
|
+
#
|
|
218
|
+
# @param [Proc] block
|
|
219
|
+
# @return [Proc]
|
|
220
|
+
#
|
|
221
|
+
def with_dsl(block)
|
|
222
|
+
return nil if block.nil?
|
|
223
|
+
if self.class.resource_dsl
|
|
224
|
+
dsl = self.class.resource_dsl
|
|
225
|
+
proc do |*args|
|
|
226
|
+
include dsl
|
|
227
|
+
instance_exec(*args, &block)
|
|
228
|
+
end
|
|
229
|
+
else
|
|
230
|
+
block
|
|
231
|
+
end
|
|
232
|
+
end
|
|
233
|
+
|
|
191
234
|
# Idio(ma)tic unindent
|
|
192
235
|
# TODO: replace this
|
|
193
236
|
#
|
data/lib/inspec/runner.rb
CHANGED
|
@@ -66,7 +66,6 @@ module Inspec
|
|
|
66
66
|
|
|
67
67
|
def run(with = nil)
|
|
68
68
|
Inspec::Log.debug "Starting run with targets: #{@target_profiles.map(&:to_s)}"
|
|
69
|
-
Inspec::Log.debug "Backend is #{@backend}"
|
|
70
69
|
all_controls = []
|
|
71
70
|
|
|
72
71
|
@target_profiles.each do |profile|
|
|
@@ -149,17 +148,16 @@ module Inspec
|
|
|
149
148
|
end
|
|
150
149
|
|
|
151
150
|
def supports_profile?(profile)
|
|
152
|
-
return true if
|
|
151
|
+
return true if @ignore_supports
|
|
153
152
|
|
|
154
|
-
if !profile.
|
|
153
|
+
if !profile.supports_runtime?
|
|
155
154
|
fail 'This profile requires InSpec version '\
|
|
156
155
|
"#{profile.metadata.inspec_requirement}. You are running "\
|
|
157
156
|
"InSpec v#{Inspec::VERSION}.\n"
|
|
158
157
|
end
|
|
159
158
|
|
|
160
|
-
if !profile.
|
|
161
|
-
|
|
162
|
-
fail "This OS/platform (#{os_info}) is not supported by this profile."
|
|
159
|
+
if !profile.supports_os?
|
|
160
|
+
fail "This OS/platform (#{@backend.os[:name]}) is not supported by this profile."
|
|
163
161
|
end
|
|
164
162
|
|
|
165
163
|
true
|
|
@@ -231,21 +229,11 @@ module Inspec
|
|
|
231
229
|
Inspec::Log.debug "Registering rule #{rule}"
|
|
232
230
|
@rules << rule
|
|
233
231
|
checks = ::Inspec::Rule.prepare_checks(rule)
|
|
234
|
-
examples = checks.
|
|
232
|
+
examples = checks.flat_map do |m, a, b|
|
|
235
233
|
get_check_example(m, a, b)
|
|
236
|
-
end.
|
|
237
|
-
|
|
238
|
-
examples.each
|
|
239
|
-
# TODO: Remove this!! It is very dangerous to do this here.
|
|
240
|
-
# The goal of this is to make the audit DSL available to all
|
|
241
|
-
# describe blocks. Right now, these blocks are executed outside
|
|
242
|
-
# the scope of this run, thus not gaining ony of the DSL pieces.
|
|
243
|
-
# To circumvent this, the full DSL is attached to the example's
|
|
244
|
-
# scope.
|
|
245
|
-
dsl = Inspec::Resource.create_dsl(backend)
|
|
246
|
-
example.send(:include, dsl)
|
|
247
|
-
@test_collector.add_test(example, rule)
|
|
248
|
-
end
|
|
234
|
+
end.compact
|
|
235
|
+
|
|
236
|
+
examples.each { |e| @test_collector.add_test(e, rule) }
|
|
249
237
|
end
|
|
250
238
|
end
|
|
251
239
|
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: 0.
|
|
4
|
+
version: 0.35.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: 2016-09-
|
|
11
|
+
date: 2016-09-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: train
|