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,112 +0,0 @@
|
|
1
|
-
require "inspec/resources/powershell"
|
2
|
-
|
3
|
-
module Inspec::Resources
|
4
|
-
class WindowsTasks < Inspec.resource(1) # TODO: rename singular
|
5
|
-
name "windows_task"
|
6
|
-
supports platform: "windows"
|
7
|
-
desc "Use the windows_task InSpec audit resource to test task schedules on Microsoft Windows."
|
8
|
-
example <<~EXAMPLE
|
9
|
-
describe windows_task('\\Microsoft\\Windows\\Time Synchronization\\SynchronizeTime') do
|
10
|
-
it { should be_enabled }
|
11
|
-
end
|
12
|
-
|
13
|
-
describe windows_task('\\Microsoft\\Windows\\AppID\\PolicyConverter') do
|
14
|
-
it { should be_disabled }
|
15
|
-
end
|
16
|
-
|
17
|
-
describe windows_task('\\Microsoft\\Windows\\Defrag\\ScheduledDefrag') do
|
18
|
-
it { should exist }
|
19
|
-
end
|
20
|
-
|
21
|
-
describe windows_task('\\Microsoft\\Windows\\AppID\\PolicyConverter') do
|
22
|
-
its('logon_mode') { should eq 'Interactive/Background' }
|
23
|
-
its('last_result') { should eq '1' }
|
24
|
-
its('task_to_run') { should cmp '%Windir%\\system32\\appidpolicyconverter.exe' }
|
25
|
-
its('run_as_user') { should eq 'LOCAL SERVICE' }
|
26
|
-
end
|
27
|
-
EXAMPLE
|
28
|
-
|
29
|
-
def initialize(taskuri)
|
30
|
-
@taskuri = taskuri
|
31
|
-
@cache = nil
|
32
|
-
end
|
33
|
-
|
34
|
-
def exists?
|
35
|
-
return true unless info.nil? || info[:uri].nil?
|
36
|
-
|
37
|
-
false
|
38
|
-
end
|
39
|
-
|
40
|
-
# rubocop:disable Style/WordArray
|
41
|
-
def enabled?
|
42
|
-
return false if info.nil? || info[:state].nil?
|
43
|
-
|
44
|
-
["Ready", "Running"].include?(info[:state])
|
45
|
-
end
|
46
|
-
|
47
|
-
def disabled?
|
48
|
-
return false if info.nil? || info[:state].nil?
|
49
|
-
|
50
|
-
info[:scheduled_task_state] == "Disabled" || info[:state] == "Disabled"
|
51
|
-
end
|
52
|
-
|
53
|
-
def logon_mode
|
54
|
-
info[:logon_mode]
|
55
|
-
end
|
56
|
-
|
57
|
-
def last_result
|
58
|
-
info[:last_result]
|
59
|
-
end
|
60
|
-
|
61
|
-
def task_to_run
|
62
|
-
info[:task_to_run].to_s.strip
|
63
|
-
end
|
64
|
-
|
65
|
-
def run_as_user
|
66
|
-
info[:run_as_user]
|
67
|
-
end
|
68
|
-
|
69
|
-
def type
|
70
|
-
info[:type] unless info.nil?
|
71
|
-
end
|
72
|
-
|
73
|
-
def info
|
74
|
-
return @cache unless @cache.nil?
|
75
|
-
|
76
|
-
# PowerShell v5 has Get-ScheduledTask cmdlet,
|
77
|
-
# _using something with backward support to v3_
|
78
|
-
# script = "Get-ScheduledTask | ? { $_.URI -eq '#{@taskuri}' } | Select-Object URI,@{N='State';E={$_.State.ToString()}} | ConvertTo-Json"
|
79
|
-
|
80
|
-
# Using schtasks as suggested by @modille but aligning property names to match cmdlet to future proof.
|
81
|
-
script = "schtasks /query /v /fo csv /tn '#{@taskuri}' | ConvertFrom-Csv | Select @{N='URI';E={$_.TaskName}},@{N='State';E={$_.Status.ToString()}},'Logon Mode','Last Result','Task To Run','Run As User','Scheduled Task State' | ConvertTo-Json -Compress"
|
82
|
-
|
83
|
-
cmd = inspec.powershell(script)
|
84
|
-
|
85
|
-
begin
|
86
|
-
params = JSON.parse(cmd.stdout)
|
87
|
-
rescue JSON::ParserError => _e
|
88
|
-
return nil
|
89
|
-
end
|
90
|
-
|
91
|
-
# If multiple triggers are defined, `schtasks` returns a list.
|
92
|
-
# This merges that list with the latest item taking precedence.
|
93
|
-
# This is the same behavior as `Get-ScheduledTask`.
|
94
|
-
params = params.reduce(:merge) if params.is_a?(Array)
|
95
|
-
|
96
|
-
@cache = {
|
97
|
-
uri: params["URI"],
|
98
|
-
state: params["State"],
|
99
|
-
logon_mode: params["Logon Mode"],
|
100
|
-
last_result: params["Last Result"],
|
101
|
-
task_to_run: params["Task To Run"],
|
102
|
-
run_as_user: params["Run As User"],
|
103
|
-
scheduled_task_state: params["Scheduled Task State"],
|
104
|
-
type: "windows-task",
|
105
|
-
}
|
106
|
-
end
|
107
|
-
|
108
|
-
def to_s
|
109
|
-
"Windows Task '#{@taskuri}'"
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
data/lib/inspec/resources/wmi.rb
DELETED
@@ -1,109 +0,0 @@
|
|
1
|
-
require "inspec/resources/powershell"
|
2
|
-
require "inspec/utils/object_traversal"
|
3
|
-
|
4
|
-
module Inspec::Resources
|
5
|
-
# This resource simplifies the access to wmi
|
6
|
-
# on CLI you would use:
|
7
|
-
# WMIC /NAMESPACE:\\root\rsop\computer PATH RSOP_SecuritySettingNumeric WHERE "KeyName = 'MinimumPasswordAge' And precedence=1" GET Setting
|
8
|
-
# We use Get-WmiObject via Powershell to retrieve all values.
|
9
|
-
class WMI < Inspec.resource(1)
|
10
|
-
name "wmi"
|
11
|
-
supports platform: "windows"
|
12
|
-
desc "request wmi information"
|
13
|
-
example <<~EXAMPLE
|
14
|
-
describe wmi({
|
15
|
-
class: 'RSOP_SecuritySettingNumeric',
|
16
|
-
namespace: 'root\\rsop\\computer',
|
17
|
-
filter: 'KeyName = \'MinimumPasswordAge\' And precedence=1'
|
18
|
-
}) do
|
19
|
-
its('Setting') { should eq true }
|
20
|
-
end
|
21
|
-
EXAMPLE
|
22
|
-
|
23
|
-
include ObjectTraverser
|
24
|
-
attr_accessor :content
|
25
|
-
|
26
|
-
def initialize(wmiclass = nil, opts = nil)
|
27
|
-
@options = opts || {}
|
28
|
-
if wmiclass.is_a?(Hash)
|
29
|
-
@options.merge!(wmiclass)
|
30
|
-
else
|
31
|
-
Inspec.deprecate(:wmi_non_hash_usage, "Using `wmi('wmisclass')` is deprecated. Please use`wmi({class: 'wmisclass'})`")
|
32
|
-
@options[:class] = wmiclass
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
# returns nil, if not existant or value
|
37
|
-
def method_missing(*keys)
|
38
|
-
# catch behavior of rspec its implementation
|
39
|
-
# @see https://github.com/rspec/rspec-its/blob/master/lib/rspec/its.rb#L110
|
40
|
-
keys.shift if keys.is_a?(Array) && keys[0] == :[]
|
41
|
-
|
42
|
-
# map all symbols to strings
|
43
|
-
keys = keys.map { |x| x.to_s.downcase } if keys.is_a?(Array)
|
44
|
-
|
45
|
-
value(keys)
|
46
|
-
end
|
47
|
-
|
48
|
-
def value(key)
|
49
|
-
extract_value(key, params)
|
50
|
-
end
|
51
|
-
|
52
|
-
def params
|
53
|
-
return @content if defined?(@content)
|
54
|
-
|
55
|
-
@content = {}
|
56
|
-
|
57
|
-
# abort if no options are available
|
58
|
-
return @content unless defined?(@options)
|
59
|
-
|
60
|
-
# filter for supported options
|
61
|
-
args = @options.select { |key, _value| %i{class namespace query filter}.include?(key) }
|
62
|
-
|
63
|
-
# convert to Get-WmiObject arguments
|
64
|
-
params = ""
|
65
|
-
args.each { |key, value| params += " -#{key} \"#{value.gsub('"', '`"')}\"" }
|
66
|
-
|
67
|
-
# run wmi command and filter empty wmi
|
68
|
-
script = <<-EOH
|
69
|
-
Filter Aggregate
|
70
|
-
{
|
71
|
-
$arr = @{}
|
72
|
-
$_.properties | % {
|
73
|
-
$arr.Add($_.name, $_.value)
|
74
|
-
}
|
75
|
-
$arr
|
76
|
-
}
|
77
|
-
Get-WmiObject #{params} | Aggregate | ConvertTo-Json
|
78
|
-
EOH
|
79
|
-
|
80
|
-
# run wmi command
|
81
|
-
cmd = inspec.powershell(script)
|
82
|
-
@content = JSON.parse(cmd.stdout)
|
83
|
-
|
84
|
-
# make all keys case-insensitive
|
85
|
-
@content = lowercase_keys(@content)
|
86
|
-
rescue JSON::ParserError => _e
|
87
|
-
@content
|
88
|
-
end
|
89
|
-
|
90
|
-
def to_s
|
91
|
-
"WMI with #{@options}"
|
92
|
-
end
|
93
|
-
|
94
|
-
private
|
95
|
-
|
96
|
-
def lowercase_keys(content)
|
97
|
-
if content.is_a?(Hash)
|
98
|
-
content.keys.each do |key|
|
99
|
-
new_key = key.to_s.downcase
|
100
|
-
content[new_key] = content.delete(key)
|
101
|
-
lowercase_keys(content[new_key])
|
102
|
-
end
|
103
|
-
elsif content.respond_to?(:each)
|
104
|
-
content.each { |item| lowercase_keys(item) }
|
105
|
-
end
|
106
|
-
content
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|
@@ -1,143 +0,0 @@
|
|
1
|
-
require "openssl"
|
2
|
-
require "hashie/mash"
|
3
|
-
require "inspec/utils/file_reader"
|
4
|
-
|
5
|
-
module Inspec::Resources
|
6
|
-
class X509CertificateResource < Inspec.resource(1)
|
7
|
-
name "x509_certificate"
|
8
|
-
supports platform: "unix"
|
9
|
-
supports platform: "windows"
|
10
|
-
desc "Used to test x.509 certificates"
|
11
|
-
example <<~EXAMPLE
|
12
|
-
describe x509_certificate('/etc/pki/www.mywebsite.com.pem') do
|
13
|
-
its('subject') { should match /CN=My Website/ }
|
14
|
-
its('validity_in_days') { should be > 30 }
|
15
|
-
end
|
16
|
-
|
17
|
-
describe x509_certificate('trials/x509/cert.pem') do
|
18
|
-
it { should be_certificate }
|
19
|
-
it { should be_valid }
|
20
|
-
its('fingerprint') { should eq '62b137bdf427e7273dc2e487877b3033e4c8ce17' }
|
21
|
-
its('signature_algorithm') { should eq 'sha1WithRSAEncryption' }
|
22
|
-
its('validity_in_days') { should_not be < 100 }
|
23
|
-
its('validity_in_days') { should be >= 100 }
|
24
|
-
its('subject_dn') { should eq '/C=DE/ST=Berlin/L=Berlin/O=InSpec/OU=Chef Software, Inc/CN=inspec.io/emailAddress=support@chef.io' }
|
25
|
-
its('subject.C') { should eq 'DE' }
|
26
|
-
its('subject.emailAddress') { should_not be_empty }
|
27
|
-
its('subject.emailAddress') { should eq 'support@chef.io' }
|
28
|
-
its('issuer_dn') { should eq '/C=DE/ST=Berlin/L=Berlin/O=InSpec/OU=Chef Software, Inc/CN=inspec.io/emailAddress=support@chef.io' }
|
29
|
-
its('key_length') { should be >= 2048 }
|
30
|
-
its('extensions.subjectKeyIdentifier') { should cmp 'A5:16:0B:12:F4:48:0F:06:6C:32:29:67:98:12:DF:3D:0D:75:9D:5C' }
|
31
|
-
end
|
32
|
-
EXAMPLE
|
33
|
-
|
34
|
-
include FileReader
|
35
|
-
|
36
|
-
# @see https://tools.ietf.org/html/rfc5280#page-23
|
37
|
-
def initialize(filename)
|
38
|
-
@certpath = filename
|
39
|
-
@issuer = nil
|
40
|
-
@parsed_subject = nil
|
41
|
-
@parsed_issuer = nil
|
42
|
-
@extensions = nil
|
43
|
-
@cert = OpenSSL::X509::Certificate.new read_file_content(@certpath)
|
44
|
-
end
|
45
|
-
|
46
|
-
# Forward these methods directly to OpenSSL::X509::Certificate instance
|
47
|
-
%w{version not_before not_after signature_algorithm public_key}.each do |m|
|
48
|
-
define_method m do |*args|
|
49
|
-
@cert.send(m, *args)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def certificate?
|
54
|
-
!@cert.nil?
|
55
|
-
end
|
56
|
-
|
57
|
-
def fingerprint
|
58
|
-
return if @cert.nil?
|
59
|
-
|
60
|
-
OpenSSL::Digest::SHA1.new(@cert.to_der).to_s
|
61
|
-
end
|
62
|
-
|
63
|
-
def serial
|
64
|
-
return if @cert.nil?
|
65
|
-
|
66
|
-
@cert.serial.to_i
|
67
|
-
end
|
68
|
-
|
69
|
-
def subject_dn
|
70
|
-
return if @cert.nil?
|
71
|
-
|
72
|
-
@cert.subject.to_s
|
73
|
-
end
|
74
|
-
|
75
|
-
def subject
|
76
|
-
return if @cert.nil?
|
77
|
-
# Return cached subject if we have already parsed it
|
78
|
-
return @parsed_subject if @parsed_subject
|
79
|
-
|
80
|
-
# Use a Mash to make it easier to access hash elements in "its('subject') {should ...}"
|
81
|
-
@parsed_subject = Hashie::Mash.new(Hash[@cert.subject.to_a.map { |k, v, _| [k, v] }])
|
82
|
-
end
|
83
|
-
|
84
|
-
def issuer_dn
|
85
|
-
return if @cert.nil?
|
86
|
-
|
87
|
-
@cert.issuer.to_s
|
88
|
-
end
|
89
|
-
|
90
|
-
def issuer
|
91
|
-
return if @cert.nil?
|
92
|
-
# Return cached subject if we have already parsed it
|
93
|
-
return @parsed_issuer if @parsed_issuer
|
94
|
-
|
95
|
-
# Use a Mash to make it easier to access hash elements in "its('issuer') {should ...}"
|
96
|
-
@parsed_issuer = Hashie::Mash.new(Hash[@cert.issuer.to_a.map { |k, v, _| [k, v] }])
|
97
|
-
end
|
98
|
-
|
99
|
-
def key_length
|
100
|
-
return if @cert.nil?
|
101
|
-
|
102
|
-
@cert.public_key.n.num_bytes * 8
|
103
|
-
end
|
104
|
-
|
105
|
-
def validity_in_days
|
106
|
-
(not_after - Time.now.utc) / 86400
|
107
|
-
end
|
108
|
-
|
109
|
-
def valid?
|
110
|
-
now = Time.now
|
111
|
-
certificate? && (now >= not_before && now <= not_after)
|
112
|
-
end
|
113
|
-
|
114
|
-
def extensions
|
115
|
-
# Return cached Mash if we already parsed the certificate extensions
|
116
|
-
return @extensions if @extensions
|
117
|
-
# Return the exception class if we failed to instantiate a Cert from file
|
118
|
-
return @cert unless @cert.respond_to? :extensions
|
119
|
-
|
120
|
-
# Use a Mash to make it easier to access hash elements in "its('entensions') {should ...}"
|
121
|
-
@extensions = Hashie::Mash.new({})
|
122
|
-
# Make sure standard extensions exist so we don't get nil for nil:NilClass
|
123
|
-
# when the user tests for extensions which aren't present
|
124
|
-
%w{
|
125
|
-
keyUsage extendedKeyUsage basicConstraints subjectKeyIdentifier
|
126
|
-
authorityKeyIdentifier subjectAltName issuerAltName authorityInfoAccess
|
127
|
-
crlDistributionPoints issuingDistributionPoint certificatePolicies
|
128
|
-
policyConstraints nameConstraints noCheck tlsfeature nsComment
|
129
|
-
}.each { |extension| @extensions[extension] ||= [] }
|
130
|
-
# Now parse the extensions into the Mash
|
131
|
-
extension_array = @cert.extensions.map(&:to_s)
|
132
|
-
extension_array.each do |extension|
|
133
|
-
kv = extension.split(/ *= */, 2)
|
134
|
-
@extensions[kv.first] = kv.last.split(/ *, */)
|
135
|
-
end
|
136
|
-
@extensions
|
137
|
-
end
|
138
|
-
|
139
|
-
def to_s
|
140
|
-
"x509_certificate #{@certpath}"
|
141
|
-
end
|
142
|
-
end
|
143
|
-
end
|
@@ -1,103 +0,0 @@
|
|
1
|
-
require "inspec/utils/parser"
|
2
|
-
require "inspec/utils/filter"
|
3
|
-
require "inspec/utils/file_reader"
|
4
|
-
|
5
|
-
module Inspec::Resources
|
6
|
-
class XinetdConf < Inspec.resource(1)
|
7
|
-
name "xinetd_conf"
|
8
|
-
supports platform: "unix"
|
9
|
-
desc "Xinetd services configuration."
|
10
|
-
example <<~EXAMPLE
|
11
|
-
describe xinetd_conf.services('chargen') do
|
12
|
-
its('socket_types') { should include 'dgram' }
|
13
|
-
end
|
14
|
-
|
15
|
-
describe xinetd_conf.services('chargen').socket_types('dgram') do
|
16
|
-
it { should be_disabled }
|
17
|
-
end
|
18
|
-
EXAMPLE
|
19
|
-
|
20
|
-
include XinetdParser
|
21
|
-
include FileReader
|
22
|
-
|
23
|
-
def initialize(conf_path = "/etc/xinetd.conf")
|
24
|
-
@conf_path = conf_path
|
25
|
-
@contents = {}
|
26
|
-
read_content(@conf_path)
|
27
|
-
end
|
28
|
-
|
29
|
-
def to_s
|
30
|
-
"Xinetd config #{@conf_path}#{@filters}"
|
31
|
-
end
|
32
|
-
|
33
|
-
def params
|
34
|
-
@params ||= read_params
|
35
|
-
end
|
36
|
-
|
37
|
-
filter = FilterTable.create
|
38
|
-
filter.register_column(:services, field: "service")
|
39
|
-
.register_column(:ids, field: "id")
|
40
|
-
.register_column(:socket_types, field: "socket_type")
|
41
|
-
.register_column(:types, field: "type")
|
42
|
-
.register_column(:protocols, field: "protocol")
|
43
|
-
.register_column(:wait, field: "wait")
|
44
|
-
.register_custom_matcher(:disabled?) { |x| x.where("disable" => "no").services.empty? }
|
45
|
-
.register_custom_matcher(:enabled?) { |x| x.where("disable" => "yes").services.empty? }
|
46
|
-
.install_filter_methods_on_resource(self, :service_lines)
|
47
|
-
|
48
|
-
private
|
49
|
-
|
50
|
-
def read_content(path = @conf_path)
|
51
|
-
return @contents[path] if @contents.key?(path)
|
52
|
-
|
53
|
-
@contents[path] = read_file_content(path)
|
54
|
-
end
|
55
|
-
|
56
|
-
def read_params
|
57
|
-
return {} if read_content.nil?
|
58
|
-
|
59
|
-
flat_params = parse_xinetd(read_content)
|
60
|
-
# we need to map service data in order to use it with filtertable
|
61
|
-
params = { "services" => {} }
|
62
|
-
# map services that were defined and map it to the service hash
|
63
|
-
flat_params.each do |k, v|
|
64
|
-
name = k[/^service (.+)$/, 1]
|
65
|
-
# its not a service, no change required
|
66
|
-
if name.nil?
|
67
|
-
params[k] = v
|
68
|
-
# handle service entries
|
69
|
-
else
|
70
|
-
# store service
|
71
|
-
params["services"][name] = v
|
72
|
-
|
73
|
-
# add the service identifier to its parameters
|
74
|
-
if v.is_a?(Array)
|
75
|
-
v.each { |service| service.params["service"] = name }
|
76
|
-
else
|
77
|
-
v.params["service"] = name
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
params
|
82
|
-
end
|
83
|
-
|
84
|
-
# Method used to derive the default protocol used from the socket_type
|
85
|
-
def default_protocol(type)
|
86
|
-
case type
|
87
|
-
when "stream"
|
88
|
-
"tcp"
|
89
|
-
when "dgram"
|
90
|
-
"udp"
|
91
|
-
else
|
92
|
-
"unknown"
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
def service_lines
|
97
|
-
@services ||= params["services"].values.flatten.map do |service|
|
98
|
-
service.params["protocol"] ||= default_protocol(service.params["socket_type"])
|
99
|
-
service.params
|
100
|
-
end
|
101
|
-
end
|
102
|
-
end
|
103
|
-
end
|