Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use chef handler to run inspec tests #113

Merged
merged 9 commits into from
Oct 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ suites:
attributes:
audit:
profiles: &profiles
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not 100% sure what &profiles should refer to

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover from initial implementation.. Yaml syntax docs: "Repeated nodes are first identified by an anchor (marked with the ampersand - “&”), and are then aliased (referenced with an asterisk - “*”) thereafter."

base/ssh: true
base/linux: true
- name: compliance # compliance direct reporting
run_list:
- recipe[audit::default]
Expand Down
30 changes: 20 additions & 10 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# inspec gem version to install(e.g. '1.1.0')
default['audit']['inspec_version'] = '1.2.0'

# collector possible values: chef-server, chef-compliance, chef-visibility
# chef-visibility requires inspec version 0.27.1 or above
Expand All @@ -23,34 +25,29 @@
# Attributes server, insecure and token/refresh_token are only needed for the 'chef-compliance' collector
# server format example: 'https://comp-server.example.com/api'
default['audit']['server'] = nil

# choose between the permanent refresh_token or ephemeral token(access_token). Needed only for the 'chef-compliance' collector
default['audit']['refresh_token'] = nil

# the token(access_token) expires in 12h after creation
default['audit']['token'] = nil

# set this insecure attribute to true if the compliance server uses self-signed ssl certificates
default['audit']['insecure'] = nil

# owner needed for the 'chef-compliance' and 'chef-server' collectors
default['audit']['owner'] = nil

default['audit']['quiet'] = nil
default['audit']['profiles'] = {}

# raise exception if Compliance API endpoint is unreachable
# while fetching profiles or posting report
default['audit']['raise_if_unreachable'] = true

# fail converge if downloaded profile is not present
default['audit']['fail_if_not_present'] = false

# fail converge after posting report if any audits have failed
default['audit']['fail_if_any_audits_failed'] = false

# inspec gem version to install(e.g. '1.1.0')
default['audit']['inspec_version'] = '1.2.0'

# by default run audit every time
default['audit']['interval']['enabled'] = false

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are going to need it for now

# by default run compliance once a day
default['audit']['interval']['time'] = 1440

Expand All @@ -59,3 +56,16 @@

# overwrite existing profile in upload mode
default['audit']['overwrite'] = true

# use json format since this is for reporting
default['audit']['format'] = 'json'

# set profiles to empty array as default
default['audit']['profiles'] = []

# output for inspec results
result_path = File.expand_path('../../inspec_results.json', __FILE__)
default['audit']['output'] = result_path

# inspec gem version to install(e.g. '1.1.0')
default['audit']['inspec_version'] = '1.2.0'
37 changes: 0 additions & 37 deletions examples/kitchen/.kitchen.linux.yml

This file was deleted.

47 changes: 0 additions & 47 deletions examples/kitchen/.kitchen.win.yml

This file was deleted.

6 changes: 0 additions & 6 deletions examples/kitchen/Berksfile

This file was deleted.

7 changes: 0 additions & 7 deletions examples/kitchen/Gemfile

This file was deleted.

77 changes: 0 additions & 77 deletions examples/kitchen/README.md

This file was deleted.

Binary file removed examples/kitchen/cc_report.png
Binary file not shown.
Binary file removed examples/kitchen/visib_reporting.png
Binary file not shown.
25 changes: 0 additions & 25 deletions examples/visibility_win/.kitchen.yml

This file was deleted.

4 changes: 0 additions & 4 deletions examples/visibility_win/Berksfile

This file was deleted.

23 changes: 0 additions & 23 deletions examples/visibility_win/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions examples/visibility_win/metadata.rb

This file was deleted.

24 changes: 0 additions & 24 deletions examples/visibility_win/recipes/chef_client_config.rb

This file was deleted.

6 changes: 0 additions & 6 deletions examples/visibility_win/recipes/default.rb

This file was deleted.

11 changes: 0 additions & 11 deletions examples/visibility_win/spec/spec_helper.rb

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions examples/visibility_win/spec/unit/recipes/default_spec.rb

This file was deleted.

Loading