inspec 0.30.0 → 0.31.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +50 -2
- data/Gemfile +2 -1
- data/docs/cli.rst +1 -17
- data/docs/resources.rst +128 -0
- data/docs/shell.rst +130 -0
- data/inspec.gemspec +3 -4
- data/lib/bundles/inspec-compliance/.kitchen.yml +0 -1
- data/lib/bundles/inspec-compliance/README.md +8 -3
- data/lib/bundles/inspec-compliance/api.rb +21 -6
- data/lib/bundles/inspec-compliance/bootstrap.sh +13 -9
- data/lib/bundles/inspec-compliance/cli.rb +23 -19
- data/lib/bundles/inspec-compliance/target.rb +1 -0
- data/lib/bundles/inspec-compliance/test/integration/default/cli.rb +42 -5
- data/lib/bundles/inspec-init/cli.rb +9 -0
- data/lib/bundles/inspec-supermarket/cli.rb +9 -0
- data/lib/bundles/inspec-supermarket/target.rb +2 -1
- data/lib/fetchers/local.rb +5 -2
- data/lib/fetchers/url.rb +1 -0
- data/lib/inspec/base_cli.rb +2 -1
- data/lib/inspec/cli.rb +14 -5
- data/lib/inspec/dependencies/dependency_set.rb +38 -0
- data/lib/inspec/dependencies/requirement.rb +103 -0
- data/lib/inspec/{dependencies.rb → dependencies/resolver.rb} +13 -132
- data/lib/inspec/dependencies/vendor_index.rb +98 -0
- data/lib/inspec/plugins/source_reader.rb +4 -0
- data/lib/inspec/profile.rb +2 -2
- data/lib/inspec/resource.rb +2 -0
- data/lib/inspec/runner.rb +13 -1
- data/lib/inspec/runner_mock.rb +4 -0
- data/lib/inspec/runner_rspec.rb +6 -2
- data/lib/inspec/shell.rb +22 -1
- data/lib/inspec/version.rb +1 -1
- data/lib/resources/iis_site.rb +107 -0
- data/lib/resources/port.rb +11 -4
- data/lib/resources/ssh_conf.rb +10 -2
- data/lib/resources/ssl.rb +94 -0
- data/lib/resources/xinetd.rb +11 -2
- data/lib/utils/parser.rb +6 -1
- metadata +17 -561
- data/lib/utils/hash_map.rb +0 -37
- data/tasks/maintainers.rb +0 -213
- data/test/bench/startup/startup.flat.txt +0 -1005
- data/test/bench/startup/startup.graph.html +0 -71958
- data/test/bench/startup/startup.grind.dat +0 -101602
- data/test/bench/startup/startup.stack.html +0 -24516
- data/test/bench/startup.flat.txt +0 -998
- data/test/bench/startup.graph.html +0 -71420
- data/test/bench/startup.grind.dat +0 -103554
- data/test/bench/startup.stack.html +0 -25015
- data/test/cookbooks/os_prepare/attributes/default.rb +0 -2
- data/test/cookbooks/os_prepare/files/empty.iso +0 -0
- data/test/cookbooks/os_prepare/files/example.csv +0 -7
- data/test/cookbooks/os_prepare/files/example.ini +0 -6
- data/test/cookbooks/os_prepare/files/example.json +0 -12
- data/test/cookbooks/os_prepare/files/example.yml +0 -7
- data/test/cookbooks/os_prepare/metadata.rb +0 -13
- data/test/cookbooks/os_prepare/recipes/_runit_service_centos.rb +0 -34
- data/test/cookbooks/os_prepare/recipes/_upstart_service_centos.rb +0 -25
- data/test/cookbooks/os_prepare/recipes/apache.rb +0 -14
- data/test/cookbooks/os_prepare/recipes/apt.rb +0 -20
- data/test/cookbooks/os_prepare/recipes/auditctl.rb +0 -8
- data/test/cookbooks/os_prepare/recipes/default.rb +0 -29
- data/test/cookbooks/os_prepare/recipes/file.rb +0 -46
- data/test/cookbooks/os_prepare/recipes/iptables.rb +0 -13
- data/test/cookbooks/os_prepare/recipes/json_yaml_csv_ini.rb +0 -34
- data/test/cookbooks/os_prepare/recipes/mount.rb +0 -33
- data/test/cookbooks/os_prepare/recipes/package.rb +0 -25
- data/test/cookbooks/os_prepare/recipes/postgres.rb +0 -20
- data/test/cookbooks/os_prepare/recipes/prep_container.rb +0 -15
- data/test/cookbooks/os_prepare/recipes/registry_key.rb +0 -87
- data/test/cookbooks/os_prepare/recipes/service.rb +0 -19
- data/test/cookbooks/os_prepare/templates/default/sv-default-svlog-run.erb +0 -2
- data/test/docker_run.rb +0 -162
- data/test/docker_test.rb +0 -58
- data/test/functional/helper.rb +0 -37
- data/test/functional/inheritance_test.rb +0 -62
- data/test/functional/inspec_archive_test.rb +0 -80
- data/test/functional/inspec_compliance_test.rb +0 -61
- data/test/functional/inspec_exec_json_test.rb +0 -122
- data/test/functional/inspec_exec_jsonmin_test.rb +0 -59
- data/test/functional/inspec_exec_test.rb +0 -123
- data/test/functional/inspec_json_profile_test.rb +0 -103
- data/test/functional/inspec_test.rb +0 -91
- data/test/helper.rb +0 -329
- data/test/integration/default/_debug_spec.rb +0 -8
- data/test/integration/default/apache_conf_spec.rb +0 -21
- data/test/integration/default/apt_spec.rb +0 -37
- data/test/integration/default/auditd_rules_spec.rb +0 -32
- data/test/integration/default/cmp_matcher_spec.rb +0 -115
- data/test/integration/default/csv_spec.rb +0 -11
- data/test/integration/default/etc_group_spec.rb +0 -29
- data/test/integration/default/file_spec.rb +0 -195
- data/test/integration/default/group_spec.rb +0 -59
- data/test/integration/default/ini_spec.rb +0 -11
- data/test/integration/default/iptables_spec.rb +0 -29
- data/test/integration/default/json_spec.rb +0 -11
- data/test/integration/default/kernel_module_spec.rb +0 -23
- data/test/integration/default/kernel_parameter_spec.rb +0 -60
- data/test/integration/default/mount_spec.rb +0 -19
- data/test/integration/default/os_spec.rb +0 -13
- data/test/integration/default/package_spec.rb +0 -30
- data/test/integration/default/port_spec.rb +0 -27
- data/test/integration/default/postgres_session_spec.rb +0 -13
- data/test/integration/default/powershell_spec.rb +0 -42
- data/test/integration/default/registry_key_spec.rb +0 -109
- data/test/integration/default/secpol_spec.rb +0 -11
- data/test/integration/default/service_spec.rb +0 -128
- data/test/integration/default/user_spec.rb +0 -96
- data/test/integration/default/vbscript_spec.rb +0 -22
- data/test/integration/default/wmi_spec.rb +0 -66
- data/test/integration/default/yaml_spec.rb +0 -11
- data/test/resource/command_test.rb +0 -33
- data/test/resource/dsl_test.rb +0 -45
- data/test/resource/file_test.rb +0 -146
- data/test/resource/ssh_config.rb +0 -9
- data/test/resource/sshd_config.rb +0 -9
- data/test/test-extra.yaml +0 -11
- data/test/test.yaml +0 -11
- data/test/unit/control_test.rb +0 -58
- data/test/unit/fetchers/local_test.rb +0 -67
- data/test/unit/fetchers/mock_test.rb +0 -43
- data/test/unit/fetchers/tar_test.rb +0 -36
- data/test/unit/fetchers/url_test.rb +0 -152
- data/test/unit/fetchers/zip_test.rb +0 -36
- data/test/unit/fetchers_test.rb +0 -65
- data/test/unit/metadata_test.rb +0 -137
- data/test/unit/mock/cmd/$env-PATH +0 -1
- data/test/unit/mock/cmd/Get-NetAdapter +0 -24
- data/test/unit/mock/cmd/GetUserAccount +0 -33
- data/test/unit/mock/cmd/GetWin32Group +0 -23
- data/test/unit/mock/cmd/Resolve-DnsName +0 -26
- data/test/unit/mock/cmd/Test-NetConnection +0 -4
- data/test/unit/mock/cmd/auditctl +0 -3
- data/test/unit/mock/cmd/auditctl-legacy +0 -7
- data/test/unit/mock/cmd/auditctl-s +0 -8
- data/test/unit/mock/cmd/auditpol +0 -2
- data/test/unit/mock/cmd/brew-info-jq +0 -1
- data/test/unit/mock/cmd/chage-l-root +0 -7
- data/test/unit/mock/cmd/dpkg-s-curl +0 -21
- data/test/unit/mock/cmd/dscl +0 -5
- data/test/unit/mock/cmd/env +0 -1
- data/test/unit/mock/cmd/etc-apt +0 -7
- data/test/unit/mock/cmd/find-apache2-conf-enabled +0 -1
- data/test/unit/mock/cmd/find-apache2-ports-conf +0 -1
- data/test/unit/mock/cmd/find-etc-rc-d-name-S +0 -12
- data/test/unit/mock/cmd/find-net-interface +0 -9
- data/test/unit/mock/cmd/find-xinetd.d +0 -2
- data/test/unit/mock/cmd/gem-list-local-a-q-rubocop +0 -1
- data/test/unit/mock/cmd/get-net-tcpconnection +0 -24
- data/test/unit/mock/cmd/get-netadapter-binding-bridge +0 -4
- data/test/unit/mock/cmd/get-package-firefox +0 -30
- data/test/unit/mock/cmd/get-package-ruby +0 -18
- data/test/unit/mock/cmd/get-service-dhcp +0 -10
- data/test/unit/mock/cmd/get-windows-feature +0 -7
- data/test/unit/mock/cmd/get-wmiobject +0 -9
- data/test/unit/mock/cmd/getent-hosts-example.com +0 -1
- data/test/unit/mock/cmd/getent-passwd-jfolmer +0 -1
- data/test/unit/mock/cmd/getent-passwd-root +0 -1
- data/test/unit/mock/cmd/hpux-netstat-inet +0 -10
- data/test/unit/mock/cmd/hpux-netstat-inet6 +0 -11
- data/test/unit/mock/cmd/id-chartmann +0 -1
- data/test/unit/mock/cmd/id-jfolmer +0 -1
- data/test/unit/mock/cmd/id-root +0 -1
- data/test/unit/mock/cmd/initctl--version +0 -5
- data/test/unit/mock/cmd/initctl-show-config-ssh +0 -3
- data/test/unit/mock/cmd/initctl-status-ssh +0 -1
- data/test/unit/mock/cmd/iptables-s +0 -6
- data/test/unit/mock/cmd/launchctl-list +0 -3
- data/test/unit/mock/cmd/logins-x +0 -4
- data/test/unit/mock/cmd/ls-1-etc-init.d +0 -2
- data/test/unit/mock/cmd/ls-sys-class-net-br +0 -2
- data/test/unit/mock/cmd/lsmod +0 -2
- data/test/unit/mock/cmd/lsof-nP-i-FpctPn +0 -63
- data/test/unit/mock/cmd/mount +0 -1
- data/test/unit/mock/cmd/mount-multiple +0 -2
- data/test/unit/mock/cmd/netstat-an.utf8 +0 -13
- data/test/unit/mock/cmd/netstat-tulpen +0 -6
- data/test/unit/mock/cmd/npm-ls-g--json-bower +0 -9
- data/test/unit/mock/cmd/pacman-qi-curl +0 -21
- data/test/unit/mock/cmd/ping-example.com +0 -6
- data/test/unit/mock/cmd/pip-show-jinja2 +0 -11
- data/test/unit/mock/cmd/pkg-info-system-file-system-zfs +0 -8
- data/test/unit/mock/cmd/pkginfo-l-SUNWzfsr +0 -7
- data/test/unit/mock/cmd/ps-aux +0 -5
- data/test/unit/mock/cmd/ps-auxZ +0 -3
- data/test/unit/mock/cmd/pw-usershow-root-7 +0 -1
- data/test/unit/mock/cmd/reg_schedule +0 -6
- data/test/unit/mock/cmd/rpm-qia-curl +0 -24
- data/test/unit/mock/cmd/s11-netstat-an-finet-finet6 +0 -32
- data/test/unit/mock/cmd/sbin_sysctl +0 -1
- data/test/unit/mock/cmd/secedit-export +0 -7
- data/test/unit/mock/cmd/service-e +0 -2
- data/test/unit/mock/cmd/service-sendmail-onestatus +0 -3
- data/test/unit/mock/cmd/service-sshd-status +0 -1
- data/test/unit/mock/cmd/sockstat +0 -5
- data/test/unit/mock/cmd/success +0 -0
- data/test/unit/mock/cmd/swlist-l-product +0 -1
- data/test/unit/mock/cmd/systemctl-show-all-dbus +0 -6
- data/test/unit/mock/cmd/systemctl-show-all-sshd +0 -7
- data/test/unit/mock/cmd/win32_product +0 -8
- data/test/unit/mock/cmd/yum-repolist-all +0 -52
- data/test/unit/mock/files/apache2.conf +0 -14
- data/test/unit/mock/files/auditd.conf +0 -4
- data/test/unit/mock/files/bond0 +0 -37
- data/test/unit/mock/files/etcgroup +0 -3
- data/test/unit/mock/files/example.csv +0 -6
- data/test/unit/mock/files/grub.conf +0 -21
- data/test/unit/mock/files/inetd.conf +0 -2
- data/test/unit/mock/files/kitchen.yml +0 -7
- data/test/unit/mock/files/limits.conf +0 -5
- data/test/unit/mock/files/login.defs +0 -5
- data/test/unit/mock/files/mysql.conf +0 -8
- data/test/unit/mock/files/mysql2.conf +0 -2
- data/test/unit/mock/files/ntp.conf +0 -5
- data/test/unit/mock/files/passwd +0 -2
- data/test/unit/mock/files/policyfile.lock.json +0 -12
- data/test/unit/mock/files/ports.conf +0 -6
- data/test/unit/mock/files/rootwrap.conf +0 -7
- data/test/unit/mock/files/serve-cgi-bin.conf +0 -20
- data/test/unit/mock/files/shadow +0 -2
- data/test/unit/mock/files/ssh_config +0 -5
- data/test/unit/mock/files/sshd_config +0 -7
- data/test/unit/mock/files/sysctl.conf +0 -7
- data/test/unit/mock/files/xinetd.conf +0 -9
- data/test/unit/mock/files/xinetd.d/.gitkeep +0 -0
- data/test/unit/mock/files/xinetd.d_chargen-dgram +0 -9
- data/test/unit/mock/files/xinetd.d_chargen-stream +0 -9
- data/test/unit/mock/profiles/complete-metadata/inspec.yml +0 -7
- data/test/unit/mock/profiles/complete-profile/controls/filesystem_spec.rb +0 -16
- data/test/unit/mock/profiles/complete-profile/inspec.yml +0 -10
- data/test/unit/mock/profiles/complete-profile/libraries/testlib.rb +0 -1
- data/test/unit/mock/profiles/empty-metadata/inspec.yml +0 -0
- data/test/unit/mock/profiles/legacy-complete-metadata/metadata.rb +0 -7
- data/test/unit/mock/profiles/legacy-complete-metadata/test/.gitkeep +0 -0
- data/test/unit/mock/profiles/legacy-empty-metadata/controls/.gitkeep +0 -0
- data/test/unit/mock/profiles/legacy-empty-metadata/metadata.rb +0 -0
- data/test/unit/mock/profiles/legacy-simple-metadata/metadata.rb +0 -1
- data/test/unit/mock/profiles/legacy-simple-metadata/test/.gitkeep +0 -0
- data/test/unit/mock/profiles/library/controls/filesystem_spec.rb +0 -7
- data/test/unit/mock/profiles/library/inspec.yml +0 -10
- data/test/unit/mock/profiles/library/libraries/gordonlib.rb +0 -2
- data/test/unit/mock/profiles/library/libraries/testlib.rb +0 -12
- data/test/unit/mock/profiles/resource-tiny/inspec.yml +0 -10
- data/test/unit/mock/profiles/resource-tiny/libraries/resource.rb +0 -3
- data/test/unit/mock/profiles/simple-metadata/inspec.yml +0 -1
- data/test/unit/mock/profiles/skippy-profile-os/controls/one.rb +0 -3
- data/test/unit/mock/profiles/skippy-profile-os/inspec.yml +0 -5
- data/test/unit/mock/profiles/spec_only/specfile.rb +0 -11
- data/test/unit/mock/profiles/supported_inspec/inspec.yml +0 -2
- data/test/unit/mock/profiles/unsupported_inspec/inspec.yml +0 -2
- data/test/unit/objects_test.rb +0 -65
- data/test/unit/plugin_test.rb +0 -44
- data/test/unit/plugins/resource_test.rb +0 -60
- data/test/unit/profile_context_test.rb +0 -345
- data/test/unit/profile_test.rb +0 -252
- data/test/unit/resources/apache_conf_test.rb +0 -31
- data/test/unit/resources/apt_test.rb +0 -46
- data/test/unit/resources/audit_policy_test.rb +0 -13
- data/test/unit/resources/auditd_conf_test.rb +0 -15
- data/test/unit/resources/auditd_rules_test.rb +0 -91
- data/test/unit/resources/bash_test.rb +0 -29
- data/test/unit/resources/bond_test.rb +0 -24
- data/test/unit/resources/bridge_test.rb +0 -56
- data/test/unit/resources/csv_test.rb +0 -35
- data/test/unit/resources/etc_group_test.rb +0 -37
- data/test/unit/resources/file_test.rb +0 -202
- data/test/unit/resources/gem_test.rb +0 -20
- data/test/unit/resources/group_test.rb +0 -96
- data/test/unit/resources/grub_conf_test.rb +0 -29
- data/test/unit/resources/host_test.rb +0 -38
- data/test/unit/resources/inetd_conf_test.rb +0 -15
- data/test/unit/resources/ini_test.rb +0 -16
- data/test/unit/resources/interface_test.rb +0 -54
- data/test/unit/resources/iptables_test.rb +0 -35
- data/test/unit/resources/json_test.rb +0 -36
- data/test/unit/resources/kernel_module_test.rb +0 -23
- data/test/unit/resources/kernel_parameter_test.rb +0 -13
- data/test/unit/resources/limits_conf_test.rb +0 -14
- data/test/unit/resources/login_def_test.rb +0 -16
- data/test/unit/resources/mount_test.rb +0 -26
- data/test/unit/resources/mysql_conf_test.rb +0 -14
- data/test/unit/resources/npm_test.rb +0 -20
- data/test/unit/resources/ntp_conf_test.rb +0 -16
- data/test/unit/resources/oneget_test.rb +0 -45
- data/test/unit/resources/os_env_test.rb +0 -18
- data/test/unit/resources/os_test.rb +0 -40
- data/test/unit/resources/package_test.rb +0 -87
- data/test/unit/resources/parse_config_test.rb +0 -26
- data/test/unit/resources/passwd_test.rb +0 -111
- data/test/unit/resources/pip_test.rb +0 -15
- data/test/unit/resources/port_test.rb +0 -165
- data/test/unit/resources/powershell_test.rb +0 -32
- data/test/unit/resources/processes_test.rb +0 -72
- data/test/unit/resources/registry_key_test.rb +0 -18
- data/test/unit/resources/security_policy_test.rb +0 -16
- data/test/unit/resources/service_test.rb +0 -305
- data/test/unit/resources/shadow_test.rb +0 -67
- data/test/unit/resources/ssh_conf_test.rb +0 -33
- data/test/unit/resources/user_test.rb +0 -124
- data/test/unit/resources/vbscript_test.rb +0 -18
- data/test/unit/resources/windows_feature.rb +0 -17
- data/test/unit/resources/wmi_test.rb +0 -42
- data/test/unit/resources/xinetd_test.rb +0 -60
- data/test/unit/resources/yaml_test.rb +0 -34
- data/test/unit/resources/yum_test.rb +0 -68
- data/test/unit/shell_detector_test.rb +0 -78
- data/test/unit/source_reader_test.rb +0 -17
- data/test/unit/source_readers/flat_test.rb +0 -61
- data/test/unit/source_readers/inspec_test.rb +0 -38
- data/test/unit/utils/filter_array_test.rb +0 -59
- data/test/unit/utils/filter_table_test.rb +0 -177
- data/test/unit/utils/find_files_test.rb +0 -23
- data/test/unit/utils/passwd_parser_test.rb +0 -32
- data/test/unit/utils/simpleconfig_test.rb +0 -80
- data/test/unit/utils/solaris_netstat_parser.rb +0 -124
data/test/unit/metadata_test.rb
DELETED
@@ -1,137 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
# author: Dominik Richter
|
3
|
-
# author: Christoph Hartmann
|
4
|
-
|
5
|
-
require 'helper'
|
6
|
-
require 'inspec/metadata'
|
7
|
-
|
8
|
-
describe 'metadata with supported operating systems' do
|
9
|
-
let(:logger) { Minitest::Mock.new }
|
10
|
-
|
11
|
-
def supports_meta(params)
|
12
|
-
res = Inspec::Metadata.from_yaml('mock', "---", nil, logger)
|
13
|
-
# manually inject supported parameters
|
14
|
-
res.params[:supports] = params
|
15
|
-
Inspec::Metadata.finalize(res, 'mock', logger)
|
16
|
-
res
|
17
|
-
end
|
18
|
-
|
19
|
-
describe 'running on ubuntu 14.04' do
|
20
|
-
let (:backend) { MockLoader.new(:ubuntu1404).backend }
|
21
|
-
|
22
|
-
it 'finalizes a loaded metadata via Profile ID' do
|
23
|
-
res = Inspec::Metadata.from_yaml('mock', '---', nil)
|
24
|
-
Inspec::Metadata.finalize(res, 'mock')
|
25
|
-
res.params[:name].must_equal('mock')
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'finalizes a loaded metadata via Profile ID and overwrites the ID' do
|
29
|
-
res = Inspec::Metadata.from_yaml('mock', "---\nname: hello", nil)
|
30
|
-
Inspec::Metadata.finalize(res, 'mock')
|
31
|
-
res.params[:name].must_equal('mock')
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'finalizes a loaded metadata by turning strings into symbols' do
|
35
|
-
res = Inspec::Metadata.from_yaml('mock', "---\nauthor: world", nil)
|
36
|
-
Inspec::Metadata.finalize(res, 'mock')
|
37
|
-
res.params[:author].must_equal('world')
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'loads the support field from metadata' do
|
41
|
-
res = Inspec::Metadata.from_yaml('mock',
|
42
|
-
"---\nsupports:\n - os: ubuntu", nil)
|
43
|
-
res.params[:supports].must_equal([{ os: 'ubuntu' }])
|
44
|
-
end
|
45
|
-
|
46
|
-
it 'load a profile with empty supports clause' do
|
47
|
-
m = supports_meta(nil)
|
48
|
-
m.supports_transport?(backend).must_equal true
|
49
|
-
end
|
50
|
-
|
51
|
-
it 'supports legacy simple support style, but warns' do
|
52
|
-
# i.e. setting this to something that would fail:
|
53
|
-
logger.expect :warn, nil, ["Do not use deprecated `supports: linux` syntax. Instead use:\nsupports:\n - os-family: linux\n\n"]
|
54
|
-
m = supports_meta('linux')
|
55
|
-
m.supports_transport?(backend).must_equal true
|
56
|
-
logger.verify
|
57
|
-
end
|
58
|
-
|
59
|
-
it 'supports legacy simple support style, but warns' do
|
60
|
-
# i.e. setting this to something that would fail:
|
61
|
-
logger.expect :warn, nil, ["Do not use deprecated `supports: linux` syntax. Instead use:\nsupports:\n - os-family: linux\n\n"]
|
62
|
-
m = supports_meta(['linux'])
|
63
|
-
m.supports_transport?(backend).must_equal true
|
64
|
-
logger.verify
|
65
|
-
end
|
66
|
-
|
67
|
-
it 'loads a profile which supports os ubuntu' do
|
68
|
-
m = supports_meta({ 'os' => 'ubuntu' })
|
69
|
-
m.supports_transport?(backend).must_equal true
|
70
|
-
end
|
71
|
-
|
72
|
-
it 'loads a profile which supports os name ubuntu' do
|
73
|
-
m = supports_meta({ 'os-name' => 'ubuntu' })
|
74
|
-
m.supports_transport?(backend).must_equal true
|
75
|
-
end
|
76
|
-
|
77
|
-
it 'loads a profile which supports os family linux' do
|
78
|
-
m = supports_meta({ 'os-family' => 'linux' })
|
79
|
-
m.supports_transport?(backend).must_equal true
|
80
|
-
end
|
81
|
-
|
82
|
-
it 'loads a profile which supports release 14.04' do
|
83
|
-
m = supports_meta({ 'release' => '14.04' })
|
84
|
-
m.supports_transport?(backend).must_equal true
|
85
|
-
end
|
86
|
-
|
87
|
-
it 'rejects a profile which supports release 12.04' do
|
88
|
-
m = supports_meta({ 'release' => '12.04' })
|
89
|
-
m.supports_transport?(backend).must_equal false
|
90
|
-
end
|
91
|
-
|
92
|
-
it 'loads a profile which supports ubuntu 14.04' do
|
93
|
-
m = supports_meta({ 'os-name' => 'ubuntu', 'release' => '14.04' })
|
94
|
-
m.supports_transport?(backend).must_equal true
|
95
|
-
end
|
96
|
-
|
97
|
-
it 'rejects a profile which supports ubuntu 12.04' do
|
98
|
-
m = supports_meta({ 'os-name' => 'ubuntu', 'release' => '12.04' })
|
99
|
-
m.supports_transport?(backend).must_equal false
|
100
|
-
end
|
101
|
-
|
102
|
-
it 'reject unsupported os' do
|
103
|
-
m = supports_meta({ 'os-name' => 'windows' })
|
104
|
-
m.supports_transport?(backend).must_equal false
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
describe 'testing the supported runtime' do
|
109
|
-
let(:current_version) { Inspec::VERSION }
|
110
|
-
let(:next_version) { current_version.sub(/\.\d+$/) { |num| num.to_i.next } }
|
111
|
-
|
112
|
-
it 'returns true on testing the current version' do
|
113
|
-
m = supports_meta({ 'inspec' => current_version })
|
114
|
-
m.supports_runtime?.must_equal true
|
115
|
-
end
|
116
|
-
|
117
|
-
it 'returns true on testing the current version' do
|
118
|
-
m = supports_meta({ 'inspec' => '= ' + current_version })
|
119
|
-
m.supports_runtime?.must_equal true
|
120
|
-
end
|
121
|
-
|
122
|
-
it 'returns true on testing >= current version' do
|
123
|
-
m = supports_meta({ 'inspec' => '>= ' + current_version })
|
124
|
-
m.supports_runtime?.must_equal true
|
125
|
-
end
|
126
|
-
|
127
|
-
it 'returns false on testing >= the next version' do
|
128
|
-
m = supports_meta({ 'inspec' => '>= ' + next_version })
|
129
|
-
m.supports_runtime?.must_equal false
|
130
|
-
end
|
131
|
-
|
132
|
-
it 'returns false on testing > the next version' do
|
133
|
-
m = supports_meta({ 'inspec' => '> ' + next_version })
|
134
|
-
m.supports_runtime?.must_equal false
|
135
|
-
end
|
136
|
-
end
|
137
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\opscode\chef\bin\
|
@@ -1,24 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"Name": "vEthernet (Intel(R) PRO 1000 MT Network Connection - Virtual Switch)",
|
4
|
-
"InterfaceDescription": "Hyper-V Virtual Ethernet Adapter #2",
|
5
|
-
"Status": "Up",
|
6
|
-
"State": 2,
|
7
|
-
"MacAddress": "00-0C-29-E3-48-9B",
|
8
|
-
"LinkSpeed": "10 Gbps",
|
9
|
-
"ReceiveLinkSpeed": 10000000000,
|
10
|
-
"TransmitLinkSpeed": 10000000000,
|
11
|
-
"Virtual": true
|
12
|
-
},
|
13
|
-
{
|
14
|
-
"Name": "Ethernet0",
|
15
|
-
"InterfaceDescription": "Intel(R) PRO/1000 MT Network Connection",
|
16
|
-
"Status": "Not Present",
|
17
|
-
"State": 3,
|
18
|
-
"MacAddress": "00-0C-29-E3-48-9B",
|
19
|
-
"LinkSpeed": "0 bps",
|
20
|
-
"ReceiveLinkSpeed": 0,
|
21
|
-
"TransmitLinkSpeed": 0,
|
22
|
-
"Virtual": false
|
23
|
-
}
|
24
|
-
]
|
@@ -1,33 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"User": {
|
3
|
-
"Caption": "EXAMPLE\\Administrator",
|
4
|
-
"Description": "Built-in account for administering the computer/domain",
|
5
|
-
"Domain": "EXAMPLE",
|
6
|
-
"Name": "Administrator",
|
7
|
-
"LocalAccount": false,
|
8
|
-
"Lockout": false,
|
9
|
-
"PasswordChangeable": true,
|
10
|
-
"PasswordExpires": true,
|
11
|
-
"PasswordRequired": true,
|
12
|
-
"SID": "S-1-5-21-725088257-906184668-2367214287-500",
|
13
|
-
"SIDType": 1,
|
14
|
-
"Status": "OK"
|
15
|
-
},
|
16
|
-
"Groups": [{
|
17
|
-
"Caption": "WIN-K0AKLED332V\\Administrators",
|
18
|
-
"Domain": "WIN-K0AKLED332V",
|
19
|
-
"Name": "Administrators",
|
20
|
-
"LocalAccount": true,
|
21
|
-
"SID": "S-1-5-32-544",
|
22
|
-
"SIDType": 4,
|
23
|
-
"Status": "OK"
|
24
|
-
}, {
|
25
|
-
"Caption": "EXAMPLE\\Domain Admins",
|
26
|
-
"Domain": "EXAMPLE",
|
27
|
-
"Name": "Domain Admins",
|
28
|
-
"LocalAccount": false,
|
29
|
-
"SID": "S-1-5-21-725088257-906184668-2367214287-512",
|
30
|
-
"SIDType": 2,
|
31
|
-
"Status": "OK"
|
32
|
-
}]
|
33
|
-
}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"Caption": "WIN-K0AKLED332V\\Administrators",
|
4
|
-
"Domain": "WIN-K0AKLED332V",
|
5
|
-
"Name": "Administrators",
|
6
|
-
"SID": "S-1-5-32-544",
|
7
|
-
"LocalAccount": true
|
8
|
-
},
|
9
|
-
{
|
10
|
-
"Caption": "WIN-K0AKLED332V\\Users",
|
11
|
-
"Domain": "WIN-K0AKLED332V",
|
12
|
-
"Name": "Users",
|
13
|
-
"SID": "S-1-5-32-545",
|
14
|
-
"LocalAccount": true
|
15
|
-
},
|
16
|
-
{
|
17
|
-
"Caption": "EXAMPLE\\Domain Admins",
|
18
|
-
"Domain": "EXAMPLE",
|
19
|
-
"Name": "Domain Admins",
|
20
|
-
"SID": "S-1-5-21-725088257-906184668-2367214287-512",
|
21
|
-
"LocalAccount": false
|
22
|
-
}
|
23
|
-
]
|
@@ -1,26 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"IP4Address": "134.170.185.46",
|
4
|
-
"Name": "microsoft.com",
|
5
|
-
"Type": 1,
|
6
|
-
"CharacterSet": 1,
|
7
|
-
"Section": 1,
|
8
|
-
"DataLength": 4,
|
9
|
-
"TTL": 5,
|
10
|
-
"Address": "134.170.185.46",
|
11
|
-
"IPAddress": "134.170.185.46",
|
12
|
-
"QueryType": 1
|
13
|
-
},
|
14
|
-
{
|
15
|
-
"IP4Address": "134.170.188.221",
|
16
|
-
"Name": "microsoft.com",
|
17
|
-
"Type": 1,
|
18
|
-
"CharacterSet": 1,
|
19
|
-
"Section": 1,
|
20
|
-
"DataLength": 4,
|
21
|
-
"TTL": 5,
|
22
|
-
"Address": "134.170.188.221",
|
23
|
-
"IPAddress": "134.170.188.221",
|
24
|
-
"QueryType": 1
|
25
|
-
}
|
26
|
-
]
|
data/test/unit/mock/cmd/auditctl
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
LIST_RULES: exit,always syscall=rmdir,unlink
|
2
|
-
LIST_RULES: exit,always auid=1001 (0x3e9) syscall=open
|
3
|
-
LIST_RULES: exit,always watch=/etc/group perm=wa
|
4
|
-
LIST_RULES: exit,always watch=/etc/passwd perm=wa
|
5
|
-
LIST_RULES: exit,always watch=/etc/shadow perm=wa
|
6
|
-
LIST_RULES: exit,always watch=/etc/sudoers perm=wa
|
7
|
-
LIST_RULES: exit,always watch=/etc/secret_directory perm=r
|
data/test/unit/mock/cmd/auditpol
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
[{"name":"jq","full_name":"jq","desc":"Lightweight and flexible command-line JSON processor","homepage":"https://stedolan.github.io/jq/","versions":{"stable":"1.4","bottle":true,"devel":"1.5rc2","head":"HEAD"},"revision":0,"installed":[{"version":"1.4","used_options":[],"built_as_bottle":null,"poured_from_bottle":true}],"linked_keg":"1.4","keg_only":null,"dependencies":["bison"],"conflicts_with":[],"caveats":null,"requirements":[],"options":[]}]
|
@@ -1,7 +0,0 @@
|
|
1
|
-
Last password change : Aug 14, 2015
|
2
|
-
Password expires : never
|
3
|
-
Password inactive : never
|
4
|
-
Account expires : never
|
5
|
-
Minimum number of days between password change : 0
|
6
|
-
Maximum number of days between password change : 99999
|
7
|
-
Number of days of warning before password expires : 7
|
@@ -1,21 +0,0 @@
|
|
1
|
-
Package: curl
|
2
|
-
Status: install ok installed
|
3
|
-
Priority: optional
|
4
|
-
Section: web
|
5
|
-
Installed-Size: 306
|
6
|
-
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
|
7
|
-
Architecture: amd64
|
8
|
-
Multi-Arch: foreign
|
9
|
-
Version: 7.35.0-1ubuntu2
|
10
|
-
Depends: libc6 (>= 2.17), libcurl3 (= 7.35.0-1ubuntu2), zlib1g (>= 1:1.1.4)
|
11
|
-
Description: command line tool for transferring data with URL syntax
|
12
|
-
curl is a command line tool for transferring data with URL syntax, supporting
|
13
|
-
DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3,
|
14
|
-
POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP.
|
15
|
-
.
|
16
|
-
curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form
|
17
|
-
based upload, proxies, cookies, user+password authentication (Basic, Digest,
|
18
|
-
NTLM, Negotiate, kerberos...), file transfer resume, proxy tunneling and a
|
19
|
-
busload of other useful tricks.
|
20
|
-
Homepage: http://curl.haxx.se
|
21
|
-
Original-Maintainer: Alessandro Ghedini <ghedo@debian.org>
|
data/test/unit/mock/cmd/dscl
DELETED
data/test/unit/mock/cmd/env
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
data/test/unit/mock/cmd/etc-apt
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu wily main
|
2
|
-
# deb-src http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu wily main
|
3
|
-
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
|
4
|
-
# newer versions of the distribution.
|
5
|
-
|
6
|
-
deb http://archive.ubuntu.com/ubuntu/ wily main restricted
|
7
|
-
deb-src http://archive.ubuntu.com/ubuntu/ wily main restricted
|
@@ -1 +0,0 @@
|
|
1
|
-
/etc/apache2/conf-enabled/serve-cgi-bin.conf
|
@@ -1 +0,0 @@
|
|
1
|
-
/etc/apache2/ports.conf
|
@@ -1,12 +0,0 @@
|
|
1
|
-
/etc/rc.d/rc0.d/S01halt
|
2
|
-
/etc/rc.d/rc0.d/S00killall
|
3
|
-
/etc/rc.d/rc2.d/S90crond
|
4
|
-
/etc/rc.d/rc2.d/S55sshd
|
5
|
-
/etc/rc.d/rc5.d/S90crond
|
6
|
-
/etc/rc.d/rc5.d/S55sshd
|
7
|
-
/etc/rc.d/rc1.d/S99single
|
8
|
-
/etc/rc.d/rc3.d/S90crond
|
9
|
-
/etc/rc.d/rc3.d/S55sshd
|
10
|
-
/etc/rc.d/rc4.d/S08ip6tables
|
11
|
-
/etc/rc.d/rc4.d/S90crond
|
12
|
-
/etc/rc.d/rc4.d/S55sshd
|
@@ -1 +0,0 @@
|
|
1
|
-
rubocop (0.33.0, 0.32.1, 0.28.0)
|
@@ -1,24 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"State": 2,
|
4
|
-
"Caption": null,
|
5
|
-
"Description": null,
|
6
|
-
"LocalAddress": "::",
|
7
|
-
"LocalPort": 135,
|
8
|
-
"RemoteAddress": "::",
|
9
|
-
"RemotePort": 0,
|
10
|
-
"DisplayName": null,
|
11
|
-
"Status": null
|
12
|
-
},
|
13
|
-
{
|
14
|
-
"State": 2,
|
15
|
-
"Caption": null,
|
16
|
-
"Description": null,
|
17
|
-
"LocalAddress": "192.168.10.157",
|
18
|
-
"LocalPort": 135,
|
19
|
-
"RemoteAddress": "0.0.0.0",
|
20
|
-
"RemotePort": 0,
|
21
|
-
"DisplayName": null,
|
22
|
-
"Status": null
|
23
|
-
}
|
24
|
-
]
|
@@ -1,30 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"ProviderName": "Programs",
|
3
|
-
"Dependencies": [],
|
4
|
-
"Source": "",
|
5
|
-
"Status": "Installed",
|
6
|
-
"SearchKey": "Mozilla Firefox",
|
7
|
-
"FullPath": "",
|
8
|
-
"PackageFilename": "",
|
9
|
-
"FromTrustedSource": false,
|
10
|
-
"Summary": "Mozilla Firefox 40.0.3 (x86 en-US)",
|
11
|
-
"CanonicalId": "programs:Mozilla Firefox 40.0.3 (x86 en-US)/40.0.3",
|
12
|
-
"Metadata": {},
|
13
|
-
"SwidTagText": "",
|
14
|
-
"Name": "Mozilla Firefox 40.0.3 (x86 en-US)",
|
15
|
-
"Version": "40.0.3",
|
16
|
-
"VersionScheme": "unknown",
|
17
|
-
"Attributes": {
|
18
|
-
"Keys": [
|
19
|
-
"name",
|
20
|
-
"version",
|
21
|
-
"versionScheme"
|
22
|
-
],
|
23
|
-
"Values": [
|
24
|
-
"Mozilla Firefox 40.0.3 (x86 en-US)",
|
25
|
-
"40.0.3",
|
26
|
-
"unknown"
|
27
|
-
],
|
28
|
-
"Count": 3
|
29
|
-
}
|
30
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"ProviderName": "Programs",
|
4
|
-
"Status": "Installed",
|
5
|
-
"SearchKey": "Ruby 2.1.6-p336-x64",
|
6
|
-
"CanonicalId": "programs:Ruby 2.1.6-p336-x64/2.1.6-p336",
|
7
|
-
"Name": "Ruby 2.1.6-p336-x64",
|
8
|
-
"Version": "2.1.6-p336"
|
9
|
-
},
|
10
|
-
{
|
11
|
-
"ProviderName": "Programs",
|
12
|
-
"Status": "Installed",
|
13
|
-
"SearchKey": "Ruby 2.1.6-p336-x64",
|
14
|
-
"CanonicalId": "programs:Ruby 2.1.6-p336-x64/2.1.6-p336",
|
15
|
-
"Name": "Ruby 2.1.6-p336-x64",
|
16
|
-
"Version": "2.1.6-p336"
|
17
|
-
}
|
18
|
-
]
|
@@ -1,7 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"Name": "DHCP",
|
3
|
-
"DisplayName": "DHCP Server",
|
4
|
-
"Description": "Dynamic Host Configuration Protocol (DHCP) Server enables you to centrally configure, manage, and provide temporary IP addresses and related information for client computers.",
|
5
|
-
"Installed": false,
|
6
|
-
"InstallState": 0
|
7
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
2606:2800:220:1:248:1893:25c8:1946 example.com
|
@@ -1 +0,0 @@
|
|
1
|
-
jfolmer:x:0:0:jfolmer:/jfolmer:/bin/bash
|
@@ -1 +0,0 @@
|
|
1
|
-
root:x:0:0:root:/root:/bin/bash
|
@@ -1,10 +0,0 @@
|
|
1
|
-
Active Internet connections (including servers)
|
2
|
-
Proto Recv-Q Send-Q Local Address Foreign Address (state)
|
3
|
-
tcp 0 0 *.515 *.* LISTEN
|
4
|
-
tcp 0 28 16.147.37.141.22 16.180.154.172.64145 ESTABLISHED
|
5
|
-
tcp 0 0 *.22 *.* LISTEN
|
6
|
-
tcp 0 0 *.49196 *.* LISTEN
|
7
|
-
tcp 0 0 16.147.37.141.49399 16.147.37.141.1712 ESTABLISHED
|
8
|
-
tcp 0 0 127.0.0.1.49433 *.* LISTEN
|
9
|
-
udp 0 0 127.0.0.1.49178 127.0.0.1.49178
|
10
|
-
udp 0 0 *.49153 *.*
|
@@ -1,11 +0,0 @@
|
|
1
|
-
Active Internet connections (IPv6, including servers)
|
2
|
-
Proto Recv-Q Send-Q Local Address Foreign Address (state)
|
3
|
-
tcp6 0 0 ::1.49309 *.* LISTEN
|
4
|
-
tcp6 0 0 *.21 *.* LISTEN
|
5
|
-
tcp6 0 0 ::1.49671 ::1.49400 ESTABLISHED
|
6
|
-
tcp6 0 0 *.383 *.* LISTEN
|
7
|
-
tcp6 0 0 *.22 *.* LISTEN
|
8
|
-
tcp6 0 0 ::1.49403 ::1.49400 ESTABLISHED
|
9
|
-
tcp6 0 0 ::1.62538 ::1.62537 TIME_WAIT
|
10
|
-
udp6 0 0 *.514 *.*
|
11
|
-
udp6 0 0 *.9 *.*
|
@@ -1 +0,0 @@
|
|
1
|
-
uid=501(chartmann) gid=20(staff) groups=20(staff),701(com.apple.sharepoint.group.1),12(everyone)
|
@@ -1 +0,0 @@
|
|
1
|
-
uid=201105(jfolmer) gid=200513(domain users) groups=200513(domain users),200512(domain admins),200572(denied rodc password replication group)
|
data/test/unit/mock/cmd/id-root
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
uid=0(root) gid=0(root) groups=0(root)
|
@@ -1 +0,0 @@
|
|
1
|
-
ssh start/running, process 1291
|
@@ -1,6 +0,0 @@
|
|
1
|
-
-P INPUT DROP
|
2
|
-
-P FORWARD DROP
|
3
|
-
-P OUTPUT ACCEPT
|
4
|
-
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
5
|
-
-A INPUT -i eth0 -p tcp -m tcp --dport 22 -m state --state NEW -j ACCEPT
|
6
|
-
-A INPUT -i eth0 -p tcp -m tcp --dport 80 -m state --state NEW -m comment --comment "http like its 1990" -j ACCEPT
|
data/test/unit/mock/cmd/logins-x
DELETED
data/test/unit/mock/cmd/lsmod
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
p697
|
2
|
-
cUserEvent
|
3
|
-
tIPv4
|
4
|
-
PUDP
|
5
|
-
n*:*
|
6
|
-
p6835
|
7
|
-
cVBoxHeadl
|
8
|
-
tIPv4
|
9
|
-
PTCP
|
10
|
-
n127.0.0.1:2022
|
11
|
-
tIPv4
|
12
|
-
PUDP
|
13
|
-
n*:61197
|
14
|
-
p2022
|
15
|
-
cjava
|
16
|
-
tIPv6
|
17
|
-
PTCP
|
18
|
-
n192.168.1.66:51098->172.18.1.63:22
|
19
|
-
p8708
|
20
|
-
csshd
|
21
|
-
tIPv4
|
22
|
-
PTCP
|
23
|
-
n*:22
|
24
|
-
tIPv6
|
25
|
-
PTCP
|
26
|
-
n*:22
|
27
|
-
p13451
|
28
|
-
cssh
|
29
|
-
tIPv4
|
30
|
-
PTCP
|
31
|
-
n192.168.1.66:46951->192.168.1.80:22
|
32
|
-
p24137
|
33
|
-
cntpd
|
34
|
-
tIPv4
|
35
|
-
PUDP
|
36
|
-
n*:123
|
37
|
-
tIPv6
|
38
|
-
PUDP
|
39
|
-
n*:123
|
40
|
-
tIPv4
|
41
|
-
PUDP
|
42
|
-
n127.0.0.1:123
|
43
|
-
tIPv4
|
44
|
-
PUDP
|
45
|
-
n192.168.1.66:123
|
46
|
-
tIPv4
|
47
|
-
PUDP
|
48
|
-
n172.17.42.1:123
|
49
|
-
tIPv6
|
50
|
-
PUDP
|
51
|
-
n[2602:30a:c0d0:e070:8e70:5aff:fe66:6ebc]:123
|
52
|
-
tIPv6
|
53
|
-
PUDP
|
54
|
-
n[::1]:123
|
55
|
-
tIPv6
|
56
|
-
PUDP
|
57
|
-
n[fe80::8e70:5aff:fe66:6ebc]:123
|
58
|
-
tIPv6
|
59
|
-
PUDP
|
60
|
-
n[2602:30a:c0d0:e070:b1e3:fa7c:c1cd:e1dd]:123
|
61
|
-
tIPv4
|
62
|
-
PUDP
|
63
|
-
n9.48.126.170:123
|
data/test/unit/mock/cmd/mount
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
/dev/xvda1 on / type ext4 (rw,discard)
|