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,150 +0,0 @@
|
|
1
|
-
# copyright: 2016, Chef Software Inc.
|
2
|
-
|
3
|
-
require "inspec/utils/filter"
|
4
|
-
require "inspec/utils/file_reader"
|
5
|
-
|
6
|
-
# The file format consists of
|
7
|
-
# - user
|
8
|
-
# - password
|
9
|
-
# - last_change
|
10
|
-
# - min_days before password change
|
11
|
-
# - max_days until password change
|
12
|
-
# - warn_days before warning about expiry
|
13
|
-
# - inactive_days before deactivating the account
|
14
|
-
# - expiry_date when this account will expire
|
15
|
-
|
16
|
-
module Inspec::Resources
|
17
|
-
class Shadow < Inspec.resource(1)
|
18
|
-
name "shadow"
|
19
|
-
supports platform: "unix"
|
20
|
-
desc "Use the shadow InSpec resource to test the contents of /etc/shadow, "\
|
21
|
-
"which contains information for users that may log into "\
|
22
|
-
"the system and/or as users that own running processes."
|
23
|
-
example <<~EXAMPLE
|
24
|
-
describe shadow do
|
25
|
-
its('user') { should_not include 'forbidden_user' }
|
26
|
-
end
|
27
|
-
|
28
|
-
describe shadow.user('bin') do
|
29
|
-
its('password') { should cmp 'x' }
|
30
|
-
its('count') { should eq 1 }
|
31
|
-
end
|
32
|
-
EXAMPLE
|
33
|
-
|
34
|
-
include FileReader
|
35
|
-
|
36
|
-
attr_reader :params
|
37
|
-
|
38
|
-
def initialize(path = "/etc/shadow", opts = {})
|
39
|
-
@opts = opts
|
40
|
-
@path = path || "/etc/shadow"
|
41
|
-
@filters = @opts[:filters] || ""
|
42
|
-
end
|
43
|
-
|
44
|
-
filtertable = FilterTable.create
|
45
|
-
filtertable
|
46
|
-
.register_column(:users, field: "user")
|
47
|
-
.register_column(:passwords, field: "password")
|
48
|
-
.register_column(:last_changes, field: "last_change")
|
49
|
-
.register_column(:min_days, field: "min_days")
|
50
|
-
.register_column(:max_days, field: "max_days")
|
51
|
-
.register_column(:warn_days, field: "warn_days")
|
52
|
-
.register_column(:inactive_days, field: "inactive_days")
|
53
|
-
.register_column(:expiry_dates, field: "expiry_date")
|
54
|
-
.register_column(:reserved, field: "reserved")
|
55
|
-
|
56
|
-
filtertable.register_custom_property(:content) do |t, _|
|
57
|
-
t.entries.map do |e|
|
58
|
-
[e.user, e.password, e.last_change, e.min_days, e.max_days, e.warn_days, e.inactive_days, e.expiry_date].compact.join(":")
|
59
|
-
end.join("\n")
|
60
|
-
end
|
61
|
-
|
62
|
-
filtertable.install_filter_methods_on_resource(self, :set_params)
|
63
|
-
|
64
|
-
def filter(query = {})
|
65
|
-
return self if query.nil? || query.empty?
|
66
|
-
|
67
|
-
res = set_params
|
68
|
-
filters = ""
|
69
|
-
query.each do |attr, condition|
|
70
|
-
condition = condition.to_s if condition.is_a? Integer
|
71
|
-
filters += " #{attr} = #{condition.inspect}"
|
72
|
-
res = res.find_all do |line|
|
73
|
-
case line[attr.to_s]
|
74
|
-
when condition
|
75
|
-
true
|
76
|
-
else
|
77
|
-
false
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
content = res.map { |x| x.values.join(":") }.join("\n")
|
82
|
-
Shadow.new(@path, content: content, filters: @filters + filters)
|
83
|
-
end
|
84
|
-
|
85
|
-
# Next 4 are deprecated methods. We define them here so we can emit a deprecation message.
|
86
|
-
# They are also defined on the Table, above.
|
87
|
-
def user(query = nil)
|
88
|
-
Inspec.deprecate(:properties_shadow, "The shadow `user` property is deprecated. Please use `users` instead.")
|
89
|
-
query.nil? ? where.users : where("user" => query)
|
90
|
-
end
|
91
|
-
|
92
|
-
def password(query = nil)
|
93
|
-
Inspec.deprecate(:properties_shadow, "The shadow `password` property is deprecated. Please use `passwords` instead.")
|
94
|
-
query.nil? ? where.passwords : where("password" => query)
|
95
|
-
end
|
96
|
-
|
97
|
-
def last_change(query = nil)
|
98
|
-
Inspec.deprecate(:properties_shadow, "The shadow `last_change` property is deprecated. Please use `last_changes` instead.")
|
99
|
-
query.nil? ? where.last_changes : where("last_change" => query)
|
100
|
-
end
|
101
|
-
|
102
|
-
def expiry_date(query = nil)
|
103
|
-
Inspec.deprecate(:properties_shadow, "The shadow `expiry_date` property is deprecated. Please use `expiry_dates` instead.")
|
104
|
-
query.nil? ? where.expiry_dates : where("expiry_date" => query)
|
105
|
-
end
|
106
|
-
|
107
|
-
def lines
|
108
|
-
Inspec.deprecate(:properties_shadow, "The shadow `lines` property is deprecated.")
|
109
|
-
shadow_content.to_s.split("\n")
|
110
|
-
end
|
111
|
-
|
112
|
-
def to_s
|
113
|
-
f = @filters.empty? ? "" : " with" + @filters
|
114
|
-
"#{@path}#{f}"
|
115
|
-
end
|
116
|
-
|
117
|
-
private
|
118
|
-
|
119
|
-
def shadow_content
|
120
|
-
@opts[:content] || read_file_content(@path, allow_empty: true)
|
121
|
-
end
|
122
|
-
|
123
|
-
def set_params
|
124
|
-
@params ||= Array(shadow_content.to_s.split("\n")).map { |l| parse_shadow_line(l) }
|
125
|
-
end
|
126
|
-
|
127
|
-
def map_data(id)
|
128
|
-
set_params.collect { |x| x[id] }
|
129
|
-
end
|
130
|
-
|
131
|
-
# Parse a line of /etc/shadow
|
132
|
-
#
|
133
|
-
# @param [String] line a line of /etc/shadow
|
134
|
-
# @return [Hash] Map of entries in this line
|
135
|
-
def parse_shadow_line(line)
|
136
|
-
x = line.split(":")
|
137
|
-
{
|
138
|
-
"user" => x.at(0),
|
139
|
-
"password" => x.at(1),
|
140
|
-
"last_change" => x.at(2),
|
141
|
-
"min_days" => x.at(3),
|
142
|
-
"max_days" => x.at(4),
|
143
|
-
"warn_days" => x.at(5),
|
144
|
-
"inactive_days" => x.at(6),
|
145
|
-
"expiry_date" => x.at(7),
|
146
|
-
"reserved" => x.at(8),
|
147
|
-
}
|
148
|
-
end
|
149
|
-
end
|
150
|
-
end
|
@@ -1,98 +0,0 @@
|
|
1
|
-
# copyright: 2015, Vulcano Security GmbH
|
2
|
-
|
3
|
-
require "inspec/utils/simpleconfig"
|
4
|
-
require "inspec/utils/file_reader"
|
5
|
-
|
6
|
-
module Inspec::Resources
|
7
|
-
class SshConfig < Inspec.resource(1)
|
8
|
-
name "ssh_config"
|
9
|
-
supports platform: "unix"
|
10
|
-
desc "Use the `ssh_config` InSpec audit resource to test OpenSSH client configuration data located at `/etc/ssh/ssh_config` on Linux and Unix platforms."
|
11
|
-
example <<~EXAMPLE
|
12
|
-
describe ssh_config do
|
13
|
-
its('cipher') { should contain '3des' }
|
14
|
-
its('port') { should eq '22' }
|
15
|
-
its('hostname') { should include('example.com') }
|
16
|
-
end
|
17
|
-
EXAMPLE
|
18
|
-
|
19
|
-
include FileReader
|
20
|
-
|
21
|
-
def initialize(conf_path = nil, type = nil)
|
22
|
-
@conf_path = conf_path || "/etc/ssh/ssh_config"
|
23
|
-
typename = (@conf_path.include?("sshd") ? "Server" : "Client")
|
24
|
-
@type = type || "SSH #{typename} configuration #{conf_path}"
|
25
|
-
read_content
|
26
|
-
end
|
27
|
-
|
28
|
-
def content
|
29
|
-
read_content
|
30
|
-
end
|
31
|
-
|
32
|
-
def params(*opts)
|
33
|
-
opts.inject(read_params) do |res, nxt|
|
34
|
-
res.respond_to?(:key) ? res[nxt] : nil
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def convert_hash(hash)
|
39
|
-
new_hash = {}
|
40
|
-
hash.each do |k, v|
|
41
|
-
new_hash[k.downcase] = v
|
42
|
-
end
|
43
|
-
new_hash
|
44
|
-
end
|
45
|
-
|
46
|
-
def method_missing(name)
|
47
|
-
param = read_params[name.to_s.downcase]
|
48
|
-
return nil if param.nil?
|
49
|
-
# extract first value if we have only one value in array
|
50
|
-
return param[0] if param.length == 1
|
51
|
-
|
52
|
-
param
|
53
|
-
end
|
54
|
-
|
55
|
-
def to_s
|
56
|
-
"SSH Configuration"
|
57
|
-
end
|
58
|
-
|
59
|
-
private
|
60
|
-
|
61
|
-
def read_content
|
62
|
-
return @content if defined?(@content)
|
63
|
-
|
64
|
-
@content = read_file_content(@conf_path)
|
65
|
-
end
|
66
|
-
|
67
|
-
def read_params
|
68
|
-
return @params if defined?(@params)
|
69
|
-
return @params = {} if read_content.nil?
|
70
|
-
|
71
|
-
conf = SimpleConfig.new(
|
72
|
-
read_content,
|
73
|
-
assignment_regex: /^\s*(\S+?)\s+(.*?)\s*$/,
|
74
|
-
multiple_values: true
|
75
|
-
)
|
76
|
-
@params = convert_hash(conf.params)
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
class SshdConfig < SshConfig
|
81
|
-
name "sshd_config"
|
82
|
-
supports platform: "unix"
|
83
|
-
desc "Use the sshd_config InSpec audit resource to test configuration data for the Open SSH daemon located at /etc/ssh/sshd_config on Linux and UNIX platforms. sshd---the Open SSH daemon---listens on dedicated ports, starts a daemon for each incoming connection, and then handles encryption, authentication, key exchanges, command execution, and data exchanges."
|
84
|
-
example <<~EXAMPLE
|
85
|
-
describe sshd_config do
|
86
|
-
its('Protocol') { should eq '2' }
|
87
|
-
end
|
88
|
-
EXAMPLE
|
89
|
-
|
90
|
-
def initialize(path = nil)
|
91
|
-
super(path || "/etc/ssh/sshd_config")
|
92
|
-
end
|
93
|
-
|
94
|
-
def to_s
|
95
|
-
"SSHD Configuration"
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
data/lib/inspec/resources/ssl.rb
DELETED
@@ -1,99 +0,0 @@
|
|
1
|
-
# copyright: 2015, Chef Software Inc.
|
2
|
-
|
3
|
-
require "sslshake"
|
4
|
-
require "inspec/utils/filter"
|
5
|
-
require "uri"
|
6
|
-
require "parallel"
|
7
|
-
|
8
|
-
# Custom resource based on the InSpec resource DSL
|
9
|
-
module Inspec::Resources
|
10
|
-
class SSL < Inspec.resource(1)
|
11
|
-
name "ssl"
|
12
|
-
supports platform: "unix"
|
13
|
-
supports platform: "windows"
|
14
|
-
|
15
|
-
desc "
|
16
|
-
SSL test resource
|
17
|
-
"
|
18
|
-
|
19
|
-
example <<~EXAMPLE
|
20
|
-
describe ssl(port: 443) do
|
21
|
-
it { should be_enabled }
|
22
|
-
end
|
23
|
-
|
24
|
-
# protocols: ssl2, ssl3, tls1.0, tls1.1, tls1.2
|
25
|
-
describe ssl(port: 443).protocols('ssl2') do
|
26
|
-
it { should_not be_enabled }
|
27
|
-
end
|
28
|
-
|
29
|
-
# any ciphers, filter by name or regex
|
30
|
-
describe ssl(port: 443).ciphers(/rc4/i) do
|
31
|
-
it { should_not be_enabled }
|
32
|
-
end
|
33
|
-
EXAMPLE
|
34
|
-
|
35
|
-
VERSIONS = [
|
36
|
-
"ssl2",
|
37
|
-
"ssl3",
|
38
|
-
"tls1.0",
|
39
|
-
"tls1.1",
|
40
|
-
"tls1.2",
|
41
|
-
].freeze
|
42
|
-
|
43
|
-
attr_reader :host, :port, :timeout, :retries
|
44
|
-
|
45
|
-
def initialize(opts = {})
|
46
|
-
@host = opts[:host]
|
47
|
-
if @host.nil?
|
48
|
-
# Transports like SSH and WinRM will provide a hostname
|
49
|
-
if inspec.backend.respond_to?("hostname")
|
50
|
-
@host = inspec.backend.hostname
|
51
|
-
elsif inspec.backend.class.to_s == "Train::Transports::Local::Connection"
|
52
|
-
@host = "localhost"
|
53
|
-
end
|
54
|
-
end
|
55
|
-
@port = opts[:port] || 443
|
56
|
-
@timeout = opts[:timeout]
|
57
|
-
@retries = opts[:retries]
|
58
|
-
end
|
59
|
-
|
60
|
-
filter = FilterTable.create
|
61
|
-
filter.register_custom_matcher(:enabled?) do |x|
|
62
|
-
raise "Cannot determine host for SSL test. Please specify it or use a different target." if x.resource.host.nil?
|
63
|
-
|
64
|
-
x.handshake.values.any? { |i| i["success"] }
|
65
|
-
end
|
66
|
-
filter.register_column(:ciphers, field: "cipher")
|
67
|
-
.register_column(:protocols, field: "protocol")
|
68
|
-
.register_custom_property(:handshake) do |x|
|
69
|
-
groups = x.entries.group_by(&:protocol)
|
70
|
-
res = Parallel.map(groups, in_threads: 8) do |proto, e|
|
71
|
-
[proto, SSLShake.hello(x.resource.host, port: x.resource.port,
|
72
|
-
protocol: proto, ciphers: e.map(&:cipher),
|
73
|
-
timeout: x.resource.timeout, retries: x.resource.retries, servername: x.resource.host)]
|
74
|
-
end
|
75
|
-
Hash[res]
|
76
|
-
end
|
77
|
-
.install_filter_methods_on_resource(self, :scan_config)
|
78
|
-
|
79
|
-
def to_s
|
80
|
-
"SSL/TLS on #{@host}:#{@port}"
|
81
|
-
end
|
82
|
-
|
83
|
-
private
|
84
|
-
|
85
|
-
def scan_config
|
86
|
-
[
|
87
|
-
{ "protocol" => "ssl2", "ciphers" => SSLShake::SSLv2::CIPHERS.keys },
|
88
|
-
{ "protocol" => "ssl3", "ciphers" => SSLShake::TLS::SSL3_CIPHERS.keys },
|
89
|
-
{ "protocol" => "tls1.0", "ciphers" => SSLShake::TLS::TLS10_CIPHERS.keys },
|
90
|
-
{ "protocol" => "tls1.1", "ciphers" => SSLShake::TLS::TLS10_CIPHERS.keys },
|
91
|
-
{ "protocol" => "tls1.2", "ciphers" => SSLShake::TLS::TLS_CIPHERS.keys },
|
92
|
-
].map do |line|
|
93
|
-
line["ciphers"].map do |cipher|
|
94
|
-
{ "protocol" => line["protocol"], "cipher" => cipher }
|
95
|
-
end
|
96
|
-
end.flatten
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
@@ -1,119 +0,0 @@
|
|
1
|
-
require "inspec/resources/command"
|
2
|
-
require "inspec/resources/powershell"
|
3
|
-
|
4
|
-
module Inspec::Resources
|
5
|
-
# this resource returns additional system informatio
|
6
|
-
class System < Inspec.resource(1)
|
7
|
-
name "sys_info"
|
8
|
-
supports platform: "unix"
|
9
|
-
supports platform: "windows"
|
10
|
-
|
11
|
-
desc "Use the user InSpec system resource to test for operating system properties."
|
12
|
-
example <<~EXAMPLE
|
13
|
-
describe sys_info do
|
14
|
-
its('hostname') { should eq 'example.com' }
|
15
|
-
end
|
16
|
-
|
17
|
-
describe sys_info do
|
18
|
-
its('fqdn') { should eq 'user.example.com' }
|
19
|
-
end
|
20
|
-
|
21
|
-
EXAMPLE
|
22
|
-
|
23
|
-
%w{ domain fqdn ip_address short }.each do |opt|
|
24
|
-
define_method(opt.to_sym) do
|
25
|
-
hostname(opt)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
# returns the hostname of the local system
|
30
|
-
def hostname(opt = nil)
|
31
|
-
os = inspec.os
|
32
|
-
if os.linux?
|
33
|
-
linux_hostname(opt)
|
34
|
-
elsif os.darwin?
|
35
|
-
mac_hostname(opt)
|
36
|
-
elsif os.windows?
|
37
|
-
if !opt.nil?
|
38
|
-
skip_resource "The `sys_info.hostname` resource is not supported with that option on your OS."
|
39
|
-
else
|
40
|
-
inspec.powershell("$env:computername").stdout.chomp
|
41
|
-
end
|
42
|
-
else
|
43
|
-
skip_resource "The `sys_info.hostname` resource is not supported on your OS yet."
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def linux_hostname(opt = nil)
|
48
|
-
if opt
|
49
|
-
opt = case opt
|
50
|
-
when "f", "long", "fqdn", "full"
|
51
|
-
" -f"
|
52
|
-
when "d", "domain"
|
53
|
-
" -d"
|
54
|
-
when "i", "ip_address"
|
55
|
-
" -I"
|
56
|
-
when "s", "short"
|
57
|
-
" -s"
|
58
|
-
else
|
59
|
-
"ERROR"
|
60
|
-
end
|
61
|
-
end
|
62
|
-
if opt == "ERROR"
|
63
|
-
skip_resource "The `sys_info.hostname` resource is not supported with that option on your OS."
|
64
|
-
else
|
65
|
-
inspec.command("hostname#{opt}").stdout.chomp
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
def mac_hostname(opt = nil)
|
70
|
-
if opt
|
71
|
-
opt = case opt
|
72
|
-
when "f", "long", "fqdn", "full"
|
73
|
-
" -f"
|
74
|
-
when "s", "short"
|
75
|
-
" -s"
|
76
|
-
else
|
77
|
-
"ERROR"
|
78
|
-
end
|
79
|
-
end
|
80
|
-
if opt == "ERROR"
|
81
|
-
skip_resource "The `sys_info.hostname` resource is not supported with that option on your OS."
|
82
|
-
else
|
83
|
-
inspec.command("hostname#{opt}").stdout.chomp
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
# returns the Manufacturer of the local system
|
88
|
-
def manufacturer
|
89
|
-
os = inspec.os
|
90
|
-
if os.darwin?
|
91
|
-
"Apple Inc."
|
92
|
-
elsif os.linux?
|
93
|
-
inspec.command("cat /sys/class/dmi/id/sys_vendor").stdout.chomp
|
94
|
-
elsif os.windows?
|
95
|
-
inspec.powershell("Get-CimInstance -ClassName Win32_ComputerSystem | Select Manufacturer -ExpandProperty Manufacturer").stdout.chomp
|
96
|
-
else
|
97
|
-
skip_resource "The `sys_info.manufacturer` resource is not supported on your OS yet."
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
# returns the ServerModel of the local system
|
102
|
-
def model
|
103
|
-
os = inspec.os
|
104
|
-
if os.darwin?
|
105
|
-
inspec.command("sysctl -n hw.model").stdout.chomp
|
106
|
-
elsif os.linux?
|
107
|
-
inspec.command("cat /sys/class/dmi/id/product_name").stdout.chomp
|
108
|
-
elsif os.windows?
|
109
|
-
inspec.powershell("Get-CimInstance -ClassName Win32_ComputerSystem | Select Model -ExpandProperty Model").stdout.chomp
|
110
|
-
else
|
111
|
-
skip_resource "The `sys_info.model` resource is not supported on your OS yet."
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
def to_s
|
116
|
-
"System Information"
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|