inspec 4.18.51 → 4.18.85
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/inspec.gemspec +15 -37
- data/lib/resource_support/aws/aws_resource_mixin.rb +1 -1
- metadata +22 -709
- data/Gemfile +0 -61
- data/LICENSE +0 -14
- data/README.md +0 -474
- data/etc/deprecations.json +0 -125
- data/etc/plugin_filters.json +0 -45
- data/lib/bundles/README.md +0 -3
- data/lib/bundles/inspec-compliance/api.rb +0 -7
- data/lib/bundles/inspec-compliance/configuration.rb +0 -7
- data/lib/bundles/inspec-compliance/http.rb +0 -7
- data/lib/bundles/inspec-compliance/support.rb +0 -7
- data/lib/bundles/inspec-compliance/target.rb +0 -7
- data/lib/bundles/inspec-supermarket.rb +0 -9
- data/lib/bundles/inspec-supermarket/README.md +0 -45
- data/lib/bundles/inspec-supermarket/api.rb +0 -87
- data/lib/bundles/inspec-supermarket/cli.rb +0 -71
- data/lib/bundles/inspec-supermarket/target.rb +0 -31
- data/lib/inspec.rb +0 -30
- data/lib/inspec/archive/tar.rb +0 -25
- data/lib/inspec/archive/zip.rb +0 -15
- data/lib/inspec/backend.rb +0 -101
- data/lib/inspec/base_cli.rb +0 -318
- data/lib/inspec/cached_fetcher.rb +0 -65
- data/lib/inspec/cli.rb +0 -469
- data/lib/inspec/completions/bash.sh.erb +0 -45
- data/lib/inspec/completions/fish.sh.erb +0 -34
- data/lib/inspec/completions/zsh.sh.erb +0 -61
- data/lib/inspec/config.rb +0 -511
- data/lib/inspec/control_eval_context.rb +0 -248
- data/lib/inspec/dependencies/cache.rb +0 -74
- data/lib/inspec/dependencies/dependency_set.rb +0 -93
- data/lib/inspec/dependencies/lockfile.rb +0 -115
- data/lib/inspec/dependencies/requirement.rb +0 -135
- data/lib/inspec/dependencies/resolver.rb +0 -86
- data/lib/inspec/describe_base.rb +0 -53
- data/lib/inspec/dist.rb +0 -20
- data/lib/inspec/dsl.rb +0 -115
- data/lib/inspec/dsl_shared.rb +0 -32
- data/lib/inspec/env_printer.rb +0 -156
- data/lib/inspec/errors.rb +0 -18
- data/lib/inspec/exceptions.rb +0 -11
- data/lib/inspec/expect.rb +0 -42
- data/lib/inspec/fetcher.rb +0 -48
- data/lib/inspec/fetcher/git.rb +0 -211
- data/lib/inspec/fetcher/local.rb +0 -116
- data/lib/inspec/fetcher/mock.rb +0 -34
- data/lib/inspec/fetcher/url.rb +0 -281
- data/lib/inspec/file_provider.rb +0 -318
- data/lib/inspec/formatters.rb +0 -3
- data/lib/inspec/formatters/base.rb +0 -269
- data/lib/inspec/formatters/json_rspec.rb +0 -20
- data/lib/inspec/formatters/show_progress.rb +0 -12
- data/lib/inspec/globals.rb +0 -9
- data/lib/inspec/impact.rb +0 -36
- data/lib/inspec/input.rb +0 -421
- data/lib/inspec/input_dsl_helpers.rb +0 -26
- data/lib/inspec/input_registry.rb +0 -315
- data/lib/inspec/library_eval_context.rb +0 -55
- data/lib/inspec/log.rb +0 -7
- data/lib/inspec/metadata.rb +0 -253
- data/lib/inspec/method_source.rb +0 -20
- data/lib/inspec/objects.rb +0 -14
- data/lib/inspec/objects/control.rb +0 -85
- data/lib/inspec/objects/describe.rb +0 -106
- data/lib/inspec/objects/each_loop.rb +0 -41
- data/lib/inspec/objects/input.rb +0 -49
- data/lib/inspec/objects/list.rb +0 -15
- data/lib/inspec/objects/or_test.rb +0 -45
- data/lib/inspec/objects/ruby_helper.rb +0 -13
- data/lib/inspec/objects/tag.rb +0 -32
- data/lib/inspec/objects/test.rb +0 -94
- data/lib/inspec/objects/value.rb +0 -32
- data/lib/inspec/plugin/v1.rb +0 -2
- data/lib/inspec/plugin/v1/plugin_types/cli.rb +0 -22
- data/lib/inspec/plugin/v1/plugin_types/fetcher.rb +0 -83
- data/lib/inspec/plugin/v1/plugin_types/resource.rb +0 -176
- data/lib/inspec/plugin/v1/plugin_types/secret.rb +0 -11
- data/lib/inspec/plugin/v1/plugin_types/source_reader.rb +0 -36
- data/lib/inspec/plugin/v1/plugins.rb +0 -59
- data/lib/inspec/plugin/v1/registry.rb +0 -90
- data/lib/inspec/plugin/v2.rb +0 -46
- data/lib/inspec/plugin/v2/activator.rb +0 -40
- data/lib/inspec/plugin/v2/config_file.rb +0 -151
- data/lib/inspec/plugin/v2/filter.rb +0 -96
- data/lib/inspec/plugin/v2/installer.rb +0 -512
- data/lib/inspec/plugin/v2/loader.rb +0 -321
- data/lib/inspec/plugin/v2/plugin_base.rb +0 -112
- data/lib/inspec/plugin/v2/plugin_types/cli.rb +0 -49
- data/lib/inspec/plugin/v2/plugin_types/dsl.rb +0 -11
- data/lib/inspec/plugin/v2/plugin_types/input.rb +0 -34
- data/lib/inspec/plugin/v2/plugin_types/mock.rb +0 -12
- data/lib/inspec/plugin/v2/registry.rb +0 -98
- data/lib/inspec/plugin/v2/status.rb +0 -29
- data/lib/inspec/profile.rb +0 -658
- data/lib/inspec/profile_context.rb +0 -203
- data/lib/inspec/profile_vendor.rb +0 -84
- data/lib/inspec/reporters.rb +0 -73
- data/lib/inspec/reporters/automate.rb +0 -78
- data/lib/inspec/reporters/base.rb +0 -25
- data/lib/inspec/reporters/cli.rb +0 -370
- data/lib/inspec/reporters/json.rb +0 -113
- data/lib/inspec/reporters/json_automate.rb +0 -80
- data/lib/inspec/reporters/json_min.rb +0 -48
- data/lib/inspec/reporters/junit.rb +0 -77
- data/lib/inspec/reporters/yaml.rb +0 -20
- data/lib/inspec/require_loader.rb +0 -29
- data/lib/inspec/resource.rb +0 -114
- data/lib/inspec/resources.rb +0 -130
- data/lib/inspec/resources/aide_conf.rb +0 -153
- data/lib/inspec/resources/apache.rb +0 -47
- data/lib/inspec/resources/apache_conf.rb +0 -156
- data/lib/inspec/resources/apt.rb +0 -151
- data/lib/inspec/resources/audit_policy.rb +0 -64
- data/lib/inspec/resources/auditd.rb +0 -251
- data/lib/inspec/resources/auditd_conf.rb +0 -45
- data/lib/inspec/resources/bash.rb +0 -33
- data/lib/inspec/resources/bond.rb +0 -70
- data/lib/inspec/resources/bridge.rb +0 -125
- data/lib/inspec/resources/bsd_service.rb +0 -2
- data/lib/inspec/resources/chocolatey_package.rb +0 -82
- data/lib/inspec/resources/command.rb +0 -91
- data/lib/inspec/resources/cpan.rb +0 -58
- data/lib/inspec/resources/cran.rb +0 -64
- data/lib/inspec/resources/crontab.rb +0 -173
- data/lib/inspec/resources/csv.rb +0 -56
- data/lib/inspec/resources/dh_params.rb +0 -83
- data/lib/inspec/resources/directory.rb +0 -23
- data/lib/inspec/resources/docker.rb +0 -274
- data/lib/inspec/resources/docker_container.rb +0 -91
- data/lib/inspec/resources/docker_image.rb +0 -84
- data/lib/inspec/resources/docker_object.rb +0 -52
- data/lib/inspec/resources/docker_plugin.rb +0 -64
- data/lib/inspec/resources/docker_service.rb +0 -91
- data/lib/inspec/resources/elasticsearch.rb +0 -165
- data/lib/inspec/resources/etc_fstab.rb +0 -96
- data/lib/inspec/resources/etc_group.rb +0 -157
- data/lib/inspec/resources/etc_hosts.rb +0 -68
- data/lib/inspec/resources/etc_hosts_allow.rb +0 -2
- data/lib/inspec/resources/etc_hosts_allow_deny.rb +0 -114
- data/lib/inspec/resources/etc_hosts_deny.rb +0 -2
- data/lib/inspec/resources/file.rb +0 -339
- data/lib/inspec/resources/filesystem.rb +0 -139
- data/lib/inspec/resources/firewalld.rb +0 -148
- data/lib/inspec/resources/gem.rb +0 -80
- data/lib/inspec/resources/group.rb +0 -2
- data/lib/inspec/resources/groups.rb +0 -241
- data/lib/inspec/resources/grub_conf.rb +0 -230
- data/lib/inspec/resources/host.rb +0 -310
- data/lib/inspec/resources/http.rb +0 -275
- data/lib/inspec/resources/iis_app.rb +0 -101
- data/lib/inspec/resources/iis_app_pool.rb +0 -127
- data/lib/inspec/resources/iis_site.rb +0 -148
- data/lib/inspec/resources/iis_website.rb +0 -2
- data/lib/inspec/resources/inetd_conf.rb +0 -53
- data/lib/inspec/resources/ini.rb +0 -28
- data/lib/inspec/resources/interface.rb +0 -204
- data/lib/inspec/resources/ip6tables.rb +0 -79
- data/lib/inspec/resources/iptables.rb +0 -80
- data/lib/inspec/resources/json.rb +0 -116
- data/lib/inspec/resources/kernel_module.rb +0 -106
- data/lib/inspec/resources/kernel_parameter.rb +0 -54
- data/lib/inspec/resources/key_rsa.rb +0 -66
- data/lib/inspec/resources/ksh.rb +0 -33
- data/lib/inspec/resources/launchd_service.rb +0 -2
- data/lib/inspec/resources/limits_conf.rb +0 -45
- data/lib/inspec/resources/linux_kernel_parameter.rb +0 -2
- data/lib/inspec/resources/login_defs.rb +0 -56
- data/lib/inspec/resources/mount.rb +0 -88
- data/lib/inspec/resources/mssql_session.rb +0 -117
- data/lib/inspec/resources/mysql.rb +0 -81
- data/lib/inspec/resources/mysql_conf.rb +0 -128
- data/lib/inspec/resources/mysql_session.rb +0 -88
- data/lib/inspec/resources/nginx.rb +0 -96
- data/lib/inspec/resources/nginx_conf.rb +0 -232
- data/lib/inspec/resources/noop.rb +0 -9
- data/lib/inspec/resources/npm.rb +0 -68
- data/lib/inspec/resources/ntp_conf.rb +0 -51
- data/lib/inspec/resources/oneget.rb +0 -71
- data/lib/inspec/resources/oracledb_session.rb +0 -149
- data/lib/inspec/resources/os.rb +0 -34
- data/lib/inspec/resources/os_env.rb +0 -86
- data/lib/inspec/resources/package.rb +0 -391
- data/lib/inspec/resources/packages.rb +0 -111
- data/lib/inspec/resources/parse_config.rb +0 -112
- data/lib/inspec/resources/parse_config_file.rb +0 -2
- data/lib/inspec/resources/passwd.rb +0 -73
- data/lib/inspec/resources/pip.rb +0 -132
- data/lib/inspec/resources/platform.rb +0 -112
- data/lib/inspec/resources/port.rb +0 -791
- data/lib/inspec/resources/postfix_conf.rb +0 -35
- data/lib/inspec/resources/postgres.rb +0 -152
- data/lib/inspec/resources/postgres_conf.rb +0 -116
- data/lib/inspec/resources/postgres_hba_conf.rb +0 -86
- data/lib/inspec/resources/postgres_ident_conf.rb +0 -75
- data/lib/inspec/resources/postgres_session.rb +0 -70
- data/lib/inspec/resources/powershell.rb +0 -67
- data/lib/inspec/resources/ppa.rb +0 -2
- data/lib/inspec/resources/processes.rb +0 -219
- data/lib/inspec/resources/rabbitmq_conf.rb +0 -2
- data/lib/inspec/resources/rabbitmq_config.rb +0 -52
- data/lib/inspec/resources/registry_key.rb +0 -296
- data/lib/inspec/resources/runit_service.rb +0 -2
- data/lib/inspec/resources/script.rb +0 -1
- data/lib/inspec/resources/security_identifier.rb +0 -91
- data/lib/inspec/resources/security_policy.rb +0 -182
- data/lib/inspec/resources/service.rb +0 -820
- data/lib/inspec/resources/shadow.rb +0 -150
- data/lib/inspec/resources/ssh_config.rb +0 -98
- data/lib/inspec/resources/sshd_config.rb +0 -2
- data/lib/inspec/resources/ssl.rb +0 -99
- data/lib/inspec/resources/sys_info.rb +0 -119
- data/lib/inspec/resources/systemd_service.rb +0 -2
- data/lib/inspec/resources/sysv_service.rb +0 -2
- data/lib/inspec/resources/toml.rb +0 -30
- data/lib/inspec/resources/upstart_service.rb +0 -2
- data/lib/inspec/resources/user.rb +0 -1
- data/lib/inspec/resources/users.rb +0 -742
- data/lib/inspec/resources/vbscript.rb +0 -67
- data/lib/inspec/resources/virtualization.rb +0 -255
- data/lib/inspec/resources/windows_feature.rb +0 -126
- data/lib/inspec/resources/windows_hotfix.rb +0 -37
- data/lib/inspec/resources/windows_registry_key.rb +0 -2
- data/lib/inspec/resources/windows_task.rb +0 -112
- data/lib/inspec/resources/wmi.rb +0 -109
- data/lib/inspec/resources/x509_certificate.rb +0 -143
- data/lib/inspec/resources/xinetd_conf.rb +0 -103
- data/lib/inspec/resources/xml.rb +0 -48
- data/lib/inspec/resources/yaml.rb +0 -42
- data/lib/inspec/resources/yum.rb +0 -162
- data/lib/inspec/resources/zfs_dataset.rb +0 -62
- data/lib/inspec/resources/zfs_pool.rb +0 -50
- data/lib/inspec/rspec_extensions.rb +0 -116
- data/lib/inspec/rule.rb +0 -389
- data/lib/inspec/runner.rb +0 -333
- data/lib/inspec/runner_mock.rb +0 -37
- data/lib/inspec/runner_rspec.rb +0 -184
- data/lib/inspec/runtime_profile.rb +0 -23
- data/lib/inspec/schema.rb +0 -245
- data/lib/inspec/secrets.rb +0 -15
- data/lib/inspec/secrets/yaml.rb +0 -29
- data/lib/inspec/shell.rb +0 -211
- data/lib/inspec/shell_detector.rb +0 -89
- data/lib/inspec/source_reader.rb +0 -26
- data/lib/inspec/ui.rb +0 -213
- data/lib/inspec/ui_table_helper.rb +0 -12
- data/lib/inspec/utils/command_wrapper.rb +0 -23
- data/lib/inspec/utils/convert.rb +0 -8
- data/lib/inspec/utils/database_helpers.rb +0 -75
- data/lib/inspec/utils/deprecation.rb +0 -6
- data/lib/inspec/utils/deprecation/config_file.rb +0 -109
- data/lib/inspec/utils/deprecation/deprecator.rb +0 -118
- data/lib/inspec/utils/deprecation/errors.rb +0 -14
- data/lib/inspec/utils/deprecation/global_method.rb +0 -9
- data/lib/inspec/utils/enumerable_delegation.rb +0 -7
- data/lib/inspec/utils/erlang_parser.rb +0 -190
- data/lib/inspec/utils/file_reader.rb +0 -24
- data/lib/inspec/utils/filter.rb +0 -461
- data/lib/inspec/utils/filter_array.rb +0 -25
- data/lib/inspec/utils/find_files.rb +0 -44
- data/lib/inspec/utils/hash.rb +0 -37
- data/lib/inspec/utils/json_log.rb +0 -15
- data/lib/inspec/utils/modulator.rb +0 -9
- data/lib/inspec/utils/nginx_parser.rb +0 -101
- data/lib/inspec/utils/object_traversal.rb +0 -47
- data/lib/inspec/utils/parser.rb +0 -277
- data/lib/inspec/utils/pkey_reader.rb +0 -17
- data/lib/inspec/utils/simpleconfig.rb +0 -121
- data/lib/inspec/utils/spdx.rb +0 -10
- data/lib/inspec/utils/spdx.txt +0 -383
- data/lib/inspec/utils/telemetry.rb +0 -3
- data/lib/inspec/utils/telemetry/collector.rb +0 -81
- data/lib/inspec/utils/telemetry/data_series.rb +0 -44
- data/lib/inspec/utils/telemetry/global_methods.rb +0 -22
- data/lib/inspec/version.rb +0 -3
- data/lib/matchers/matchers.rb +0 -341
- data/lib/plugins/README.md +0 -16
- data/lib/plugins/inspec-artifact/lib/inspec-artifact.rb +0 -12
- data/lib/plugins/inspec-artifact/lib/inspec-artifact/base.rb +0 -170
- data/lib/plugins/inspec-artifact/lib/inspec-artifact/cli.rb +0 -116
- data/lib/plugins/inspec-artifact/test/functional/inspec_artifact_test.rb +0 -50
- data/lib/plugins/inspec-compliance/README.md +0 -207
- data/lib/plugins/inspec-compliance/lib/inspec-compliance.rb +0 -12
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/api.rb +0 -362
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/api/login.rb +0 -198
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/cli.rb +0 -269
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/configuration.rb +0 -103
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/http.rb +0 -117
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/images/cc-token.png +0 -0
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/support.rb +0 -34
- data/lib/plugins/inspec-compliance/lib/inspec-compliance/target.rb +0 -146
- data/lib/plugins/inspec-compliance/test/functional/inspec_compliance_test.rb +0 -53
- data/lib/plugins/inspec-compliance/test/integration/default/cli.rb +0 -91
- data/lib/plugins/inspec-compliance/test/unit/api/login_test.rb +0 -190
- data/lib/plugins/inspec-compliance/test/unit/api_test.rb +0 -386
- data/lib/plugins/inspec-compliance/test/unit/target_test.rb +0 -155
- data/lib/plugins/inspec-habitat/Berksfile +0 -5
- data/lib/plugins/inspec-habitat/README.md +0 -150
- data/lib/plugins/inspec-habitat/kitchen.yml +0 -28
- data/lib/plugins/inspec-habitat/lib/inspec-habitat.rb +0 -11
- data/lib/plugins/inspec-habitat/lib/inspec-habitat/cli.rb +0 -41
- data/lib/plugins/inspec-habitat/lib/inspec-habitat/profile.rb +0 -265
- data/lib/plugins/inspec-habitat/templates/habitat/plan.sh.erb +0 -6
- data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/Berksfile +0 -2
- data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/README.md +0 -3
- data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/files/hab_setup.exp +0 -28
- data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/metadata.rb +0 -9
- data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/recipes/default.rb +0 -61
- data/lib/plugins/inspec-habitat/test/functional/inspec_habitat_test.rb +0 -34
- data/lib/plugins/inspec-habitat/test/integration/default/inspec_habitat/README.md +0 -3
- data/lib/plugins/inspec-habitat/test/integration/default/inspec_habitat/controls/inspec_habitat.rb +0 -40
- data/lib/plugins/inspec-habitat/test/integration/default/inspec_habitat/inspec.yml +0 -10
- data/lib/plugins/inspec-habitat/test/support/example_profile/README.md +0 -3
- data/lib/plugins/inspec-habitat/test/support/example_profile/controls/example.rb +0 -7
- data/lib/plugins/inspec-habitat/test/support/example_profile/inspec.yml +0 -10
- data/lib/plugins/inspec-habitat/test/unit/profile_test.rb +0 -242
- data/lib/plugins/inspec-init/README.md +0 -31
- data/lib/plugins/inspec-init/lib/inspec-init.rb +0 -12
- data/lib/plugins/inspec-init/lib/inspec-init/cli.rb +0 -15
- data/lib/plugins/inspec-init/lib/inspec-init/cli_plugin.rb +0 -243
- data/lib/plugins/inspec-init/lib/inspec-init/cli_profile.rb +0 -47
- data/lib/plugins/inspec-init/lib/inspec-init/renderer.rb +0 -97
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/Gemfile +0 -11
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/LICENSE +0 -2
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/README.md +0 -28
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/Rakefile +0 -40
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/lib/inspec-plugin-template.rb +0 -14
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/lib/inspec-plugin-template/cli_command.rb +0 -62
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/lib/inspec-plugin-template/plugin.rb +0 -53
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/lib/inspec-plugin-template/version.rb +0 -8
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/fixtures/README.md +0 -24
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/functional/README.md +0 -12
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/functional/inspec_plugin_template_test.rb +0 -110
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/helper.rb +0 -24
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/unit/README.md +0 -17
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/unit/cli_args_test.rb +0 -67
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/unit/plugin_def_test.rb +0 -51
- data/lib/plugins/inspec-init/templates/profiles/aws/libraries/.gitkeep +0 -0
- data/lib/plugins/inspec-init/templates/profiles/azure/libraries/.gitkeep +0 -0
- data/lib/plugins/inspec-init/templates/profiles/gcp/libraries/.gitkeep +0 -0
- data/lib/plugins/inspec-init/templates/profiles/os/README.md +0 -3
- data/lib/plugins/inspec-init/templates/profiles/os/controls/example.rb +0 -18
- data/lib/plugins/inspec-init/templates/profiles/os/inspec.yml +0 -10
- data/lib/plugins/inspec-init/templates/profiles/os/libraries/.gitkeep +0 -0
- data/lib/plugins/inspec-init/test/functional/inspec_init_plugin_test.rb +0 -184
- data/lib/plugins/inspec-init/test/functional/inspec_init_profile_test.rb +0 -121
- data/lib/plugins/inspec-plugin-manager-cli/README.md +0 -6
- data/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli.rb +0 -17
- data/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb +0 -518
- data/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/plugin.rb +0 -12
- data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/config_dirs/empty/.gitkeep +0 -0
- data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/plugins/inspec-egg-white-omelette/lib/inspec-egg-white-omelette.rb +0 -2
- data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/plugins/inspec-egg-white-omelette/lib/inspec-egg-white-omelette/.gitkeep +0 -0
- data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/plugins/inspec-wrong-structure/.gitkeep +0 -0
- data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/plugins/wrong-name/lib/wrong-name.rb +0 -1
- data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/plugins/wrong-name/lib/wrong-name/.gitkeep +0 -0
- data/lib/plugins/inspec-plugin-manager-cli/test/functional/help_test.rb +0 -23
- data/lib/plugins/inspec-plugin-manager-cli/test/functional/helper.rb +0 -62
- data/lib/plugins/inspec-plugin-manager-cli/test/functional/install_test.rb +0 -368
- data/lib/plugins/inspec-plugin-manager-cli/test/functional/list_test.rb +0 -101
- data/lib/plugins/inspec-plugin-manager-cli/test/functional/search_test.rb +0 -129
- data/lib/plugins/inspec-plugin-manager-cli/test/functional/uninstall_test.rb +0 -63
- data/lib/plugins/inspec-plugin-manager-cli/test/functional/update_test.rb +0 -84
- data/lib/plugins/inspec-plugin-manager-cli/test/unit/cli_args_test.rb +0 -77
- data/lib/plugins/inspec-plugin-manager-cli/test/unit/plugin_def_test.rb +0 -39
- data/lib/plugins/shared/core_plugin_test_helper.rb +0 -153
- data/lib/plugins/things-for-train-integration.rb +0 -14
- data/lib/source_readers/flat.rb +0 -36
- data/lib/source_readers/inspec.rb +0 -66
@@ -1,6 +0,0 @@
|
|
1
|
-
pkg_name=<%= "inspec-profile-#{profile.name}" %>
|
2
|
-
pkg_version=<%= profile.version %>
|
3
|
-
pkg_origin=<%= habitat_origin %>
|
4
|
-
pkg_svc_user=root
|
5
|
-
<%= "pkg_license='#{profile.metadata.params[:license]}'" if profile.metadata.params[:license]%>
|
6
|
-
pkg_scaffolding="chef/scaffolding-chef-inspec"
|
@@ -1,28 +0,0 @@
|
|
1
|
-
#!/usr/bin/expect -f
|
2
|
-
|
3
|
-
set timeout -1
|
4
|
-
|
5
|
-
spawn hab setup
|
6
|
-
|
7
|
-
expect "Connect to an on-premises bldr instance?"
|
8
|
-
send -- "No\r"
|
9
|
-
|
10
|
-
expect "Set up a default origin?"
|
11
|
-
send -- "Yes\r"
|
12
|
-
|
13
|
-
expect "Default origin name"
|
14
|
-
send -- "vagrant\r"
|
15
|
-
|
16
|
-
expect "Create an origin key for `vagrant'?"
|
17
|
-
send -- "Yes\r"
|
18
|
-
|
19
|
-
expect "Set up a default Habitat personal access token?"
|
20
|
-
send -- "No\r"
|
21
|
-
|
22
|
-
expect "Set up a default Habitat Supervisor CtlGateway secret?"
|
23
|
-
send -- "No\r"
|
24
|
-
|
25
|
-
expect "Enable analytics?"
|
26
|
-
send -- "No\r"
|
27
|
-
|
28
|
-
expect eof
|
@@ -1,61 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Cookbook:: kitchen_setup_cookbook
|
3
|
-
# Recipe:: default
|
4
|
-
#
|
5
|
-
# Copyright:: 2019, The Authors, All Rights Reserved.
|
6
|
-
|
7
|
-
package %w{ruby ruby-dev gcc g++ make expect}
|
8
|
-
|
9
|
-
base_dir = "/home/vagrant"
|
10
|
-
|
11
|
-
cookbook_file "#{base_dir}/inspec-local.gem" do
|
12
|
-
source "inspec-local.gem"
|
13
|
-
action :create
|
14
|
-
end
|
15
|
-
|
16
|
-
gem_package "inspec" do
|
17
|
-
source "#{base_dir}/inspec-local.gem"
|
18
|
-
subscribes :install, "cookbook_file[#{base_dir}/inspec-local.gem]", :immediately
|
19
|
-
end
|
20
|
-
|
21
|
-
cookbook_file "#{base_dir}/hab_setup.exp" do
|
22
|
-
source "hab_setup.exp"
|
23
|
-
mode "0755"
|
24
|
-
action :create
|
25
|
-
end
|
26
|
-
|
27
|
-
hab_install "install habitat"
|
28
|
-
hab_sup "setup hab supervisor"
|
29
|
-
|
30
|
-
execute "setup hab cli" do
|
31
|
-
command "#{base_dir}/hab_setup.exp"
|
32
|
-
live_stream true
|
33
|
-
not_if { ::File.exist?("/hab/etc/cli.toml") }
|
34
|
-
not_if { ::File.exist?("~/.hab/etc/cli.toml") }
|
35
|
-
end
|
36
|
-
|
37
|
-
execute "create inspec profile for testing" do
|
38
|
-
command "inspec init profile #{base_dir}/hab_test_profile"
|
39
|
-
live_stream true
|
40
|
-
creates "#{base_dir}/hab_test_profile"
|
41
|
-
end
|
42
|
-
|
43
|
-
directory "#{base_dir}/output"
|
44
|
-
|
45
|
-
execute "create hart file from profile" do
|
46
|
-
command "inspec habitat profile create #{base_dir}/hab_test_profile --output_dir '#{base_dir}/output'"
|
47
|
-
live_stream true
|
48
|
-
not_if "find #{base_dir}/output | grep vagrant-inspec-profile-hab_test_profile-0.1.0-.*.hart"
|
49
|
-
end
|
50
|
-
|
51
|
-
execute "install vagrant/inspec-profile-hab_test_profile" do
|
52
|
-
command "hab pkg install #{base_dir}/output/*.hart"
|
53
|
-
live_stream true
|
54
|
-
not_if "hab pkg list --origin vagrant | grep inspec-profile"
|
55
|
-
end
|
56
|
-
|
57
|
-
execute "load vagrant/inspec-profile-hab_test_profile into supervisor" do
|
58
|
-
command "hab svc load vagrant/inspec-profile-hab_test_profile"
|
59
|
-
live_stream true
|
60
|
-
not_if 'sudo hab svc status | grep "vagrant/inspec-profile-hab_test_profile"'
|
61
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
require_relative "../../../shared/core_plugin_test_helper.rb"
|
2
|
-
require "fileutils"
|
3
|
-
|
4
|
-
class ProfileCli < Minitest::Test
|
5
|
-
include CorePluginFunctionalHelper
|
6
|
-
|
7
|
-
def setup
|
8
|
-
@tmpdir = Dir.mktmpdir
|
9
|
-
@habitat_profile = File.join(@tmpdir, "habitat-profile")
|
10
|
-
run_inspec_process("init profile " + @habitat_profile)
|
11
|
-
end
|
12
|
-
|
13
|
-
def teardown
|
14
|
-
FileUtils.remove_entry_secure(@tmpdir)
|
15
|
-
end
|
16
|
-
|
17
|
-
def test_setup_subcommand
|
18
|
-
result = run_inspec_process("habitat profile setup " + @habitat_profile + " --log-level debug")
|
19
|
-
|
20
|
-
# Command creates only expected files
|
21
|
-
base_dir = File.join(@tmpdir, "habitat-profile", "habitat")
|
22
|
-
files = %w{
|
23
|
-
plan.sh
|
24
|
-
}
|
25
|
-
actual_files = Dir.glob(File.join(base_dir, "**/*"))
|
26
|
-
expected_files = files.map { |x| File.join(base_dir, x) }
|
27
|
-
assert_equal actual_files.sort, expected_files.sort
|
28
|
-
|
29
|
-
# Command runs without error
|
30
|
-
assert_empty result.stderr
|
31
|
-
|
32
|
-
assert_exit_code 0, result
|
33
|
-
end
|
34
|
-
end
|
data/lib/plugins/inspec-habitat/test/integration/default/inspec_habitat/controls/inspec_habitat.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
control "inspec-habitat-create" do
|
2
|
-
title "Create command"
|
3
|
-
|
4
|
-
output_hart_dir = "/home/vagrant/output"
|
5
|
-
find_hart_output = command("find #{output_hart_dir} -name '*.hart'").stdout
|
6
|
-
hart_files = find_hart_output.split("\n")
|
7
|
-
|
8
|
-
hab_profile_path = "/home/vagrant/hab_test_profile"
|
9
|
-
find_profile_files_command = "find #{hab_profile_path} -type f -printf '%f\n'"
|
10
|
-
profile_files = command(find_profile_files_command).stdout.split("\n").sort
|
11
|
-
expected_files = %w{
|
12
|
-
.gitkeep
|
13
|
-
README.md
|
14
|
-
example.rb
|
15
|
-
inspec.yml
|
16
|
-
}
|
17
|
-
|
18
|
-
describe "`inspec habitat profile create`" do
|
19
|
-
it "should create exactly 1 hart file" do
|
20
|
-
expect(hart_files.length).to eq(1)
|
21
|
-
end
|
22
|
-
it "does not add any extra files to a default generated profile" do
|
23
|
-
expect(profile_files).to eq(expected_files)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
control "inspec-habitat-service" do
|
29
|
-
title "inspec-profile-hab_test_profile service"
|
30
|
-
describe "The running service" do
|
31
|
-
it "should create a log file" do
|
32
|
-
log = "/hab/svc/inspec-profile-hab_test_profile/logs/inspec_log.txt"
|
33
|
-
expect(file(log).exist?).to be(true)
|
34
|
-
end
|
35
|
-
it "should create a JSON file for the last run" do
|
36
|
-
log = "/hab/svc/inspec-profile-hab_test_profile/logs/inspec_last_run.json"
|
37
|
-
JSON.parse(file(log).content)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
@@ -1,242 +0,0 @@
|
|
1
|
-
require "mixlib/log"
|
2
|
-
require "fileutils"
|
3
|
-
require "minitest/autorun"
|
4
|
-
require "inspec/backend"
|
5
|
-
require_relative "../../lib/inspec-habitat/profile.rb"
|
6
|
-
|
7
|
-
class InspecPlugins::Habitat::ProfileTest < Minitest::Test
|
8
|
-
def setup
|
9
|
-
@tmpdir = Dir.mktmpdir
|
10
|
-
|
11
|
-
@output_dir = File.join(@tmpdir, "output")
|
12
|
-
FileUtils.mkdir(@output_dir)
|
13
|
-
|
14
|
-
@fake_hart_file = FileUtils.touch(File.join(@tmpdir, "fake-hart.hart"))[0]
|
15
|
-
|
16
|
-
# Path from `__FILE__` needed to support running tests in `inspec/inspec`
|
17
|
-
@test_profile_path = File.join(
|
18
|
-
File.expand_path(File.dirname(__FILE__)),
|
19
|
-
"../",
|
20
|
-
"support",
|
21
|
-
"example_profile"
|
22
|
-
)
|
23
|
-
@test_profile = Inspec::Profile.for_target(
|
24
|
-
@test_profile_path,
|
25
|
-
backend: Inspec::Backend.create(Inspec::Config.mock)
|
26
|
-
)
|
27
|
-
|
28
|
-
@hab_profile = InspecPlugins::Habitat::Profile.new(
|
29
|
-
@test_profile_path,
|
30
|
-
{ output_dir: @output_dir }
|
31
|
-
)
|
32
|
-
|
33
|
-
@mock_hab_config = {
|
34
|
-
"auth_token" => "FAKETOKEN",
|
35
|
-
"origin" => "fake_origin",
|
36
|
-
}
|
37
|
-
|
38
|
-
Inspec::Log.level(:fatal)
|
39
|
-
end
|
40
|
-
|
41
|
-
def after_run
|
42
|
-
FileUtils.remove_entry_secure(@tmpdir)
|
43
|
-
end
|
44
|
-
|
45
|
-
def test_create_raises_if_output_dir_does_not_exist
|
46
|
-
profile = InspecPlugins::Habitat::Profile.new(
|
47
|
-
@test_profile_path,
|
48
|
-
{
|
49
|
-
output_dir: "/not/a/real/path",
|
50
|
-
log_level: "fatal",
|
51
|
-
}
|
52
|
-
)
|
53
|
-
|
54
|
-
assert_raises(SystemExit) { profile.create }
|
55
|
-
# TODO: Figure out how to capture and validate `Inspec::Log.error`
|
56
|
-
end
|
57
|
-
|
58
|
-
def test_create
|
59
|
-
file_count = Dir.glob(File.join(@test_profile_path, "**/*")).count
|
60
|
-
|
61
|
-
@hab_profile.stub :read_habitat_config, @mock_hab_config do
|
62
|
-
@hab_profile.stub :verify_habitat_setup, nil do
|
63
|
-
@hab_profile.stub :build_hart, @fake_hart_file do
|
64
|
-
@hab_profile.create
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
# It should not modify target profile
|
70
|
-
new_file_count = Dir.glob(File.join(@test_profile_path, "**/*")).count
|
71
|
-
assert_equal new_file_count, file_count
|
72
|
-
|
73
|
-
# It should create 1 Habitat artifact
|
74
|
-
output_files = Dir.glob(File.join(@output_dir, "**/*"))
|
75
|
-
assert_equal 1, output_files.count
|
76
|
-
assert_equal "fake-hart.hart", File.basename(output_files.first)
|
77
|
-
end
|
78
|
-
|
79
|
-
def test_create_rasies_if_habitat_is_not_installed
|
80
|
-
cmd = Minitest::Mock.new
|
81
|
-
cmd.expect(:error?, true)
|
82
|
-
cmd.expect(:run_command, nil)
|
83
|
-
|
84
|
-
Mixlib::ShellOut.stub :new, cmd, "hab --version" do
|
85
|
-
assert_raises(SystemExit) { @hab_profile.create }
|
86
|
-
# TODO: Figure out how to capture and validate `Inspec::Log.error`
|
87
|
-
end
|
88
|
-
|
89
|
-
cmd.verify
|
90
|
-
end
|
91
|
-
|
92
|
-
def test_upload
|
93
|
-
@hab_profile.stub :read_habitat_config, @mock_hab_config do
|
94
|
-
@hab_profile.stub :create, @fake_hart_file do
|
95
|
-
@hab_profile.stub :upload_hart, nil do
|
96
|
-
@hab_profile.upload
|
97
|
-
# TODO: Figure out how to capture and validate `Inspec::Log.error`
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
def test_upload_raises_if_no_habitat_auth_token_is_found
|
104
|
-
@hab_profile.stub :read_habitat_config, {} do
|
105
|
-
assert_raises(SystemExit) { @hab_profile.upload }
|
106
|
-
# TODO: Figure out how to capture and validate `Inspec::Log.error`
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
def test_create_working_dir
|
111
|
-
Dir.stub :mktmpdir, "/tmp/fakedir" do
|
112
|
-
assert_equal "/tmp/fakedir", @hab_profile.send(:create_working_dir)
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
def test_duplicate_profile
|
117
|
-
current_profile = @test_profile
|
118
|
-
duplicated_profile = @hab_profile.send(:duplicate_profile,
|
119
|
-
@test_profile_path,
|
120
|
-
@tmpdir)
|
121
|
-
assert duplicated_profile.is_a?(Inspec::Profile)
|
122
|
-
assert duplicated_profile.sha256 == current_profile.sha256.to_s
|
123
|
-
refute_same duplicated_profile.root_path, current_profile.root_path
|
124
|
-
end
|
125
|
-
|
126
|
-
def test_profile_from_path
|
127
|
-
profile = @hab_profile.send(:profile_from_path, @test_profile_path)
|
128
|
-
assert profile.is_a?(Inspec::Profile)
|
129
|
-
end
|
130
|
-
|
131
|
-
def test_copy_profile_to_working_dir
|
132
|
-
duplicated_profile = @hab_profile.send(:duplicate_profile,
|
133
|
-
@test_profile_path,
|
134
|
-
@tmpdir)
|
135
|
-
|
136
|
-
dst = File.join(@tmpdir, "working_dir")
|
137
|
-
FileUtils.mkdir_p(dst)
|
138
|
-
@hab_profile.send(:copy_profile_to_working_dir, duplicated_profile, dst)
|
139
|
-
|
140
|
-
expected_files = %w{
|
141
|
-
README.md
|
142
|
-
inspec.yml
|
143
|
-
example.rb
|
144
|
-
}
|
145
|
-
|
146
|
-
actual_files = Dir.glob(File.join(dst, "**/*")).map do |path|
|
147
|
-
next unless File.file?(path)
|
148
|
-
|
149
|
-
File.basename(path)
|
150
|
-
end.compact
|
151
|
-
|
152
|
-
assert(actual_files.sort == expected_files.sort)
|
153
|
-
end
|
154
|
-
|
155
|
-
def test_verify_profile_raises_if_profile_is_not_valid
|
156
|
-
bad_profile_path = File.join(@tmpdir, "bad_profile")
|
157
|
-
FileUtils.mkdir_p(File.join(bad_profile_path))
|
158
|
-
FileUtils.touch(File.join(bad_profile_path, "inspec.yml"))
|
159
|
-
bad_profile = Inspec::Profile.for_target(
|
160
|
-
bad_profile_path,
|
161
|
-
backend: Inspec::Backend.create(Inspec::Config.mock)
|
162
|
-
)
|
163
|
-
assert_raises(SystemExit) { @hab_profile.send(:verify_profile, bad_profile) }
|
164
|
-
# TODO: Figure out how to capture and validate `Inspec::Log.error`
|
165
|
-
end
|
166
|
-
|
167
|
-
def test_vendor_profile_dependencies_does_not_vendor_if_already_vendored
|
168
|
-
mock_lock_file = Minitest::Mock.new
|
169
|
-
mock_lock_file.expect(:exist?, true)
|
170
|
-
mock_cache_path = Minitest::Mock.new
|
171
|
-
mock_cache_path.expect(:exist?, true)
|
172
|
-
|
173
|
-
mock = Minitest::Mock.new
|
174
|
-
mock.expect(:lockfile, mock_lock_file)
|
175
|
-
mock.expect(:cache_path, mock_cache_path)
|
176
|
-
|
177
|
-
Inspec::ProfileVendor.stub :new, mock do
|
178
|
-
new_profile = @hab_profile.send(:vendor_profile_dependencies!,
|
179
|
-
@test_profile)
|
180
|
-
assert new_profile.is_a?(Inspec::Profile)
|
181
|
-
end
|
182
|
-
end
|
183
|
-
|
184
|
-
def test_vendor_profile_dependencies
|
185
|
-
mock_lock_file = Minitest::Mock.new
|
186
|
-
mock_lock_file.expect(:exist?, false)
|
187
|
-
|
188
|
-
mock = Minitest::Mock.new
|
189
|
-
mock.expect(:lockfile, mock_lock_file)
|
190
|
-
mock.expect(:vendor!, nil)
|
191
|
-
mock.expect(:make_readable, nil)
|
192
|
-
|
193
|
-
Inspec::ProfileVendor.stub :new, mock do
|
194
|
-
new_profile = @hab_profile.send(:vendor_profile_dependencies!,
|
195
|
-
@test_profile)
|
196
|
-
assert new_profile.is_a?(Inspec::Profile)
|
197
|
-
end
|
198
|
-
mock.verify
|
199
|
-
end
|
200
|
-
|
201
|
-
def test_verify_habitat_setup_raises_if_hab_version_errors
|
202
|
-
mock = Minitest::Mock.new
|
203
|
-
mock.expect(:run_command, nil)
|
204
|
-
mock.expect(:error?, true)
|
205
|
-
mock.expect(:stderr, "This would be an error message")
|
206
|
-
|
207
|
-
Mixlib::ShellOut.stub(:new, mock) do
|
208
|
-
assert_raises(SystemExit) { @hab_profile.send(:verify_habitat_setup, {}) }
|
209
|
-
# TODO: Figure out how to capture and validate `Inspec::Log.error`
|
210
|
-
end
|
211
|
-
mock.verify
|
212
|
-
end
|
213
|
-
|
214
|
-
def test_verify_habitat_setup_raises_if_not_habitat_origin
|
215
|
-
mock = Minitest::Mock.new
|
216
|
-
mock.expect(:run_command, nil)
|
217
|
-
mock.expect(:error?, false)
|
218
|
-
|
219
|
-
Mixlib::ShellOut.stub(:new, mock) do
|
220
|
-
assert_raises(SystemExit) { @hab_profile.send(:verify_habitat_setup, {}) }
|
221
|
-
# TODO: Figure out how to capture and validate `Inspec::Log.error`
|
222
|
-
end
|
223
|
-
mock.verify
|
224
|
-
end
|
225
|
-
|
226
|
-
# TODO: Figure out how to stub system()
|
227
|
-
# def test_build_hart
|
228
|
-
# end
|
229
|
-
|
230
|
-
def test_upload_hart_raises_if_hab_pkg_upload_fails
|
231
|
-
mock = Minitest::Mock.new
|
232
|
-
mock.expect(:run_command, nil)
|
233
|
-
mock.expect(:error?, true)
|
234
|
-
mock.expect(:stdout, "This would contain output from `hab`")
|
235
|
-
mock.expect(:stderr, "This would be an error message")
|
236
|
-
|
237
|
-
Mixlib::ShellOut.stub(:new, mock) do
|
238
|
-
assert_raises(SystemExit) { @hab_profile.send(:upload_hart, @fake_hart_file, {}) }
|
239
|
-
# TODO: Figure out how to capture and validate `Inspec::Log.error`
|
240
|
-
end
|
241
|
-
end
|
242
|
-
end
|