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,153 +0,0 @@
|
|
1
|
-
require "inspec/utils/filter"
|
2
|
-
require "inspec/utils/parser"
|
3
|
-
require "inspec/utils/file_reader"
|
4
|
-
|
5
|
-
module Inspec::Resources
|
6
|
-
class AideConf < Inspec.resource(1)
|
7
|
-
name "aide_conf"
|
8
|
-
supports platform: "unix"
|
9
|
-
desc 'Use the aide_conf InSpec audit resource to test the rules established for
|
10
|
-
the file integrity tool AIDE. Controlled by the aide.conf file typically at /etc/aide.conf.'
|
11
|
-
example <<~EXAMPLE
|
12
|
-
describe aide_conf do
|
13
|
-
its('selection_lines') { should include '/sbin' }
|
14
|
-
end
|
15
|
-
|
16
|
-
describe aide_conf.where { selection_line == '/bin' } do
|
17
|
-
its('rules.flatten') { should include 'r' }
|
18
|
-
end
|
19
|
-
|
20
|
-
describe aide_conf.all_have_rule('sha512') do
|
21
|
-
it { should eq true }
|
22
|
-
end
|
23
|
-
EXAMPLE
|
24
|
-
|
25
|
-
attr_reader :params
|
26
|
-
|
27
|
-
include CommentParser
|
28
|
-
include FileReader
|
29
|
-
|
30
|
-
def initialize(aide_conf_path = nil)
|
31
|
-
@conf_path = aide_conf_path || "/etc/aide.conf"
|
32
|
-
@content = nil
|
33
|
-
@rules = nil
|
34
|
-
read_content
|
35
|
-
end
|
36
|
-
|
37
|
-
def all_have_rule(rule)
|
38
|
-
# Case when file didn't exist or perms didn't allow an open
|
39
|
-
return false if @content.nil?
|
40
|
-
|
41
|
-
lines = @params.reject { |line| line["rules"].include? rule }
|
42
|
-
lines.empty?
|
43
|
-
end
|
44
|
-
|
45
|
-
filter = FilterTable.create
|
46
|
-
filter.register_column(:selection_lines, field: "selection_line")
|
47
|
-
.register_column(:rules, field: "rules")
|
48
|
-
|
49
|
-
filter.install_filter_methods_on_resource(self, :params)
|
50
|
-
|
51
|
-
def to_s
|
52
|
-
"AIDE Config"
|
53
|
-
end
|
54
|
-
|
55
|
-
private
|
56
|
-
|
57
|
-
def read_content
|
58
|
-
return @content unless @content.nil?
|
59
|
-
|
60
|
-
@rules = {}
|
61
|
-
|
62
|
-
raw_conf = read_file_content(@conf_path)
|
63
|
-
|
64
|
-
# If there is a file and it contains content, continue
|
65
|
-
@content = filter_comments(raw_conf.lines)
|
66
|
-
@params = parse_conf(@content)
|
67
|
-
end
|
68
|
-
|
69
|
-
def filter_comments(data)
|
70
|
-
content = []
|
71
|
-
data.each do |line|
|
72
|
-
content_line, = parse_comment_line(line, comment_char: "#", standalone_comments: false)
|
73
|
-
content.push(content_line)
|
74
|
-
end
|
75
|
-
content
|
76
|
-
end
|
77
|
-
|
78
|
-
def parse_conf(content)
|
79
|
-
params = []
|
80
|
-
content.each do |line|
|
81
|
-
param = parse_line(line)
|
82
|
-
unless param["selection_line"].nil?
|
83
|
-
params.push(param)
|
84
|
-
end
|
85
|
-
end
|
86
|
-
params
|
87
|
-
end
|
88
|
-
|
89
|
-
def parse_line(line)
|
90
|
-
line_and_rules = {}
|
91
|
-
# Case when line is a rule line
|
92
|
-
if line.include?(" = ")
|
93
|
-
parse_rule_line(line)
|
94
|
-
# Case when line is a selection line
|
95
|
-
elsif line.start_with?("/", "!", "=")
|
96
|
-
line_and_rules = parse_selection_line(line)
|
97
|
-
end
|
98
|
-
line_and_rules
|
99
|
-
end
|
100
|
-
|
101
|
-
def parse_rule_line(line)
|
102
|
-
line.gsub!(/\s+/, "")
|
103
|
-
rule_line_arr = line.split("=")
|
104
|
-
rules_list = rule_line_arr.last.split("+")
|
105
|
-
rule_name = rule_line_arr.first
|
106
|
-
rules_list.each_index do |i|
|
107
|
-
# Cases where rule respresents one or more other rules
|
108
|
-
if @rules.key?(rules_list[i])
|
109
|
-
rules_list[i] = @rules[rules_list[i]]
|
110
|
-
end
|
111
|
-
rules_list[i] = handle_multi_rule(rules_list, i)
|
112
|
-
end
|
113
|
-
@rules[rule_name] = rules_list.flatten
|
114
|
-
end
|
115
|
-
|
116
|
-
def parse_selection_line(line)
|
117
|
-
selec_line_arr = line.split(" ")
|
118
|
-
selection_line = selec_line_arr.first
|
119
|
-
selection_line.chop! if selection_line.end_with?("/")
|
120
|
-
rule_list = selec_line_arr.last.split("+")
|
121
|
-
rule_list.each_index do |i|
|
122
|
-
hash_list = @rules[rule_list[i]]
|
123
|
-
# Cases where rule respresents one or more other rules
|
124
|
-
unless hash_list.nil?
|
125
|
-
rule_list[i] = hash_list
|
126
|
-
end
|
127
|
-
rule_list[i] = handle_multi_rule(rule_list, i)
|
128
|
-
end
|
129
|
-
rule_list.flatten!
|
130
|
-
{
|
131
|
-
"selection_line" => selection_line,
|
132
|
-
"rules" => rule_list,
|
133
|
-
}
|
134
|
-
end
|
135
|
-
|
136
|
-
def handle_multi_rule(rule_list, i)
|
137
|
-
# Rules that represent multiple rules (R,L,>)
|
138
|
-
r_rules = %w{p i l n u g s m c md5}
|
139
|
-
l_rules = %w{p i l n u g}
|
140
|
-
grow_log_rules = %w{p l u g i n S}
|
141
|
-
|
142
|
-
case rule_list[i]
|
143
|
-
when "R"
|
144
|
-
return r_rules
|
145
|
-
when "L"
|
146
|
-
return l_rules
|
147
|
-
when ">"
|
148
|
-
return grow_log_rules
|
149
|
-
end
|
150
|
-
rule_list[i]
|
151
|
-
end
|
152
|
-
end
|
153
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# copyright: 2015, Vulcano Security GmbH
|
2
|
-
|
3
|
-
module Inspec::Resources
|
4
|
-
class Apache < Inspec.resource(1)
|
5
|
-
name "apache"
|
6
|
-
supports platform: "unix"
|
7
|
-
desc "Use the apache InSpec audit resource to retrieve Apache environment settings."
|
8
|
-
example <<~EXAMPLE
|
9
|
-
describe apache do
|
10
|
-
its ('service') { should cmp 'apache2' }
|
11
|
-
end
|
12
|
-
|
13
|
-
describe apache do
|
14
|
-
its ('conf_dir') { should cmp '/etc/apache2' }
|
15
|
-
end
|
16
|
-
|
17
|
-
describe apache do
|
18
|
-
its ('conf_path') { should cmp '/etc/apache2/apache2.conf' }
|
19
|
-
end
|
20
|
-
|
21
|
-
describe apache do
|
22
|
-
its ('user') { should cmp 'www-data' }
|
23
|
-
end
|
24
|
-
EXAMPLE
|
25
|
-
|
26
|
-
attr_reader :service, :conf_dir, :conf_path, :user
|
27
|
-
def initialize
|
28
|
-
Inspec.deprecate(:resource_apache, "The apache resource is deprecated")
|
29
|
-
|
30
|
-
if inspec.os.debian?
|
31
|
-
@service = "apache2"
|
32
|
-
@conf_dir = "/etc/apache2/"
|
33
|
-
@conf_path = File.join @conf_dir, "apache2.conf"
|
34
|
-
@user = "www-data"
|
35
|
-
else
|
36
|
-
@service = "httpd"
|
37
|
-
@conf_dir = "/etc/httpd/"
|
38
|
-
@conf_path = File.join @conf_dir, "/conf/httpd.conf"
|
39
|
-
@user = "apache"
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def to_s
|
44
|
-
"Apache Environment"
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,156 +0,0 @@
|
|
1
|
-
# copyright: 2015, Vulcano Security GmbH
|
2
|
-
|
3
|
-
require "inspec/utils/simpleconfig"
|
4
|
-
require "inspec/utils/find_files"
|
5
|
-
require "inspec/utils/file_reader"
|
6
|
-
|
7
|
-
module Inspec::Resources
|
8
|
-
class ApacheConf < Inspec.resource(1)
|
9
|
-
name "apache_conf"
|
10
|
-
supports platform: "linux"
|
11
|
-
supports platform: "debian"
|
12
|
-
desc "Use the apache_conf InSpec audit resource to test the configuration settings for Apache. This file is typically located under /etc/apache2 on the Debian and Ubuntu platforms and under /etc/httpd on the Fedora, CentOS, Red Hat Enterprise Linux, and Arch Linux platforms. The configuration settings may vary significantly from platform to platform."
|
13
|
-
example <<~EXAMPLE
|
14
|
-
describe apache_conf do
|
15
|
-
its('setting_name') { should eq 'value' }
|
16
|
-
end
|
17
|
-
EXAMPLE
|
18
|
-
|
19
|
-
include FindFiles
|
20
|
-
include FileReader
|
21
|
-
|
22
|
-
attr_reader :conf_path
|
23
|
-
|
24
|
-
def initialize(conf_path = nil)
|
25
|
-
@conf_path = conf_path || default_conf_path
|
26
|
-
@files_contents = {}
|
27
|
-
@content = nil
|
28
|
-
@params = nil
|
29
|
-
read_content
|
30
|
-
end
|
31
|
-
|
32
|
-
def content
|
33
|
-
@content ||= read_content
|
34
|
-
end
|
35
|
-
|
36
|
-
def params(*opts)
|
37
|
-
@params || read_content
|
38
|
-
res = @params
|
39
|
-
opts.each do |opt|
|
40
|
-
res = res[opt] unless res.nil?
|
41
|
-
end
|
42
|
-
res
|
43
|
-
end
|
44
|
-
|
45
|
-
def method_missing(name)
|
46
|
-
# ensure params are loaded
|
47
|
-
@params || read_content
|
48
|
-
|
49
|
-
# extract values
|
50
|
-
@params[name.to_s] unless @params.nil?
|
51
|
-
end
|
52
|
-
|
53
|
-
def filter_comments(data)
|
54
|
-
content = ""
|
55
|
-
data.each_line do |line|
|
56
|
-
unless line.match(/^\s*#/)
|
57
|
-
content << line
|
58
|
-
end
|
59
|
-
end
|
60
|
-
content
|
61
|
-
end
|
62
|
-
|
63
|
-
def read_content
|
64
|
-
@content = ""
|
65
|
-
@params = {}
|
66
|
-
|
67
|
-
read_file_content(conf_path)
|
68
|
-
|
69
|
-
to_read = [conf_path]
|
70
|
-
until to_read.empty?
|
71
|
-
raw_conf = read_file(to_read[0])
|
72
|
-
@content += raw_conf
|
73
|
-
|
74
|
-
# An explaination of the below regular expression.
|
75
|
-
# Creates two capture groups.
|
76
|
-
# The first group captures the first group of non-whitespace character
|
77
|
-
# surrounded whitespace characters.
|
78
|
-
# The second group contains a conditional with a positive lookahead
|
79
|
-
# (does the line end with one or more spaces?). If the lookahead succeeds
|
80
|
-
# a non-greedy capture takes place, if it fails then a greedy capture takes place.
|
81
|
-
# The regex is terminated by an expression that matches zero or more spaces.
|
82
|
-
params = SimpleConfig.new(
|
83
|
-
raw_conf,
|
84
|
-
assignment_regex: /^\s*(\S+)\s+['"]*((?=.*\s+$).*?|.*?)['"]*\s*$/,
|
85
|
-
multiple_values: true
|
86
|
-
).params
|
87
|
-
|
88
|
-
# Capture any characters between quotes that are not escaped in values
|
89
|
-
params.values.map! do |value|
|
90
|
-
value.map! do |sub_value|
|
91
|
-
sub_value[/(?<=["|'])(?:\\.|[^"'\\])*(?=["|'])/] || sub_value
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
@params.merge!(params)
|
96
|
-
|
97
|
-
to_read = to_read.drop(1)
|
98
|
-
to_read += include_files(params).find_all do |fp|
|
99
|
-
not @files_contents.key? fp
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
# fiter comments
|
104
|
-
@content = filter_comments @content
|
105
|
-
@content
|
106
|
-
end
|
107
|
-
|
108
|
-
def include_files(params)
|
109
|
-
# see if there is more config files to include
|
110
|
-
include_files = params["Include"] || []
|
111
|
-
include_files_optional = params["IncludeOptional"] || []
|
112
|
-
|
113
|
-
includes = []
|
114
|
-
(include_files + include_files_optional).each do |f|
|
115
|
-
id = Pathname.new(f).absolute? ? f : File.join(conf_dir, f)
|
116
|
-
files = find_files(id, depth: 1, type: "file")
|
117
|
-
files += find_files(id, depth: 1, type: "link")
|
118
|
-
|
119
|
-
includes.push(files) if files
|
120
|
-
end
|
121
|
-
|
122
|
-
# [].flatten! == nil
|
123
|
-
includes.flatten! || []
|
124
|
-
end
|
125
|
-
|
126
|
-
def read_file(path)
|
127
|
-
@files_contents[path] ||= read_file_content(path, true)
|
128
|
-
end
|
129
|
-
|
130
|
-
def conf_dir
|
131
|
-
if inspec.os.debian?
|
132
|
-
File.dirname(conf_path)
|
133
|
-
else
|
134
|
-
# On RHEL-based systems, the configuration is usually in a /conf directory
|
135
|
-
# that contains the primary config file. We assume the "config path" is the
|
136
|
-
# directory that contains the /conf directory, such as /etc/httpd, so that
|
137
|
-
# the conf.d directory can be properly located.
|
138
|
-
Pathname.new(File.dirname(conf_path)).parent.to_s
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
def to_s
|
143
|
-
"Apache Config #{conf_path}"
|
144
|
-
end
|
145
|
-
|
146
|
-
private
|
147
|
-
|
148
|
-
def default_conf_path
|
149
|
-
if inspec.os.debian?
|
150
|
-
"/etc/apache2/apache2.conf"
|
151
|
-
else
|
152
|
-
"/etc/httpd/conf/httpd.conf"
|
153
|
-
end
|
154
|
-
end
|
155
|
-
end
|
156
|
-
end
|
data/lib/inspec/resources/apt.rb
DELETED
@@ -1,151 +0,0 @@
|
|
1
|
-
require "inspec/resources/command"
|
2
|
-
|
3
|
-
# Verifies apt and ppa repositories
|
4
|
-
#
|
5
|
-
# Usage:
|
6
|
-
# describe apt('ubuntu-wine/ppa') do
|
7
|
-
# it { should exist }
|
8
|
-
# it { should be_enabled }
|
9
|
-
# end
|
10
|
-
#
|
11
|
-
# it also understands a ppa url
|
12
|
-
# describe apt('ppa:ubuntu-wine/ppa') do
|
13
|
-
# it { should exist }
|
14
|
-
# it { should be_enabled }
|
15
|
-
# end
|
16
|
-
#
|
17
|
-
# The following ppa formats are supported:
|
18
|
-
# - ubuntu-wine/ppa
|
19
|
-
# - ppa:ubuntu-wine/ppa
|
20
|
-
# - http://ppa.launchpad.net/juju/stable/ubuntu
|
21
|
-
#
|
22
|
-
# Install a ppa as following:
|
23
|
-
# apt-get install python-software-properties
|
24
|
-
# apt-get install software-properties-common
|
25
|
-
# add-apt-repository ppa:ubuntu-wine/ppa
|
26
|
-
|
27
|
-
require "uri"
|
28
|
-
|
29
|
-
module Inspec::Resources
|
30
|
-
class AptRepository < Inspec.resource(1)
|
31
|
-
name "apt"
|
32
|
-
supports platform: "unix"
|
33
|
-
desc "Use the apt InSpec audit resource to verify Apt repositories on the Debian and Ubuntu platforms, and also PPA repositories on the Ubuntu platform."
|
34
|
-
example <<~EXAMPLE
|
35
|
-
describe apt('nginx/stable') do
|
36
|
-
it { should exist }
|
37
|
-
it { should be_enabled }
|
38
|
-
end
|
39
|
-
EXAMPLE
|
40
|
-
|
41
|
-
def initialize(ppa_name)
|
42
|
-
@deb_url = nil
|
43
|
-
# check if the os is ubuntu or debian
|
44
|
-
if inspec.os.debian?
|
45
|
-
@deb_url = determine_ppa_url(ppa_name)
|
46
|
-
else
|
47
|
-
# this resource is only supported on ubuntu and debian
|
48
|
-
skip_resource "The `apt` resource is not supported on your OS yet."
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def exists?
|
53
|
-
find_repo.count > 0
|
54
|
-
end
|
55
|
-
|
56
|
-
def enabled?
|
57
|
-
return false if find_repo.count == 0
|
58
|
-
|
59
|
-
actives = find_repo.map { |repo| repo[:active] }
|
60
|
-
actives = actives.uniq
|
61
|
-
actives.size == 1 && actives[0] = true
|
62
|
-
end
|
63
|
-
|
64
|
-
def to_s
|
65
|
-
"Apt Repository #{@deb_url}"
|
66
|
-
end
|
67
|
-
|
68
|
-
private
|
69
|
-
|
70
|
-
def find_repo
|
71
|
-
read_debs.select { |repo| repo[:url] == @deb_url && repo[:type] == "deb" }
|
72
|
-
end
|
73
|
-
|
74
|
-
# TODO: remove this. just see if it is valid w/ URI.parse
|
75
|
-
HTTP_URL_RE = /\A#{URI::DEFAULT_PARSER.make_regexp(%w{http https})}\z/.freeze
|
76
|
-
|
77
|
-
def read_debs
|
78
|
-
return @repo_cache if defined?(@repo_cache)
|
79
|
-
|
80
|
-
# load all lists
|
81
|
-
cmd = inspec.command("find /etc/apt/ -name \*.list -exec sh -c 'cat {} || echo -n' \\;")
|
82
|
-
|
83
|
-
# @see https://help.ubuntu.com/community/Repositories/CommandLine#Explanation_of_the_Repository_Format
|
84
|
-
@repo_cache = cmd.stdout.lines.map do |raw_line|
|
85
|
-
# detect if the repo is commented out
|
86
|
-
line = raw_line.gsub(/^(#\s*)*/, "")
|
87
|
-
active = raw_line == line
|
88
|
-
|
89
|
-
# formats:
|
90
|
-
# deb "http://archive.ubuntu.com/ubuntu/" wily main restricted ...
|
91
|
-
# deb http://archive.ubuntu.com/ubuntu/ wily main restricted ...
|
92
|
-
# deb [trusted=yes] http://archive.ubuntu.com/ubuntu/ wily main restricted ...
|
93
|
-
|
94
|
-
words = line.split
|
95
|
-
words.delete_at 1 if words[1] && words[1].start_with?("[")
|
96
|
-
type, url, distro, *components = words
|
97
|
-
url = url.delete('"') if url
|
98
|
-
|
99
|
-
next if components.empty?
|
100
|
-
next unless URI::HTTP === URI.parse(url)
|
101
|
-
next unless %w{deb deb-src}.include? type
|
102
|
-
|
103
|
-
# map data
|
104
|
-
{
|
105
|
-
type: type,
|
106
|
-
url: url,
|
107
|
-
distro: distro,
|
108
|
-
components: components,
|
109
|
-
active: active,
|
110
|
-
}
|
111
|
-
end.compact
|
112
|
-
end
|
113
|
-
|
114
|
-
# resolves ppa urls
|
115
|
-
# @see http://bazaar.launchpad.net/~ubuntu-core-dev/software-properties/main/view/head:/softwareproperties/ppa.py
|
116
|
-
def determine_ppa_url(ppa_url)
|
117
|
-
# verify if we have the url already, then just return
|
118
|
-
return ppa_url if ppa_url =~ HTTP_URL_RE
|
119
|
-
|
120
|
-
# otherwise start generating the ppa url
|
121
|
-
|
122
|
-
# special care if the name stats with :
|
123
|
-
ppa_url = ppa_url.split(":")[1] if ppa_url.start_with?("ppa:")
|
124
|
-
|
125
|
-
# parse ppa owner and repo
|
126
|
-
ppa_owner, ppa_repo = ppa_url.split("/")
|
127
|
-
ppa_repo = "ppa" if ppa_repo.nil?
|
128
|
-
|
129
|
-
# construct new ppa url and return it
|
130
|
-
format("http://ppa.launchpad.net/%s/%s/ubuntu", ppa_owner, ppa_repo)
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
|
-
class PpaRepository < AptRepository
|
135
|
-
name "ppa"
|
136
|
-
|
137
|
-
def exists?
|
138
|
-
deprecated
|
139
|
-
super()
|
140
|
-
end
|
141
|
-
|
142
|
-
def enabled?
|
143
|
-
deprecated
|
144
|
-
super()
|
145
|
-
end
|
146
|
-
|
147
|
-
def deprecated
|
148
|
-
Inspec.deprecate(:resource_ppa, "The `ppa` resource is deprecated. Please use `apt`")
|
149
|
-
end
|
150
|
-
end
|
151
|
-
end
|