kitchen-inspec 0.25.0 → 0.26.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/CODEOWNERS +3 -0
- data/.gitignore +11 -0
- data/.kitchen.yml +82 -0
- data/.rspec +2 -0
- data/.travis.yml +41 -0
- data/Berksfile +8 -0
- data/CHANGELOG.md +469 -0
- data/Gemfile +37 -0
- data/Guardfile +23 -0
- data/MAINTAINERS.md +13 -0
- data/README.md +275 -0
- data/Rakefile +129 -0
- data/kitchen-inspec.gemspec +24 -0
- data/lib/kitchen/verifier/inspec_version.rb +1 -1
- data/spec/kitchen/verifier/inspec_spec.rb +607 -0
- data/spec/spec_helper.rb +33 -0
- data/test/cookbooks/os_prepare/metadata.rb +8 -0
- data/test/cookbooks/os_prepare/recipes/default.rb +5 -0
- data/test/integration/attributes/controls/example.rb +11 -0
- data/test/integration/attributes/inspec.yml +8 -0
- data/test/integration/contains_inspec/inspec/_debug_spec.rb +1 -0
- data/test/integration/contains_inspec/inspec/os_spec.rb +7 -0
- data/test/integration/duplicates/dup.rb +13 -0
- data/test/integration/profile-attribute.yml +2 -0
- data/test/integration/profile/controls/example.rb +15 -0
- data/test/integration/profile/controls/gordon.rb +14 -0
- data/test/integration/profile/inspec.yml +10 -0
- data/test/integration/profile/libraries/gordon_config.rb +6 -0
- data/test/recipes/default/_debug_test.rb +1 -0
- data/test/recipes/default/os_test.rb +7 -0
- metadata +35 -6
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# Author:: Fletcher Nichol (<fnichol@chef.io>)
|
4
|
+
#
|
5
|
+
# Copyright (C) 2015, Chef Software Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the 'License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
|
19
|
+
if ENV["CODECLIMATE_REPO_TOKEN"]
|
20
|
+
require "codeclimate-test-reporter"
|
21
|
+
CodeClimate::TestReporter.start
|
22
|
+
elsif ENV["COVERAGE"]
|
23
|
+
require "simplecov"
|
24
|
+
SimpleCov.profiles.define "gem" do
|
25
|
+
command_name "Specs"
|
26
|
+
|
27
|
+
add_filter ".gem/"
|
28
|
+
add_filter "/spec/"
|
29
|
+
|
30
|
+
add_group "Libraries", "/lib/"
|
31
|
+
end
|
32
|
+
SimpleCov.start "gem"
|
33
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
val_user = attribute("user", default: "alice", description: "An identification for the user")
|
3
|
+
val_password = attribute("password", description: "A value for the password")
|
4
|
+
|
5
|
+
describe val_user do
|
6
|
+
it { should eq "bob" }
|
7
|
+
end
|
8
|
+
|
9
|
+
describe val_password do
|
10
|
+
it { should eq "secret" }
|
11
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
p "You are currently running on OS family: #{os[:family] || 'unknown'}, OS release: #{os[:release] || 'unknown'}"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# This is an InSpec test, that will be successful the first run. If it is
|
4
|
+
# executed the second time, the test will fail
|
5
|
+
path = "/tmp/file"
|
6
|
+
describe file(path) do
|
7
|
+
it { should_not exist }
|
8
|
+
end
|
9
|
+
|
10
|
+
# HACK: create a second file to fail tests if they run twice
|
11
|
+
describe command("mkdir -p #{path}") do
|
12
|
+
its("exit_status") { should eq 0 }
|
13
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# copyright: 2015, Chef Software, Inc.
|
3
|
+
# license: All rights reserved
|
4
|
+
|
5
|
+
title "/tmp profile"
|
6
|
+
|
7
|
+
# you add controls here
|
8
|
+
control "tmp-1.0" do # A unique ID for this control
|
9
|
+
impact 0.7 # The criticality, if this control fails.
|
10
|
+
title "Create /tmp directory" # A human-readable title
|
11
|
+
desc "An optional description..."
|
12
|
+
describe file("/tmp") do # The actual test
|
13
|
+
it { should be_directory }
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# copyright: 2015, Chef Software, Inc.
|
3
|
+
# license: All rights reserved
|
4
|
+
|
5
|
+
title "Gordon Config Checks"
|
6
|
+
|
7
|
+
control "gordon-1.0" do
|
8
|
+
impact 0.7
|
9
|
+
title "Verify the version number of Gordon"
|
10
|
+
desc "An optional description..."
|
11
|
+
describe gordon_config do
|
12
|
+
its("version") { should eq("1.0") }
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
name: profile
|
2
|
+
title: InSpec Example Profile
|
3
|
+
maintainer: Chef Software, Inc.
|
4
|
+
copyright: Chef Software, Inc.
|
5
|
+
copyright_email: support@chef.io
|
6
|
+
license: Apache 2 license
|
7
|
+
summary: Demonstrates the use of InSpec Compliance Profile
|
8
|
+
version: 1.0.0
|
9
|
+
supports:
|
10
|
+
- os-family: linux
|
@@ -0,0 +1 @@
|
|
1
|
+
p "You are currently running on OS family: #{os[:family] || 'unknown'}, OS release: #{os[:release] || 'unknown'}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-inspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.26.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Chef Software, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inspec
|
@@ -60,17 +60,46 @@ dependencies:
|
|
60
60
|
version: '3.4'
|
61
61
|
description: A Test Kitchen Verifier for InSpec
|
62
62
|
email:
|
63
|
-
-
|
63
|
+
- info@chef.io
|
64
64
|
executables: []
|
65
65
|
extensions: []
|
66
66
|
extra_rdoc_files: []
|
67
67
|
files:
|
68
|
+
- ".github/CODEOWNERS"
|
69
|
+
- ".gitignore"
|
70
|
+
- ".kitchen.yml"
|
71
|
+
- ".rspec"
|
72
|
+
- ".travis.yml"
|
73
|
+
- Berksfile
|
74
|
+
- CHANGELOG.md
|
75
|
+
- Gemfile
|
76
|
+
- Guardfile
|
68
77
|
- LICENSE
|
78
|
+
- MAINTAINERS.md
|
79
|
+
- README.md
|
80
|
+
- Rakefile
|
69
81
|
- bin/console
|
70
82
|
- bin/setup
|
83
|
+
- kitchen-inspec.gemspec
|
71
84
|
- lib/kitchen/verifier/inspec.rb
|
72
85
|
- lib/kitchen/verifier/inspec_version.rb
|
73
|
-
|
86
|
+
- spec/kitchen/verifier/inspec_spec.rb
|
87
|
+
- spec/spec_helper.rb
|
88
|
+
- test/cookbooks/os_prepare/metadata.rb
|
89
|
+
- test/cookbooks/os_prepare/recipes/default.rb
|
90
|
+
- test/integration/attributes/controls/example.rb
|
91
|
+
- test/integration/attributes/inspec.yml
|
92
|
+
- test/integration/contains_inspec/inspec/_debug_spec.rb
|
93
|
+
- test/integration/contains_inspec/inspec/os_spec.rb
|
94
|
+
- test/integration/duplicates/dup.rb
|
95
|
+
- test/integration/profile-attribute.yml
|
96
|
+
- test/integration/profile/controls/example.rb
|
97
|
+
- test/integration/profile/controls/gordon.rb
|
98
|
+
- test/integration/profile/inspec.yml
|
99
|
+
- test/integration/profile/libraries/gordon_config.rb
|
100
|
+
- test/recipes/default/_debug_test.rb
|
101
|
+
- test/recipes/default/os_test.rb
|
102
|
+
homepage: https://github.com/inspec/kitchen-inspec
|
74
103
|
licenses:
|
75
104
|
- Apache-2.0
|
76
105
|
metadata: {}
|
@@ -90,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
119
|
version: '0'
|
91
120
|
requirements: []
|
92
121
|
rubyforge_project:
|
93
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.6.13
|
94
123
|
signing_key:
|
95
124
|
specification_version: 4
|
96
125
|
summary: A Test Kitchen Verifier for InSpec
|