Commit graph

2262 commits

Author SHA1 Message Date
Chef Expeditor
007e23af5b Bump version to 2.1.5 by Expeditor 2018-03-22 12:25:57 +00:00
eramoto
c7e87ca3e3 Unify method in which file content is read across all resources (#2359)
* Create file-check functionality into utility file

There are the similar issues as PR #2302. Almost resources return false
positives when a file does not exist or is not read.

* Replace to file-check functionality
* Fix dh_params and x509_certificate resources

If a file is empty, OpenSSL::PKey::DH and OpenSSL::X509::Certificate have
raised an exception and have skipped the inspection. Thus x509_certificate
and dh_params resources are not allowed to read a empty file.

* to_s of shadow expects filters is not nil
* Remove workaround of sshd_config

Removes the workaround of sshd_config since Travis CI fails due to a bug
of dev-sec/ssh-baseline and the PR #100 will fix it.

* Use init block variable in methods

Signed-off-by: ERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>
2018-03-22 08:25:45 -04:00
Chef Expeditor
8d8edea7f3 Bump version to 2.1.4 by Expeditor 2018-03-21 17:53:35 +00:00
Paul Welch
dc9ea8d1d2 Correct support platform for audit_policy (#2850)
Audity Policy resource is only used on the windows platform and
was incorrectly set to unix.

Fixes #2829

Co-authored-by: Trevor Bramble <tbramble@chef.io>
Co-authored-by: Paul Welch <pwelch@chef.io>

Signed-off-by: Paul Welch <pwelch@chef.io>
2018-03-21 13:53:24 -04:00
Chef Expeditor
8fa49b8428 Bump version to 2.1.3 by Expeditor 2018-03-21 17:47:19 +00:00
Jared Quick
4f6aa79cb8 Remove supports for generic resources. (#2848)
Signed-off-by: Jared Quick <jquick@chef.io>
2018-03-21 10:45:23 -07:00
Chef Expeditor
716078c786 Bump version to 2.1.2 by Expeditor 2018-03-21 17:44:42 +00:00
eramoto
a687479e6c Fix typo in some docs (#2841)
Also includes fixes such as PostgreSQL, TCPMUX, and etc.

Signed-off-by: ERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>
2018-03-20 08:43:30 -04:00
Chef Expeditor
58d2b01d3f Bump version to 2.1.1 by Expeditor 2018-03-19 17:10:30 +00:00
Matthew Dromazos
555de72912 Skelatal resource: aws_s3_bucket_object (#2620)
* Initial commit of new resource
* Makes changes to docs to match changes to the resources.
* Adds clarifications in docs and changes it to be an erb file.
* Simplifies some unit tests
* Wraps calls to the api in a aws_catch_errors method
* Removes provisioner terraform code

Signed-off-by: Matthew Dromazos <dromazmj@dukes.jmu.edu>
2018-03-19 13:10:17 -04:00
Chef Expeditor
74b8a5ea5a Bump version to 2.1.0 by Expeditor 2018-03-15 19:08:42 +00:00
Jared Quick
fafa681f5c
Set backend cache to defualt true. (#2827)
Signed-off-by: Jared Quick <jquick@chef.io>
2018-03-15 15:08:34 -04:00
Chef Expeditor
f988d52b8d Bump version to 2.0.49 by Expeditor 2018-03-14 13:36:00 +00:00
Chef Expeditor
3a64dffb7d Bump version to 2.0.48 by Expeditor 2018-03-12 13:02:51 +00:00
Jerry Aldrich
439fcb5993 Write version_constraints as an array for inspec.lock (#2619)
* Modify version constraints to be an Array

This will allow both old and new versions of InSpec to parse the
`inspec.lock` correctly.

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-03-12 09:02:37 -04:00
Chef Expeditor
c3064f0b0d Bump version to 2.0.47 by Expeditor 2018-03-09 13:41:35 +00:00
Tom Hodder
eeeeda18d8 quote password when generating mysql command string (#2685)
* quote password when generating mysql command string
* added a test for mysql_session, added shellwords escaping to mysql_session resource
* changed the name of the escape method
* clarified test conditions

Signed-off-by: Tom Hodder <tom@limepepper.co.uk>
2018-03-09 08:41:21 -05:00
Chef Expeditor
50772a67ef Bump version to 2.0.46 by Expeditor 2018-03-09 04:22:48 +00:00
Chef Expeditor
4d510f9c3c Bump version to 2.0.45 by Expeditor 2018-03-08 22:26:21 +00:00
Miah Johnson
75f39e74f2 Refine deprecated methods to be consisten with supported fields in (#2801)
shadow file.

After much thought the deprecations from #2642 were for the wrong methods.

Plural method names feel much more natural when working with this
resource because you can have more than a single result.

Consider a match like `shadow.user(/^www/)`, this could return multiple
users, so `shadow.users` feels more natural here.

The problem is that the fields we're matching in the shadow file itself
are singular. Each entry is for a user, which has a password, and some
other fields. A user never has `passwords` in the shadow file, only a
`password`.

This is made more obvious when you use the `filter` method.

When we use this filter: `shadow.filter(min_days: 20, max_days: 30)` we
are matching fields in the shadow file and not using our matcher
methods. This means that if there is a discrepancy between our matcher
methods, and the shadow fields the user could end up confused. Like I did =)

This PR changes:

Changed matchers to match shadow fields.
Updated documentation to reflect changes.
Updated tests to reflect changes.
Re-add `filter` method, and add a test for it.
Renamed variable for FilterTable to be less confusing.
Renamed query argument for methods to be consistent.
Cleanup docs based on comments from @jerryaldrichiii
Make Rubocop happy <3

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2018-03-08 17:26:08 -05:00
Chef Expeditor
e3a3b00859 Bump version to 2.0.44 by Expeditor 2018-03-08 21:02:04 +00:00
Miah Johnson
5fee525be8 Remove os checks from initialize as this is provided by platform (#2797)
Removes skip_resource and raise .. if InSpec.os stuff from initialize as this is covered by platform support.

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2018-03-08 16:01:50 -05:00
Chef Expeditor
c42d8c12ad Bump version to 2.0.43 by Expeditor 2018-03-08 20:46:11 +00:00
Jared Quick
a9127d3f6c
Create reporter directory if it does not exist. (#2798)
Signed-off-by: Jared Quick <jquick@chef.io>
2018-03-08 15:45:59 -05:00
Chef Expeditor
9a46d5a97b Bump version to 2.0.42 by Expeditor 2018-03-08 20:38:28 +00:00
Noel Georgi
4c54e3fdd9 Added the missing variable reference (#2794)
Signed-off-by: Noel Georgi <noel.georgi@reancloud.com>
2018-03-08 15:38:14 -05:00
Chef Expeditor
4d6e35b0b5 Bump version to 2.0.41 by Expeditor 2018-03-08 04:04:39 +00:00
Wei He
a3898db2fe Fix http with connection error (#2770)
* fix: http resource handle connection failed (ex. port is not open)
* add test case

Signed-off-by: Wing924 <weihe924stephen@gmail.com>
2018-03-07 23:04:26 -05:00
Chef Expeditor
18675ae326 Bump version to 2.0.40 by Expeditor 2018-03-07 15:09:33 +00:00
Christoph Hartmann
3d87d75c5a
return 1 as exit code for commands that are not available (#2792)
* return 1 as exit code for commands that are not available

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>

* update tests

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2018-03-07 16:09:22 +01:00
Chef Expeditor
9dca812689 Bump version to 2.0.39 by Expeditor 2018-03-07 14:31:45 +00:00
Miah Johnson
f6db0e345a Update shadow resource to use FilterTable (#2642)
* Change shadow resource to use FilterTable rather than custom filter
implementation.

Add tests for singluar aliased methods and other minor changes to work
with FilterTable output.
Coverage is at 100%

Signed-off-by: Miah Johnson <miah@chia-pet.org>

* merge master

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2018-03-07 15:31:30 +01:00
Chef Expeditor
acd20e8aea Bump version to 2.0.38 by Expeditor 2018-03-07 13:39:37 +00:00
João Vale
3e2450e703 Host resource: use bash over netcat in Linux (#2607)
* Add support to use bash in host resource

Netcat's presence is widely regarded as a security issue, and thus not
always available. This solution first tries to use bash builtins and
timeout (from coreutils), so is less likely to require installing
additional packages.

* Darwin UDP support in host resource
* Host: use netcat first if available

Signed-off-by: João Vale <jpvale@gmail.com>
2018-03-07 08:39:27 -05:00
Chef Expeditor
b8d165d13f Bump version to 2.0.37 by Expeditor 2018-03-06 13:56:27 +00:00
Jerry Aldrich
e4e907624a iptables resource: Add support for other bin paths (#2783)
* iptables resource: Add support for other bin paths
* Use `%w{}` instead of `[]`

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-03-06 08:56:15 -05:00
Chef Expeditor
fad22481b8 Bump version to 2.0.36 by Expeditor 2018-03-02 18:51:06 +00:00
Chef Expeditor
a6852a6f5a Bump version to 2.0.35 by Expeditor 2018-03-02 18:45:29 +00:00
Clinton Wolfe
d0e6d2eb72 AWS API Pagination fixes (#2762)
* Add pagination support to aws_iam_groups
* Add pagination support to aws_iam_policy
* Add pagination to aws_iam_policies
* Adds pagination to aws_iam_access_keys
* Adds pagination to aws_kms_keys

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-03-02 13:45:17 -05:00
Chef Expeditor
1e5c3d4d0d Bump version to 2.0.34 by Expeditor 2018-03-02 14:14:17 +00:00
Richard Nixon
47e4c578e0 Fix aws-iam-users pagination (#2761)
* Fix aws-iam-users pagination

PROBLEM: aws-iam-users resource only retrieves 100 records due to pagination
in the AWS IAM list_users function.

FIX: Iterate over all the pages using the AWS pagination variables `marker`
and `is_truncated`

Signed-off-by: Richard Nixon <richard.nixon@btinternet.com>
2018-03-02 09:14:05 -05:00
Chef Expeditor
3e5a8c110a Bump version to 2.0.33 by Expeditor 2018-03-02 14:03:11 +00:00
Jerry Aldrich
3da8fd1e98 command resource: Add exist? for Alpine Linux (#2768)
This allows `command('foo').exist?` to work on Alpine Linux.

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-03-02 09:02:58 -05:00
Chef Expeditor
f7e8266e6a Bump version to 2.0.32 by Expeditor 2018-03-01 19:30:20 +00:00
Noel Georgi
dd033fbf1b mssql_session - Handling cases where the data is nil (#2752)
* Fixing bug where the row data returned is nil

Signed-off-by: Noel Georgi <noel.georgi@reancloud.com>
2018-03-01 14:30:07 -05:00
Chef Expeditor
087a9e5776 Bump version to 2.0.31 by Expeditor 2018-03-01 14:20:30 +00:00
Chef Expeditor
e38d4b762b Bump version to 2.0.30 by Expeditor 2018-02-28 19:23:09 +00:00
Jerry Aldrich
4631306ef1 virtualization_resource: Fix NoMethodError on nil:NilClass (#2603)
* Move instance variable to avoid `NoMethodError`

Methods for `role` and `system` properties are dynamically generated and
return values from the `@virtualization_data` Mash. Therefor, we must
ensure `@virtualization_data` exists before calling these methods.

* Move supports logic to `supports platform: linux`

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-02-28 14:22:55 -05:00
Chef Expeditor
48958a8924 Bump version to 2.0.29 by Expeditor 2018-02-28 18:47:22 +00:00
Chef Expeditor
af38fa7c56 Bump version to 2.0.28 by Expeditor 2018-02-27 18:15:21 +00:00