Commit graph

2493 commits

Author SHA1 Message Date
Chef Expeditor
f2edb7a285 Bump version to 2.2.45 by Chef Expeditor 2018-07-25 20:01:53 +00:00
Jerry Aldrich
f2d64938b7 windows_feature resource: Add DISM support (#3224)
* windows_feature resource: Add DISM support

This modifies the `windows_feature` resource to fallback to DISM when
the `Get-WindowsFeature` command is not available.

* Allow specifying `:dism` or `:powershell`
* Replace stacktrace with smaller error message
* Add notes/todo about raise behavior
* Remove duplicated platform check

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-07-25 16:00:06 -04:00
Jerry Aldrich
2245bba021 cli: Downcase supermarket tool name to match URL (#3242)
* cli: Downcase supermarket tool name to match URL

This downcases the user provided tool name. Without this fetching the
profile will fail because the Supermarket API downcases in the URL.

* Add another downcase
* Add handling for `supermarket://owner_but_no_name`

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-07-25 15:59:19 -04:00
Jerry Aldrich
c1d7b2cfa3 alpine resource: Fix small style issues (#3238)
* Constrain RuboCop disables to single method
* Add comment to Alpine package command
* Use single quotes for Alpine package command
* Change `it` statement to be readable

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-07-25 15:57:51 -04:00
Chef Expeditor
c647ac9469 Bump version to 2.2.44 by Chef Expeditor 2018-07-25 19:57:27 +00:00
James Stocks
fb0a8989db Add extra fault checking to git fetcher (#3239)
Raise with the stderr from `git ls-remote` if stderr is not empty.
This is useful when inspec runs in CI and you do not have direct control/troublshooting options.

Signed-off-by: James Stocks <jstocks@chef.io>
2018-07-25 15:57:03 -04:00
Chef Expeditor
3c0abf7774 Bump version to 2.2.43 by Chef Expeditor 2018-07-25 17:08:23 +00:00
Chef Expeditor
b8928aca74 Bump version to 2.2.42 by Chef Expeditor 2018-07-23 08:45:31 +00:00
Chef Expeditor
9d36e1b61a Bump version to 2.2.41 by Chef Expeditor 2018-07-19 19:07:50 +00:00
Dan Webb
a0fffa5286 Add Alpine package provider (#3215)
- Add Alpine tests
- Stub apk grep command for alpine
- Resolve (disable for now) rubocop ABC/CyclomaticComplexity/PerceivedComplexity

Signed-off-by: Dan Webb <dan.webb@damacus.io>
2018-07-19 15:07:36 -04:00
James Stocks
ca833afacf Generate describe code for an array of strings (#3227)
Context:
When testing a Windows registry key with a period character in it e.g. `explorer.exe` it is not possible to use `its("explorer.exe")` because the period would be interpreted as method chaining.
In this case, you must instead use `its(["explorer", "exe"])`
See https://github.com/inspec/inspec/issues/1281

This commit fixes `to_ruby`in `Inspec::Describe` so that it produces an array in the generated Inspec code instead of a string.

Signed-off-by: James Stocks <jstocks@chef.io>
2018-07-19 15:00:21 -04:00
Chef Expeditor
9581176633 Bump version to 2.2.40 by Chef Expeditor 2018-07-19 12:17:08 +00:00
Miah Johnson
bfd569fe99 Ensure resources fail that target something that isn't supported (#3231)
* Use fail_resource rather than skip_resource when the platform is not
supported by the resource.

* Update tests to handle failing on unsupported platforms.
Update functional tests.

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2018-07-19 08:16:54 -04:00
Chef Expeditor
60177faa24 Bump version to 2.2.39 by Chef Expeditor 2018-07-18 20:55:41 +00:00
Chef Expeditor
d95ccadac7 Bump version to 2.2.38 by Chef Expeditor 2018-07-17 15:42:47 +00:00
Clinton Wolfe
02cb93ec23 Refactor 'inspec init profile' into a reusable component. (#3214)
* Refactor 'inspec init profile' into a reusable component.

base_cli.rb had several methods used internally, these are exposed so
lib/bundles/inspec-init/profile.rb can act as a library for anything
that needs to create new Inspec profiles programatically

* Move output methods to be public instance methods; and make Init::Profile into a working renderer.  Functional tests pass but could use some refactoring to be easier to use.
* Refactor, renaming vars to be clearer
* Move puts and exit calls into basecli
* Add comment about simplified ERB rendering in ruby 2.5.0+

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-07-17 11:42:36 -04:00
Chef Expeditor
fee139bafb Bump version to 2.2.37 by Chef Expeditor 2018-07-16 12:21:12 +00:00
Jerry Aldrich
706493f2f3 command resource: Allow redacting #to_s (#3207)
* command resource: Allow redacting `#to_s`
* Respond to feedback

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-07-16 08:20:57 -04:00
Chef Expeditor
409a71b28e Bump version to 2.2.36 by Chef Expeditor 2018-07-13 19:54:25 +00:00
Chef Expeditor
54a9b7a97e Bump version to 2.2.35 by Chef Expeditor 2018-07-09 17:57:56 +00:00
Stanislav Voroniy
a16877f427 A number of bug fixes and new features for oracledb_session resource (#3170)
Signed-off-by: Stanislav Voroniy <stas@voroniy.com>
2018-07-09 13:57:45 -04:00
Chef Expeditor
1eb31e1c31 Bump version to 2.2.34 by Chef Expeditor 2018-07-05 20:39:09 +00:00
Stanislav Voroniy
4112085ff7 fix for apache_conf to handle quoted Includes (#3193)
Signed-off-by: Stanislav Voroniy <stas@voroniy.com>
2018-07-05 16:38:58 -04:00
Chef Expeditor
eb40d23fb0 Bump version to 2.2.33 by Chef Expeditor 2018-07-05 19:44:41 +00:00
Clinton Wolfe
92e96ebedb Accept regexes for --controls option to inspec exec (#3179)
* Functional tests for regex control selection
* Implementation for regex-based control filtering

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-07-05 15:44:30 -04:00
Chef Expeditor
dc0c8b7cc0 Bump version to 2.2.32 by Chef Expeditor 2018-07-05 19:37:28 +00:00
Miah Johnson
a084187b21 When a profile is created with init, the last item after a / is the (#3175)
profile name. eg "with/slash" would result in a profile created in the
"with" directory named "slash"

Add test for inspec init, and updated other for new output.

Clean up profiles created during testing and place them in temporary
directories.

Describe our test a bit better.
Check that the profile was created in the right location.
Check that the profile is named correctly.

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2018-07-05 15:37:18 -04:00
Noel Georgi
6fe13ce1eb Updating inspec with bastion options (#3180)
* Updating inspec with bastion options as per https://github.com/inspec/train/pull/310
* Updating train pin
* Adding --password to pass the test
* Revert "Updating train pin"
* PR changes

Signed-off-by: Noel Georgi <18496730+frezbo@users.noreply.github.com>
2018-07-05 15:37:04 -04:00
Chef Expeditor
b94eec74fe Bump version to 2.2.31 by Chef Expeditor 2018-07-05 18:54:11 +00:00
Jerry Aldrich
b4c5475f26 cli: Add --insecure option for exec and shell (#3195)
* cli: Add `--insecure` option to `exec` and `shell`
* Move `--insecure` to target options

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-07-05 14:53:58 -04:00
Chef Expeditor
3fb1108c4d Bump version to 2.2.30 by Chef Expeditor 2018-07-05 18:20:25 +00:00
Chef Expeditor
30acc75ea5 Bump version to 2.2.29 by Chef Expeditor 2018-07-05 17:55:05 +00:00
Chef Expeditor
58bc7b78a5 Bump version to 2.2.28 by Chef Expeditor 2018-07-05 13:12:30 +00:00
Jared Quick
b31427673c
Update the node platform info to warn if we cannot find something. (#3186)
Signed-off-by: Jared Quick <jquick@chef.io>
2018-07-05 09:12:18 -04:00
Chef Expeditor
311b906227 Bump version to 2.2.27 by Chef Expeditor 2018-06-29 12:43:45 +00:00
Clinton Wolfe
2ac5581d32 Document exit codes for 'inspec exec' and add --no-distinct-exit option (#3178)
* Add long description to inspec exec command, mentioning exit codes
* Modify website doc builder code to use long description if available
* Functional test for --distinct-exit flag
* Implement --distinct-exit option
* Inspec shell also needs the option

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-06-29 08:43:34 -04:00
Chef Expeditor
f09d115296 Bump version to 2.2.26 by Chef Expeditor 2018-06-26 19:14:36 +00:00
Clinton Wolfe
8683c54510 Update core resources with filtertable API changes (#3117)
* Search and replace filtertable methods to use new names, and rely on automatic methods
* Remove spurious exists? matchers - see https://relishapp.com/rspec/rspec-expectations/docs/built-in-matchers/exist-matcher
* Revert removing exists? - we'll do it on a separate PR
* Gah, didn't save before resolving conflict
* Add back name column on aws cloudtrail trails

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-06-26 15:14:21 -04:00
Chef Expeditor
d59f432986 Bump version to 2.2.25 by Chef Expeditor 2018-06-26 17:04:45 +00:00
Jared Quick
52694d4031 Add parent_profile field in json output (#3164)
Signed-off-by: Jared Quick <jquick@chef.io>
2018-06-26 13:04:31 -04:00
Chef Expeditor
f9017b8467 Bump version to 2.2.24 by Chef Expeditor 2018-06-26 11:57:21 +00:00
Chef Expeditor
b85da4fb27 Bump version to 2.2.23 by Chef Expeditor 2018-06-26 11:54:00 +00:00
Chef Expeditor
639267adab Bump version to 2.2.22 by Chef Expeditor 2018-06-26 11:50:32 +00:00
Jerry Aldrich
737df411ef apache_conf resource: Strip quotes from values (#3142)
* apache_conf resource: Strip quotes from values
* Update regex to capture all vars between quotes
* Change `x` and `y` to proper variable names

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-06-26 07:48:48 -04:00
Clinton Wolfe
1d976921e3 Detect inspec-core mode and do not attempt to load cloud resources (#3163)
* Do not load AWS resources if SDK version mismatches
* Detect if we are running ins inspec-core mode, and do not attempt loading AWS or Azure if so.

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-06-26 07:47:33 -04:00
Chef Expeditor
e680896f19 Bump version to 2.2.21 by Chef Expeditor 2018-06-26 11:47:11 +00:00
Colin Hebert
7deed13425 Add support for shallow link paths (#3168)
* Add support for shallow link paths
* Improve documentation of the

Signed-off-by: Colin Hebert <hebert.colin@gmail.com>
2018-06-26 07:47:00 -04:00
Chef Expeditor
0a0a7b7fe9 Bump version to 2.2.20 by Chef Expeditor 2018-06-21 18:20:07 +00:00
Clinton Wolfe
44c0fd2e4f
Accept symbols and downcased criteria in aws_iam_policy have_statement matcher (#3129)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-06-21 14:19:56 -04:00
Chef Expeditor
03b6dd8324 Bump version to 2.2.19 by Chef Expeditor 2018-06-21 17:38:00 +00:00