inspec 0.9.8 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -1
- data/CHANGELOG.md +23 -2
- data/Gemfile +1 -1
- data/Rakefile +15 -1
- data/docs/resources.rst +1 -1
- data/examples/profile/controls/gordon.rb +1 -1
- data/examples/resource/controls/tiny.rb +3 -0
- data/examples/resource/inspec.yml +10 -0
- data/examples/resource/libraries/tiny.rb +3 -0
- data/lib/inspec/dsl.rb +17 -17
- data/lib/inspec/metadata.rb +3 -8
- data/lib/inspec/plugins/resource.rb +1 -1
- data/lib/inspec/profile.rb +3 -2
- data/lib/inspec/profile_context.rb +2 -2
- data/lib/inspec/rule.rb +7 -7
- data/lib/inspec/shell.rb +5 -8
- data/lib/inspec/targets/dir.rb +1 -1
- data/lib/inspec/targets/tar.rb +3 -6
- data/lib/inspec/targets/url.rb +15 -9
- data/lib/inspec/targets/url.rb.orig +87 -0
- data/lib/inspec/version.rb +1 -1
- data/lib/matchers/matchers.rb +1 -1
- data/lib/resources/audit_policy.rb +1 -1
- data/lib/resources/command.rb +3 -3
- data/lib/resources/etc_group.rb +1 -1
- data/lib/resources/file.rb +4 -3
- data/lib/resources/group.rb +14 -18
- data/lib/resources/iptables.rb +1 -1
- data/lib/resources/json.rb +4 -6
- data/lib/resources/kernel_parameter.rb +1 -1
- data/lib/resources/os.rb +1 -1
- data/lib/resources/package.rb +20 -2
- data/lib/resources/passwd.rb +1 -1
- data/lib/resources/port.rb +112 -42
- data/lib/resources/postgres_conf.rb +1 -1
- data/lib/resources/postgres_session.rb +2 -2
- data/lib/resources/registry_key.rb +2 -1
- data/lib/resources/security_policy.rb +2 -2
- data/lib/resources/service.rb +50 -1
- data/lib/resources/user.rb +45 -0
- data/lib/resources/yum.rb +2 -2
- data/lib/utils/convert.rb +1 -1
- data/lib/utils/find_files.rb +3 -3
- data/lib/utils/parser.rb +2 -2
- data/tasks/maintainers.rb +6 -6
- data/test/helper.rb +4 -2
- data/test/integration/cookbooks/os_prepare/recipes/file.rb +9 -2
- data/test/integration/cookbooks/os_prepare/recipes/json_yaml_csv_ini.rb +8 -2
- data/test/integration/test/integration/default/etc_group_spec.rb +22 -0
- data/test/integration/test/integration/default/file_spec.rb +10 -1
- data/test/integration/test/integration/default/group_spec.rb +17 -0
- data/test/integration/test/integration/default/package_spec.rb +10 -4
- data/test/integration/test/integration/default/port_spec.rb +6 -0
- data/test/integration/test/integration/default/service_spec.rb +3 -0
- data/test/integration/test/integration/default/user_spec.rb +26 -16
- data/test/unit/metadata_test.rb +24 -0
- data/test/unit/mock/cmd/lsof-nP-i-FpctPn +63 -0
- data/test/unit/mock/cmd/netstat-tulpen +1 -0
- data/test/unit/mock/cmd/systemctl-show-all-sshd +1 -1
- data/test/unit/mock/profiles/complete-meta/metadata.rb +1 -1
- data/test/unit/mock/profiles/custom-resource/libraries/resource.rb +3 -0
- data/test/unit/mock/profiles/custom-resource/metadata.rb +7 -0
- data/{examples/kitchen-ansible/.kitchen/logs/default-centos-71.log → test/unit/mock/profiles/custom-resource/test/.gitkeep} +0 -0
- data/test/unit/profile_test.rb +6 -2
- data/test/unit/resources/port_test.rb +8 -0
- data/test/unit/targets.rb +132 -0
- metadata +19 -551
- data/bin/os +0 -23
- data/examples/kitchen-ansible/.kitchen/logs/default-ubuntu-1204.log +0 -0
- data/examples/kitchen-ansible/.kitchen/logs/default-ubuntu-1404.log +0 -432
- data/examples/kitchen-ansible/.kitchen/logs/kitchen.log +0 -10
- data/examples/kitchen-ansible/Gemfile.lock +0 -154
- data/examples/kitchen-chef/.kitchen/default-centos-71.yml +0 -6
- data/examples/kitchen-chef/.kitchen/default-ubuntu-1204.yml +0 -6
- data/examples/kitchen-chef/.kitchen/default-ubuntu-1404.yml +0 -6
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/id +0 -1
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/Vagrantfile +0 -9
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/id +0 -1
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/Vagrantfile +0 -9
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/id +0 -1
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/Vagrantfile +0 -9
- data/examples/kitchen-chef/.kitchen/logs/default-centos-71.log +0 -4
- data/examples/kitchen-chef/.kitchen/logs/default-ubuntu-1204.log +0 -4
- data/examples/kitchen-chef/.kitchen/logs/default-ubuntu-1404.log +0 -4
- data/examples/kitchen-chef/.kitchen/logs/kitchen.log +0 -8
- data/examples/kitchen-chef/Berksfile.lock +0 -11
- data/examples/kitchen-chef/Gemfile.lock +0 -223
- data/examples/kitchen-puppet/.bundle/config +0 -2
- data/examples/kitchen-puppet/.kitchen/logs/default-centos-71.log +0 -0
- data/examples/kitchen-puppet/.kitchen/logs/default-ubuntu-1204.log +0 -0
- data/examples/kitchen-puppet/.kitchen/logs/default-ubuntu-1404.log +0 -306
- data/examples/kitchen-puppet/.kitchen/logs/kitchen.log +0 -10
- data/examples/kitchen-puppet/.librarian/puppet/config +0 -2
- data/examples/kitchen-puppet/Gemfile.lock +0 -174
- data/examples/kitchen-puppet/Puppetfile.lock +0 -2
- data/examples/profile/libraries/.DS_Store +0 -0
- data/examples/test-kitchen/.kitchen/logs/default-centos-71.log +0 -5
- data/examples/test-kitchen/.kitchen/logs/default-ubuntu-1204.log +0 -5
- data/examples/test-kitchen/.kitchen/logs/default-ubuntu-1404.log +0 -5
- data/examples/test-kitchen/.kitchen/logs/kitchen.log +0 -5
- data/examples/test-kitchen/Berksfile.lock +0 -11
- data/examples/test-kitchen/Gemfile.lock +0 -233
- data/lib/.DS_Store +0 -0
- data/lib/resources/certificate.rb +0 -0
- data/lib/resources/private_key.rb +0 -0
- data/test/chefdk/.gitignore +0 -16
- data/test/chefdk/.kitchen.yml +0 -27
- data/test/chefdk/Policyfile.rb +0 -16
- data/test/chefdk/README.md +0 -4
- data/test/chefdk/chefignore +0 -100
- data/test/chefdk/metadata.rb +0 -7
- data/test/chefdk/recipes/default.rb +0 -5
- data/test/chefdk/spec/spec_helper.rb +0 -2
- data/test/chefdk/spec/unit/recipes/default_spec.rb +0 -20
- data/test/chefdk/test/integration/default/serverspec/default_spec.rb +0 -9
- data/test/chefdk/test/integration/helpers/serverspec/spec_helper.rb +0 -8
- data/test/integration/.DS_Store +0 -0
- data/test/integration/.kitchen.local.yml +0 -68
- data/test/integration/.kitchen/default-aws-linux.yml +0 -4
- data/test/integration/.kitchen/default-centos-511.yml +0 -6
- data/test/integration/.kitchen/default-centos-67.yml +0 -6
- data/test/integration/.kitchen/default-centos-7.yml +0 -4
- data/test/integration/.kitchen/default-centos-71.yml +0 -6
- data/test/integration/.kitchen/default-debian-6010.yml +0 -6
- data/test/integration/.kitchen/default-debian-78.yml +0 -6
- data/test/integration/.kitchen/default-debian-8.yml +0 -4
- data/test/integration/.kitchen/default-debian-81.yml +0 -6
- data/test/integration/.kitchen/default-fedora-21.yml +0 -6
- data/test/integration/.kitchen/default-fedora-22.yml +0 -4
- data/test/integration/.kitchen/default-freebsd-102.yml +0 -6
- data/test/integration/.kitchen/default-freebsd-93.yml +0 -6
- data/test/integration/.kitchen/default-opensuse-132-x86-64.yml +0 -6
- data/test/integration/.kitchen/default-redhat-65.yml +0 -4
- data/test/integration/.kitchen/default-redhat-71.yml +0 -4
- data/test/integration/.kitchen/default-suse-11sp3.yml +0 -4
- data/test/integration/.kitchen/default-suse-12.yml +0 -4
- data/test/integration/.kitchen/default-ubuntu-1004.yml +0 -6
- data/test/integration/.kitchen/default-ubuntu-1204.yml +0 -4
- data/test/integration/.kitchen/default-ubuntu-1404.yml +0 -4
- data/test/integration/.kitchen/default-ubuntu-1510.yml +0 -4
- data/test/integration/.kitchen/default-windows-2012.yml +0 -5
- data/test/integration/.kitchen/default-windows-2012r2.yml +0 -6
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/id +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/Vagrantfile +0 -9
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67-i386/Vagrantfile +0 -9
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/id +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/Vagrantfile +0 -9
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/id +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/Vagrantfile +0 -9
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/id +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/Vagrantfile +0 -9
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/id +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/Vagrantfile +0 -9
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/id +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/Vagrantfile +0 -9
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/id +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/Vagrantfile +0 -9
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/id +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/Vagrantfile +0 -9
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/id +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/Vagrantfile +0 -9
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/id +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/Vagrantfile +0 -9
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/id +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/Vagrantfile +0 -9
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/id +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/Vagrantfile +0 -9
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/id +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/Vagrantfile +0 -9
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/id +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/Vagrantfile +0 -9
- data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-new-ubuntu-1404/Vagrantfile +0 -9
- data/test/integration/.kitchen/logs/default-aws-linux.log +0 -0
- data/test/integration/.kitchen/logs/default-centos-511-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-centos-511.log +0 -0
- data/test/integration/.kitchen/logs/default-centos-67-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-centos-67.log +0 -0
- data/test/integration/.kitchen/logs/default-centos-7.log +0 -0
- data/test/integration/.kitchen/logs/default-centos-71.log +0 -0
- data/test/integration/.kitchen/logs/default-debian-6010-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-debian-6010.log +0 -0
- data/test/integration/.kitchen/logs/default-debian-78-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-debian-78.log +0 -0
- data/test/integration/.kitchen/logs/default-debian-8.log +0 -0
- data/test/integration/.kitchen/logs/default-debian-81-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-debian-81.log +0 -0
- data/test/integration/.kitchen/logs/default-fedora-21-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-fedora-21.log +0 -0
- data/test/integration/.kitchen/logs/default-fedora-22.log +0 -0
- data/test/integration/.kitchen/logs/default-freebsd-102.log +0 -0
- data/test/integration/.kitchen/logs/default-freebsd-93.log +0 -0
- data/test/integration/.kitchen/logs/default-mint-172-cinnamon.log +0 -0
- data/test/integration/.kitchen/logs/default-opensuse-132-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-opensuse-132-x86-64.log +0 -0
- data/test/integration/.kitchen/logs/default-redhat-65.log +0 -0
- data/test/integration/.kitchen/logs/default-redhat-71.log +0 -0
- data/test/integration/.kitchen/logs/default-suse-11sp3.log +0 -0
- data/test/integration/.kitchen/logs/default-suse-12.log +0 -0
- data/test/integration/.kitchen/logs/default-ubuntu-1004-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-ubuntu-1004.log +0 -0
- data/test/integration/.kitchen/logs/default-ubuntu-1204-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-ubuntu-1204.log +0 -23
- data/test/integration/.kitchen/logs/default-ubuntu-1404-i386.log +0 -0
- data/test/integration/.kitchen/logs/default-ubuntu-1404.log +0 -0
- data/test/integration/.kitchen/logs/default-ubuntu-1510.log +0 -0
- data/test/integration/.kitchen/logs/default-windows-2012.log +0 -0
- data/test/integration/.kitchen/logs/default-windows-2012r2.log +0 -0
- data/test/integration/.kitchen/logs/kitchen.log +0 -3
- data/test/integration/.kitchen/logs/new-centos-511-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-centos-511.log +0 -0
- data/test/integration/.kitchen/logs/new-centos-67-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-centos-67.log +0 -0
- data/test/integration/.kitchen/logs/new-centos-71.log +0 -0
- data/test/integration/.kitchen/logs/new-debian-6010-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-debian-6010.log +0 -0
- data/test/integration/.kitchen/logs/new-debian-78-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-debian-78.log +0 -0
- data/test/integration/.kitchen/logs/new-debian-81-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-debian-81.log +0 -0
- data/test/integration/.kitchen/logs/new-fedora-21-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-fedora-21.log +0 -0
- data/test/integration/.kitchen/logs/new-fedora-22.log +0 -0
- data/test/integration/.kitchen/logs/new-freebsd-102.log +0 -0
- data/test/integration/.kitchen/logs/new-freebsd-93.log +0 -0
- data/test/integration/.kitchen/logs/new-opensuse-132-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-opensuse-132-x86-64.log +0 -0
- data/test/integration/.kitchen/logs/new-ubuntu-1004-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-ubuntu-1004.log +0 -0
- data/test/integration/.kitchen/logs/new-ubuntu-1204-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-ubuntu-1204.log +0 -0
- data/test/integration/.kitchen/logs/new-ubuntu-1404-i386.log +0 -0
- data/test/integration/.kitchen/logs/new-ubuntu-1404.log +0 -3
- data/test/integration/.kitchen/logs/test-centos-511-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-centos-511.log +0 -0
- data/test/integration/.kitchen/logs/test-centos-67-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-centos-67.log +0 -0
- data/test/integration/.kitchen/logs/test-centos-71.log +0 -0
- data/test/integration/.kitchen/logs/test-debian-6010-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-debian-6010.log +0 -0
- data/test/integration/.kitchen/logs/test-debian-78-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-debian-78.log +0 -0
- data/test/integration/.kitchen/logs/test-debian-81-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-debian-81.log +0 -0
- data/test/integration/.kitchen/logs/test-fedora-21-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-fedora-21.log +0 -0
- data/test/integration/.kitchen/logs/test-fedora-22.log +0 -0
- data/test/integration/.kitchen/logs/test-freebsd-102.log +0 -0
- data/test/integration/.kitchen/logs/test-freebsd-93.log +0 -0
- data/test/integration/.kitchen/logs/test-opensuse-132-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-opensuse-132-x86-64.log +0 -0
- data/test/integration/.kitchen/logs/test-ubuntu-1004-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-ubuntu-1004.log +0 -0
- data/test/integration/.kitchen/logs/test-ubuntu-1204-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-ubuntu-1204.log +0 -0
- data/test/integration/.kitchen/logs/test-ubuntu-1404-i386.log +0 -0
- data/test/integration/.kitchen/logs/test-ubuntu-1404.log +0 -0
- data/test/integration/.kitchen/new-ubuntu-1404.yml +0 -1
- data/test/integration/Berksfile.lock +0 -11
- data/test/integration/TODO.md +0 -15
- data/test/integration/test/.DS_Store +0 -0
- data/test/integration/test/integration/.DS_Store +0 -0
- data/test/integration/test/integration/default/.DS_Store +0 -0
- data/test/integration/test/integration/default/certificate_spec.rb +0 -7
- data/test/integration/test/integration/default/etc_group.rb +0 -13
- data/test/serverspec/.kitchen.yml +0 -18
- data/test/serverspec/.kitchen/default-ubuntu-1404.yml +0 -6
- data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/action_set_name +0 -1
- data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/creator_uid +0 -1
- data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/id +0 -1
- data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/index_uuid +0 -1
- data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/private_key +0 -27
- data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/synced_folders +0 -1
- data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/Vagrantfile +0 -9
- data/test/serverspec/.kitchen/logs/default-ubuntu-1404.log +0 -2
- data/test/serverspec/.kitchen/logs/kitchen.log +0 -3
- data/test/serverspec/Berksfile +0 -3
- data/test/serverspec/Berksfile.lock +0 -5
- data/test/serverspec/TODO.md +0 -2
- data/test/serverspec/test/integration/default/serverspec/os_spec.rb +0 -25
- data/test/serverspec/test/integration/default/serverspec/spec_helper.rb +0 -48
- data/test/serverspec/test/integration/default/serverspec/sysctl_spec.rb +0 -37
- data/test/unit/mock/cmd/lsof-np-itcp +0 -4
@@ -58,8 +58,8 @@ class PostgresSession < Inspec.resource(1)
|
|
58
58
|
# remove the whole header (i.e. up to the first ^-----+------+------$)
|
59
59
|
# remove the tail
|
60
60
|
lines = cmd.stdout
|
61
|
-
|
62
|
-
|
61
|
+
.sub(/(.*\n)+([-]+[+])*[-]+\n/, '')
|
62
|
+
.sub(/\n[^\n]*\n\n$/, '')
|
63
63
|
l = Lines.new(lines.strip, "PostgreSQL query: #{query}")
|
64
64
|
RSpec.__send__('describe', l, &block)
|
65
65
|
end
|
@@ -26,7 +26,8 @@ class RegistryKey < Inspec.resource(1)
|
|
26
26
|
reg_key ||= name
|
27
27
|
@name = name
|
28
28
|
@reg_key = reg_key
|
29
|
-
|
29
|
+
|
30
|
+
return skip_resource 'The `registry_key` resource is not supported on your OS yet.' if !inspec.os.windows?
|
30
31
|
end
|
31
32
|
|
32
33
|
def exists?
|
@@ -58,7 +58,7 @@ class SecurityPolicy < Inspec.resource(1)
|
|
58
58
|
key = Regexp.escape(method.to_s)
|
59
59
|
target = ''
|
60
60
|
@policy.each_line {|s|
|
61
|
-
target = s.strip if s
|
61
|
+
target = s.strip if s =~ /^\s*#{key}\s*=\s*(.*)\b/
|
62
62
|
}
|
63
63
|
|
64
64
|
# extract variable value
|
@@ -66,7 +66,7 @@ class SecurityPolicy < Inspec.resource(1)
|
|
66
66
|
|
67
67
|
if !result.nil?
|
68
68
|
val = result[:value]
|
69
|
-
val = val.to_i if val
|
69
|
+
val = val.to_i if val =~ /^\d+$/
|
70
70
|
else
|
71
71
|
# TODO: we may need to return skip or failure if the
|
72
72
|
# requested value is not available
|
data/lib/resources/service.rb
CHANGED
@@ -80,6 +80,8 @@ class Service < Inspec.resource(1)
|
|
80
80
|
@service_mgmt = BSDInit.new(inspec)
|
81
81
|
when 'arch', 'opensuse'
|
82
82
|
@service_mgmt = Systemd.new(inspec)
|
83
|
+
when 'aix'
|
84
|
+
@service_mgmt = SrcMstr.new(inspec)
|
83
85
|
end
|
84
86
|
|
85
87
|
return skip_resource 'The `service` resource is not supported on your OS yet.' if @service_mgmt.nil?
|
@@ -142,7 +144,7 @@ class Systemd < ServiceManager
|
|
142
144
|
params['SubState'] == 'running' ? (running = true) : (running = false)
|
143
145
|
# test via systemctl --quiet is-enabled
|
144
146
|
# ActiveState values eg.g inactive, active
|
145
|
-
params['
|
147
|
+
params['UnitFileState'] == 'enabled' ? (enabled = true) : (enabled = false)
|
146
148
|
|
147
149
|
{
|
148
150
|
name: params['Id'],
|
@@ -155,6 +157,53 @@ class Systemd < ServiceManager
|
|
155
157
|
end
|
156
158
|
end
|
157
159
|
|
160
|
+
# AIX services
|
161
|
+
class SrcMstr < ServiceManager
|
162
|
+
attr_reader :name
|
163
|
+
|
164
|
+
def info(service_name)
|
165
|
+
@name = service_name
|
166
|
+
running = status?
|
167
|
+
return nil if running.nil?
|
168
|
+
|
169
|
+
{
|
170
|
+
name: service_name,
|
171
|
+
description: nil,
|
172
|
+
installed: true,
|
173
|
+
running: running,
|
174
|
+
enabled: enabled?,
|
175
|
+
type: 'srcmstr',
|
176
|
+
}
|
177
|
+
end
|
178
|
+
|
179
|
+
def status?
|
180
|
+
status_cmd = inspec.command("lssrc -s #{@name}")
|
181
|
+
return nil if status_cmd.exit_status.to_i != 0
|
182
|
+
status_cmd.stdout.split(/\n/).last.chomp =~ /active$/ ? true : false
|
183
|
+
end
|
184
|
+
|
185
|
+
def enabled?
|
186
|
+
enabled_rc_tcpip? || enabled_inittab?
|
187
|
+
end
|
188
|
+
|
189
|
+
private
|
190
|
+
|
191
|
+
# #rubocop:disable Style/TrailingComma
|
192
|
+
def enabled_rc_tcpip?
|
193
|
+
if inspec.command(
|
194
|
+
"grep -v ^# /etc/rc.tcpip | grep 'start ' | grep -Eq '(/{0,1}| )#{@name} '",
|
195
|
+
).exit_status == 0
|
196
|
+
true
|
197
|
+
else
|
198
|
+
false
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
def enabled_inittab?
|
203
|
+
inspec.command("lsitab #{@name}").exit_status.to_i == 0 ? true : false
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
158
207
|
# @see: http://upstart.ubuntu.com
|
159
208
|
class Upstart < ServiceManager
|
160
209
|
def info(service_name)
|
data/lib/resources/user.rb
CHANGED
@@ -62,6 +62,8 @@ class User < Inspec.resource(1)
|
|
62
62
|
@user_provider = DarwinUser.new(inspec)
|
63
63
|
when 'freebsd'
|
64
64
|
@user_provider = FreeBSDUser.new(inspec)
|
65
|
+
when 'aix'
|
66
|
+
@user_provider = AixUser.new(inspec)
|
65
67
|
else
|
66
68
|
return skip_resource 'The `user` resource is not supported on your OS yet.'
|
67
69
|
end
|
@@ -263,6 +265,49 @@ class LinuxUser < UnixUser
|
|
263
265
|
end
|
264
266
|
end
|
265
267
|
|
268
|
+
class AixUser < UnixUser
|
269
|
+
def identity(username)
|
270
|
+
id = super(username)
|
271
|
+
return nil if id.nil?
|
272
|
+
# AIX 'id' command doesn't include the primary group in the supplementary
|
273
|
+
# yet it can be somewhere in the supplementary list if someone added root
|
274
|
+
# to a groups list in /etc/group
|
275
|
+
# we rearrange to expected list if that is the case
|
276
|
+
if id[:groups].first != id[:group]
|
277
|
+
id[:groups].reject! { |i| i == id[:group] } if id[:groups].include?(id[:group])
|
278
|
+
id[:groups].unshift(id[:group])
|
279
|
+
end
|
280
|
+
|
281
|
+
id
|
282
|
+
end
|
283
|
+
|
284
|
+
def meta_info(username)
|
285
|
+
lsuser = inspec.command("lsuser -C -a home shell #{username}")
|
286
|
+
return nil if lsuser.exit_status != 0
|
287
|
+
|
288
|
+
user = lsuser.stdout.chomp.split("\n").last.split(':')
|
289
|
+
{
|
290
|
+
home: user[1],
|
291
|
+
shell: user[2],
|
292
|
+
}
|
293
|
+
end
|
294
|
+
|
295
|
+
def credentials(username)
|
296
|
+
cmd = inspec.command(
|
297
|
+
"lssec -c -f /etc/security/user -s #{username} -a minage -a maxage -a pwdwarntime",
|
298
|
+
)
|
299
|
+
return nil if cmd.exit_status != 0
|
300
|
+
|
301
|
+
user_sec = cmd.stdout.chomp.split("\n").last.split(':')
|
302
|
+
|
303
|
+
{
|
304
|
+
mindays: user_sec[1].to_i * 7,
|
305
|
+
maxdays: user_sec[2].to_i * 7,
|
306
|
+
warndays: user_sec[3].to_i,
|
307
|
+
}
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
266
311
|
# we do not use 'finger' for MacOS, because it is harder to parse data with it
|
267
312
|
# @see https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/fingerd.8.html
|
268
313
|
# instead we use 'dscl' to request user data
|
data/lib/resources/yum.rb
CHANGED
@@ -57,7 +57,7 @@ class Yum < Inspec.resource(1)
|
|
57
57
|
in_repo = false
|
58
58
|
@content.each_line do |line|
|
59
59
|
# detect repo start
|
60
|
-
in_repo = true if line
|
60
|
+
in_repo = true if line =~ /^\s*Repo-id\s*:\s*(.*)\b/
|
61
61
|
# detect repo end
|
62
62
|
if line == "\n" && in_repo
|
63
63
|
in_repo = false
|
@@ -94,7 +94,7 @@ class Yum < Inspec.resource(1)
|
|
94
94
|
|
95
95
|
# Removes lefthand and righthand whitespace
|
96
96
|
def strip(value)
|
97
|
-
value.
|
97
|
+
value.strip if !value.nil?
|
98
98
|
end
|
99
99
|
|
100
100
|
# Optimize the key value
|
data/lib/utils/convert.rb
CHANGED
data/lib/utils/find_files.rb
CHANGED
@@ -14,7 +14,7 @@ module FindFiles
|
|
14
14
|
link: 'l',
|
15
15
|
socket: 's',
|
16
16
|
door: 'D',
|
17
|
-
}
|
17
|
+
}.freeze
|
18
18
|
|
19
19
|
# ignores errors
|
20
20
|
def find_files(path, opts = {})
|
@@ -38,7 +38,7 @@ module FindFiles
|
|
38
38
|
end
|
39
39
|
|
40
40
|
result.stdout.split("\n")
|
41
|
-
|
42
|
-
|
41
|
+
.map(&:strip)
|
42
|
+
.find_all { |x| !x.empty? }
|
43
43
|
end
|
44
44
|
end
|
data/lib/utils/parser.rb
CHANGED
data/tasks/maintainers.rb
CHANGED
@@ -21,7 +21,7 @@ SOURCE = File.join(File.dirname(__FILE__), '..', 'MAINTAINERS.toml')
|
|
21
21
|
TARGET = File.join(File.dirname(__FILE__), '..', 'MAINTAINERS.md')
|
22
22
|
|
23
23
|
# The list of repositories that teams should own
|
24
|
-
REPOSITORIES = ['chef/inspec']
|
24
|
+
REPOSITORIES = ['chef/inspec'].freeze
|
25
25
|
|
26
26
|
begin
|
27
27
|
require 'tomlrb'
|
@@ -194,11 +194,11 @@ begin
|
|
194
194
|
|
195
195
|
# rubocop:disable Metrics/AbcSize
|
196
196
|
def person(list, person)
|
197
|
-
if list[person].key?('GitHub')
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
197
|
+
out = if list[person].key?('GitHub')
|
198
|
+
"* [#{list[person]['Name']}](https://github.com/#{list[person]['GitHub']})"
|
199
|
+
else
|
200
|
+
"* #{list[person]['Name']}"
|
201
|
+
end
|
202
202
|
out << "\n * IRC - #{list[person]['IRC']}" if list[person].key?('IRC')
|
203
203
|
out << "\n * [@#{list[person]['Twitter']}](https://twitter.com/#{list[person]['Twitter']})" if list[person].key?('Twitter')
|
204
204
|
out << "\n * [#{list[person]['email']}](mailto:#{list[person]['email']})" if list[person].key?('email')
|
data/test/helper.rb
CHANGED
@@ -17,6 +17,8 @@ end
|
|
17
17
|
require 'inspec/resource'
|
18
18
|
require 'inspec/backend'
|
19
19
|
require 'inspec/profile'
|
20
|
+
require 'inspec/targets'
|
21
|
+
require 'inspec/targets/zip'
|
20
22
|
|
21
23
|
class MockLoader
|
22
24
|
# pass the os identifier to emulate a specific operating system
|
@@ -135,8 +137,8 @@ class MockLoader
|
|
135
137
|
'/sbin/sysctl -q -n net.ipv4.conf.all.forwarding' => cmd.call('sbin_sysctl'),
|
136
138
|
# ports on windows
|
137
139
|
'Get-NetTCPConnection | Select-Object -Property State, Caption, Description, LocalAddress, LocalPort, RemoteAddress, RemotePort, DisplayName, Status | ConvertTo-Json' => cmd.call('get-net-tcpconnection'),
|
138
|
-
# ports
|
139
|
-
'lsof -nP -
|
140
|
+
# lsof formatted list of ports (should be quite cross platform)
|
141
|
+
'lsof -nP -i -FpctPn' => cmd.call('lsof-nP-i-FpctPn'),
|
140
142
|
# ports on linux
|
141
143
|
'netstat -tulpen' => cmd.call('netstat-tulpen'),
|
142
144
|
# ports on freebsd
|
@@ -6,8 +6,15 @@
|
|
6
6
|
|
7
7
|
if node['platform_family'] != 'windows'
|
8
8
|
|
9
|
-
gid = '
|
10
|
-
|
9
|
+
gid = case node['platform_family']
|
10
|
+
when 'aix'
|
11
|
+
'system'
|
12
|
+
when 'freebsd'
|
13
|
+
'wheel'
|
14
|
+
else
|
15
|
+
'root'
|
16
|
+
end
|
17
|
+
|
11
18
|
|
12
19
|
file '/tmp/file' do
|
13
20
|
mode '0765'
|
@@ -4,8 +4,14 @@
|
|
4
4
|
#
|
5
5
|
# adds a yaml file
|
6
6
|
|
7
|
-
gid = '
|
8
|
-
|
7
|
+
gid = case node['platform_family']
|
8
|
+
when 'aix'
|
9
|
+
'system'
|
10
|
+
when 'freebsd'
|
11
|
+
'wheel'
|
12
|
+
else
|
13
|
+
'root'
|
14
|
+
end
|
9
15
|
|
10
16
|
['yml', 'json', 'csv', 'ini'].each { |filetype|
|
11
17
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
root_group = case os[:family]
|
4
|
+
when 'aix'
|
5
|
+
'system'
|
6
|
+
when 'freebsd'
|
7
|
+
'wheel'
|
8
|
+
else
|
9
|
+
'root'
|
10
|
+
end
|
11
|
+
|
12
|
+
if os.unix?
|
13
|
+
describe etc_group do
|
14
|
+
its('gids') { should_not contain_duplicates }
|
15
|
+
its('groups') { should include root_group }
|
16
|
+
its('users') { should include 'root' }
|
17
|
+
end
|
18
|
+
|
19
|
+
describe etc_group.where(name: root_group) do
|
20
|
+
its('users') { should include 'root' }
|
21
|
+
end
|
22
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
|
3
|
+
case os[:family]
|
4
|
+
when 'freebsd'
|
4
5
|
filedata = {
|
5
6
|
user: 'root',
|
6
7
|
group: 'wheel',
|
@@ -8,6 +9,14 @@ if os[:family] == 'freebsd'
|
|
8
9
|
dir_md5sum: '598f4fe64aefab8f00bcbea4c9239abf',
|
9
10
|
dir_sha256sum: '9b4fb24edd6d1d8830e272398263cdbf026b97392cc35387b991dc0248a628f9',
|
10
11
|
}
|
12
|
+
when 'aix'
|
13
|
+
filedata = {
|
14
|
+
user: 'root',
|
15
|
+
group: 'system',
|
16
|
+
dir_content: nil,
|
17
|
+
dir_md5sum: nil,
|
18
|
+
dir_sha256sum: nil,
|
19
|
+
}
|
11
20
|
else
|
12
21
|
filedata = {
|
13
22
|
user: 'root',
|
@@ -30,3 +30,20 @@ if os[:family] == 'freebsd'
|
|
30
30
|
its('gid') { should eq nil }
|
31
31
|
end
|
32
32
|
end
|
33
|
+
|
34
|
+
if os[:family] == 'aix'
|
35
|
+
describe group('system') do
|
36
|
+
it { should exist }
|
37
|
+
its('gid') { should eq 0 }
|
38
|
+
end
|
39
|
+
|
40
|
+
describe group('bin') do
|
41
|
+
it { should exist }
|
42
|
+
its('gid') { should eq 2 }
|
43
|
+
end
|
44
|
+
|
45
|
+
describe group('noroot') do
|
46
|
+
it { should_not exist }
|
47
|
+
its('gid') { should eq nil }
|
48
|
+
end
|
49
|
+
end
|
@@ -1,11 +1,17 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
|
3
|
+
case os[:family]
|
4
|
+
when 'centos', 'fedora', 'opensuse', 'debian', 'ubuntu'
|
4
5
|
describe package('curl') do
|
5
6
|
it { should be_installed }
|
6
7
|
end
|
7
|
-
|
8
|
-
describe package('
|
9
|
-
it {
|
8
|
+
when 'aix'
|
9
|
+
describe package('bos.rte') do
|
10
|
+
it { should be_installed }
|
11
|
+
its('version') { should match /^(6|7)[.|\d]+\d$/ }
|
10
12
|
end
|
11
13
|
end
|
14
|
+
|
15
|
+
describe package('nginx') do
|
16
|
+
it { should_not be_installed }
|
17
|
+
end
|
@@ -5,5 +5,11 @@ if os.unix?
|
|
5
5
|
describe port(22) do
|
6
6
|
it { should be_listening }
|
7
7
|
its('protocols') { should include('tcp') }
|
8
|
+
its('protocols') { should_not include('udp') }
|
9
|
+
its('processes') { should include 'sshd' }
|
10
|
+
end
|
11
|
+
|
12
|
+
describe port(65432) do
|
13
|
+
it { should_not be_listening }
|
8
14
|
end
|
9
15
|
end
|
@@ -17,6 +17,9 @@ elsif ['windows'].include?(os[:family])
|
|
17
17
|
# Ubuntu
|
18
18
|
unavailable_service = 'sshd'
|
19
19
|
available_service = 'dhcp'
|
20
|
+
elsif ['aix'].include?(os[:family])
|
21
|
+
unavailable_service = 'clamav'
|
22
|
+
available_service = 'xntpd'
|
20
23
|
end
|
21
24
|
|
22
25
|
describe service(unavailable_service) do
|
@@ -1,8 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
case os[:family]
|
4
|
+
when 'centos', 'redhat', 'fedora', 'opensuse', 'debian', 'ubuntu'
|
6
5
|
userinfo = {
|
7
6
|
name: 'root',
|
8
7
|
group: 'root',
|
@@ -14,10 +13,10 @@ if ['centos', 'fedora', 'opensuse', 'debian', 'ubuntu'].include?(os[:family])
|
|
14
13
|
}
|
15
14
|
|
16
15
|
# different groupset for centos 5
|
17
|
-
userinfo[:groups] = ["root", "bin", "daemon", "sys", "adm", "disk", "wheel"]
|
18
|
-
|
19
|
-
elsif ['freebsd'].include?(os[:family])
|
16
|
+
userinfo[:groups] = ["root", "bin", "daemon", "sys", "adm", "disk", "wheel"] \
|
17
|
+
if os[:release].to_i == 5
|
20
18
|
|
19
|
+
when 'freebsd'
|
21
20
|
userinfo = {
|
22
21
|
name: 'root',
|
23
22
|
group: 'wheel',
|
@@ -28,8 +27,7 @@ elsif ['freebsd'].include?(os[:family])
|
|
28
27
|
shell: '/bin/csh',
|
29
28
|
}
|
30
29
|
|
31
|
-
|
32
|
-
|
30
|
+
when 'windows'
|
33
31
|
userinfo = {
|
34
32
|
name: 'Administrator',
|
35
33
|
group: nil,
|
@@ -40,23 +38,35 @@ elsif ['windows'].include?(os[:family])
|
|
40
38
|
shell: nil,
|
41
39
|
}
|
42
40
|
|
41
|
+
when 'aix'
|
42
|
+
userinfo = {
|
43
|
+
name: 'bin',
|
44
|
+
group: 'bin',
|
45
|
+
uid: 2,
|
46
|
+
gid: 2,
|
47
|
+
groups: %w{bin sys adm},
|
48
|
+
home: '/bin',
|
49
|
+
shell: nil,
|
50
|
+
#mindays: 0,
|
51
|
+
#maxdays: 0,
|
52
|
+
warndays: 0,
|
53
|
+
}
|
54
|
+
|
43
55
|
else
|
44
56
|
userinfo = {}
|
45
57
|
end
|
46
58
|
|
47
|
-
|
59
|
+
case os[:family]
|
60
|
+
when 'windows'
|
48
61
|
describe user(userinfo[:name]) do
|
49
62
|
it { should exist }
|
50
|
-
it { should belong_to_group userinfo[:group] }
|
51
|
-
its('uid') { should eq userinfo[:uid] }
|
52
|
-
its('gid') { should eq userinfo[:gid] }
|
53
|
-
its('group') { should eq userinfo[:group] }
|
54
|
-
its('groups') { should eq userinfo[:groups] }
|
55
|
-
its('home') { should eq userinfo[:home] }
|
56
|
-
its('shell') { should eq userinfo[:shell] }
|
57
63
|
end
|
58
64
|
else
|
59
65
|
describe user(userinfo[:name]) do
|
60
66
|
it { should exist }
|
67
|
+
userinfo.each do |k, v|
|
68
|
+
next if k.to_sym == :name
|
69
|
+
its(k) { should eq v }
|
70
|
+
end
|
61
71
|
end
|
62
72
|
end
|