inspec 1.0.0 → 1.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +933 -101
- data/Gemfile +8 -17
- data/MAINTAINERS.md +2 -1
- data/MAINTAINERS.toml +9 -4
- data/README.md +49 -28
- data/Rakefile +54 -39
- data/bin/inspec +1 -1
- data/docs/dsl_inspec.md +17 -4
- data/docs/dsl_resource.md +1 -1
- data/docs/habitat.md +192 -0
- data/docs/inspec_and_friends.md +4 -2
- data/docs/matchers.md +11 -0
- data/docs/migration.md +293 -0
- data/docs/profiles.md +124 -76
- data/docs/resources/aide_conf.md.erb +81 -0
- data/docs/resources/apache_conf.md.erb +10 -10
- data/docs/resources/apt.md.erb +13 -13
- data/docs/resources/audit_policy.md.erb +10 -10
- data/docs/resources/auditd_conf.md.erb +10 -10
- data/docs/resources/auditd_rules.md.erb +11 -11
- data/docs/resources/bash.md.erb +12 -12
- data/docs/resources/bond.md.erb +15 -15
- data/docs/resources/bridge.md.erb +11 -11
- data/docs/resources/bsd_service.md.erb +11 -11
- data/docs/resources/command.md.erb +23 -23
- data/docs/resources/crontab.md.erb +84 -0
- data/docs/resources/csv.md.erb +10 -10
- data/docs/resources/dh_params.md +191 -0
- data/docs/resources/directory.md.erb +8 -8
- data/docs/resources/docker.md.erb +160 -0
- data/docs/resources/docker_container.md.erb +89 -0
- data/docs/resources/docker_image.md.erb +86 -0
- data/docs/resources/etc_group.md.erb +16 -16
- data/docs/resources/etc_hosts.md.erb +62 -0
- data/docs/resources/file.md.erb +80 -58
- data/docs/resources/gem.md.erb +32 -13
- data/docs/resources/group.md.erb +12 -12
- data/docs/resources/grub_conf.md.erb +11 -11
- data/docs/resources/host.md.erb +27 -18
- data/docs/resources/http.md.erb +104 -0
- data/docs/resources/iis_app.md.erb +126 -0
- data/docs/resources/iis_site.md.erb +17 -17
- data/docs/resources/inetd_conf.md.erb +10 -10
- data/docs/resources/ini.md.erb +9 -9
- data/docs/resources/interface.md.erb +13 -13
- data/docs/resources/iptables.md.erb +21 -14
- data/docs/resources/json.md.erb +11 -11
- data/docs/resources/kernel_module.md.erb +73 -12
- data/docs/resources/kernel_parameter.md.erb +12 -12
- data/docs/resources/key_rsa.md.erb +70 -0
- data/docs/resources/launchd_service.md.erb +11 -11
- data/docs/resources/limits_conf.md.erb +10 -10
- data/docs/resources/login_def.md.erb +12 -12
- data/docs/resources/mount.md.erb +14 -14
- data/docs/resources/mssql_session.md.erb +62 -0
- data/docs/resources/mysql_conf.md.erb +14 -14
- data/docs/resources/mysql_session.md.erb +22 -10
- data/docs/resources/npm.md.erb +13 -13
- data/docs/resources/ntp_conf.md.erb +9 -9
- data/docs/resources/oneget.md.erb +11 -11
- data/docs/resources/oracledb_session.md.erb +53 -0
- data/docs/resources/os.md.erb +17 -17
- data/docs/resources/os_env.md.erb +12 -12
- data/docs/resources/package.md.erb +29 -16
- data/docs/resources/parse_config.md.erb +18 -18
- data/docs/resources/parse_config_file.md.erb +29 -23
- data/docs/resources/{etc_passwd.md.erb → passwd.md.erb} +17 -17
- data/docs/resources/pip.md.erb +15 -15
- data/docs/resources/port.md.erb +23 -23
- data/docs/resources/postgres_conf.md.erb +15 -13
- data/docs/resources/postgres_hba_conf.md.erb +104 -0
- data/docs/resources/postgres_ident_conf.md.erb +87 -0
- data/docs/resources/postgres_session.md.erb +28 -21
- data/docs/resources/powershell.md.erb +14 -14
- data/docs/resources/processes.md.erb +123 -0
- data/docs/resources/rabbitmq_config.md.erb +55 -0
- data/docs/resources/registry_key.md.erb +44 -21
- data/docs/resources/runit_service.md.erb +11 -11
- data/docs/resources/security_policy.md.erb +10 -10
- data/docs/resources/service.md.erb +18 -18
- data/docs/resources/{etc_shadow.md.erb → shadow.md.erb} +19 -19
- data/docs/resources/ssh_config.md.erb +13 -13
- data/docs/resources/sshd_config.md.erb +15 -15
- data/docs/resources/ssl.md.erb +13 -13
- data/docs/resources/sys_info.md.erb +10 -10
- data/docs/resources/systemd_service.md.erb +11 -11
- data/docs/resources/sysv_service.md.erb +11 -11
- data/docs/resources/upstart_service.md.erb +11 -11
- data/docs/resources/user.md.erb +20 -20
- data/docs/resources/users.md.erb +19 -19
- data/docs/resources/vbscript.md.erb +13 -13
- data/docs/resources/virtualization.md.erb +71 -0
- data/docs/resources/windows_feature.md.erb +10 -10
- data/docs/resources/windows_task.md.erb +103 -0
- data/docs/resources/wmi.md.erb +10 -10
- data/docs/resources/x509_certificate.md.erb +146 -0
- data/docs/resources/xinetd_conf.md.erb +17 -17
- data/docs/resources/xml.md.erb +75 -0
- data/docs/resources/yaml.md.erb +25 -11
- data/docs/resources/yum.md.erb +24 -16
- data/docs/resources/zfs_dataset.md.erb +63 -0
- data/docs/resources/zfs_pool.md.erb +57 -0
- data/docs/ruby_usage.md +50 -0
- data/docs/shared/matcher_cmp.md.erb +4 -6
- data/examples/inheritance/README.md +49 -3
- data/examples/inheritance/controls/example.rb +4 -1
- data/examples/inheritance/inspec.yml +3 -1
- data/examples/meta-profile/README.md +29 -3
- data/examples/meta-profile/controls/example.rb +10 -5
- data/examples/meta-profile/inspec.yml +4 -8
- data/examples/profile/README.md +1 -1
- data/examples/profile/controls/example.rb +0 -1
- data/examples/profile/controls/gordon.rb +0 -1
- data/examples/profile/inspec.yml +1 -1
- data/examples/profile-attribute/inspec.yml +1 -1
- data/examples/profile-sensitive/README.md +29 -0
- data/examples/profile-sensitive/controls/sensitive-failures.rb +9 -0
- data/examples/profile-sensitive/controls/sensitive.rb +9 -0
- data/examples/profile-sensitive/inspec.yml +8 -0
- data/inspec.gemspec +10 -2
- data/lib/bundles/inspec-artifact/README.md +1 -0
- data/lib/bundles/inspec-artifact/cli.rb +284 -0
- data/lib/bundles/inspec-artifact.rb +7 -0
- data/lib/bundles/inspec-compliance/README.md +44 -15
- data/lib/bundles/inspec-compliance/api.rb +135 -29
- data/lib/bundles/inspec-compliance/cli.rb +128 -21
- data/lib/bundles/inspec-compliance/configuration.rb +8 -0
- data/lib/bundles/inspec-compliance/http.rb +26 -19
- data/lib/bundles/inspec-compliance/target.rb +50 -25
- data/lib/bundles/inspec-habitat/cli.rb +31 -0
- data/lib/bundles/inspec-habitat/log.rb +10 -0
- data/lib/bundles/inspec-habitat/profile.rb +372 -0
- data/lib/bundles/inspec-habitat.rb +12 -0
- data/lib/bundles/inspec-init/templates/profile/controls/example.rb +0 -1
- data/lib/bundles/inspec-init/templates/profile/inspec.yml +1 -1
- data/lib/bundles/inspec-supermarket/api.rb +7 -5
- data/lib/bundles/inspec-supermarket/cli.rb +2 -2
- data/lib/fetchers/git.rb +4 -2
- data/lib/fetchers/local.rb +4 -1
- data/lib/fetchers/url.rb +64 -10
- data/lib/inspec/archive/tar.rb +1 -1
- data/lib/inspec/backend.rb +26 -3
- data/lib/inspec/base_cli.rb +44 -7
- data/lib/inspec/cached_fetcher.rb +2 -2
- data/lib/inspec/cli.rb +34 -12
- data/lib/inspec/completions/fish.sh.erb +34 -0
- data/lib/inspec/control_eval_context.rb +0 -2
- data/lib/inspec/dependencies/cache.rb +0 -1
- data/lib/inspec/dependencies/dependency_set.rb +2 -2
- data/lib/inspec/dependencies/lockfile.rb +13 -6
- data/lib/inspec/dependencies/requirement.rb +6 -6
- data/lib/inspec/dependencies/resolver.rb +4 -4
- data/lib/inspec/dsl.rb +3 -5
- data/lib/inspec/env_printer.rb +9 -1
- data/lib/inspec/exceptions.rb +8 -0
- data/lib/inspec/fetcher.rb +1 -1
- data/lib/inspec/file_provider.rb +47 -11
- data/lib/inspec/library_eval_context.rb +1 -1
- data/lib/inspec/metadata.rb +62 -18
- data/lib/inspec/method_source.rb +24 -0
- data/lib/inspec/objects/attribute.rb +21 -0
- data/lib/inspec/objects/control.rb +21 -3
- data/lib/inspec/objects/each_loop.rb +2 -1
- data/lib/inspec/objects/list.rb +1 -1
- data/lib/inspec/objects/or_test.rb +17 -2
- data/lib/inspec/objects/tag.rb +27 -0
- data/lib/inspec/objects/test.rb +9 -8
- data/lib/inspec/objects.rb +1 -0
- data/lib/inspec/plugins/fetcher.rb +4 -5
- data/lib/inspec/plugins/resource.rb +1 -2
- data/lib/inspec/plugins/source_reader.rb +3 -3
- data/lib/inspec/plugins.rb +1 -1
- data/lib/inspec/polyfill.rb +0 -1
- data/lib/inspec/profile.rb +92 -23
- data/lib/inspec/profile_context.rb +1 -1
- data/lib/inspec/profile_vendor.rb +66 -0
- data/lib/inspec/resource.rb +29 -3
- data/lib/inspec/rspec_json_formatter.rb +672 -285
- data/lib/inspec/rule.rb +12 -16
- data/lib/inspec/runner.rb +26 -15
- data/lib/inspec/runner_rspec.rb +1 -0
- data/lib/inspec/runtime_profile.rb +26 -0
- data/lib/inspec/schema.rb +185 -0
- data/lib/inspec/secrets/yaml.rb +8 -1
- data/lib/inspec/secrets.rb +1 -1
- data/lib/inspec/shell.rb +92 -22
- data/lib/inspec/source_reader.rb +1 -1
- data/lib/inspec/version.rb +1 -1
- data/lib/inspec.rb +1 -1
- data/lib/matchers/matchers.rb +67 -17
- data/lib/resources/aide_conf.rb +162 -0
- data/lib/resources/apache.rb +0 -1
- data/lib/resources/apache_conf.rb +3 -3
- data/lib/resources/apt.rb +2 -1
- data/lib/resources/audit_policy.rb +0 -1
- data/lib/resources/auditd_conf.rb +1 -2
- data/lib/resources/auditd_rules.rb +5 -5
- data/lib/resources/bond.rb +1 -1
- data/lib/resources/bridge.rb +1 -1
- data/lib/resources/command.rb +5 -3
- data/lib/resources/crontab.rb +102 -0
- data/lib/resources/csv.rb +18 -1
- data/lib/resources/dh_params.rb +84 -0
- data/lib/resources/directory.rb +7 -3
- data/lib/resources/docker.rb +198 -0
- data/lib/resources/docker_container.rb +114 -0
- data/lib/resources/docker_image.rb +96 -0
- data/lib/resources/etc_group.rb +2 -3
- data/lib/resources/etc_hosts.rb +81 -0
- data/lib/resources/file.rb +88 -30
- data/lib/resources/gem.rb +26 -6
- data/lib/resources/groups.rb +4 -5
- data/lib/resources/grub_conf.rb +3 -4
- data/lib/resources/host.rb +175 -35
- data/lib/resources/http.rb +73 -0
- data/lib/resources/iis_app.rb +103 -0
- data/lib/resources/iis_site.rb +23 -0
- data/lib/resources/inetd_conf.rb +9 -4
- data/lib/resources/interface.rb +4 -3
- data/lib/resources/json.rb +37 -14
- data/lib/resources/kernel_module.rb +77 -10
- data/lib/resources/kernel_parameter.rb +0 -1
- data/lib/resources/key_rsa.rb +67 -0
- data/lib/resources/limits_conf.rb +3 -4
- data/lib/resources/login_def.rb +2 -3
- data/lib/resources/mount.rb +34 -4
- data/lib/resources/mssql_session.rb +81 -12
- data/lib/resources/mysql.rb +0 -1
- data/lib/resources/mysql_conf.rb +1 -2
- data/lib/resources/mysql_session.rb +18 -7
- data/lib/resources/nginx_conf.rb +95 -0
- data/lib/resources/ntp_conf.rb +2 -3
- data/lib/resources/oracledb_session.rb +138 -0
- data/lib/resources/os_env.rb +7 -5
- data/lib/resources/package.rb +70 -13
- data/lib/resources/packages.rb +111 -0
- data/lib/resources/parse_config.rb +3 -4
- data/lib/resources/passwd.rb +4 -5
- data/lib/resources/pip.rb +29 -21
- data/lib/resources/port.rb +133 -14
- data/lib/resources/postgres.rb +53 -43
- data/lib/resources/postgres_conf.rb +40 -13
- data/lib/resources/postgres_hba_conf.rb +101 -0
- data/lib/resources/postgres_ident_conf.rb +79 -0
- data/lib/resources/postgres_session.rb +28 -20
- data/lib/resources/powershell.rb +2 -2
- data/lib/resources/processes.rb +61 -26
- data/lib/resources/rabbitmq_conf.rb +53 -0
- data/lib/resources/registry_key.rb +34 -11
- data/lib/resources/security_policy.rb +2 -2
- data/lib/resources/service.rb +17 -7
- data/lib/resources/ssh_conf.rb +17 -6
- data/lib/resources/ssl.rb +3 -4
- data/lib/resources/sys_info.rb +1 -1
- data/lib/resources/toml.rb +26 -0
- data/lib/resources/users.rb +41 -41
- data/lib/resources/virtualization.rb +252 -0
- data/lib/resources/windows_task.rb +106 -0
- data/lib/resources/x509_certificate.rb +143 -0
- data/lib/resources/xinetd.rb +18 -2
- data/lib/resources/xml.rb +27 -0
- data/lib/resources/yaml.rb +10 -2
- data/lib/resources/yum.rb +25 -7
- data/lib/resources/zfs_dataset.rb +60 -0
- data/lib/resources/zfs_pool.rb +49 -0
- data/lib/source_readers/flat.rb +2 -1
- data/lib/source_readers/inspec.rb +30 -11
- data/lib/utils/command_wrapper.rb +3 -3
- data/lib/utils/database_helpers.rb +77 -0
- data/lib/utils/erlang_parser.rb +192 -0
- data/lib/utils/filter.rb +2 -1
- data/lib/utils/filter_array.rb +0 -1
- data/lib/utils/find_files.rb +1 -2
- data/lib/utils/latest_version.rb +21 -0
- data/lib/utils/nginx_parser.rb +76 -0
- data/lib/utils/object_traversal.rb +5 -4
- data/lib/utils/parser.rb +23 -4
- data/lib/utils/plugin_registry.rb +3 -3
- data/lib/utils/simpleconfig.rb +25 -8
- data/lib/utils/spdx.rb +13 -0
- data/lib/utils/spdx.txt +344 -0
- metadata +168 -22
- data/docs/cli.md +0 -342
- data/docs/resources/process.md.erb +0 -73
- /data/docs/{plugin_kitchen_inspec.html.md → plugin_kitchen_inspec.md} +0 -0
data/Gemfile
CHANGED
|
@@ -2,13 +2,6 @@
|
|
|
2
2
|
source 'https://rubygems.org'
|
|
3
3
|
gemspec
|
|
4
4
|
|
|
5
|
-
# pin dependency for Ruby 1.9.3 since bundler is not
|
|
6
|
-
# detecting that net-ssh 3 does not work with 1.9.3
|
|
7
|
-
if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('1.9.3')
|
|
8
|
-
gem 'net-ssh', '~> 2.9'
|
|
9
|
-
gem 'tins', '~> 1.6.0'
|
|
10
|
-
end
|
|
11
|
-
|
|
12
5
|
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.2.2')
|
|
13
6
|
gem 'json', '~> 1.8'
|
|
14
7
|
gem 'rack', '< 2.0'
|
|
@@ -20,13 +13,14 @@ group :test do
|
|
|
20
13
|
gem 'bundler', '~> 1.5'
|
|
21
14
|
gem 'minitest', '~> 5.5'
|
|
22
15
|
gem 'rake', '~> 10'
|
|
23
|
-
gem 'rubocop', '
|
|
16
|
+
gem 'rubocop', '= 0.39.0'
|
|
24
17
|
gem 'simplecov', '~> 0.10'
|
|
25
18
|
gem 'concurrent-ruby', '~> 0.9'
|
|
26
19
|
gem 'mocha', '~> 1.1'
|
|
27
20
|
gem 'ruby-progressbar', '~> 1.8'
|
|
28
|
-
gem '
|
|
29
|
-
gem '
|
|
21
|
+
gem 'webmock', '~> 2.3.2'
|
|
22
|
+
gem 'jsonschema', '~> 2.0.2'
|
|
23
|
+
gem 'm'
|
|
30
24
|
end
|
|
31
25
|
|
|
32
26
|
group :integration do
|
|
@@ -39,17 +33,10 @@ group :integration do
|
|
|
39
33
|
gem 'kitchen-dokken'
|
|
40
34
|
end
|
|
41
35
|
|
|
42
|
-
group :simulator do
|
|
43
|
-
gem 'github-markup'
|
|
44
|
-
gem 'redcarpet'
|
|
45
|
-
gem 'docker-api'
|
|
46
|
-
end
|
|
47
|
-
|
|
48
36
|
group :tools do
|
|
49
37
|
gem 'pry', '~> 0.10'
|
|
50
38
|
gem 'rb-readline'
|
|
51
39
|
gem 'license_finder'
|
|
52
|
-
gem 'github_changelog_generator', '~> 1'
|
|
53
40
|
end
|
|
54
41
|
|
|
55
42
|
# gems for Maintainers.md generation
|
|
@@ -60,3 +47,7 @@ group :maintenance do
|
|
|
60
47
|
gem 'octokit'
|
|
61
48
|
gem 'netrc'
|
|
62
49
|
end
|
|
50
|
+
|
|
51
|
+
group :deploy do
|
|
52
|
+
gem 'inquirer'
|
|
53
|
+
end
|
data/MAINTAINERS.md
CHANGED
data/MAINTAINERS.toml
CHANGED
|
@@ -25,7 +25,8 @@ project lead.
|
|
|
25
25
|
|
|
26
26
|
maintainers = [
|
|
27
27
|
"chris-rock",
|
|
28
|
-
"
|
|
28
|
+
"adamleff",
|
|
29
|
+
"alexpop"
|
|
29
30
|
]
|
|
30
31
|
|
|
31
32
|
[people]
|
|
@@ -37,6 +38,10 @@ project lead.
|
|
|
37
38
|
Name = "Christoph Hartmann"
|
|
38
39
|
GitHub = "chris-rock"
|
|
39
40
|
|
|
40
|
-
[people.
|
|
41
|
-
Name = "
|
|
42
|
-
GitHub = "
|
|
41
|
+
[people.adamleff]
|
|
42
|
+
Name = "Adam Leff"
|
|
43
|
+
GitHub = "adamleff"
|
|
44
|
+
|
|
45
|
+
[people.alexpop]
|
|
46
|
+
Name = "Alex Pop"
|
|
47
|
+
GitHub = "alexpop"
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# InSpec: Inspect Your Infrastructure
|
|
2
2
|
|
|
3
|
-
[](https://community-slack.chef.io/)
|
|
4
4
|
[](https://travis-ci.org/chef/inspec)
|
|
5
5
|
[](https://ci.appveyor.com/project/Chef/inspec/branch/master)
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ describe inetd_conf do
|
|
|
18
18
|
end
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
InSpec makes it easy to run your tests wherever you need. More options are found in our [CLI docs](
|
|
21
|
+
InSpec makes it easy to run your tests wherever you need. More options are found in our [CLI docs](https://www.inspec.io/docs/reference/cli/).
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
24
|
# run test locally
|
|
@@ -27,6 +27,9 @@ inspec exec test.rb
|
|
|
27
27
|
# run test on remote host on SSH
|
|
28
28
|
inspec exec test.rb -t ssh://user@hostname -i /path/to/key
|
|
29
29
|
|
|
30
|
+
# run test on remote host using SSH agent private key authentication. Requires InSpec 1.7.1
|
|
31
|
+
inspec exec test.rb -t ssh://user@hostname
|
|
32
|
+
|
|
30
33
|
# run test on remote windows host on WinRM
|
|
31
34
|
inspec exec test.rb -t winrm://Administrator@windowshost --password 'your-password'
|
|
32
35
|
|
|
@@ -45,6 +48,18 @@ inspec exec test.rb -t docker://container_id
|
|
|
45
48
|
|
|
46
49
|
InSpec requires Ruby ( >1.9 ).
|
|
47
50
|
|
|
51
|
+
### Install as package
|
|
52
|
+
|
|
53
|
+
The InSpec package is available for MacOS, RedHat, Ubuntu and Windows. Download the latest package at [InSpec Downloads](https://downloads.chef.io/inspec) or install InSpec via script:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
# RedHat, Ubuntu, and macOS
|
|
57
|
+
curl https://omnitruck.chef.io/install.sh | sudo bash -s -- -P inspec
|
|
58
|
+
|
|
59
|
+
# Windows
|
|
60
|
+
. { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; install -project inspec
|
|
61
|
+
```
|
|
62
|
+
|
|
48
63
|
### Install it via rubygems.org
|
|
49
64
|
|
|
50
65
|
When installing from source, gem dependencies may require ruby build tools to be installed.
|
|
@@ -110,6 +125,19 @@ gem install inspec-*.gem
|
|
|
110
125
|
|
|
111
126
|
On Windows, you need to install [Ruby](http://rubyinstaller.org/downloads/) with [Ruby Development Kit](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit) to build dependencies with its native extensions.
|
|
112
127
|
|
|
128
|
+
### Install via Habitat
|
|
129
|
+
|
|
130
|
+
Currently, this method of installation only supports Linux. See the [Habitat site](https://www.habitat.sh/) for more information.
|
|
131
|
+
|
|
132
|
+
Download the `hab` binary from the [Habitat](https://www.habitat.sh/docs/get-habitat/) site.
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
hab pkg install chef/inspec
|
|
136
|
+
export PATH="$(hab pkg path core/ruby)/bin:$(hab pkg path chef/inspec)/bin:$PATH"
|
|
137
|
+
|
|
138
|
+
inspec
|
|
139
|
+
```
|
|
140
|
+
|
|
113
141
|
### Run InSpec
|
|
114
142
|
|
|
115
143
|
You should now be able to run:
|
|
@@ -156,11 +184,12 @@ describe sshd_config do
|
|
|
156
184
|
end
|
|
157
185
|
```
|
|
158
186
|
|
|
159
|
-
* Test your `kitchen.yml` file to verify that only Vagrant is configured as the driver.
|
|
187
|
+
* Test your `kitchen.yml` file to verify that only Vagrant is configured as the driver. The %w() formatting will
|
|
188
|
+
pass rubocop lintng and allow you to access nested mappings.
|
|
160
189
|
|
|
161
190
|
```ruby
|
|
162
191
|
describe yaml('.kitchen.yml') do
|
|
163
|
-
its(
|
|
192
|
+
its(%w(driver name)) { should eq('vagrant') }
|
|
164
193
|
end
|
|
165
194
|
```
|
|
166
195
|
|
|
@@ -210,6 +239,9 @@ inspec exec test.rb -t docker://container_id
|
|
|
210
239
|
|
|
211
240
|
# run with sudo
|
|
212
241
|
inspec exec test.rb --sudo [--sudo-password ...] [--sudo-options ...] [--sudo_command ...]
|
|
242
|
+
|
|
243
|
+
# run in a subshell
|
|
244
|
+
inspec exec test.rb --shell [--shell-options ...] [--shell-command ...]
|
|
213
245
|
```
|
|
214
246
|
|
|
215
247
|
### detect
|
|
@@ -232,7 +264,7 @@ Which will provide you with:
|
|
|
232
264
|
Remote Targets
|
|
233
265
|
|
|
234
266
|
Platform | Versions | Architectures
|
|
235
|
-
|
|
267
|
+
--- | --- | ---
|
|
236
268
|
AIX | 6.1, 7.1, 7.2 | ppc64
|
|
237
269
|
CentOS | 5, 6, 7 | i386, x86_64
|
|
238
270
|
Debian | 7, 8 | i386, x86_64
|
|
@@ -241,7 +273,7 @@ Mac OS X | 10.9, 10.10, 10.11 | x86_64
|
|
|
241
273
|
Oracle Enterprise Linux | 5, 6, 7 | i386, x86_64
|
|
242
274
|
Red Hat Enterprise Linux | 5, 6, 7 | i386, x86_64
|
|
243
275
|
Solaris | 10, 11 | sparc, x86
|
|
244
|
-
Windows | 7, 8, 8.1, 2008
|
|
276
|
+
Windows | 7, 8, 8.1, 10, 2008, 2008R2 , 2012, 2012R2, 2016 | x86, x86_64
|
|
245
277
|
Ubuntu Linux | | x86, x86_64
|
|
246
278
|
SUSE Linux Enterprise Server | 11, 12 | x86_64
|
|
247
279
|
Scientific Linux | 5.x, 6.x and 7.x | i386, x86_64
|
|
@@ -252,12 +284,12 @@ Gentoo Linux | | x86_64
|
|
|
252
284
|
Arch Linux | | x86_64
|
|
253
285
|
HP-UX | 11.31 | ia64
|
|
254
286
|
|
|
255
|
-
*
|
|
287
|
+
*For Windows, PowerShell 3.0 or above is required.*
|
|
256
288
|
|
|
257
289
|
In addition, runtime support is provided for:
|
|
258
290
|
|
|
259
291
|
Platform | Versions
|
|
260
|
-
---- |
|
|
292
|
+
---- | ----
|
|
261
293
|
Debian | 8
|
|
262
294
|
RHEL | 6, 7
|
|
263
295
|
Ubuntu | 12.04+
|
|
@@ -268,28 +300,17 @@ Windows | 2012+
|
|
|
268
300
|
|
|
269
301
|
Documentation
|
|
270
302
|
|
|
303
|
+
* https://www.inspec.io/docs/
|
|
304
|
+
* https://www.inspec.io/docs/reference/resources/
|
|
271
305
|
* https://github.com/chef/inspec/tree/master/docs
|
|
272
306
|
|
|
273
|
-
Blogs:
|
|
274
|
-
|
|
275
|
-
*
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
*
|
|
280
|
-
* [InSpec Tutorial: Day 4 - Custom Matchers](http://www.anniehedgie.com/inspec-basics-4)
|
|
281
|
-
* [InSpec Tutorial: Day 5 - Creating a Profile](http://www.anniehedgie.com/inspec-basics-5)
|
|
282
|
-
* [InSpec Tutorial: Day 6 - Ways to Run It and Places to Store It](http://www.anniehedgie.com/inspec-basics-6)
|
|
283
|
-
* [InSpec Tutorial: Day 7 - How to Inherit a Profile from Chef Compliance Server](http://www.anniehedgie.com/inspec-basics-7)
|
|
284
|
-
* [Windows infrastructure testing using InSpec – Part I](http://datatomix.com/?p=236)
|
|
285
|
-
* [Windows infrastructure testing using InSpec and Profiles – Part II](http://datatomix.com/?p=238)
|
|
286
|
-
* [Testing Ansible with Inspec](http://scienceofficersblog.blogspot.de/2016/02/testing-ansible-with-inspec.html)
|
|
287
|
-
* [Operating Chef/InSpec in an air gapped environment](https://github.com/jeremymv2/chef-intranet-scaffolding/blob/master/README.md)
|
|
288
|
-
|
|
289
|
-
Podcasts:
|
|
290
|
-
|
|
291
|
-
* [InSpec Foodfight](http://foodfightshow.org/2016/02/inspec.html)
|
|
292
|
-
* [Test Driven Infrastructure With Arthur Maltson And Michael Goetz](https://www.arresteddevops.com/tdi/)
|
|
307
|
+
Tutorials/Blogs/Podcasts:
|
|
308
|
+
|
|
309
|
+
* https://www.inspec.io/tutorials/
|
|
310
|
+
|
|
311
|
+
Relationship to other tools (RSpec, Serverspec):
|
|
312
|
+
|
|
313
|
+
* https://www.inspec.io/docs/reference/inspec_and_friends/
|
|
293
314
|
|
|
294
315
|
## Share your Profiles
|
|
295
316
|
|
data/Rakefile
CHANGED
|
@@ -4,21 +4,28 @@
|
|
|
4
4
|
require 'bundler'
|
|
5
5
|
require 'bundler/gem_tasks'
|
|
6
6
|
require 'rake/testtask'
|
|
7
|
-
require 'rubocop/rake_task'
|
|
8
|
-
require_relative 'tasks/docs'
|
|
9
7
|
require_relative 'tasks/maintainers'
|
|
10
|
-
require_relative 'tasks/
|
|
8
|
+
require_relative 'tasks/spdx'
|
|
9
|
+
|
|
10
|
+
# The docs tasks rely on ruby-progressbar. If we can't load it, then don't
|
|
11
|
+
# load the docs tasks. This is necessary to allow this Rakefile to work
|
|
12
|
+
# when the "tests" gem group in the Gemfile has been excluded, such as
|
|
13
|
+
# during an appbundle-updater run.
|
|
14
|
+
begin
|
|
15
|
+
require 'ruby-progressbar'
|
|
16
|
+
require_relative 'tasks/docs'
|
|
17
|
+
rescue LoadError
|
|
18
|
+
puts 'docs tasks are unavailable because the ruby-progressbar gem is not available.'
|
|
19
|
+
end
|
|
11
20
|
|
|
12
21
|
# Rubocop
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
RuboCop::RakeTask.new
|
|
22
|
+
begin
|
|
23
|
+
require 'rubocop/rake_task'
|
|
24
|
+
RuboCop::RakeTask.new(:lint)
|
|
25
|
+
rescue LoadError
|
|
26
|
+
puts 'rubocop is not available. Install the rubocop gem to run the lint tests.'
|
|
16
27
|
end
|
|
17
28
|
|
|
18
|
-
# lint the project
|
|
19
|
-
desc 'Run robocop linter'
|
|
20
|
-
task lint: [:rubocop]
|
|
21
|
-
|
|
22
29
|
# update command output for demo
|
|
23
30
|
desc 'Run inspec commands and save results to www/app/responses'
|
|
24
31
|
task :update_demo do
|
|
@@ -27,7 +34,7 @@ task :update_demo do
|
|
|
27
34
|
end
|
|
28
35
|
|
|
29
36
|
# run tests
|
|
30
|
-
task default: [:
|
|
37
|
+
task default: [:lint, :test]
|
|
31
38
|
|
|
32
39
|
Rake::TestTask.new do |t|
|
|
33
40
|
t.libs << 'test'
|
|
@@ -122,14 +129,6 @@ end
|
|
|
122
129
|
# Check the requirements for running an update of this repository.
|
|
123
130
|
def check_update_requirements
|
|
124
131
|
require_command 'git'
|
|
125
|
-
require_command 'github_changelog_generator', "\n"\
|
|
126
|
-
"For more information on how to install it see:\n"\
|
|
127
|
-
" https://github.com/skywinder/github-changelog-generator\n"
|
|
128
|
-
require_env 'CHANGELOG_GITHUB_TOKEN', "\n"\
|
|
129
|
-
"Please configure this token to make sure you can run all commands\n"\
|
|
130
|
-
"against GitHub.\n\n"\
|
|
131
|
-
"See github_changelog_generator homepage for more information:\n"\
|
|
132
|
-
" https://github.com/skywinder/github-changelog-generator\n"
|
|
133
132
|
end
|
|
134
133
|
|
|
135
134
|
# Show the current version of this gem.
|
|
@@ -138,32 +137,48 @@ task :version do
|
|
|
138
137
|
inspec_version
|
|
139
138
|
end
|
|
140
139
|
|
|
141
|
-
desc 'Generate the changelog'
|
|
142
|
-
task :changelog do
|
|
143
|
-
require_relative 'lib/inspec/version'
|
|
144
|
-
system "github_changelog_generator -u chef -p inspec --future-release #{Inspec::VERSION} --since-tag 0.7.0"
|
|
145
|
-
end
|
|
146
|
-
|
|
147
|
-
# Update the version of this gem and create an updated
|
|
148
|
-
# changelog. It covers everything short of actually releasing
|
|
149
|
-
# the gem.
|
|
150
|
-
desc 'Bump the version of this gem'
|
|
151
|
-
task :bump_version, [:version] do |_, args|
|
|
152
|
-
v = args[:version] || ENV['to']
|
|
153
|
-
fail "You must specify a target version! rake bump_version to=1.2.3" if v.empty?
|
|
154
|
-
check_update_requirements
|
|
155
|
-
inspec_version(v)
|
|
156
|
-
Rake::Task['changelog'].invoke
|
|
157
|
-
Rake::Task['docs:cli'].invoke
|
|
158
|
-
end
|
|
159
|
-
|
|
160
140
|
desc 'Release a new docker image'
|
|
161
141
|
task :release_docker do
|
|
162
142
|
version = Inspec::VERSION
|
|
163
143
|
cmd = "rm *.gem; gem build *gemspec && "\
|
|
164
144
|
"mv *.gem inspec.gem && "\
|
|
165
145
|
"docker build -t chef/inspec:#{version} . && "\
|
|
166
|
-
"docker push chef/inspec:#{version}"
|
|
146
|
+
"docker push chef/inspec:#{version} && "\
|
|
147
|
+
"docker tag chef/inspec:#{version} chef/inspec:latest &&"\
|
|
148
|
+
"docker push chef/inspec:latest"
|
|
167
149
|
puts "--> #{cmd}"
|
|
168
150
|
sh('sh', '-c', cmd)
|
|
169
151
|
end
|
|
152
|
+
|
|
153
|
+
desc 'Release a new Habitat package'
|
|
154
|
+
task :release_habitat do
|
|
155
|
+
version = Inspec::VERSION
|
|
156
|
+
ENV['HAB_ORIGIN'] = "chef"
|
|
157
|
+
if Dir.exist?("./results") then
|
|
158
|
+
raise "Please remove the ./results directory"
|
|
159
|
+
end
|
|
160
|
+
if ! ENV.has_key?("HAB_AUTH_TOKEN") then
|
|
161
|
+
raise "Please set the HAB_AUTH_TOKEN environment variable"
|
|
162
|
+
end
|
|
163
|
+
cmd = "echo #{version} > ./habitat/VERSION && "\
|
|
164
|
+
"hab pkg build . && " \
|
|
165
|
+
"hab pkg upload ./results/*.hart --channel stable"
|
|
166
|
+
puts "--> #{cmd}"
|
|
167
|
+
sh('sh', '-c', cmd)
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
desc 'Release the website [deprecated]'
|
|
171
|
+
task :www do
|
|
172
|
+
puts 'The Rake tasks for releasing the website are now in the www/ directory.'
|
|
173
|
+
puts 'Run `cd www` and then `rake --tasks` for a list of the www-related tasks available.'
|
|
174
|
+
exit(1)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
namespace :www do
|
|
178
|
+
desc 'Release the website [deprecated]'
|
|
179
|
+
task :release do
|
|
180
|
+
puts 'The Rake tasks for releasing the website are now in the www/ directory.'
|
|
181
|
+
puts 'Run `cd www` and then `rake --tasks` for a list of the www-related tasks available.'
|
|
182
|
+
exit(1)
|
|
183
|
+
end
|
|
184
|
+
end
|
data/bin/inspec
CHANGED
data/docs/dsl_inspec.md
CHANGED
|
@@ -44,7 +44,10 @@ where
|
|
|
44
44
|
|
|
45
45
|
* `'sshd-8'` is the name of the control
|
|
46
46
|
* `impact`, `title`, and `desc` define metadata that fully describes the importance of the control, its purpose, with a succinct and complete description
|
|
47
|
-
* `impact` is an float that measures the importance of the compliance results and must be a value between `0.0` and `1.0`.
|
|
47
|
+
* `impact` is an float that measures the importance of the compliance results and must be a value between `0.0` and `1.0`. The value ranges are:
|
|
48
|
+
* `0.0 to <0.4` these are controls with minor criticality
|
|
49
|
+
* `0.4 to <0.7` these are controls with major criticality
|
|
50
|
+
* `0.7 to 1.0` these are critical controls
|
|
48
51
|
* `tag` is optional meta-information with with key or key-value pairs
|
|
49
52
|
* `ref` is a reference to an external document
|
|
50
53
|
* `describe` is a block that contains at least one test. A `control` block must contain at least one `describe` block, but may contain as many as required
|
|
@@ -68,13 +71,23 @@ describe.one do
|
|
|
68
71
|
end
|
|
69
72
|
```
|
|
70
73
|
|
|
74
|
+
#### Sensitive resources
|
|
75
|
+
|
|
76
|
+
In some scenarios, you may be writing checks involving resources with sensitive content (e.g. a file resource). In the case of failures, it may be desired to suppress output. This can be done by adding the `:sensitive` flag to the resource definition
|
|
77
|
+
|
|
78
|
+
```ruby
|
|
79
|
+
describe file('/tmp/mysecretfile'), :sensitive do
|
|
80
|
+
its('content') { should contain 'secret_info' }
|
|
81
|
+
end
|
|
82
|
+
```
|
|
83
|
+
|
|
71
84
|
## Examples
|
|
72
85
|
|
|
73
86
|
The following examples show simple compliance tests using a single `control` block.
|
|
74
87
|
|
|
75
88
|
## Test System Event Log
|
|
76
89
|
|
|
77
|
-
The following test shows how to audit machines running Windows 2012 R2 that
|
|
90
|
+
The following test shows how to audit machines running Windows 2012 R2 that password complexity is enabled:
|
|
78
91
|
|
|
79
92
|
```ruby
|
|
80
93
|
control 'windows-account-102' do
|
|
@@ -89,7 +102,7 @@ end
|
|
|
89
102
|
|
|
90
103
|
## Are PosgtreSQL passwords empty?
|
|
91
104
|
|
|
92
|
-
The following test shows how to audit machines running
|
|
105
|
+
The following test shows how to audit machines running PostgreSQL to ensure that passwords are not empty.
|
|
93
106
|
|
|
94
107
|
```ruby
|
|
95
108
|
control 'postgres-7' do
|
|
@@ -173,7 +186,7 @@ end
|
|
|
173
186
|
|
|
174
187
|
## Test Windows Registry Keys
|
|
175
188
|
|
|
176
|
-
The following test shows how to audit machines to ensure Safe DLL
|
|
189
|
+
The following test shows how to audit machines to ensure Safe DLL Search Mode is enabled:
|
|
177
190
|
|
|
178
191
|
```ruby
|
|
179
192
|
control 'windows-base-101' do
|
data/docs/dsl_resource.md
CHANGED
|
@@ -90,4 +90,4 @@ class GordonConfig < Inspec.resource(1)
|
|
|
90
90
|
end
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
For a full example, see our [example resource](
|
|
93
|
+
For a full example, see our [example resource](https://github.com/chef/inspec/blob/master/examples/profile/libraries/gordon_config.rb).
|
data/docs/habitat.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: InSpec Integration with Habitat
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Habitat Integration
|
|
6
|
+
|
|
7
|
+
InSpec provides an easy method to create an executable Habitat package for an InSpec profile. When run via the Habitat Supervisor, the package will run InSpec with your profile and write out its findings to a JSON file. This provides the ability to ship your compliance controls alongside your Habitat-packaged application and continuously run InSpec, providing you *Continuous Compliance.*
|
|
8
|
+
|
|
9
|
+
## What is Habitat?
|
|
10
|
+
|
|
11
|
+
Habitat by Chef is our new Application Automation tool that aims to make it easy, safe, and fast to build, deploy, and manage applications. From build dependencies, runtime dependencies, dynamic configuration, and service discovery (just to name a few), Habitat packages the automation with the application instead of relying on an underlying platform.
|
|
12
|
+
|
|
13
|
+
To learn more about Habitat and try our demos and tutorials, visit [https://www.habitat.sh](https://www.habitat.sh).
|
|
14
|
+
|
|
15
|
+
## Using the Habitat Integration
|
|
16
|
+
|
|
17
|
+
After creating a Habitat package for an InSpec profile (see CLI commands below) and uploading the package to a Habitat Depot or manually distributing to a host, start the Habitat Supervisor with your package:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
hab start adamleff/inspec-profile-frontend1
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The Habitat Supervisor will install InSpec and execute your profile in a loop. By default, the loop runs every 300 seconds but can be changed via the `sleep_time` configuration value:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
HAB_INSPEC_PROFILE_FRONTEND1="sleep_time = 60" hab start adamleff/inspec-profile-frontend1
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The Habitat Supervisor will display output like this:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
hab start adamleff/inspec-profile-frontend1
|
|
33
|
+
∵ Missing package for core/hab-sup/0.17.0
|
|
34
|
+
» Installing core/hab-sup/0.17.0
|
|
35
|
+
↓ Downloading core/hab-sup/0.17.0/20170214235450
|
|
36
|
+
1.68 MB / 1.68 MB - [=========================================================================] 100.00 % 7.43 MB/s
|
|
37
|
+
|
|
38
|
+
... more Habitat output here ...
|
|
39
|
+
|
|
40
|
+
hab-sup(MN): Starting adamleff/inspec-profile-frontend1/0.1.0/20170328173005
|
|
41
|
+
hab-sup(CS): adamleff/inspec-profile-frontend1/0.1.0/20170328173005 is not installed
|
|
42
|
+
↓ Downloading adamleff-20160617201047 public origin key
|
|
43
|
+
79 B / 79 B | [===============================================================================] 100.00 % 2.64 MB/s
|
|
44
|
+
☑ Cached adamleff-20160617201047 public origin key
|
|
45
|
+
↓ Downloading chef/inspec/1.17.0/20170321214949
|
|
46
|
+
16.93 MB / 16.93 MB / [======================================================================] 100.00 % 10.49 MB/s
|
|
47
|
+
|
|
48
|
+
... more Habitat output here ...
|
|
49
|
+
|
|
50
|
+
★ Install of adamleff/inspec-profile-frontend1/0.1.0/20170328173005 complete with 9 new packages installed.
|
|
51
|
+
hab-sup(MR): Butterfly Member ID d9bd761e18c144469d755b1b97406eb2
|
|
52
|
+
hab-sup(MR): Starting butterfly on 0.0.0.0:9638
|
|
53
|
+
hab-sup(MR): Starting http-gateway on 0.0.0.0:9631
|
|
54
|
+
inspec-profile-frontend1.default(SR): Initializing
|
|
55
|
+
inspec-profile-frontend1.default(SV): Starting process as user=hab, group=hab
|
|
56
|
+
inspec-profile-frontend1.default(O): Executing InSpec for adamleff/inspec-profile-frontend1
|
|
57
|
+
inspec-profile-frontend1.default(O): InSpec run completed successfully.
|
|
58
|
+
inspec-profile-frontend1.default(O): sleeping for 300 seconds
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The above sample output shows the supervisor starting, downloading the necessary dependencies for the supervisor and the InSpec profile, and then shows the supervisor running InSpec successfully.
|
|
62
|
+
|
|
63
|
+
InSpec will write a JSON file in the `${svc_var_path}/inspec_results` directory containing the results of the last InSpec run. For example, for the `adamleff/inspec-profile-frontend1` package, the InSpec results will be at:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
/hab/svc/inspec-profile-frontend1/var/inspec_results/inspec-profile-frontend1.json
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## InSpec Habitat CLI Commands
|
|
70
|
+
|
|
71
|
+
### inspec habitat profile create
|
|
72
|
+
|
|
73
|
+
Create a Habitat package for an InSpec profile. InSpec will validate the profile, fetch and vendor any dependencies (if necessary), and build the Habitat package with a dependency on the latest InSpec. The resulting package will be saved to the current working directory.
|
|
74
|
+
|
|
75
|
+
The package file will be named:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
HABITAT_ORIGIN-inspec-profile-PROFILE_NAME-PROFILE_VERSION-BUILD_ID-x86_64-linux.hart
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
For example:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
adamleff-inspec-profile-frontend1-0.1.0-20170328173005-x86_64-linux.hart
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### Syntax
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
inspec habitat profile create PROFILE_DIRECTORY
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Example:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
inspec habitat profile create ~/profiles/frontend1
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### inspec habitat profile create
|
|
100
|
+
|
|
101
|
+
Create a Habitat package for an InSpec profile. InSpec will validate the profile, fetch and vendor any dependencies (if necessary), and build the Habitat package with a dependency on the latest InSpec. The resulting package will be saved to the current working directory.
|
|
102
|
+
|
|
103
|
+
The package can then be manually uploaded to a Habitat Depot or manually distributed to a host and installed via `hab pkg install`.
|
|
104
|
+
|
|
105
|
+
The package file will be named:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
HABITAT_ORIGIN-inspec-profile-PROFILE_NAME-PROFILE_VERSION-BUILD_ID-x86_64-linux.hart
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
For example:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
adamleff-inspec-profile-frontend1-0.1.0-20170328173005-x86_64-linux.hart
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
#### Syntax
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
inspec habitat profile create PROFILE_DIRECTORY
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### Example
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
inspec habitat profile create ~/profiles/frontend1
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
#### Example Output
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
$ habitat profile create ~/profiles/frontend1
|
|
133
|
+
[2017-03-28T13:29:32-04:00] INFO: Creating a Habitat artifact for profile: /Users/aleff/profiles/frontend1
|
|
134
|
+
[2017-03-28T13:29:32-04:00] INFO: Checking to see if Habitat is installed...
|
|
135
|
+
[2017-03-28T13:29:32-04:00] INFO: Copying profile contents to the work directory...
|
|
136
|
+
[2017-03-28T13:29:32-04:00] INFO: Generating Habitat plan at /var/folders/v5/z54gb76j2rs3wrn65hmtyf1r0000gp/T/inspec-habitat-exporter20170328-4932-kg2ltd/habitat/plan.sh...
|
|
137
|
+
[2017-03-28T13:29:32-04:00] INFO: Generating a Habitat run hook at /var/folders/v5/z54gb76j2rs3wrn65hmtyf1r0000gp/T/inspec-habitat-exporter20170328-4932-kg2ltd/habitat/hooks/run...
|
|
138
|
+
[2017-03-28T13:29:32-04:00] INFO: Generating Habitat's default.toml configuration...
|
|
139
|
+
[2017-03-28T13:29:32-04:00] INFO: Building our Habitat artifact...
|
|
140
|
+
hab-studio: Destroying Studio at /hab/studios/src (default)
|
|
141
|
+
hab-studio: Creating Studio at /hab/studios/src (default)
|
|
142
|
+
hab-studio: Importing adamleff secret origin key
|
|
143
|
+
» Importing origin key from standard input
|
|
144
|
+
★ Imported secret origin key adamleff-20160617201047.
|
|
145
|
+
» Installing core/hab-backline
|
|
146
|
+
↓ Downloading core/hab-backline/0.19.0/20170311034116
|
|
147
|
+
2.17 KB / 2.17 KB / [=========================================================================] 100.00 % 4.33 MB/s
|
|
148
|
+
|
|
149
|
+
... more Habitat output here...
|
|
150
|
+
|
|
151
|
+
[2017-03-28T13:30:18-04:00] INFO: Copying artifact to /Users/aleff...
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### inspec habitat profile upload
|
|
155
|
+
|
|
156
|
+
Create and then upload a Habitat package for an InSpec profile. Like the `inspec habitat profile create` command, InSpec will validate the profile, fetch and vendor any dependencies (if necessary), and build the Habitat package with a dependency on the latest InSpec. However, instead of saving the package locally to the workstation, InSpec will upload it to the depot defined in the `HAB_DEPOT` environment variable. If `HAB_DEPOT` is not defined, the package will be uploaded to the public Habitat depot at [https://app.habitat.sh](https://app.habitat.sh).
|
|
157
|
+
|
|
158
|
+
#### Syntax
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
inspec habitat profile upload PROFILE_DIRECTORY
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
#### Example
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
inspec habitat profile upload ~/profiles/frontend1
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
#### Example Output
|
|
171
|
+
```
|
|
172
|
+
[2017-03-28T13:29:32-04:00] INFO: Creating a Habitat artifact for profile: /Users/aleff/profiles/frontend1
|
|
173
|
+
[2017-03-28T13:29:32-04:00] INFO: Checking to see if Habitat is installed...
|
|
174
|
+
[2017-03-28T13:29:32-04:00] INFO: Copying profile contents to the work directory...
|
|
175
|
+
[2017-03-28T13:29:32-04:00] INFO: Generating Habitat plan at /var/folders/v5/z54gb76j2rs3wrn65hmtyf1r0000gp/T/inspec-habitat-exporter20170328-4932-kg2ltd/habitat/plan.sh...
|
|
176
|
+
[2017-03-28T13:29:32-04:00] INFO: Generating a Habitat run hook at /var/folders/v5/z54gb76j2rs3wrn65hmtyf1r0000gp/T/inspec-habitat-exporter20170328-4932-kg2ltd/habitat/hooks/run...
|
|
177
|
+
[2017-03-28T13:29:32-04:00] INFO: Generating Habitat's default.toml configuration...
|
|
178
|
+
[2017-03-28T13:29:32-04:00] INFO: Building our Habitat artifact...
|
|
179
|
+
hab-studio: Destroying Studio at /hab/studios/src (default)
|
|
180
|
+
hab-studio: Creating Studio at /hab/studios/src (default)
|
|
181
|
+
hab-studio: Importing adamleff secret origin key
|
|
182
|
+
» Importing origin key from standard input
|
|
183
|
+
★ Imported secret origin key adamleff-20160617201047.
|
|
184
|
+
» Installing core/hab-backline
|
|
185
|
+
↓ Downloading core/hab-backline/0.19.0/20170311034116
|
|
186
|
+
2.17 KB / 2.17 KB / [=========================================================================] 100.00 % 4.33 MB/s
|
|
187
|
+
|
|
188
|
+
... more Habitat output here...
|
|
189
|
+
|
|
190
|
+
[2017-03-28T13:30:18-04:00] INFO: Uploading the Habitat artifact to our Depot...
|
|
191
|
+
[2017-03-28T13:30:23-04:00] INFO: Upload complete!
|
|
192
|
+
```
|
data/docs/inspec_and_friends.md
CHANGED
|
@@ -42,7 +42,7 @@ end
|
|
|
42
42
|
|
|
43
43
|
## Serverspec
|
|
44
44
|
|
|
45
|
-
Serverspec
|
|
45
|
+
Serverspec is the first extension of RSpec that enabled
|
|
46
46
|
users to run RSpec tests on servers to verify deployed artifacts. It was
|
|
47
47
|
created in March 2013 by Gosuke Miyashita and has been widely adopted.
|
|
48
48
|
It is also one of the core test frameworks within test-kitchen and has
|
|
@@ -60,7 +60,9 @@ Lessons learned from Serverspec include:
|
|
|
60
60
|
* Support for Windows is a first-class requirement.
|
|
61
61
|
* A command line interface (CLI) is required for faster iteration of test code.
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
You can also watch this [podcast](http://foodfightshow.org/2016/02/inspec.html) to find out more on the relationship of InSpec and Serverspec.
|
|
64
|
+
|
|
65
|
+
### How is InSpec different from Serverspec
|
|
64
66
|
|
|
65
67
|
One of the key differences is that InSpec targets more user groups. It
|
|
66
68
|
is optimized for DevOps, Security, and Compliance professionals.
|