Commit graph

730 commits

Author SHA1 Message Date
Clinton Wolfe
082882d98d
Merge pull request #3915 from nqb/docs/apt-resource
apt: correct docs to clarify that it matches repositories not packages
2019-04-08 11:22:35 -04:00
Miah Johnson
8435990722
Merge pull request #3899 from inspec/sp/crontab-path-update
crontab: Add validation for path param
2019-04-04 17:26:13 +00:00
nqb
79078d611c
fix: apt resource matchs repositories not packages
Obvious fix.

Signed-off-by: nqb <nqb+git@azyx.fr>
2019-04-03 08:50:08 +02:00
Aaron Lippold
1e9f8fd018 Merge branch 'master' of https://github.com/inspec/inspec into al-mitre/more-permissive-than
Signed-off-by: Aaron Lippold <lippold@gmail.com>
2019-03-28 15:50:16 -04:00
Josh Larsen
3c24f37c33 Fix broken links in migration docs.
Obvious fix.
2019-03-28 13:17:13 -04:00
Aaron Lippold
e312b44563 Addressing review items.
Signed-off-by: Aaron Lippold <lippold@gmail.com>
2019-03-27 09:55:48 -04:00
Stuart Paterson
5accfa5391
Add protection for crontab resource path and document it.
Signed-off-by: Stuart Paterson <spaterson@chef.io>
2019-03-21 15:49:00 +00:00
Clinton Wolfe
2d40181f35
Merge pull request #3890 from inspec/cw/fix-glossary-links
Repair anchor links to use dashes instead of underscores
2019-03-20 11:06:51 -04:00
Aaron Lippold
9a8ed4d3e5 move the advanced use-case to the tips and tricks
Signed-off-by: Aaron Lippold <lippold@gmail.com>
2019-03-18 21:56:00 -04:00
Aaron Lippold
a2a86860d6 This adds the more_permissive_than?(mode) matcher to the file resource.
Fixes #3893

Signed-off-by: Aaron Lippold <lippold@gmail.com>
2019-03-18 18:10:13 -04:00
Keith Walters
c2bd0616fe Allow http resource to follow redirects
By specifying a `max_redirects` attribute, the `http` resource worker
will follow any HTTP Redirect response (301, 302, etc...) up to the
limit defined by this attribute. For a local worker, exceeding that
limit will raise a `FaradayMiddleware::RedirectLimitReached` exception.
For a remote worker, the curl command will exit without populating the
`status` and `body` properties.

Signed-off-by: Keith Walters <keith.walters@cattywamp.us>
2019-03-16 20:54:52 -04:00
Clinton Wolfe
0d299e9b1d Repair anchor links to use dashes instead of underscores
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-03-14 10:57:48 -04:00
Mary Jinglewski
222a13d75a Definition list format
Signed-off-by: Mary Jinglewski <mjinglewski@chef.io>
2019-02-27 15:14:27 -05:00
Clinton Wolfe
c28e48afa2 Docs feedback
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-27 15:14:27 -05:00
Jerry Aldrich
a1a6497989 Update docs/config.md
Co-Authored-By: clintoncwolfe <clintoncwolfe@gmail.com>
2019-02-27 15:14:27 -05:00
Clinton Wolfe
59de0c3c8a Clarify fallback behavior
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-27 15:14:27 -05:00
Clinton Wolfe
20ffbffb01 Document teh credential sets features and config file format
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-27 15:14:27 -05:00
jtimberman
d2d4c9605f add json example from http request
I was looking for an example of how to do this, but I didn't find
anything in the documentation. This is a simple examle in the `json`
resource that returns a JSON blob back from an `http` request to a
"`/health`" endpoint.

Signed-off-by: Joshua Timberman <joshua@chef.io>
2019-02-21 10:23:52 -07:00
Clinton Wolfe
48711fa7bb
Merge pull request #3778 from inspec/team/filesystem-free-percent
filesystem: Add free_kb, size_kb, type, and percent_free properties
2019-02-06 17:40:10 -05:00
Clinton Wolfe
2b836a35c1
Merge pull request #3781 from EmFl/patch-2
package: Correct contradictory docs examples
2019-02-06 14:22:30 -05:00
Clinton Wolfe
dd3d3cbd2f Add deprecation hook for size()
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 14:02:17 -05:00
Clinton Wolfe
02cb799ee6 Rename free to free_kb
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 14:01:04 -05:00
Clinton Wolfe
5bbd4c16d6 Add size_kb, and correct Powershell code to return KB for both total size and free space, rather than total in GB and free space in bytes
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 14:01:04 -05:00
Clinton Wolfe
fef637a6c6 Add percent_free property
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 14:01:04 -05:00
James Massardo
83c0c18fca Add free space and type to filesystem resource
Signed-off-by: James Massardo <jmassardo@chef.io>
2019-02-06 14:01:04 -05:00
EmFl
785430ec3f
Update package.md.erb
Some contradictory description vs code example
2019-02-06 09:45:38 +01:00
Elijah Oyekunle
179ce538ed changed wrong references to pg_hba to pg_ident
Obvious fix.

Signed-off-by: Elijah Oyekunle <eloyekunle@gmail.com>
2019-02-01 14:10:18 +01:00
Clinton Wolfe
8760c48dbd Update docs
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-01-28 00:42:27 -05:00
Sean Escriva
cae4cb7049
Apply suggestions from review, fix typos
Signed-off-by: Sean Escriva <sean.escriva@gmail.com>
2019-01-23 08:59:59 -05:00
Sean Escriva
b764ced5d9
Document additional usage of json resource
The `command` and `content` usage seems to have been supported for some time, but is not included in the documentation.

ref:
* https://github.com/inspec/inspec/pull/1271

Signed-off-by: Sean Escriva <sean.escriva@gmail.com>
2019-01-20 15:16:30 -05:00
Clinton Wolfe
267786bf81 Doc updates per PR feedback
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-01-15 15:37:08 -05:00
Jerry Aldrich
f5ec7c9c65 Fix style/RuboCop on cw/deprecation-facility
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2019-01-14 13:57:59 -08:00
Clinton Wolfe
4111d21e0e Added devdocs
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-01-10 23:54:50 -08:00
Miah Johnson
15162bf920 Add resources for aws_billing_report and aws_billing_reports. (#2838)
Signed-off-by: Miah Johnson <miah@chia-pet.org>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-01-09 16:06:48 -08:00
Clinton Wolfe
1593903490
Adjust version number for availability of aws_sqs_queue (#3685)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-12-20 16:33:22 -05:00
Amit Saha
bbc07f5f11 aws_sqs_queue - new resource (#3674)
Signed-off-by: Amit Saha <amitsaha.in@gmail.com>
2018-12-20 14:33:21 -05:00
Jerry Aldrich
91fe4ad03b Fix labels on Docker containers (#3673)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-12-20 12:31:13 -05:00
Nathan Haneysmith
ec04c36f55 Fix formatting of heading on doc for aws_config_delivery_channel (#3656)
Heading is displaying incorrect on https://www.inspec.io/docs/reference/resources/aws_config_delivery_channel/
2018-12-12 11:26:39 -05:00
Clinton Wolfe
fefa6c2ecd
Plugin Type: DSLs (#3557)
This PR adds 5 closely related plugin types, which allow a plugin to implement new DSL methods / keywords. The mechanism to activate the plugins are all very similar - basically, in a particular location in the code, `method_missing` is implemented, and is used to activate the particular type of DSL being requested.

4 of the DSL plugin types relate to code that could appear in a profile control file.

* outer_profile_dsl plugins allow you to extend the code in profile Ruby files that appear outside `control` or `describe` blocks.
* control_dsl plugins allow you to extend the code within `control` blocks.
* describe_dsl plugins allow you to extend the code within `describe` blocks.
* test_dsl plugins allow you to extend the code within `it`/`its` blocks.

Finally, the `resource_dsl` plugin allows you to extend the code used within custom resources.

Basic unit tests are provided to prove that the plugin types are properly defined.

A simple plugin fixture defining DSL hooks (based on favorite foods) is included, and is exercised through a set of functional tests.

The plugin developer docs are updated to describe the 5 DSLs.

*Note*: Implementing a plugin using any of the DSL plugin types is experimental.  The contexts that are exposed to the DSL methods are private and poorly documented. The InSpec project does not claim the APIs used by these plugin types are covered by SemVer.  Plugin authors are encouraged to pin tightly to the `inspec` gem in their gemspecs.

Motivation for this plugin comes from the desire to allow passionate community members to implement things like "2 out of 3" tests, example groups, improved serverspec compatibility, "they/their" and other "fluency" changes, as well as make it possible for future work by the InSpec team to be implemented as a core plugin, rather than a direct change to the main codebase.
2018-11-29 14:14:06 -05:00
Ian Savage
79f7239c69 Add SQLcl to Oracledb_session Doc (#3632)
* Add SQLcl option to oracledb_session.md.erb

Added sqlcl_bin option to oracledb_session documentation.

* Add SQLcl option to oracledb_session.md.erb

Signed-off-by: ibsavage <ianbsavage1@gmail.com>
2018-11-27 16:56:49 -05:00
Clinton Wolfe
b3fafab1e6 Add aws_eks_cluster resource (#3582)
* add aws_eks_cluster

Signed-off-by: Timothy van Zadelhoff
timothy.inspec@theothersolution.nl

* disable ABC check on fetch_from_api

Signed-off-by: Timothy van Zadelhoff <timothy.inspec@theothersolution.nl>

* add status predicates

* Change docs for status attribute

Signed-off-by: Timothy van Zadelhoff <timothy.inspec@theothersolution.nl>

*     Add integration tests

    Signed-off-by: Timothy van Zadelhoff <timothy.inspec@theothersolution.nl>

* Adjust EKS build code to almost work

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

* EKS only uses private subnets - integration tests pass

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

* Correct AWS Exception class for resource search miss in unit test

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

* Update unit test to reflect AWS resource-standard miss behavior, returning nil for most properties

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-11-27 16:54:47 -05:00
Jared Quick
09b0c41e39
Update UUID documentation (#3612)
* Update UUID documentation
* Fix feedback.

Signed-off-by: Jared Quick <jquick@chef.io>
2018-11-15 13:19:37 -05:00
Timothy van Zadelhoff
5739cb2d6b aws_security_group: Query against other security group ids in allow_* matchers (#3576)
* add security-group to security-group rules
* update docs
* Add integration tests for security-group to security-group rules
* rubocop fix
*     Add one security group rule, with position.
* make control fit description

Signed-off-by: Timothy van Zadelhoff <timothy.inspec@theothersolution.nl
2018-11-13 13:25:33 -05:00
Mark Hughes
45926ef63a Added xml resource support for ints, bools, and string responses (#3583)
Methods like…

* `count()` return `Integer` values
* `boolean()` return `TrueClass`/`FalseClass` values
* `concat()` return `String` values

…but threw exceptions because those types weren't supported.

This adds support to the `xml` resource, and adds tests to verify some of those examples.

Signed-off-by: Mark Hughes <greenantdotcom@users.noreply.github.com>
2018-11-08 12:47:18 -05:00
David McCown
3ab956845c Fixes broken link in documentation (#3588)
Signed-off-by: David McCown <dmccown@chef.io>
2018-11-07 15:40:07 -05:00
Ksenia
c07ec59070 Add 17 hexadecimal characters support aws_vpc (#3518) (#3564)
aws_vpc: accept 17 hexadecimal characters for vpc_id 

Signed-off-by kchistova <kchistova@gmail.com>
2018-11-05 10:01:16 -05:00
David Grizzanti
d8c90df4df Doc typo fix (#3551)
Signed-off-by: Dave Grizzanti <david_grizzanti@comcast.com>
2018-11-05 09:11:23 -05:00
Nell Shamrell-Harrington
9faf638ff7 documents inspec habitat profile setup command (#3559)
* documents inspec habitat profile setup command
* fixes link and typo

Signed-off-by: Nell Shamrell <nellshamrell@gmail.com>
2018-11-01 13:47:23 -04:00
Jerry Aldrich
4a6f5f719a Fix rendering and other issues in the Style Guide (#3539)
* Fix rendering and other issues in the Style Guide
* Use backticks for technical literals
* Correct RubyGems spelling
* Clarify plugin installation instructions
* Clean up Avoid/Use style

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-11-01 13:07:02 -04:00
Jared Quick
0f42b31016
Allow end of options during Thor array parsing (#3547)
Signed-off-by: Jared Quick <jquick@chef.io>
2018-10-30 06:32:16 -04:00
Jerry Aldrich
329da7f679 Add cmp vs eq to the style guide (#3536)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-10-25 13:21:02 -04:00
Jerry Aldrich
955d444b95 Correct/Enhance cmp matcher examples (#3537)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-10-23 16:02:40 -04:00
James Stocks
7c58285eb6 New resource to work with Windows security identifiers (SIDs) (#3405)
* Resource for a Windows Security Identifier (SID)
* Integration tests for security_identifier resource
* Address rubocop violations
* Improve security_identifier from PR feedback
* Update security_identifier tests
* Improve security_identifier unit tests
* Fix unit tests fpr security_identifier resource
* More security_identifier unit tests
* Add docs page for security_identifier resource
* Fix issues with documentation
* Improve docs
Link to Microsoft reference page, and use their term 'trustee' instead of 'entity' where applicable.

* Change exists to exist
* Test appveyor file changes.

Signed-off-by: Jared Quick <jquick@chef.io>
2018-10-19 09:01:00 -04:00
Miah Johnson
7a6119e7a6 Add missing tests for groups resource, document members property, and assorted fixes. (#3467)
* Add missing tests for groups resource, document members propery, and assorted fixes.

Update existing documentation for group resource.
Add documentation for groups resource.
Update group resource tests to test members property.
Change groups resource members property to have simple style. (this
ensures members is a single array)
remove deprecated have_gid propery.
change `if !` to `unless`
Remove early return from members method. This prevented members from
working correctly on any OS other than Windows.
Add missing tests for the groups resource.
remove tests for has_gid

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

* Fix comments

Signed-off-by: Jared Quick <jquick@chef.io>
2018-10-18 16:48:30 -04:00
Matt Ray
ea8d05881b Minor cleanups of plugin documentation. 'Plugin' instead of 'PluginDefinition' (#3527)
Signed-off-by: Matt Ray <matthewhray@gmail.com>
2018-10-18 15:56:04 -04:00
Jerry Aldrich
f1bd34def3 docs: Fix small issues with the file resource (#3515)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-10-17 23:44:45 -04:00
Jerry Aldrich
911ef87dc1 docs: Add link to the file resource from directory (#3517) 2018-10-17 23:44:20 -04:00
Jerry Aldrich
7313eb7819 style: Fix quotes/style on the docker resource (#3516)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-10-17 09:14:19 -04:00
Jared Quick
2bbcdbde9b
Inspec 3.0 (#3512)
* Remove deprecated yumrepo. (#3435)

* Remove deprecations for cli `--format` and metadata.rb (#3452)

* Remove deprecated database_helpers stderr/stdout methods.
Update deprecation text for processes/apache.

* Remove deprecations for `--format` and metadata.rb
Remove deprecated `format` code.
Remove deprecated code test and change json-config format test to use
reporter.
Remove deprecated metadata.rb code
Remove deprecation notice for old supports syntax.
Deprecate metadata.rb from source_reader
Remove rubocop disables as they are no longer required for this code block.
Remove deprecated legacy metadata.rb mock profiles.
Remove deprecated metadata.rb profile tests.
Remove deprecated yumrepo test.

* Allow inspec-3.0 branch to be tested.
* Allow appveyor to test inspec-3.0 branch
* Change runner tests to use reporter rather than format.
Remove deprecated `supports: linux` tests.

* Remove skip from inherited profiles from showing up in reporting (breaking change) (#3332)

* Skip loading dependency profiles if they are unsupported on the current
platform.

Skip loading dependencies if they are unsupported on the current
platform.

Wrap our log and next in a conditional checking if the platform is
supported.

Change a `if !` into a `unless`

Check if the backend is a Train Mock Connection and if so say that the
profile does support the platform.

While iterating through tests being loaded skip when the platform is
unsupported.

We now log a WARN when a profile is skipped due to unsupported platform,
so lets check that.

Modified existing test to log that there are 0 skipped tests, instead of
2.

Add functional test that loads profile-support-skip with a json reporter
to check that our controls are not loaded and that stderr contains our
warning.

* Rather than iterating through each test return before recursion if the platform is
unsupported.

* Resolve tests using a supported platform different from testing platform

Add a control to `test/unit/mock/profiles/complete-profile` that would
work on any OS with a Internet connection. This allows the profile
to execute on any OS with success. `filesystem_spec.rb` was a control
that would only work on Linux and some BSD's.

We want profile tests to consistently work across development and testing
platforms, and not get 'skipped' in some cases.  Travis-CI tests on Linux,
Inspec Dev team uses Linux and MacOS, Appveyor tests on Windows

Also Updated `file_provider_test.rb` for `complete-profile` content changes.

If you `MockLoader.load_profile` on a unsupported platform you might not
hit the usual skip. Lets handle situations where the tests array in
Profile#load_checks_params could be nil.

* Use safe navigation rather than checking if tests is nil.
Update tests to point to unsupported_inspec and account for WARN changes.
Make unsupported_inspec profile support os-family 'unsupported_inspec'

* Fix skip bug when using include/require controls. (#3487)

* Fix skip bug when using include/require controls.
* fix test and feedback.

* Remove need for UUID detection for Automate report (#3507)
* Add json metadata for skipped profiles (#3495)

* Add skip metadata to json reports
* Unify skip messages.
* Update with status field.
* Add testing.
* Fix tests.
* lint
* Add skip exit codes for profile skips.
* Update website for 3.0 launch

Add `plugins` to sidebar.
Change 2.0 -> 3.0 in slim files.
Update 3.0 features list.
* Fix comments
* Update float to numeric.
* Change Float to numeric.
* updated feature list and impact doc
* Change "What's new in InSpec 3.0" -> "Announcing InSpec 3.0"
* Bump VERSION to 3.0.0 (#3511)

* Remove 3.0 testing checks.

* Fix azure link.
2018-10-15 18:25:27 -04:00
Jerry Aldrich
0b0a0a4d48 Change Inspec to InSpec where appropriate (#3494)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-10-15 12:09:46 -04:00
Jerry Aldrich
d3f1267315 docs: Add version to multiple descriptions doc (#3477)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-10-10 16:17:05 -04:00
Paul Welch
5375393053 Fix Packages Resource Docs (#3469)
Some instances of the packages resource in the examples
were referencing package instead of packages.

Signed-off-by: Paul Welch <pwelch@chef.io>
2018-10-08 09:35:30 -04:00
Clinton Wolfe
857b9bb11c Plugins: Support for Train Plugins in InSpec (#3444)
* Unit tests passing for loading Train plugins
* detect works with a train test fixture
* Update fixture install of train-fixture-plugin
* Add functional tests for detect and shell when talking to a train plugin backend
* Update docs to reflect availability of Train plugins
* Functional test for install train plugin from path
* Working install train plugin from path, more tests for installing from odd locations
* PR Feedback

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-09-27 18:46:35 -04:00
Dominik Richter
9f920d5586
RFC inspec style guide (#3356)
* 🚶 start style guide

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2018-09-27 09:12:36 -07:00
Jerry Aldrich
20776b363d Add support for multiple descriptions for controls (#3424)
* Add support for multiple descriptions for controls

This adds the ability to specify multiple descriptions in controls.

Example:

```ruby
control 'my-control' do
  impact 1.0
  title 'My control'
  desc 'A default description'
  desc 'rational', 'I need an example'
  describe file('/tmp') do
    it { should be_directory }
  end
end
```

Many thanks to @jquick for helping me with the unit tests.
* Remove unused `descriptions` method
* Remove unused profile from test mocks
* Respond to feedback

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-09-26 13:28:57 -04:00
Jared Quick
39b3b7135e
Add audit-cookbook integration testing (#3431)
* Add audit integration testing.
* Add some docs and feedback changes.
* Updated integration task to use paramaters and clean it up.
* Fix unit test

Signed-off-by: Jared Quick <jquick@chef.io>
2018-09-25 15:53:26 -04:00
Clinton Wolfe
0ced18841f
CLI Plugin Manager SubCommand (#3414)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-09-25 10:29:18 -04:00
James Massardo
2af1535f7c Add new resource: aws_ebs_volume (#3381)
* Added support for basic AWS EBS volume testing
* Fix error in exists matcher
* Added EBS resource documentation and requested changes

Signed-off-by: James Massardo <jmassardo@chef.io>
2018-09-21 11:49:28 -04:00
Martin Logan
242bee9ce6 Update AWS Security Group to work with IPV6 rules. (#3394)
Add inbound_rules_count and outbound_rules_count for total variants

Signed-off-by: Martin Logan <martinloganzz@gmail.com>
2018-09-18 16:21:41 -04:00
Ben Abrams
0b33644819 adding versions to the gem resource (#3398)
This is useful when you have multiple versions of the same gem installed. It can be leveraged like so:
```
describe gem('rest-client') do
  its('versions') { should include /1.8\.\d+/ }
  its('versions') { should include /2.0\.\d+/ }
  its('versions.count') { should_be eq 2 }
end
```

Signed-off-by: Ben Abrams <me@benabrams.it>
2018-09-18 13:17:10 -04:00
Kayleigh Doores
9c1b7eb6a2 Added db_name flag (#3383)
* Added db_name flag
* removed trailing whitespace
* Added comment to disable metrics

Signed-off-by: Kayleigh <kayleigh.doores@gmail.com>
2018-09-17 20:59:31 -04:00
Jared Quick
daff65470e
Fix rendering of profiles webpage. (#3393)
Signed-off-by: Jared Quick <jquick@chef.io>
2018-09-17 17:41:42 -04:00
Jared Quick
ac106a090e
Implement InSpec global attributes (#3318)
* Add yml attribute option.
* Add type matching.
* Add testing profile for global attributes testing all types.
* Allow attributes to be called within a control block.
* Fix attribut test issues and allow value to be set at runtime.
* Allow setting attr value after creation.
* Move attributes to global namespace.
* Move attributes to a singleton object.
* Add unit and updated functional testing.
* Rename attributes to attributes_test so the testhelper picks it up.
* Add attribute object tests and error types.
* Update with feedback changes.
* Remove extra line.
* Move attribute registry class file.
* Add documentation for attributes
* Rename rspec_extensions.
* Add some failing functional tests.
* Update docs and fix typos.

Signed-off-by: Jared Quick <jquick@chef.io>
2018-09-12 16:42:58 -04:00
Noel Georgi
34ae5aac40 Add HTTP basic auth for URL based inspec deps (#3341)
* Add HTTP basic auth for URL based inspec deps
* Add tests

Signed-off-by: Noel Georgi <git@frezbo.com>
2018-08-30 12:57:50 -04:00
Noel Georgi
9b5aaa4f87 Support erb rendering (#3338)
* Support erb rendering

Fixes: https://github.com/inspec/inspec/issues/3337

* Add UT's and docs

Signed-off-by: Noel Georgi <git@frezbo.com>
2018-08-30 12:56:06 -04:00
Miah Johnson
006b4c7e6f Fix documentation link for azure integration tests. (#3336)
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2018-08-30 10:30:22 -04:00
Clinton Wolfe
d24e0f0ec9 Plugins V2 API: CLI Command Plugin Type, Again (#3296)
Plugins V2 API: CLI Command Plugin Type

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-08-16 20:22:28 -04:00
Clinton Wolfe
811318f2f8 Plugins API v2: Loader, Base API, and Test Harness (#3278)
* Functional tests for userdir option
* Accepts --config-dir CLI option
* Actually loads a config file from the config dir, more cases to test
* Able to load config and verify contents from config-dir
* Functional tests to ensure precedence for config options
* Enable setting config dir via env var
* .inspec, not .inspec.d
* Begin converting PluginCtl to PluginLoader/Registry
* Able to load and partially validate the plugins.json file
* More work on the plugin loader
* Break the world, move next gen stuff to plugin/
* Be sure to require base cli in bundled plugins
* Move test file
* Revert changes to v1 plugin, so we can have a separate one
* Checkpoint commit
* Move v2 plugin work to v2 area
* Move plugins v1 code into an isolated directory
* rubocop fixes
* Rip out the stuff about a user-dir config file, just use a plugin file
* Two psuedocode test file
* Working base API, moock plugin type, and loader.
* Adjust load path to be more welcoming
* Silence circular depencency warning, which was breaking a unit test
* Linting
* Fix plugin type registry, add tests to cover
* Feedback from Jerry

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-08-16 18:16:32 -04:00
Kimberly Garmoe
02aba82b38 Fixes docs images (#3288)
Signed-off-by: kagarmoe <kgarmoe@chef.io>
2018-08-14 14:24:11 -04:00
Christoph Hartmann
28df22bdbe update docs to use new platform attributes in supports (#3279)
* update docs to use new platform attributes in supports
* Updated supports docs.

Signed-off-by: Jared Quick <jquick@chef.io>
2018-08-09 14:07:18 -04:00
James Stocks
29d82a0460 Correct docs for Windows registry_key resource (#3248)
Last update was mistaken about the workaround that should be used.
This commit corrects that mistake and provides some example output from `inspec shell`.

Signed-off-by: James Stocks <jstocks@chef.io>
2018-08-09 09:17:05 -04:00
Clinton Wolfe
2de06bdeb5 Clean injection of Availability section (#3206)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-08-09 08:34:49 -04:00
Noel Georgi
9d3beb8d41 Adding docker plugin support (#3074)
* Fixing tests and squashing
* Updating as per some PR comments
* PR comments

Signed-off-by: Noel Georgi <18496730+frezbo@users.noreply.github.com>
2018-08-09 08:20:32 -04:00
Jerry Aldrich
f2d64938b7 windows_feature resource: Add DISM support (#3224)
* windows_feature resource: Add DISM support

This modifies the `windows_feature` resource to fallback to DISM when
the `Get-WindowsFeature` command is not available.

* Allow specifying `:dism` or `:powershell`
* Replace stacktrace with smaller error message
* Add notes/todo about raise behavior
* Remove duplicated platform check

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-07-25 16:00:06 -04:00
James Stocks
3b56223a52 Update docs for registry keys with period characters (#3216)
Signed-off-by: James Stocks <jstocks@chef.io>
2018-07-19 15:00:39 -04:00
Kimberly Garmoe
eb87fd384d Markdown and code fence fixes (#3230)
Signed-off-by: kgarmoe <kgarmoe@chef.io>
2018-07-19 14:31:38 -04:00
Jerry Aldrich
67405bca66 docs: Fix first xinetd_conf example (#3229)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-07-18 11:29:39 -04:00
Jerry Aldrich
706493f2f3 command resource: Allow redacting #to_s (#3207)
* command resource: Allow redacting `#to_s`
* Respond to feedback

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-07-16 08:20:57 -04:00
Jerry Aldrich
3ea6780407 docs: Fix formatting/style on InSpec DSL page (#3201)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-07-13 15:54:13 -04:00
Stanislav Voroniy
a16877f427 A number of bug fixes and new features for oracledb_session resource (#3170)
Signed-off-by: Stanislav Voroniy <stas@voroniy.com>
2018-07-09 13:57:45 -04:00
Clinton Wolfe
d0e2608ec3 Overhaul shadow docs (#3156)
* Overhaul shadow docs
* Feedback from stocksy
* Edits to shadow resource
* PR feedback correction
* Attempt to clarify grammar for expiry_date criterion

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-07-05 16:15:03 -04:00
Colin Hebert
7deed13425 Add support for shallow link paths (#3168)
* Add support for shallow link paths
* Improve documentation of the

Signed-off-by: Colin Hebert <hebert.colin@gmail.com>
2018-06-26 07:47:00 -04:00
Clinton Wolfe
44c0fd2e4f
Accept symbols and downcased criteria in aws_iam_policy have_statement matcher (#3129)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-06-21 14:19:56 -04:00
Clinton Wolfe
81d0423ee0 Overhaul Glossary (#3152)
* Move text glossary into main glossary file, and adjust headings
* Rewrite simple visual glossary example with more concrete example and add internal hyperlinks
* Add plural visual glossary
* Progress on the text glossary
* More Progress on the text glossary
* Remove skeletal advanced usage section for
* Edits for markdown, copy, passives

Signed-off-by: kgarmoe <kgarmoe@chef.io>
2018-06-20 21:26:36 -04:00
Christoph Hartmann
b2e0bccea8 deprecate azure_generic_resource (#3132)
* deprecate azure_generic_resource

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2018-06-15 08:44:19 -04:00
Jerry Aldrich
01d31efde3 docs: Remove extra backticks from windows_task (#3149)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-06-15 08:08:03 -04:00
Jared Quick
7db83446ba
Add insecure option to the automate report json (#3124)
* Add insecure option to the automate report json.
* Add in automate and compliance json documentation.
* Fix typo.

Signed-off-by: Jared Quick <jquick@chef.io>
2018-06-14 14:05:21 -04:00
Clinton Wolfe
7aa60852e6 Add list properties back to shadow (#3140)
* Un-deprecate plural properties on shadow; deprecate the singular versions
* Update filtertable interface to current
* A weak attempt at making the docs coherent
* Doc feedback per Jerry

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-06-14 13:42:00 -04:00
Andrey Artemov
47bb4aa2fe Fix code examples for http resource (#3134)
Signed-off-by: Andrey Artemov <andrey.artemov@gmail.com>
2018-06-14 09:29:10 -04:00
Clinton Wolfe
6f46d52242
Add aws_elb and aws_elbs resources (#3079)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-06-07 15:06:05 -04:00
Miah Johnson
ab32446213 Adds a aws_flow_log resource with unit and integration testing. (#2906)
Signed-off-by: Miah Johnson <miah@chia-pet.org>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-06-07 14:41:46 -04:00
Miah Johnson
5416f523a9 correct docs for shadow (#3042)
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2018-06-06 14:13:34 -04:00
Miah Johnson
71ca82fd74 Documentation fixes (#3058)
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2018-06-06 14:10:48 -04:00
Clinton Wolfe
f9dd82f2f6
Add common methods to FilterTable automatically (#3104)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-06-05 22:35:09 -04:00
Clinton Wolfe
ca6556e0fe
Add lazy-loading to FilterTable (#3093)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-06-05 17:32:52 -04:00
Clinton Wolfe
4cd6cc07cc
Two fixes to FilterTable where criteria handling (#3045)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-06-05 00:46:32 -04:00
Clinton Wolfe
8c274daaa9
Refactor: Perform internal rename and add comments to FilterTable (#3047)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-06-04 20:20:59 -04:00
Jerry Aldrich
49118a90b9 Spellcheck FilterTable Developer Documentation (#3111)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-06-04 18:52:44 -04:00
Clinton Wolfe
b334eb65d9
FilterTable Developer Documentation (#3048)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-06-02 22:34:05 -04:00
Dominik Richter
ebd1d36600 support local npm package searches (#3105)
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2018-06-01 10:52:46 +02:00
Noel Georgi
317a6d1953 Adding YAML reporter (#3081)
* Adding YAML reporter
* Updating yaml o/p
* Removing comment
* Adding UT for YAML reporter, adding missing reporters
* This PR takes care of the following:
 - Fixes the YAML reporter UT
 - Adds the report method to YAML reporter to support code example as in #3085
 - Disables the cyclomatic complexity Metric for reporter

Signed-off-by: Noel Georgi <18496730+frezbo@users.noreply.github.com>
2018-05-31 13:42:09 -04:00
Jared Quick
03e87cd89d
Bup the release to test new gem builds (#3071)
Signed-off-by: Jared Quick <jquick@chef.io>
2018-05-17 20:05:04 -04:00
Miah Johnson
e2fe18028d true should not be a string. (#3043)
Fixes https://github.com/chef/inspec/issues/2786

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2018-05-16 08:53:37 -04:00
Miah Johnson
988eb9749b AWS resource permission docs (#3036)
* Add documentation about required IAM permissions to AWS Resources.
* Change phrasing.

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2018-05-10 14:57:53 -04:00
Clinton Wolfe
af72574b34 Skeletal aws_ec2_instances resource (#3023)
* Add integration and unit tests for aws_ec2_instances
* Basic docs for aws_ec2_instances
* Add basic aws_ec2_instances resource

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-05-10 14:54:33 -04:00
Jeremy
1407e681fc #2810 - Add check if aws s3 bucket is encrypted. (#2937)
* Add check if aws s3 bucket is encrypted.
Required terraform aws provider >= 1.6
Fix indentation issue in aws_s3_bucket.rb

* Implement most changes recommended by @TrevorBramble, and refactored other methods to align with recommendations (except Terraform nitpick; preference is to keep coding style consistent until full refactor).

Signed-off-by: Jeremy Phillips <github@uranusbytes.com>
2018-05-03 09:55:29 -04:00
Noel Georgi
ffbd6cbfb2 Fixing wrong filesystem size type (#3013)
Signed-off-by: Noel Georgi <noel.georgi@reancloud.com>
2018-05-03 09:16:07 -04:00
Clinton Wolfe
1a00853cd8
Catch exceptions in control blocks and fail the control (#2987)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-04-26 15:44:16 -04:00
Omar J. Irizarry
2495fd8196 extend os_env resource to select between Machine and User vars on Windows (#2945)
Signed-off-by: Omar J Irizarry <irizarry_omar_j@network.lilly.com>
2018-04-26 15:10:14 -04:00
Clinton Wolfe
8934352935 Make names for AWS Config service objects optional (#2928)
* Update tests and docs to assume one recorder per region
* Config recorder supports singleton fetch
* Docs and tests for singleton mode delivery_channel
* Implementation for singleton delivery channel, and some other code cleanup
* Implement some feedback, and fix a bug in traversing the struct in looking for empty results

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-04-19 13:08:16 -04:00
Axel Kummer
923f5a9e56 Update Resource documentation for Users Resource (#2954)
The `shell` matcher have to be `shells` and expects an array.
Wrong:
`its('shell') { should eq "/sbin/nologin" }`

Got error:
```
     ×  Users with username =~ /stockservice-.*/ shell
     undefined method 'shell' for Users with username =~ /stockservice-.*/:#<Class:0x000055c2471fa900>
     Did you mean?  shells
```

Correct:
its('shells') { should eq ["/sbin/nologin"] }

I think it's an documentation mistake.
-----------------------------------------
$ inspec --version
2.1.43

Signed-off-by: Axel Kummer <axel.kummer@netresearch.de>
2018-04-19 13:06:20 -04:00
Andrii Melekhovskiy
180482d0a7 Fix docs: 404 in URLs for docker resourse (#2974)
Signed-off-by: morkot <melekhovskiy@gmail.com>
2018-04-19 11:02:22 -04:00
Clinton Wolfe
73b7b6942c
Inline and attached policies for aws_iam_user and aws_iam_users (#2947)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-04-17 13:22:28 -04:00
Clinton Wolfe
745ff32c80 Basic fields for aws_vpcs (#2930)
* Update singular implementation to avoid use of inner object
* Update docs and tests for 3 new filters and properties on aws_vpcs
* Implement new filters and properties; one failing test due to odd FilterTable behavior
* changes to avoid bug 2929

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-04-12 15:48:55 -04:00
Bj Maldonado
eff4de6784 Fixed Docs asking for instead of (#2933)
Signed-off-by: Bj Maldonado <bj@maldonado.io>
2018-04-12 15:26:32 -04:00
Clinton Wolfe
7130a77c06
Policy Statement Search capability for aws_iam_policy (#2918)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-04-12 14:31:02 -04:00
Clinton Wolfe
ceec3fc66c Document the inspec_version metadata field (#2949)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-04-12 13:32:48 -04:00
Clinton Wolfe
9dee334706 Change its to it in aws root user docs (#2927)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-04-09 13:40:11 -04:00
borgified
cdccad1de4 typo (#2919)
Signed-off-by: borgified <borgified@gmail.com>
2018-04-06 17:10:13 -04:00
Clinton Wolfe
4200fdd779 AWS Security Group Rules properties and matchers (#2876)
Provides low-, and mid-level properties and matchers for examining rules on aws_security_group.

* Second draft of docs for SG rules interface; need to clarify semantics of reject
* First cut at unit tests
* Cleanup test fixtures
* Implementation for allow, with plausible unit tests
* Doc updates based on reality
* Add integration tests; move allow to allow_ / out; several docs updates
* Add be_open_to_the_world and be_open_to_the_world_on_port
* Update docs to reflect adding allow_only
* Update docs to reflect use of position to allow multiple rules with 'only'
* Implement allow_only with unit tests; still need integration tests
* Add integration tests for allow_only

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-04-06 14:22:25 -04:00
Matthew Dromazos
b5a0007851 aws_cloudtrail_trail feature: test how many days ago logs were delivered (#2887)
* * Adds new property to test how many days ago the CloudTrail delivered logs to the CloudWatch Logs.

* * Changes query for selected cloud trail in unit test
* Changes uses Time.now explicitly instead of making a variable in the unit test

Signed-off-by: Matthew Dromazos <dromazmj@dukes.jmu.edu>
2018-04-06 14:04:57 -04:00
Matthew Dromazos
74076bc44a aws_iam_group feature: test users in an iam group (#2888)
* Adds new property to test the users in an aws_iam_group
* Adds terraform code to add the recall_hit user to the administrator group

Signed-off-by: Matthew Dromazos <dromazmj@dukes.jmu.edu>
2018-04-06 14:04:13 -04:00
Gary
1677be6d42 Amended Syntax to correct formatting (#2911) 2018-04-06 09:14:41 -04:00
Matthew Dromazos
c04a98c9f8 New Skeletal Resource aws_route_tables (#2643)
* Initial commit of skeletal resource aws_route_tables
* Fixes issues with documentation
* Renames route table terraform resources to be more conventional
* Removes tags terraform resources
* Changes aws_route_table and aws_route_tables integration tests to use new terraform names
* Removes unneeded data given in unit tests

Signed-off-by: Matthew Dromazos <dromazmj@dukes.jmu.edu>
2018-04-05 12:51:22 -04:00
Matthew Dromazos
0df67fc7d0 New Skeletal Resource aws_s3_buckets (#2653)
* Initial commit of skeletal resource aws_s3_buckets
* Add fixes to documents
* Removes property 'creation_date' for there is no use case as of right now
* Rebases on master and moves aws_s3_buckets integration test to the correct location
* Adds test on unit test for false exists

Signed-off-by: Matthew Dromazos <dromazmj@dukes.jmu.edu>
2018-04-05 12:49:30 -04:00
David Alexander
3b97e16b97 New Resource: Chocolatey Package (#2793)
* Adds chocolatey package resource
* Adds docs for chocolatey_package resource
* Differentiate chocolatey package from windows feature

Suggested by @frezbo

Signed-off-by: David Alexander <opensource@thelonelyghost.com>
2018-04-05 08:54:27 -04:00
Jerry Aldrich
4731d95abd docs: Update example resource (#2904)
* Change `skip_resource` to use raise
* Add `supports` lines to example resource
* Change to rescue `StandardError` vs `Exception`
* Change raise to use `e.message` vs `$!`
* Remove redundant returns
* Change `File.exists?` to `File.exist?`
* Update shasum in tests

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-04-05 08:50:49 -04:00
Clinton Wolfe
fe591417f3 Wrong matcher name in example for aws_config_recorder (#2899)
* Wrong matcher name in example
* Remove spurious slash

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-04-03 09:17:50 -04:00
Paul Welch
27203110cd Add AWS hardware MFA matcher (#2892)
* Add AWS hardware MFA matcher
Adding a hardware as well as a virtual MFA matcher for aws_iam_root_user
resource

* Add New AWS Root Matcher Docs
- Add documentation for new root MFA matchers
- Fix logic for checking MFA devices from feedback on PR

* Add Integration tests for MFA matchers
- Add integration tests for virtual and hardware MFA matchers
- Clean up logic for has_virtual_mfa_enabled? method

Signed-off-by: Paul Welch <pwelch@chef.io>
2018-04-03 09:13:52 -04:00
Franklin Webber
6665555a73 Fixes the two incorrect examples in the YAML doc (#2875)
Signed-off-by: Franklin Webber <franklin@chef.io>
2018-03-28 13:20:56 -04:00
Mo Shark
fc3f1708c4 Porting over the singular rds resource from the aws-inspec git repo (#2866)
Signed-off-by: HackerShark <melsharkawi@mitre.org>
2018-03-28 11:23:44 -04:00
Nathan Haneysmith
002a589871 fix logic in examples for password used (#2874)
Signed-off-by: Nathan Haneysmith <nathan@chef.io>
2018-03-26 15:42:56 -04:00
Matthew Dromazos
0cbe5b60e5 New Skeletal Resource aws_config_delivery_channel (#2641)
* Initial commit of new skeletal resource aws_config_delivery_channel
* Changes delivery_frequency to be an integer and names delivery_frequency_in_hours
* Adds more documentation and clarifies descriptions
* Wraps API call in the aws_catch_errors function
* Changes config bucket name to use dashes instead of underscores
* Updates on master and changes directory location of build and integration files
* Fix integration tests to only create one ConfigRecorder

Signed-off-by: Matthew Dromazos <dromazmj@dukes.jmu.edu>
2018-03-26 14:03:23 -04:00
Matthew Dromazos
603bef6f29 New Skeletal Resource aws_kms_key (#2746)
* Initial commit of skeletal resource aws_kms_key
* * Adds comments to rerun travis
* * Clarifies some parts of the doc.
* Changes matcher have_aws_key_manager to manged_by_aws
* Fixes copypasta
* Adds clarification to property names
* Fixes rescueing exceptions from the api
* raises exceptions in the unit tests

Signed-off-by: Matthew Dromazos <dromazmj@dukes.jmu.edu>
2018-03-23 08:29:45 -04:00
Matthew Dromazos
9077a7b17b New Skeletal Resource aws_sns_subscription (#2697)
* Initial commit of skeletal resource aws_sns_subscription
* Fixes errors in documentation
* Clarifies documentation
* Wraps calls to aws api in catch_aws_errors metho
* Fixes integration tests

Signed-off-by: Matthew Dromazos <dromazmj@dukes.jmu.edu>
2018-03-22 13:38:40 -04:00
Matthew Dromazos
1bb565c708 New Skeletal Resource aws_sns_topics (#2696)
* Initial commit of skeletal resource aws_sns_topics
* Adds clarification in documentation
* Adds functionality for calling the next token returned from aws api.
* Wraps api calls in the catch_aws_errs method

Signed-off-by: Matthew Dromazos <dromazmj@dukes.jmu.edu>
2018-03-22 12:55:23 -04:00
David Alexander
9629bf6f73 Documentation: supports attribute of custom resource DSL (#2824)
* Documents `supports` attribute of custom resource DSL
* Uses html definition list for definitions
* Reverts <dl> changes to pure markdown again

Signed-off-by: David Alexander <opensource@thelonelyghost.com>
2018-03-22 08:47:31 -04:00
Paul Welch
a32a85eae5 Remove incorrect example from documentation (#2851)
Owner and mode are provided by the file resource, not ssh_config.

Fixes #2471

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 12:52:51 -04:00
Franklin Webber
87a28b56bb The resource is login_defs not login_def (#2845)
The main index is displaying the wrong resource name. The url to the resource
is not correct either. This should generate the correct entry and path in the
docs.

Signed-off-by: Franklin Webber <franklin@chef.io>
2018-03-20 13:01:34 -04: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