* Add platform resource and platform supports.
Signed-off-by: Jared Quick <jquick@chef.io>
* Cache platform and inspec checks and implement inspec_version.
Signed-off-by: Jared Quick <jquick@chef.io>
* Deprecate current inspec support in favor of inspec_version.
Signed-off-by: Jared Quick <jquick@chef.io>
* Update resource/profile skip messages.
Signed-off-by: Jared Quick <jquick@chef.io>
* Update load_resource to use platform instead of os.
Signed-off-by: Jared Quick <jquick@chef.io>
* Update platform example.
Signed-off-by: Jared Quick <jquick@chef.io>
The new ruby:alpine image already has a /share directory, so our
attempt to create one is breaking the Docker builds. This change
updates the Dockerfile to try to make the /share directory but silently
fail if it's already there.
Signed-off-by: Adam Leff <adam@leff.co>
An update to the openssl cookbook modified the defaults for `state` and
`city` in the `openssl_x509` resource. That change modified the output
of `issuer_dn` and `subject_dn` in InSpec's `x509_certificate` resource.
This modifies the expected output of the integration tests to match
these new defaults.
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Update apache_conf test to check for ServerAlias values.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
* Add ServerAlias key and values to mock apache conf which includes
trailing whitespace.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
* Updated test to reflect all ServerAlias values being put into a single
array item. This is expected as we do not override the key_values
default setting of '1' when passing the raw configuration to
SimpleConfig.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
* Update the regular expression to include a conditional with positive
lookahead that checks if the line ends with one or more spaces. If the
lookahead succeeds we non-greedily capture, and when it fails we
greedily capture.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
* Add mode method to test the value of Bonding Mode
Signed-off-by: Eammon Hanlon <eammon.hanlon@microsoft.com>
* Add test for bonding mode in bond unit test
Signed-off-by: Eammon Hanlon <eammon.hanlon@microsoft.com>
* Add documentation on mode matcher for bond resource
Signed-off-by: Eammon Hanlon <eammon.hanlon@microsoft.com>
* Update example for 'Test parameters for bond0'
Signed-off-by: Eammon Hanlon <eammon.hanlon@microsoft.com>
* Add handling for OWCA login via `compliance login`
OpsWorks Chef Automate currently returns a 200 for the
`/compliance/version` endpoint and redirects to the Chef Manage page.
This adds support to `inspec compliance login` to accept this as valid
behavior and continue with the login.
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Add test case for 200 response but no Chef Manage
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Add debug info and split `determine_server_type`
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Appease RuboCop
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Remove forced returns from `determine_server_type`
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Add `false` code path for non-200/non-401 response
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Reword debug messages
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Fixes usage of 'output' to 'stdout'
* Adds examples for 'exit_status' and 'stderr'
* Modifies the matchers section to point to the command resource
Signed-off-by: Franklin Webber <franklin@chef.io>
Traditionally those would translated DEFAULT_ATTRIBUTE. but that was wrong, it should have been nil or false or whatever the user supplied.
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
* Add support for Darwin Directory Service groups
This allows users to verify groups added by Chef on OS X.
The current method that `UnixGroup` uses is to check the contents of
`/etc/group`, but OS X adds groups to Directory Service and not
`/etc/group`. This modifies the `group` resource on Darwin to use
`dscacheutil` to get group info.
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Clean up `select_group_manager`
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Clean up DarwinGroup `groups` method
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Enhance `package` resource error handling
This does the following:
- Modifies `info` to return an empty hash instead of `nil`
- Adds a failure case if package name is not specified
- Adds a skip case if no package manager can be found
- Changes `skip_resource` to use the `ResourceSkipped` exception
- Raises an error if JSON parsing fails for Windows/MacOS/Darwin
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Make RuboCop happy
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Change missing argument behavior
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Remove unnecessary boolean check
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Rewrite of Inspec Azure Resource pack to allow the testing of _any_ value Azure reosurce.
Closes#36Closes#37
This fixes#56 so that it works with the latest version of the SDK. In fact it will only work to version >= 0.15
Signed-off-by: Russell Seymour <russell.seymour@turtlesystems.co.uk>
Functional tests can sometimes be picky. Moving them to their own
matrix item so they're smaller and faster to re-run if needed.
Signed-off-by: Adam Leff <adam@leff.co>
* Move cache cli command to vendor-cache.
Signed-off-by: Jared Quick <jquick@chef.io>
* Rename DEPRECATION to DEPRECATED for cache flag.
Signed-off-by: Jared Quick <jquick@chef.io>
* Constructor unit tests
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Constructor tests pass, all others gutted
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Basic 'where' test in place, no criteria
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Wired up filter table to backend list users
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Unit testing for has_mfa_enabled and has_console_password
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Simple AWS client implementation for Users
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Rework resource parameters and validation; copy in code from #121
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Add constructor tests
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Add search/recall tests
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Recall unit tests pass
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Failing unit tests for username and has_console_password
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* has_console_password works in unit tests
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* has_mfa_enabled failing unit tests
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* has_mfa_enabled passes unit tests
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Failing unit tests for Access Keys
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* CLean up bad rebase commit
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Access keys property works, as an uncooked AWS response
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* De-linting
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Integration tests work
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Remove provider support libraries
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Integration tests pass for users resource
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* De-lint
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Remove aws connection load from user
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Adapt aws_iam_user to rely on AwsResourceMixin
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Neither of these cops is helping us write good code, and GuardClause
specifically is actually contributing to us writing sometimes-unclear
code. Disabling both of these cops and removing all unnecessary disable
decorators in the codebase.
Signed-off-by: Adam Leff <adam@leff.co>