Commit graph

2038 commits

Author SHA1 Message Date
Adam Leff
4b9acb4800 Bump Rubocop to 0.49.1 (#2323)
* Bump Rubocop to 0.49.1

This change bumps Rubocop to 0.49.1. There have been a lot of changes
since 0.39.0 and this PR is hopefully a nice compromise of turning off
certain cops and updating our codebase to take advantage of new Ruby
2.3 methods and operators.

Signed-off-by: Adam Leff <adam@leff.co>

* Set end-of-line format to line-feed only, avoid Windows-related CRLF issues

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-21 08:49:41 +01:00
Chef Expeditor
b9b502a48d Bump version to 1.45.11 by Expeditor 2017-11-20 18:11:52 +00:00
Chef Expeditor
03099d51dc Bump version to 1.45.10 by Expeditor 2017-11-17 20:56:44 +00:00
Chef Expeditor
77fe944f23 Bump version to 1.45.9 by Expeditor 2017-11-16 17:17:17 +00:00
Seth Chisamore
396752ba26 Add basic param handling to remote HTTP worker (#2286)
http resource: Add basic param handling to remote HTTP worker
2017-11-16 12:16:23 -05:00
Adam Leff
6ccc8aad26
Update expeditor version-update script (#2312)
PR #2311 updated the Rubocop engine to use Ruby 2.3 to evaluate, and
the default behavior is to no longer require `.freeze` to be added
to string literals that are treated like constants. This caused the
pattern match used in the Expeditor version update script to no longer
work.

Also manually fixing the `lib/inspec/version.rb` file to be correct.

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-16 11:59:00 -05:00
Adam Leff
dde4a116d6
Update Rubocop to TargetRubyVersion 2.3 (#2311)
Bumps the Rubocop engine to use 2.3 and addresses the big changes
between 2.0 and 2.3.

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-16 11:26:19 -05:00
Chef Expeditor
832c66087a Bump version to 1.45.7 by Expeditor 2017-11-16 15:02:47 +00:00
Chef Expeditor
e4ef2dbf11 Bump version to 1.45.6 by Expeditor 2017-11-15 20:56:50 +00:00
eramoto
986c8818d3 xinetd_conf resource: fix false positives with config file or directory doesn't exist (#2302)
xinetd_conf resource: fix false positives when config file or directory doesn't exist
2017-11-15 15:56:39 -05:00
Chef Expeditor
e403dd6e9f Bump version to 1.45.5 by Expeditor 2017-11-15 20:49:24 +00:00
malovdm1
923e4abf21 sqlplus credentials could contain special symbols and need to be escaped (#2308)
Signed-off-by: Dmytro Malovany <dmytro.malovannyy@gmail.com>
2017-11-15 21:49:09 +01:00
Chef Expeditor
c5130621f3 Bump version to 1.45.4 by Expeditor 2017-11-14 04:05:43 +00:00
Adam Leff
c91553c6f8 Allow resource skip exceptions outside initialize methods (#2307)
PR #2235 allowed for resources to raise skip and fail exceptions and
the RSpec formatters would do the right thing. These work inside
initialize methods but not in any other method in the resource.

This change modifies the formatter to honor the ResourceSkipped
exception properly. The ResourceFailed exception needs no additional
handling as RSpec properly handles any exception thrown.

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-14 05:05:31 +01:00
Chef Expeditor
377797023e Bump version to 1.45.3 by Expeditor 2017-11-14 04:04:02 +00:00
eramoto
f9ee7596f5 Fix gid filtering for etc_group resource (#2297)
'etc_group' resource stores 'gid' as integer but the 'where' method
compares 'gid' as string.
By this fix, the 'where' method always converts the stored data to string
when comparing. And it can also look for groups without members.

Signed-off-by: ERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>
2017-11-14 05:03:50 +01:00
Chef Expeditor
99f1631d9e Bump version to 1.45.2 by Expeditor 2017-11-14 04:02:03 +00:00
Chef Expeditor
4f1e9eced6 Bump version to 1.45.1 by Expeditor 2017-11-14 03:41:49 +00:00
Adam Leff
6875e80bd8
Fix classname in JUnit formatter (#2283)
* Fix classname in JUnit formatter

The JUnit formatter currently incorrectly uses `class` instead of
`classname` as an attribute.

Signed-off-by: Adam Leff <adam@leff.co>

* Prefixing classname with profile name, fix functional tests

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-13 22:41:37 -05:00
Chef Expeditor
4840eb087e Bump version to 1.45.0 by Expeditor 2017-11-13 21:02:41 +00:00
Chef Expeditor
d8aea65849 Bump version to 1.44.9 by Expeditor 2017-11-13 17:06:14 +00:00
Wei He
f20748c88f fix port resource (parse_ss_line) (#2305)
Signed-off-by: Wing924 <weihe924stephen@gmail.com>
2017-11-13 18:06:01 +01:00
Chef Expeditor
7e6c4128c5 Bump version to 1.44.8 by Expeditor 2017-11-09 11:33:08 +00:00
Clinton Wolfe
656423d7f2 Issue warning during check if profile name contains slash (#2231)
* Add failing unit test for deprecation warning on profiles with slashes in their name

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Issue warning during validation if name contains a slash

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Slug profile names generated from target paths to prevent breaking unit tests

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Rubocop whinges

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Update functional test watching for default profile name

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Make deprecation warning more descriptive

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Rubocop whinges

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Set title with original test path if no profile name or title provided

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Rubocop whinges

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2017-11-09 12:32:54 +01:00
Chef Expeditor
2c75f048e4 Bump version to 1.44.7 by Expeditor 2017-11-09 11:29:53 +00:00
Adam Leff
86079ca3c7 Properly compare profile version strings as SemVer (#2280)
When configuring a profile dependency, if the dependent profile had a
hyphen in it, it would not properly match the default version constraint
of `>= 0`. This is because a hyphen indicates the version is a pre-release
version and proper version matching would require the constraint to also
be listed with a pre-release version string.

The proper solution is to use the `+` character instead which indicates
a build number, which is what the hyphen was meant to convey. In the
meantime, this change properly compares version strings as SemVer and
also adds tests.

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-09 12:29:41 +01:00
Chef Expeditor
8d555bd160 Bump version to 1.44.6 by Expeditor 2017-11-09 11:25:20 +00:00
Chef Expeditor
6a01aa0038 Bump version to 1.44.5 by Expeditor 2017-11-09 10:11:29 +00:00
Brett Delle Grazie
0bb318c2dc http resource: supply max-time option using read_timeout and open_timeout (#2289)
Curl doesn't distinguish between them so need to use the sum of both as
the overall timeout.

fixes #2288

Signed-off-by: Brett Delle Grazie <brett.dellegrazie@gmail.com>
2017-11-09 11:11:19 +01:00
Chef Expeditor
3b143633aa Bump version to 1.44.4 by Expeditor 2017-11-09 10:10:07 +00:00
Chef Expeditor
13a93ebd32 Bump version to 1.44.3 by Expeditor 2017-11-08 17:43:28 +00:00
Adam Leff
0a11280444
nginx resource: support quoted identifiers (#2292)
An nginx config may contain configuration settings that are quoted, such
as a map entry:

"~^\/opcache-api" 1;

The `nginx_conf` resource was failing to properly parse these.

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-08 12:42:37 -05:00
Chef Expeditor
690b1df805 Bump version to 1.44.2 by Expeditor 2017-11-08 10:41:11 +00:00
Adam Leff
9e9025c138 Switch to tomlrb for TOML parsing (#2295)
The `toml` gem has a very strict version dependency on an old version
of parslet. This change switches us to use `tomlrb` instead which has
no direct dependencies. This will allow us to bump up to a later version
of parslet that has better error handling and insight into parser errors.

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-08 11:41:00 +01:00
Chef Expeditor
9440ce6321 Bump version to 1.44.1 by Expeditor 2017-11-07 19:02:06 +00:00
Dominik Richter
eb729c4034 allow users to specify user/namespace when fetching profiles from Chef Automate (#2275)
* allow users to configure the profiles namespace

By default it uses the username of the user that is logged into the system. However, the user can now specify the `--user` on the cli to list profiles from a user other than his own domain.

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>

* allow users to provide owner for profile listing and uploading

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

* use config only

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-11-07 14:01:55 -05:00
Chef Expeditor
c2ec4b9545 Bump version to 1.44.0 by Expeditor 2017-11-06 18:29:02 +00:00
Jerry Aldrich III
43b71ff132 Add non-halting exception support to resources (#2235)
* Add non-halting exception support to resources

This adds two `Inspec::Exceptions` that can be used within resources to
either skip or fail a test without halting execution.

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2017-11-06 13:28:53 -05:00
Chef Expeditor
0961e07d73 Bump version to 1.43.10 by Expeditor 2017-11-03 20:24:06 +00:00
Chef Expeditor
356939443c Bump version to 1.43.9 by Expeditor 2017-11-03 18:29:08 +00:00
Seth Chisamore
af8443d1ea Use proper syntax in curl header option (#2285)
`curl` expects a valid header per RFC 2616 when using the
`-H`/`--header` option. RFC 2616 declares header field/values
should be separated using a colon (`:`):
https://tools.ietf.org/html/rfc2616#section-4.2

Signed-off-by: Seth Chisamore <schisamo@chef.io>
2017-11-03 14:28:54 -04:00
Chef Expeditor
d3d44bf285 Bump version to 1.43.8 by Expeditor 2017-11-02 14:04:06 +00:00
Wei He
71ed5ef964 service resource: properly search for SysV Init S files (#2274)
* bug fix: Service resource

Signed-off-by: Wing924 <weihe924stephen@gmail.com>

* fix test case

Signed-off-by: Wing924 <weihe924stephen@gmail.com>
2017-11-02 15:03:51 +01:00
Chef Expeditor
e44de521b6 Bump version to 1.43.7 by Expeditor 2017-11-01 11:01:33 +00:00
Markus Grobelin
221db7e132 mount resource: fix for Device-/Sharenames and Mountpoints including … (#2257)
* mount resource: fix for Device-/Sharenames and Mountpoints including whitespaces

Device-/Sharenames and Mountpoints on Linux may include whitespaces (\040), e.g. /etc/fstab entry like:

```//fileserver.corp.internal/Research\040&\040Development /mnt/Research\040&\040Development cifs OTHER_OPTS```

... results in a mount line like:

```//fileserver.corp.internal/Research & Development on /mnt/Research & Development type cifs (OTHER_OPTS)```

The Linux mount command replaces \040 with whitspace automatically, so this should be tributed.

I used a control like this:

```
    describe mount('/mnt/Research & Development') do
      it { should be_mounted }
      its('device') { should eq  '//fileserver.corp.internal/Research & Development' }
    end
```

Before:

```
  ×  whitespaces-1: Mount with whitespace within sharename and mountpoint. (1 failed)
     ✔  Mount /mnt/Research & Development should be mounted
     ×  Mount /mnt/Research & Development device should eq "//fileserver.corp.internal/Research & Development"

     expected: "//fileserver.corp.internal/Research & Development"
          got: "//fileserver.corp.internal/Research"

     (compared using ==)
```

After:

```
  ✔  whitespaces-01: Mount with whitespace within sharename and mountpoint.
     ✔  Mount /mnt/Research & Development should be mounted
     ✔  Mount /mnt/Research & Development device should eq "//fileserver.corp.internal/Research & Development"
```

Signed-off-by: Markus Grobelin <grobi@koppzu.de>

* mounts_with_whitespaces: make lint happy

Signed-off-by: Markus Grobelin <grobi@koppzu.de>

* mount resource: added parentheses as suggested by https://github.com/chef/inspec/pull/2257/files

Signed-off-by: Markus Grobelin <grobi@koppzu.de>

* mount resource: fix for Device-/Sharenames and Mountpoints including whitespaces
Signed-off-by: Markus Grobelin <grobi@koppzu.de>
2017-11-01 12:01:21 +01:00
Chef Expeditor
5d8384f767 Bump version to 1.43.6 by Expeditor 2017-10-27 08:33:04 +00:00
Jerry Aldrich III
94a79b2fc7 Force https scheme for inspec compliance login (#2268)
This allows a user to specify an Automate server without prepending
`https://`. Without this, anything using the `url` fetcher will fail
because `open` doesn't interpret the argument as a URL.

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2017-10-27 10:32:52 +02:00
Chef Expeditor
e2f0b0c751 Bump version to 1.43.5 by Expeditor 2017-10-26 15:32:56 +00:00
Jerry Aldrich III
91403d8c81 Add Chef Automate support to inspec compliance login (#2203)
* Merge `login` and `login_automate` commands

This provides a single interface for logging into either Chef Automate
or Chef Compliance servers. Server type is evaluated at run time via
HTTP responses from designated endpoints.

This also moves the login logic from `Compliance::ComplianceCLI` to a
separate set of modules in `Compliance::API`. This removes logic from
Thor and allows for more in depth Unit testing.

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Remove empty line below class definition

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Add message to `raise CannotDetermineServerType`

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Refactor `token_info` assignment

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Remove unnecessary rubocop disable

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Modify `Login` module namespacing

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Remove mentions of login_automate and --usertoken

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Modify `determine_server_type` to return a symbol

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Add support for `login_automate` and `--usertoken`

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Fix encoding typo

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Address PR feedback

This does the following:
  - Moves `CannotDetermineServerType` error to `.login`
  - Changes methods that store configuration to return the configuration
  - Moves user output to one location in `.login`
  - Makes other small improvements

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2017-10-26 17:32:47 +02:00
Chef Expeditor
274b1a53e5 Bump version to 1.43.4 by Expeditor 2017-10-25 14:14:42 +00:00
Markus Grobelin
2251270929 cran resource: check for R module installation (#2255)
* Added CRAN resource to check R modules

control 'cran-1' do
  impact 1.0
  desc '
    Ensure R module DBI is installed.
  '

  describe cpan('DBI') do
    it { should be_installed }
    its('version') { should cmp >= '3.0' }
  end
end

Signed-off-by: Markus Grobelin <grobi@koppzu.de>

* cran resource: made lint happy, added negative unit test, removed unused arg perl_lib_path

Signed-off-by: Markus Grobelin <grobi@koppzu.de>
2017-10-25 16:14:29 +02:00
Chef Expeditor
90ca9528aa Bump version to 1.43.3 by Expeditor 2017-10-25 14:01:36 +00:00
Markus Grobelin
c626dfdbd9 cpan resource: check for Perl module installation (#2254)
* Added CPAN resource to check Perl modules

control 'cpan-1' do
  impact 1.0
  desc '
    Ensure Perl modules DBI and DBD::Pg are installed.
  '

  describe cpan('DBI') do
    it { should be_installed }
  end

  describe cpan('DBD::Pg') do
    it { should be_installed }
    its('version') { should cmp >= '3.0' }
  end
end

Signed-off-by: Markus Grobelin <grobi@koppzu.de>

* cpan resource: fixed unit test for non-installed module

Signed-off-by: Markus Grobelin <grobi@koppzu.de>
2017-10-25 16:01:26 +02:00
Chef Expeditor
69a629c726 Bump version to 1.43.2 by Expeditor 2017-10-24 21:50:32 +00:00
Dominik Richter
39d743b12e Include ref when writing out inspec control objects (#2259)
* support ref for inspec control objects

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>

* lint

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-10-24 17:50:23 -04:00
Chef Expeditor
b2597cecfa Bump version to 1.43.1 by Expeditor 2017-10-24 20:23:08 +00:00
Jerry Aldrich III
a4cd589b93 Fix regression regarding profile upload (#2264)
Fix regression when uploading compliance profiles
2017-10-24 16:22:57 -04:00
Chef Expeditor
f43178dde8 Bump version to 1.43.0 by Expeditor 2017-10-20 21:28:57 +00:00
Adam Leff
8dc48533aa new resource: elasticsearch resource, test cluster/node state (#2261)
* new resource: elasticsearch resource, test cluster/node state

This is a new resource for testing an Elasticsearch cluster. It operates
by fetching the `_nodes` endpoint from a given Elasticsearch node and
collects data about each node in a cluster, even if there's only a
single node.

This work is based on inspiration from an initial PR #1956 submitted by
@rx294.

Signed-off-by: Rony Xavier <rx294@nyu.edu>
Signed-off-by: Aaron Lippold <lippold@gmail.com>
Signed-off-by: Adam Leff <adam@leff.co>

* Reduce mock data on non-default tests

Signed-off-by: Adam Leff <adam@leff.co>
2017-10-20 17:28:48 -04:00
Chef Expeditor
69dd8d16ec Bump version to 1.42.3 by Chef Expeditor 2017-10-18 11:24:18 +00:00
Matt Ray
c21ce063ab Replace WMI query with PowerShell cmdlet "get-hotfix" (#2252)
Signed-off-by: Matt Ray <matthewhray@gmail.com>
2017-10-18 12:24:11 +01:00
Chef Expeditor
63b8fb3b8f Bump version to 1.42.2 by Chef Expeditor 2017-10-17 15:30:46 +00:00
Sebastian Gumprich
9f9715b90b Update postgres.rb (#2248)
Signed-off-by: Sebastian Gumprich <github@gumpri.ch>
2017-10-17 16:30:35 +01:00
Chef Expeditor
0652112129 Bump version to 1.42.1 by Chef Expeditor 2017-10-17 13:02:00 +00:00
David Alexander
6ed4068fd1 Extend Windows ACL matchers (#1744)
* Adds alias for 'ListDirectory' permission

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Works with Ruby array of permissions as long as possible

Converts to PowerShell array just before use.

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Abstracts user-provided permissions to router method

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Adds FullControl as a specifiable permission

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Adds specific permission 'modify'

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Fixes #1743

Limits Windows' broad "read" permission to if it can read all of the
above, instead of just the first:

- File contents
- File attributes
- File extended attributes
- File permissions

This better aligns with how Windows names the permissions.

  'read' -> Read instead of 'read' -> ReadData

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* 'Execute' Windows ACL has alias of 'Traverse'

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Adds 'Delete' permission

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Adds `should allow('perm').by_user('me')` matcher

Provides hooks for later use with Windows ACL matching

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Adds remaining Windows ACL hooks

Skips ReadAndExecute on intentionally since it just aliases the combo of
2 permissions into one new one.

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* [Rubocop] Reduces ABC / Cyclomatic complexity

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Reduces global scope with `allows()` -> `be_allowed()`

RSpec inferred matchers work nicely here. This changes the `by_user()`
and `by()` chained matchers to just be an options hash on the underlying
`allowed?()` method.

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Fixes integration tests with rename `allows()` -> `be_allowed()`

Signed-off-by: David Alexander <opensource@thelonelyghost.com>
2017-10-17 15:01:51 +02:00
Chef Expeditor
e5ce31fcc7 Bump version to 1.42.0 by Chef Expeditor 2017-10-17 12:53:49 +00:00
Adam Leff
3c3cb741ff Add inspec habitat profile setup command (#2239)
Introduces a new `inspec habitat profile setup` command
which will set up an existing profile repository with all
the files necessary to build a Habitat package. This will
prime a repository to be used by the Habitat Builder service.

Signed-off-by: Adam Leff <adam@leff.co>
2017-10-17 14:53:41 +02:00
Chef Expeditor
56becc1231 Bump version to 1.41.10 by Chef Expeditor 2017-10-17 12:52:46 +00:00
username-is-already-taken2
dbd50c327e revised the esc chars within mark def (#2234)
Signed-off-by: username-is-already-taken2 <digitalgaz@hotmail.com>
2017-10-17 14:52:12 +02:00
Chef Expeditor
af65cf1281 Bump version to 1.41.9 by Chef Expeditor 2017-10-17 12:50:07 +00:00
Chef Expeditor
ed0d087e15 Bump version to 1.41.8 by Chef Expeditor 2017-10-17 12:47:40 +00:00
Jerry Aldrich III
62dc14a09c Fix only_if behavior when used outside controls (#2216)
* Fix `only_if` behavior when used outside controls

This renames `@skip_profile` to `@skip_file` and modifies the scope of
`only_if` (used outside of a control) to only apply to the control file
that contains it instead of the entire profile.

This does this by exposing `@skip_file` from the control context so that
it can be set back to `false` between loading control files in the
profile context.

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Modify `get_checks` to accept a rule index

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Modify `only_if` to work regardless of location

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Disable Cyclomatic/Perceived Complexity in Rubocop

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Add comment for `skip_file` in `load_control_file`

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2017-10-17 14:47:30 +02:00
Chef Expeditor
2f8cfd7a04 Bump version to 1.41.7 by Chef Expeditor 2017-10-17 12:45:46 +00:00
narkaTee
4f005d8510 Fix port ressource ss line parsing (#2243)
Fixes the 'ss -tulpen' command parsing when multiple processes use the
same fd.

Signed-off-by: Jan Ullrich <narkat@gmail.com>
2017-10-17 14:45:37 +02:00
Chef Expeditor
824e58dfbc Bump version to 1.41.6 by Chef Expeditor 2017-10-16 16:19:43 +00:00
Anton Markelov
09a2f677d5 add missed 'html' to 'format' option explanation (#2244)
Signed-off-by: Anton Markelov <doublic@gmail.com>
2017-10-16 17:19:36 +01:00
Chef Expeditor
78c2a55945 Bump version to 1.41.5 by Chef Expeditor 2017-10-12 10:30:40 +00:00
J Burns
58eae32688 etc_fstab resource: properly namespace the resource, add nfs_file_systems documentation (#2190)
* Updated nfs_file_systems example in docs

Signed-off-by: Jennifer Burns <jburns@mitre.org>
2017-10-12 11:30:33 +01:00
Chef Expeditor
ed25975c2c Bump version to 1.41.4 by Chef Expeditor 2017-10-12 06:45:45 +00:00
Chef Expeditor
97b03b0bcf Bump version to 1.41.3 by Chef Expeditor 2017-10-11 13:31:54 +00:00
Nathen Harvey
05ac2724ec Update the profile tempate (#2238)
* Remove a broken link.

Signed-off-by: Nathen Harvey <nharvey@chef.io>

* It is now 2017

While the content in this file was actually written in 2015, this
example is meant to be overwritten and is generated by the user in the
current year.

Signed-off-by: Nathen Harvey <nharvey@chef.io>
2017-10-11 14:31:44 +01:00
Chef Expeditor
ca19ef5570 Bump version to 1.41.2 by Chef Expeditor 2017-10-10 09:37:06 +00:00
Adam Leff
5114173e50 Support PAX-formatted tar files, standardize file lists (#2225)
* Support PAX-formatted tar files, standardize file lists

When a tar file is generated in PAX format, the files have an additional
relative path prefix added to them. For example, instead of:

inspec.yml

... the file is listed as:

./inspec.yml

And the source reader plugin looks only for a "inspec.yml" file to
determine the profile format.

This change addresses this issue by normalizing the file paths in the
TarReader and accounting for the additional "./" prefix that may exist
whenever the tar file is walked looking for a file to read its content.

Signed-off-by: Adam Leff <adam@leff.co>

* Remove pax from unit test, will move to functional

Signed-off-by: Adam Leff <adam@leff.co>

* Add function test for the pax header tar file

Signed-off-by: Adam Leff <adam@leff.co>
2017-10-10 10:36:57 +01:00
Chef Expeditor
4cf7c89460 Bump version to 1.41.1 by Chef Expeditor 2017-10-10 08:54:23 +00:00
Keith Walters
2a8d6e0e91 Uses netstat to detect open ports on AIX (#2210)
* Uses netstat to detect open ports on AIX

Signed-off-by: Keith Walters <keith.walters@cattywamp.us>

* Adds unit tests for AIX port resource

Signed-off-by: Keith Walters <keith.walters@cattywamp.us>
2017-10-10 10:54:18 +02:00
Chef Expeditor
ae486e50d2 Bump version to 1.41.0 by Chef Expeditor 2017-10-09 10:56:24 +00:00
Chef Expeditor
952dd09a29 Bump version to 1.40.13 by Chef Expeditor 2017-10-07 10:28:14 +00:00
Adam Leff
cbf58c7afa Enhance cmp matcher to work with symbols, fix file documentation (#2224)
* Enhance cmp matcher to work with symbols

The `cmp` matcher will now stringify symbol actual values if the
expected value was passed in as a string. This will help with the file
resource `type` method where Train returns the file type as a symbol.

Signed-off-by: Adam Leff <adam@leff.co>

* Fix documentation for file type character_device

Signed-off-by: Adam Leff <adam@leff.co>

* Fix docs for block_device

Signed-off-by: Adam Leff <adam@leff.co>

* Fix file mtime docs

Signed-off-by: Adam Leff <adam@leff.co>
2017-10-07 12:28:07 +02:00
Chef Expeditor
c716790972 Bump version to 1.40.12 by Chef Expeditor 2017-10-06 17:38:29 +00:00
Jared Quick
f9e0aaadba ssl resource: properly raise error when unable to determine if port is enabled (#2205)
* Move raise condition for host into enabled method

This is related to #1205. This will fix the ssl resource for now until
we redo the exceptions. Still looking around the code and need to build
some unit tests for the ssl resource.

My fix here is to move the raise condition till later in the flow,
specifically the enabled? method. This lets the raise get caught
accordingly without killing the other tests.

Signed-off-by: Jared Quick <jquick@chef.io>

* Remove authors from ssl resource test

Signed-off-by: Jared Quick <jquick@chef.io>
2017-10-06 19:38:22 +02:00
Chef Expeditor
fe506037c6 Bump version to 1.40.11 by Chef Expeditor 2017-10-06 17:36:25 +00:00
Adam Leff
a54bc98087 Fix loading profile files when executing multiple profiles (#2223)
When running `inspec exec` with multiple profiles, such as:

inspec exec profile1 profile2

... profile1 control calls to `inspec.profile.file` will incorrectly
try to pull files from profile2 because the RuntimeProfile object
is stored on the backend object, and we share the backend object.

This change ensures each profile has a unique backend object to ensure
the RuntimeProfile instance is not overwritten.

Signed-off-by: Adam Leff <adam@leff.co>
2017-10-06 19:36:13 +02:00
Chef Expeditor
b740c27163 Bump version to 1.40.10 by Chef Expeditor 2017-10-06 17:32:49 +00:00
Adam Leff
939ee5ecfc processes resource: support busybox ps (#2222)
This change enhances the processes resource to support the busybox
ps command which is common on Alpine, for example. The way we
map ps fields to the structs needed by FilterTable have also been
refactored to be more flexible so we can support multiple formats
in the future.

Also, the processes resource now allows the grep argument to be optional
thus allowing a user to query all resources without passing in a
match-all regex.

Signed-off-by: Adam Leff <adam@leff.co>
2017-10-06 19:32:39 +02:00
Chef Expeditor
999d115fb8 Bump version to 1.40.9 by Chef Expeditor 2017-10-06 17:32:26 +00:00
Jared Quick
3d346e779d Update shell resource help to return what is defined (#2219)
This fixes #1664. I refactored the help of the resource to build the
output depending on what is available.

Signed-off-by: Jared Quick <jquick@chef.io>
2017-10-06 19:32:16 +02:00
Chef Expeditor
70ae199949 Bump version to 1.40.8 by Chef Expeditor 2017-10-06 17:24:37 +00:00
Adam Leff
9d8c53cf31 Support symbol keys in ObjectTraverser (#2221)
As detected in #2036, it is not possible to extract values from
a YAML file if the key is a symbol. This change refactors ObjectTraverser
to support symbol keys before attempting to stringify them.

Signed-off-by: Adam Leff <adam@leff.co>
2017-10-06 19:24:31 +02:00
Chef Expeditor
b9fc73c42a Bump version to 1.40.7 by Chef Expeditor 2017-10-06 13:41:55 +00:00
Jared Quick
7bb7767dae Add nil check for sshd config file (#2217)
* Add nil check for sshd config file

This fixes #1778. There was a issue where if the user did not have read
permissions on /etc/ssh/sshd_config it would error out on the empty?
check. The fix here is to also look for nil on the file content. Along
with this I refactored the inspec file empty? check as it does not exist
and was also erroring during my testing.

Signed-off-by: Jared Quick <jquick@chef.io>

* Add emptyfile test object and refactor tests

Signed-off-by: Jared Quick <jquick@chef.io>
2017-10-06 15:41:48 +02:00