Commit graph

3379 commits

Author SHA1 Message Date
Dominik Richter
8c48e81b10 bugfix: warn users about insecure login requirements
Fixes https://github.com/chef/inspec/issues/1469

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-02-08 08:47:31 +01:00
Dominik Richter
0c66bc1b96 Merge pull request #1470 from chef/adamleff/add-dash-v
Add support for "inspec -v" showing the version
2017-02-07 21:42:20 +01:00
Adam Leff
c28d3bccbe Add support for "inspec -v" showing the version
The other Chef tooling (chef-client, chef, kitchen, berks, etc.)
support a `-v` flag to display the version. Currently, inspec
errors out with the following error:

```
Could not find command "_v".
```

This adds a Thor map so that `-v` executes the `version` command.

Signed-off-by: Adam Leff <adam@leff.co>
2017-02-07 15:28:39 -05:00
victoria jeffrey
b58a0c6902 Merge pull request #1468 from chef/adamleff/fix-slack
Replace slack invite form on Community, fix surprise code example
2017-02-07 12:42:21 -07:00
Adam Leff
78a5241eae Replace slack invite form on Community, fix surprise code example
The existing slack form on the community page doesn't function...
it's trying to post to the community-slack.chef.io site, but the actual
invite form doesn't actually live there but rather in a SlackIn app.
Also, we have some info we'd like new Slack users to receive, such as
etiquette tips and code-of-conduct information.

This change replaces the form with a link to the community-slack.chef.io
site. Also, I fixed a missing space in the surprise code example on
the main page.

Signed-off-by: Adam Leff <adam@leff.co>
2017-02-07 13:26:10 -05:00
Dominik Richter
64ee82195d 1.13.0 2017-02-07 15:01:47 +01:00
Dominik Richter
e41ec1f2a1 Merge pull request #1458 from chef/jtimberman/packages-resource
add "packages" resource
2017-02-07 13:59:08 +01:00
jtimberman
d7fad68541 add "packages" resource
This pull request adds a packages resource so that we can check for pattern matches against all the packages on a system. This initially implements only dpkg support for debian-based platforms so we can cover this use case:

```ruby
describe packages(/^xserver-xorg.*/) do
  its("list") { should be_empty }
end
```

This uses FilterTable so we can supply additional queries, too.

```ruby
describe packages(/vi.+/).where { status != 'installed' } do
  its('statuses') { should be_empty }
end
```

Users can specify the name as a string or a regular expression. If it is a string, we will escape it and convert it to a regular expression to use in matching against the full returned list of packages. If it is a regular expression, we take that as is and use it to filter the results.

While some package management systems such as `dpkg` can take a shell glob argument to filter their results, we eschew this and require a regular expression to match multiple package names because we will need this to work across other platforms in the future. This means that the following:

```ruby
packages("vim")
```

Will return *all* the "vim" packages on the system. The `packages` resource will take `"vim"`, turn it into `/vim/`, and greedily match anything with "vim" in the name. To match only a single package named `vim`, it needs to be an anchored regular expression.

```ruby
packages(/^vim$/)
```

Signed-off-by: Joshua Timberman <joshua@chef.io>

Use entries instead of list

Added a few more tests and non installed package in output
Signed-off-by: Alex Pop <apop@chef.io>

fix lint

Signed-off-by: Alex Pop <apop@chef.io>

Signed-off-by: Joshua Timberman <joshua@chef.io>
2017-02-07 10:29:11 +00:00
Dominik Richter
f8d319c1ac Merge pull request #1457 from chef/ap/its-it-thats-it
Provide a way to force it vs its for any argument
2017-02-03 20:48:36 +01:00
Alex Pop
52842de552 Provide a way to force it vs its for any argument
Signed-off-by: Alex Pop <apop@chef.io>
2017-02-03 19:26:02 +00:00
Dominik Richter
2fa8039f60 1.12.0 2017-02-03 17:36:43 +01:00
Alex Pop
d7e2edc8bb Merge pull request #1455 from chef/ap/tests-setter
Allow setting of the tests array
2017-02-03 16:00:09 +00:00
Alex Pop
920ff068e6 Allow setting of the tests array
Signed-off-by: Alex Pop <apop@chef.io>
2017-02-03 15:03:09 +00:00
Dominik Richter
90b4bfa318 Merge pull request #1451 from chef/ap/processes-filter
Add FilterTable support to processes resource
2017-02-03 13:51:50 +01:00
Alex Pop
83e44f9d2a add another variable handling example test
Signed-off-by: Alex Pop <apop@chef.io>
2017-02-03 08:28:46 +00:00
Alex Pop
f7444ed372 update the tests to reflect the list->entries migration and where support
Signed-off-by: Alex Pop <apop@chef.io>
2017-02-03 08:28:46 +00:00
Alex Pop
eb450c08a6 deprecate .list
Signed-off-by: Alex Pop <apop@chef.io>
2017-02-03 08:28:46 +00:00
Alex Pop
92454f96c3 Add FilterTable for processes
Signed-off-by: Alex Pop <apop@chef.io>
2017-02-03 08:28:46 +00:00
Dominik Richter
47304d0584 Merge pull request #1452 from chef/chris-rock/faraday
switch to faraday as http backend
2017-02-02 22:25:53 +01:00
Christoph Hartmann
58585e3455 switch to faraday as http backend
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-02-02 22:13:36 +01:00
Christoph Hartmann
283bbda0c6 1.11.0 2017-02-01 14:07:32 +01:00
Christoph Hartmann
17c1c880a3 Merge pull request #1448 from chef/ap/implicit-protocols
derive xinetd protocol from socket_type when not defined in the config file
2017-02-01 13:47:06 +01:00
Alex Pop
495185b581 derive xinetd protocol from socket_type when not defined in the config file
Signed-off-by: Alex Pop <apop@chef.io>
2017-02-01 11:19:24 +00:00
Christoph Hartmann
a060e65b23 Merge pull request #1444 from chef/ap/fix-xinetd-parsing
Fix xinetd parsing of services from the same file. Expose resource.protocols
2017-01-31 17:46:19 +01:00
Alex Pop
6f3a9d22d7 define protocol as done in CentOS
Signed-off-by: Alex Pop <apop@chef.io>
2017-01-31 14:47:21 +00:00
Alex Pop
a3de32ad04 Fix xinetd parsing of services from the same file. Expose resource.protocols
Signed-off-by: Alex Pop <apop@chef.io>
2017-01-31 12:40:29 +00:00
Christoph Hartmann
ccf2b249ca Merge pull request #1441 from jerryaldrichiii/minor-corrections-for-inspec-website
Make minor grammar/style changes to `inspec.io`
2017-01-30 17:21:10 +01:00
Jerry Aldrich III
3675ff099f Make minor grammar/style changes to inspec.io
Signed-off-by: Jerry Aldrich III <jerry@chef.io>
2017-01-30 06:42:31 -06:00
Christoph Hartmann
a4d230e5ea Merge pull request #1442 from chef/ap/ortest-negate
Add negate! support for describe.one object
2017-01-30 13:22:59 +01:00
Alex Pop
80ad877e02 Wrap regex in parenthesis no matter of the matcher used, ex: match, cmp
Signed-off-by: Alex Pop <apop@chef.io>
2017-01-30 11:51:06 +00:00
Alex Pop
5a087bd256 Add matchers and expectations to all object tests
Signed-off-by: Alex Pop <apop@chef.io>
2017-01-30 11:21:57 +00:00
Alex Pop
11429a54d3 Add Inspec::Variable test to a control
Signed-off-by: Alex Pop <apop@chef.io>
2017-01-30 11:01:02 +00:00
Alex Pop
ce90f0aa30 Add Inspec::List and Inspec::Control tests
Signed-off-by: Alex Pop <apop@chef.io>
2017-01-30 11:01:02 +00:00
Alex Pop
660b997342 Add negate! support for the describe.one object
Signed-off-by: Alex Pop <apop@chef.io>
2017-01-30 11:01:02 +00:00
Christoph Hartmann
78b7a2c680 Merge pull request #1435 from postgred/kernel_module_version
Version method for kernel_module
2017-01-27 17:49:23 +01:00
Andrey Aleksandrov
4caa8c50d1
Minor improvements
Signed-off-by: Andrey Aleksandrov <postgred@gmail.com>
2017-01-27 13:51:45 +03:00
Andrey Aleksandrov
3783357e50
Add version method to kernel_module
Signed-off-by: Andrey Aleksandrov <postgred@gmail.com>
2017-01-27 13:33:41 +03:00
Christoph Hartmann
0844308c98 Merge pull request #1433 from chef/1.10.0
1.10.0
2017-01-26 18:13:09 +01:00
Christoph Hartmann
fa707dfcab 1.10.0
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-01-26 17:46:05 +01:00
Christoph Hartmann
41df33bf7a Merge pull request #1432 from chef/chris-rock/improve-http
improve http header handling
2017-01-26 17:21:15 +01:00
Christoph Hartmann
976e5d85e4 improve http header handling
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-01-26 17:16:37 +01:00
Christoph Hartmann
440c09ea38 Merge pull request #1416 from brentm5/bm-add-refresh-token
Updated compliance api requests to actually use refresh token correctly
2017-01-26 14:27:57 +01:00
Christoph Hartmann
f6d04e1504 Merge pull request #1403 from guilhem/http
Add an http test method
2017-01-26 14:17:20 +01:00
Guilhem Lettron
51ca98c468 Add an http test method
Signed-off-by: Guilhem Lettron <g.lettron@criteo.com>
2017-01-26 12:02:54 +01:00
Montague, Brent
463f3ff09f Refactor after revisions requested from @chris-rock
Signed-off-by: Montague, Brent <brent@bmontague.com>
2017-01-25 14:33:34 -05:00
Montague, Brent
caa554b467 Updated compliance api requests to actually use refresh token correctly
We do not store a token in the config file but rather generate one on
each commmand.  This is just a first pass and needs some work.

Signed-off-by: Montague, Brent <brent@bmontague.com>
2017-01-25 14:33:34 -05:00
Alex Pop
185d1185fd Merge pull request #1431 from chef/chris-rock/fix-functional-tests
use new devsec baseline
2017-01-25 19:31:27 +00:00
Christoph Hartmann
c2d92d8e86 use new devsec baseline
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-01-25 20:22:38 +01:00
Christoph Hartmann
791f2db2e5 Merge pull request #1407 from gscho/rhel-doc-fix
Fixed error in OS docs, added CentOS to redhat family docs.
2017-01-25 12:13:51 +01:00
Christoph Hartmann
c58d601ecf Merge pull request #1428 from nathenharvey/nathen/execution_spelling
'execution' is spelled correctly
2017-01-25 12:05:13 +01:00