Commit graph

59 commits

Author SHA1 Message Date
Ryan Davis
6adf1d2560 Remove all byebug requires in code.
Please don't leave debugging remnants in the code.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-14 23:24:14 -07:00
Miah Johnson
f7575cca00 Remove more magic comments
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-09 13:24:25 -07:00
Miah Johnson
11b8da3283
Merge branch 'master' into mj/encoding 2019-05-08 12:59:55 -07:00
Miah Johnson
659b4b373a Remove # encoding: utf8 magic comments
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-07 16:06:23 -07:00
Ryan Davis
476c6878b3 Modernize use of Minitest.
+ Turn off verbosity in Rakefile by default. Use `rake V=1` to turn back on.
+ MiniTest -> Minitest everywhere.
+ MiniTest::Unit::TestCase -> Minitest::Test everywhere.
+ Updated minitest doco urls to official and up-to-date site.
+ Normalize requires. Only needs "minitest/autorun" and "minitest/pride".

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-03 15:01:57 -07:00
Clinton Wolfe
a282204b41 Update exe location in functional test helpers
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-29 13:27:10 -06:00
Stuart Paterson
3f1ed29af8 Address PR feedback, add a comment to inspec.yml.
Signed-off-by: Stuart Paterson <spaterson@chef.io>
2019-04-08 14:30:21 -04:00
Stuart Paterson
549a04bdae Update README with the re-added security group control.
Signed-off-by: Stuart Paterson <spaterson@chef.io>
2019-04-08 14:30:21 -04:00
Stuart Paterson
50a7bc7862 Replace port 22 ingress control.
Signed-off-by: Stuart Paterson <spaterson@chef.io>
2019-04-08 14:30:21 -04:00
Stuart Paterson
41a680270e Update AWS profile generation for InSpec 4 to depend on the new resource pack.
Signed-off-by: Stuart Paterson <spaterson@chef.io>
2019-04-08 14:30:21 -04:00
Clinton Wolfe
74e2f72ed5
Merge pull request #3818 from inspec/ja/rewrite-habitat-plugin
Rewrite inspec-habitat plugin
2019-03-08 09:51:46 -05:00
Stuart Paterson
54e7428e75
Set minimal inspec version in line with inspec-zure resource pack guidelines.
Signed-off-by: Stuart Paterson <spaterson@chef.io>
2019-03-04 15:47:39 +00:00
Stuart Paterson
a337ca1d23
Add InSpec init profile folder for Azure.
Signed-off-by: Stuart Paterson <spaterson@chef.io>
2019-03-04 15:33:37 +00:00
Stuart Paterson
dcb141da79
Add InSpec init profile for Azure.
Signed-off-by: Stuart Paterson <spaterson@chef.io>
2019-03-04 15:32:31 +00:00
Jerry Aldrich
7168c41c09 Prevent stack trace from being set to the user
This also verifies Habitat setup during create as well

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2019-02-28 11:55:59 -08:00
Jerry Aldrich
1ac435bceb Modify output to be a bit better for the user
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2019-02-28 10:42:42 -08:00
skylerto
51cda478d2 Fix issues with inspec compliance upload
Issues with underlying API changes caused a break in the current `inspec compliance upload`

This diff shows the change in API:

3cc2ee63e0...85c815011a (diff-9d107f8e84fe350fa821fed1838dbda8L162)

Implementing the same change in the `inspec-compliance` plugin fixes the
following issue:

```
Traceback (most recent call last):
        11: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/inspec-3.6.12/bin/inspec:12:in `<main>'
        10: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
         9: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
         8: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
         7: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
         6: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor.rb:238:in `block in subcommand'
         5: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor/invocation.rb:115:in `invoke'
         4: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
         3: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
         2: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
         1: from /hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/inspec-3.6.12/lib/plugins/inspec-compliance/lib/inspec-compliance/cli.rb:144:in `upload'
/hab/pkgs/chef/inspec/3.6.12/20190221172437/lib/gems/inspec-3.6.12/lib/inspec/backend.rb:45:in `create': undefined method `unpack_train_credentials' for {:target=>"mock://"}:Hash (NoMethodError)
```

Signed-off-by: skylerto <skylerclayne@gmail.com>
2019-02-25 10:24:27 -05:00
Jerry Aldrich
b533958ae6 Remove stacktrace being sent to exit_with_error
It is already available at the debug log level.

Thanks @clintoncwolfe for the suggestion.

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2019-02-22 10:56:28 -08:00
Jerry Aldrich
535ecdc4ac Remove Rakefile (testing should be done in InSpec)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2019-02-21 15:02:54 -08:00
Jerry Aldrich
3a67e1c958 Fix typos/grammer/etc in README.md
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2019-02-21 15:02:37 -08:00
Jerry Aldrich
5676bd114f Align = in initialize
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2019-02-21 13:16:20 -08:00
Jerry Aldrich
d2569e8da9 Make @log and attr_reader and rename to logger
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2019-02-21 13:16:16 -08:00
Jerry Aldrich
27eab8686f Change log message type to debug
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2019-02-21 13:06:08 -08:00
Stuart Paterson
7ec1803adb
Moved the AWS init profile to the correct location.
Signed-off-by: Stuart Paterson <spaterson@chef.io>
2019-02-20 15:16:11 +00:00
Jerry Aldrich
bf748d8478 Rewrite inspec-habitat plugin
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2019-02-19 00:47:14 -08:00
Jerry Aldrich
7134989eba Respond to @clintoncwolfe's feedback
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2019-02-07 11:15:01 -08:00
Clinton Wolfe
b831083d0d Add a UX reminder to update the license
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 12:08:21 -05:00
Clinton Wolfe
ffb3ee7e32 Correct functional test
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 11:58:10 -05:00
Clinton Wolfe
e3070cb02f PR feedback on product capitalization
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 11:58:10 -05:00
Clinton Wolfe
4582f1f8a7 linting
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 11:58:10 -05:00
Clinton Wolfe
247e004c8e Add detail option, to make stripped-down plugins
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 11:58:10 -05:00
Clinton Wolfe
fe7a683198 Add interactive prompting
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 11:58:10 -05:00
Clinton Wolfe
731b0705f5 Templatize everything for InSpec plugins
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 11:58:10 -05:00
Clinton Wolfe
5343c217b0 All templates work, but need to decide on hooks
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 11:58:10 -05:00
Clinton Wolfe
f95476179c support for LICENSE
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 11:58:10 -05:00
Clinton Wolfe
d553f4cbc3 Enough options to cover gemspec
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 11:58:10 -05:00
Clinton Wolfe
f83ea2d7bb Add ability to remap filenames
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 11:58:10 -05:00
Clinton Wolfe
4b9fd1df79 Basic template, not parameterized
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 11:58:10 -05:00
Clinton Wolfe
677542de02 Split the CLI implementation file
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 11:58:10 -05:00
Clinton Wolfe
e00582f0ec Adapt to new UI module
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 11:58:10 -05:00
Clinton Wolfe
81d07cd8d9 Move templates dir outside of lib
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 11:58:10 -05:00
Jerry Aldrich
ffe0bd4761 Update Habitat plugin (#3646)
This updates the Habitat plugin by doing the following:
  - Removing `settings.sh` in favor of Habitat config TOMLs
  - Changing deprecated `--format` to `--reporter`
  - Cleaning up plan.sh in several ways
  - Adding handling for different exit codes
  - Removing unnecessary runtime deps
  - Vendoring the InSpec archive during build
  - Using shebangs that reference Habitat's bash
  - Adding error handling for `hab studio enter`/`build` from `habitat/`
  - Making `pkg_svc_user` use default `hab` and not `root`

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-12-06 10:17:39 -05:00
Caprowni
af4253c755 Adding an AWS platform template so that it can be specified to create a template when using 'inspec init --platform' (#3622)
Signed-off-by: Liam Caproni <liamcaproni@gmail.com>
2018-11-27 16:55:03 -05:00
David Alexander
83d382c965 Fixes (some) ruby warnings related to functional tests (#3561)
* Fixes (some) ruby warnings related to functional tests
* Removes unneeded `Dir.tmpdir` from test

Signed-off-by: David Alexander <opensource@thelonelyghost.com>
2018-11-05 09:59:01 -05:00
Jerry Aldrich
701dd9fb0b Change usage of Dir.home to Inspec.config_dir (#3567)
This prevents errors on systems without `ENV['HOME']` (e.g. Habitat
services) by allowing the specification of the location of `.inspec` via
`ENV['INSPEC_CONFIG_DIR']`.

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-11-01 16:32:45 -04:00
Stuart Paterson
f64da78edb Adding inspec init profile for GCP. (#3484)
* Adding inspec init profile for GCP.
* Adding final newline, thanks rubocop.
* Ensure README headings are at the same level.
* Move OS-specific default profile to new location
* Enforce os-platform restriction on default profile template
* Use profile templates in subdirs.
* Updates to address PR feedback after rebasing from #3491.
* Alter test setup to properly use YAML

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-10-25 14:16:31 -04:00
Clinton Wolfe
be2101af9f Simple fix to the plugin development support suite (#3526)
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-10-18 16:05:06 -04:00
Jared Quick
970d2ec32b
Add debug and sort options for plugins (#3530)
* Add log options to plugin cli base.
* Sort search results to always show the latest.
* Add testing for debug logs
* Fix lint.

Signed-off-by: Jared Quick <jquick@chef.io>
2018-10-18 16:01:02 -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
Clinton Wolfe
de5403d352 Plugins: Filter Plugins During Search and Install (#3458)
* Unit and functional tests for a reject list facility
* Implementation of plugin reject facility
* Initial draft of reject list
* Add option to search to hide test fixture by default
* Fix test
* PR feedback

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-10-11 14:05:57 -04:00