Commit graph

3554 commits

Author SHA1 Message Date
Adam Leff
29e0dbebd1 Merge pull request #1490 from chef/dr/tutorial-link
create inspec.io/tutorial.html
2017-02-14 15:01:50 -05:00
Dominik Richter
34247f7c16 Merge pull request #1475 from chef/adamleff/show-target-in-shell
Provide target info on shell invocation
2017-02-14 15:06:52 +01:00
Adam Leff
bc7db89d70 Provide target info on shell invocation
When in inspec shell, you need to type the `help` command to find out info
about your target system. This info would be super helpful right out of the
gate so users have confidence that they're targeting the correct system.

The target info is still available via the `help` command as it always has
been, as well.

Signed-off-by: Adam Leff <adam@leff.co>
2017-02-14 14:46:47 +01:00
Dominik Richter
45e3016acb create inspec.io/tutorial.html
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-02-14 04:18:16 +01:00
Adam Leff
7e64c99738 Doc fix for SourceReaders::InspecReader
The inline docs for SourceReaders::InspecReader#new state that it takes
a SourceReader object for the target... but we're trying to create the
SourceReader object! It actually takes a FileProvider object that is
capabile of listing files for the given profile and reading them.

Signed-off-by: Adam Leff <adam@leff.co>
2017-02-13 13:19:22 -05:00
Adam Leff
d0bc085412 Generate default profile names, fix bug when using two-or-more flat profiles
When running InSpec with multiple profiles, and two or more of the profiles
are read in using the "Flat" SourceReader (i.e. they are not actual profiles
with a metadata file like inspec.yml, but rather just a folder containing
.rb files with controls and tests in them), InSpec would throw a NilClass
error when building the necessary objects for the formatter.

The cause was in `#profile_contains_example` in the formatter code which
checks to see if the profile name is the same as the profile_id in the given
example. However, if both of those were nil, it would potentially match the
wrong Flat-read profile.

This change fixes this in two ways: refusing to match if the profile name
or example profile ID is nil, and adding a default name to a profile if
it doesn't have a title or name. This will solve the matching issue and also
clean up the formatter output so users can more easily tell what tests
are from which profile/path.

Signed-off-by: Adam Leff <adam@leff.co>
2017-02-13 13:07:41 -05:00
Dominik Richter
09cc7c3a7e Merge pull request #1482 from chef/adamleff/add-crontab-resource
Adding new crontab resource
2017-02-10 20:53:17 +01:00
Adam Leff
417b791baa Adding new crontab resource
The crontab resource parses a particular user's crontab file into
individual entries and allows the user to assert information about
each entry as needed.

Signed-off-by: Adam Leff <adam@leff.co>
2017-02-10 09:33:31 -05:00
Dominik Richter
4daa4d06c0 1.14.1 2017-02-10 14:13:12 +01:00
Dominik Richter
514a255c52 Merge pull request #1484 from chef/ap/fix-packages-check
Skip packages resource for unsupported OS
2017-02-10 14:03:34 +01:00
Alex Pop
ce927e657a Skip packages resource for unsupported OS
Signed-off-by: Alex Pop <apop@chef.io>
2017-02-10 10:34:01 +00:00
Adam Leff
b121040516 Merge pull request #1481 from chef/dr/maintainers-alexpop
add Alex Pop to the list of maintainers
2017-02-09 09:55:35 -05:00
Dominik Richter
0153b571a3 add Alex Pop to the list of maintainers
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-02-09 15:42:36 +01:00
Dominik Richter
49beef6aa3 Merge pull request #1480 from chef/dr/maintainers-jason
remove Jason Reed from the list of maintainers
2017-02-09 15:41:01 +01:00
Dominik Richter
aabd23e69a remove Jason Reed from the list of maintainers
Thank you for all your support!!

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-02-09 14:45:03 +01:00
Dominik Richter
c3bfca14f7 Merge pull request #1479 from chef/adamleff/add-maintainer
Add Adam Leff as a maintainer
2017-02-09 10:36:38 +01:00
Adam Leff
586121808a Add Adam Leff as a maintainer
Signed-off-by: Adam Leff <adam@leff.co>
2017-02-08 23:00:15 -05:00
Dominik Richter
ddaa4c96cf 1.14.0 2017-02-09 00:39:04 +01:00
Dominik Richter
b86201d6df Merge pull request #1478 from chef/tduffield/relax-rubocop-pin
Use RuboCop 0.39.0 (same as chefstyle)
2017-02-09 00:09:48 +01:00
Dominik Richter
607601eb87 Merge pull request #1471 from chef/dr/scheme-url
map url to https for compliance plugin
2017-02-08 23:49:40 +01:00
Tom Duffield
1ea83f526c Address rubocop violations
Signed-off-by: Tom Duffield <tom@chef.io>
2017-02-08 16:49:16 -06:00
Tom Duffield
c5ad7b5d4a Relax constraint on rubocop
cookstyle requires = 0.39.0

Signed-off-by: Tom Duffield <tom@chef.io>
2017-02-08 16:48:30 -06:00
Dominik Richter
d4243b3558 map url to https for compliance plugin
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-02-08 23:29:58 +01:00
Alex Pop
243d6d3fd3 Merge pull request #1472 from chef/dr/insecure-https
bugfix: warn users about insecure login requirements
2017-02-08 14:57:42 +00:00
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