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,64 +0,0 @@
|
|
1
|
-
require "inspec/resources/command"
|
2
|
-
|
3
|
-
# copyright: 2015, Vulcano Security GmbH
|
4
|
-
|
5
|
-
# Advanced Auditing:
|
6
|
-
# As soon as you start applying Advanced Audit Configuration Policy, legacy policies will be completely ignored.
|
7
|
-
# reference: https://technet.microsoft.com/en-us/library/cc753632.aspx
|
8
|
-
# use:
|
9
|
-
# - list all categories: Auditpol /list /subcategory:* /r
|
10
|
-
# - list parameters: Auditpol /get /category:"System" /subcategory:"IPsec Driver"
|
11
|
-
# - list specific parameter: Auditpol /get /subcategory:"IPsec Driver"
|
12
|
-
#
|
13
|
-
# @link: http://blogs.technet.com/b/askds/archive/2011/03/11/getting-the-effective-audit-policy-in-windows-7-and-2008-r2.aspx
|
14
|
-
#
|
15
|
-
# Valid values are:
|
16
|
-
#
|
17
|
-
# - "No Auditing"
|
18
|
-
# - "Not Specified"
|
19
|
-
# - "Success"
|
20
|
-
# - "Success and Failure"
|
21
|
-
# - "Failure"
|
22
|
-
#
|
23
|
-
# Further information is available at: https://msdn.microsoft.com/en-us/library/dd973859.aspx
|
24
|
-
|
25
|
-
module Inspec::Resources
|
26
|
-
class AuditPolicy < Inspec.resource(1)
|
27
|
-
name "audit_policy"
|
28
|
-
supports platform: "windows"
|
29
|
-
desc "Use the audit_policy InSpec audit resource to test auditing policies on the Microsoft Windows platform. An auditing policy is a category of security-related events to be audited. Auditing is disabled by default and may be enabled for categories like account management, logon events, policy changes, process tracking, privilege use, system events, or object access. For each enabled auditing category property, the auditing level may be set to No Auditing, Not Specified, Success, Success and Failure, or Failure."
|
30
|
-
example <<~EXAMPLE
|
31
|
-
describe audit_policy do
|
32
|
-
its('parameter') { should eq 'value' }
|
33
|
-
end
|
34
|
-
EXAMPLE
|
35
|
-
|
36
|
-
def method_missing(method)
|
37
|
-
key = method.to_s
|
38
|
-
|
39
|
-
# expected result:
|
40
|
-
# Machine Name,Policy Target,Subcategory,Subcategory GUID,Inclusion Setting,Exclusion Setting
|
41
|
-
# WIN-MB8NINQ388J,System,Kerberos Authentication Service,{0CCE9242-69AE-11D9-BED3-505054503030},No Auditing,
|
42
|
-
result ||= inspec.command("Auditpol /get /subcategory:'#{key}' /r").stdout
|
43
|
-
|
44
|
-
# find line
|
45
|
-
target = nil
|
46
|
-
result.each_line do |s|
|
47
|
-
target = s.strip if s =~ /\b.*#{key}.*\b/
|
48
|
-
end
|
49
|
-
|
50
|
-
# extract value
|
51
|
-
values = nil
|
52
|
-
unless target.nil?
|
53
|
-
# split csv values and return value
|
54
|
-
values = target.split(",")[4]
|
55
|
-
end
|
56
|
-
|
57
|
-
values
|
58
|
-
end
|
59
|
-
|
60
|
-
def to_s
|
61
|
-
"Audit Policy"
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
@@ -1,251 +0,0 @@
|
|
1
|
-
require "forwardable"
|
2
|
-
require "inspec/utils/filter_array"
|
3
|
-
require "inspec/utils/filter"
|
4
|
-
require "inspec/utils/parser"
|
5
|
-
|
6
|
-
module Inspec::Resources
|
7
|
-
class AuditDaemon < Inspec.resource(1)
|
8
|
-
extend Forwardable
|
9
|
-
attr_accessor :lines
|
10
|
-
attr_reader :params
|
11
|
-
|
12
|
-
name "auditd"
|
13
|
-
supports platform: "unix"
|
14
|
-
desc "Use the auditd InSpec audit resource to test the rules for logging that exist on the system. The audit.rules file is typically located under /etc/audit/ and contains the list of rules that define what is captured in log files. These rules are output using the auditcl -l command."
|
15
|
-
example <<~EXAMPLE
|
16
|
-
describe auditd.syscall('chown').where {arch == 'b32'} do
|
17
|
-
its('action') { should eq ['always'] }
|
18
|
-
its('list') { should eq ['exit'] }
|
19
|
-
end
|
20
|
-
|
21
|
-
describe auditd.where {key == 'privileged'} do
|
22
|
-
its('permissions') { should include ['x'] }
|
23
|
-
end
|
24
|
-
|
25
|
-
describe auditd do
|
26
|
-
its('lines') { should include %r(-w /etc/ssh/sshd_config) }
|
27
|
-
end
|
28
|
-
EXAMPLE
|
29
|
-
|
30
|
-
def initialize
|
31
|
-
unless inspec.command("/sbin/auditctl").exist?
|
32
|
-
raise Inspec::Exceptions::ResourceFailed,
|
33
|
-
"Command `/sbin/auditctl` does not exist"
|
34
|
-
end
|
35
|
-
|
36
|
-
auditctl_cmd = "/sbin/auditctl -l"
|
37
|
-
result = inspec.command(auditctl_cmd)
|
38
|
-
|
39
|
-
if result.exit_status != 0
|
40
|
-
raise Inspec::Exceptions::ResourceFailed,
|
41
|
-
"Command `#{auditctl_cmd}` failed with error: #{result.stderr}"
|
42
|
-
end
|
43
|
-
|
44
|
-
@content = result.stdout
|
45
|
-
@params = []
|
46
|
-
|
47
|
-
if @content =~ /^LIST_RULES:/
|
48
|
-
raise Inspec::Exceptions::ResourceFailed,
|
49
|
-
"The version of audit is outdated." \
|
50
|
-
"The `auditd` resource supports versions of audit >= 2.3."
|
51
|
-
end
|
52
|
-
parse_content
|
53
|
-
end
|
54
|
-
|
55
|
-
filter = FilterTable.create
|
56
|
-
filter.register_column(:file, field: "file")
|
57
|
-
.register_column(:list, field: "list")
|
58
|
-
.register_column(:action, field: "action")
|
59
|
-
.register_column(:fields, field: "fields")
|
60
|
-
.register_column(:fields_nokey, field: "fields_nokey")
|
61
|
-
.register_column(:syscall, field: "syscall")
|
62
|
-
.register_column(:key, field: "key")
|
63
|
-
.register_column(:arch, field: "arch")
|
64
|
-
.register_column(:path, field: "path")
|
65
|
-
.register_column(:permissions, field: "permissions")
|
66
|
-
.register_column(:exit, field: "exit")
|
67
|
-
|
68
|
-
filter.install_filter_methods_on_resource(self, :params)
|
69
|
-
|
70
|
-
def status(name = nil)
|
71
|
-
@status_content ||= inspec.command("/sbin/auditctl -s").stdout.chomp
|
72
|
-
|
73
|
-
# See: https://github.com/inspec/inspec/issues/3113
|
74
|
-
if @status_content =~ /^AUDIT_STATUS/
|
75
|
-
@status_content = @status_content.gsub("AUDIT_STATUS: ", "")
|
76
|
-
.tr(" ", "\n")
|
77
|
-
.tr("=", " ")
|
78
|
-
end
|
79
|
-
|
80
|
-
@status_params ||= Hash[@status_content.scan(/^([^ ]+) (.*)$/)]
|
81
|
-
|
82
|
-
return @status_params[name] if name
|
83
|
-
|
84
|
-
@status_params
|
85
|
-
end
|
86
|
-
|
87
|
-
def parse_content
|
88
|
-
@lines = @content.lines.map(&:chomp)
|
89
|
-
|
90
|
-
lines.each do |line|
|
91
|
-
if is_file_syscall_syntax?(line)
|
92
|
-
file_syscall_syntax_rules_for(line)
|
93
|
-
end
|
94
|
-
|
95
|
-
if is_syscall?(line)
|
96
|
-
syscall_rules_for(line)
|
97
|
-
|
98
|
-
elsif is_file?(line)
|
99
|
-
file_rules_for(line)
|
100
|
-
end
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
def file_syscall_syntax_rules_for(line)
|
105
|
-
file = file_syscall_syntax_for(line)
|
106
|
-
action, list = action_list_for(line)
|
107
|
-
fields = rule_fields_for(line)
|
108
|
-
key_field, fields_nokey = remove_key_from(fields)
|
109
|
-
key = key_in(key_field.join(""))
|
110
|
-
perms = perms_in(fields)
|
111
|
-
|
112
|
-
@params.push(
|
113
|
-
{
|
114
|
-
"file" => file,
|
115
|
-
"list" => list,
|
116
|
-
"action" => action,
|
117
|
-
"fields" => fields,
|
118
|
-
"permissions" => perms,
|
119
|
-
"key" => key,
|
120
|
-
"fields_nokey" => fields_nokey,
|
121
|
-
}
|
122
|
-
)
|
123
|
-
end
|
124
|
-
|
125
|
-
def syscall_rules_for(line)
|
126
|
-
syscalls = syscalls_for(line)
|
127
|
-
action, list = action_list_for(line)
|
128
|
-
fields = rule_fields_for(line)
|
129
|
-
key_field, fields_nokey = remove_key_from(fields)
|
130
|
-
key = key_in(key_field.join(""))
|
131
|
-
arch = arch_in(fields)
|
132
|
-
path = path_in(fields)
|
133
|
-
perms = perms_in(fields)
|
134
|
-
exit_field = exit_in(fields)
|
135
|
-
|
136
|
-
syscalls.each do |s|
|
137
|
-
@params.push(
|
138
|
-
{
|
139
|
-
"syscall" => s,
|
140
|
-
"list" => list,
|
141
|
-
"action" => action,
|
142
|
-
"fields" => fields,
|
143
|
-
"key" => key,
|
144
|
-
"arch" => arch,
|
145
|
-
"path" => path,
|
146
|
-
"permissions" => perms,
|
147
|
-
"exit" => exit_field,
|
148
|
-
"fields_nokey" => fields_nokey,
|
149
|
-
}
|
150
|
-
)
|
151
|
-
end
|
152
|
-
end
|
153
|
-
|
154
|
-
def file_rules_for(line)
|
155
|
-
file = file_for(line)
|
156
|
-
perms = permissions_for(line)
|
157
|
-
key = key_for(line)
|
158
|
-
|
159
|
-
@params.push(
|
160
|
-
{
|
161
|
-
"file" => file,
|
162
|
-
"key" => key,
|
163
|
-
"permissions" => perms,
|
164
|
-
}
|
165
|
-
)
|
166
|
-
end
|
167
|
-
|
168
|
-
def to_s
|
169
|
-
"Auditd Rules"
|
170
|
-
end
|
171
|
-
|
172
|
-
private
|
173
|
-
|
174
|
-
def is_syscall?(line)
|
175
|
-
line.match(/-S /)
|
176
|
-
end
|
177
|
-
|
178
|
-
def is_file?(line)
|
179
|
-
line.match(/-w /)
|
180
|
-
end
|
181
|
-
|
182
|
-
def is_file_syscall_syntax?(line)
|
183
|
-
line.match(/-F path=/)
|
184
|
-
end
|
185
|
-
|
186
|
-
def syscalls_for(line)
|
187
|
-
line.scan(/-S ([^ ]+)\s?/).flatten.first.split(",")
|
188
|
-
end
|
189
|
-
|
190
|
-
def action_list_for(line)
|
191
|
-
line.scan(/-a ([^,]+),([^ ]+)\s?/).flatten
|
192
|
-
end
|
193
|
-
|
194
|
-
def key_for(line)
|
195
|
-
line.match(/-k ([^ ]+)\s?/)[1] if line.include?("-k ")
|
196
|
-
end
|
197
|
-
|
198
|
-
def file_for(line)
|
199
|
-
line.match(/-w ([^ ]+)\s?/)[1]
|
200
|
-
end
|
201
|
-
|
202
|
-
def file_syscall_syntax_for(line)
|
203
|
-
line.match(/-F path=(\S+)\s?/)[1]
|
204
|
-
end
|
205
|
-
|
206
|
-
def permissions_for(line)
|
207
|
-
line.match(/-p ([^ ]+)/)[1].scan(/\w/)
|
208
|
-
end
|
209
|
-
|
210
|
-
def rule_fields_for(line)
|
211
|
-
line.gsub(/-[aS] [^ ]+ /, "").split("-F ").map { |l| l.split(" ") }.flatten
|
212
|
-
end
|
213
|
-
|
214
|
-
def arch_in(fields)
|
215
|
-
fields.each do |field|
|
216
|
-
return field.match(/arch=(\S+)\s?/)[1] if field.start_with?("arch=")
|
217
|
-
end
|
218
|
-
nil
|
219
|
-
end
|
220
|
-
|
221
|
-
def perms_in(fields)
|
222
|
-
fields.each do |field|
|
223
|
-
return field.match(/perm=(\S+)\s?/)[1].scan(/\w/) if field.start_with?("perm=")
|
224
|
-
end
|
225
|
-
nil
|
226
|
-
end
|
227
|
-
|
228
|
-
def path_in(fields)
|
229
|
-
fields.each do |field|
|
230
|
-
return field.match(/path=(\S+)\s?/)[1] if field.start_with?("path=")
|
231
|
-
end
|
232
|
-
nil
|
233
|
-
end
|
234
|
-
|
235
|
-
def exit_in(fields)
|
236
|
-
fields.each do |field|
|
237
|
-
return field.match(/exit=(\S+)\s?/)[1] if field.start_with?("exit=")
|
238
|
-
end
|
239
|
-
nil
|
240
|
-
end
|
241
|
-
|
242
|
-
def key_in(field)
|
243
|
-
_, v = field.split("=")
|
244
|
-
v
|
245
|
-
end
|
246
|
-
|
247
|
-
def remove_key_from(fields)
|
248
|
-
fields.partition { |x| x.start_with? "key" }
|
249
|
-
end
|
250
|
-
end
|
251
|
-
end
|
@@ -1,45 +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 AuditDaemonConf < Inspec.resource(1)
|
8
|
-
name "auditd_conf"
|
9
|
-
supports platform: "unix"
|
10
|
-
desc "Use the auditd_conf InSpec audit resource to test the configuration settings for the audit daemon. This file is typically located under /etc/audit/auditd.conf' on UNIX and Linux platforms."
|
11
|
-
example <<~EXAMPLE
|
12
|
-
describe auditd_conf do
|
13
|
-
its('space_left_action') { should eq 'email' }
|
14
|
-
end
|
15
|
-
EXAMPLE
|
16
|
-
|
17
|
-
include FileReader
|
18
|
-
|
19
|
-
def initialize(path = nil)
|
20
|
-
@conf_path = path || "/etc/audit/auditd.conf"
|
21
|
-
@content = read_file_content(@conf_path)
|
22
|
-
end
|
23
|
-
|
24
|
-
def method_missing(name)
|
25
|
-
read_params[name.to_s]
|
26
|
-
end
|
27
|
-
|
28
|
-
def to_s
|
29
|
-
"Audit Daemon Config"
|
30
|
-
end
|
31
|
-
|
32
|
-
private
|
33
|
-
|
34
|
-
def read_params
|
35
|
-
return @params if defined?(@params)
|
36
|
-
|
37
|
-
# parse the file
|
38
|
-
conf = SimpleConfig.new(
|
39
|
-
@content,
|
40
|
-
multiple_values: false
|
41
|
-
)
|
42
|
-
@params = conf.params
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
require "inspec/utils/command_wrapper"
|
2
|
-
require "inspec/resources/command"
|
3
|
-
|
4
|
-
module Inspec::Resources
|
5
|
-
class Bash < Cmd
|
6
|
-
name "bash"
|
7
|
-
supports platform: "unix"
|
8
|
-
desc "Run a command or script in BASH."
|
9
|
-
example <<~EXAMPLE
|
10
|
-
describe bash('ls -al /') do
|
11
|
-
its('stdout') { should match /bin/ }
|
12
|
-
its('stderr') { should eq '' }
|
13
|
-
its('exit_status') { should eq 0 }
|
14
|
-
end
|
15
|
-
|
16
|
-
# Specify the path of the executable:
|
17
|
-
bash('...', path: '/bin/bash')
|
18
|
-
|
19
|
-
# Specify arguments (defaults to -c)
|
20
|
-
bash('...', args: '-x -c')
|
21
|
-
EXAMPLE
|
22
|
-
|
23
|
-
def initialize(command, options = {})
|
24
|
-
@raw_command = command
|
25
|
-
options[:shell] = "bash" if options.is_a?(Hash)
|
26
|
-
super(CommandWrapper.wrap(command, options))
|
27
|
-
end
|
28
|
-
|
29
|
-
def to_s
|
30
|
-
"Bash command #{@raw_command}"
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,70 +0,0 @@
|
|
1
|
-
require "inspec/resources/file"
|
2
|
-
require "inspec/utils/file_reader"
|
3
|
-
require "inspec/utils/simpleconfig"
|
4
|
-
|
5
|
-
module Inspec::Resources
|
6
|
-
class Bond < FileResource
|
7
|
-
name "bond"
|
8
|
-
supports platform: "unix"
|
9
|
-
desc 'Use the bond InSpec audit resource to test a logical, bonded network interface (i.e. "two or more network interfaces aggregated into a single, logical network interface"). On Linux platforms, any value in the /proc/net/bonding directory may be tested.'
|
10
|
-
example <<~EXAMPLE
|
11
|
-
describe bond('bond0') do
|
12
|
-
it { should exist }
|
13
|
-
end
|
14
|
-
EXAMPLE
|
15
|
-
|
16
|
-
include FileReader
|
17
|
-
|
18
|
-
def initialize(bond)
|
19
|
-
@bond = bond
|
20
|
-
@path = "/proc/net/bonding/#{bond}"
|
21
|
-
@file = inspec.file(@path)
|
22
|
-
@content = read_file_content(@path, allow_empty: true)
|
23
|
-
@params = {}
|
24
|
-
@loaded = false
|
25
|
-
end
|
26
|
-
|
27
|
-
def read_content
|
28
|
-
if @file.exist?
|
29
|
-
@params = SimpleConfig.new(
|
30
|
-
@content,
|
31
|
-
assignment_regex: /^\s*([^:]*?)\s*:\s*(.*?)\s*$/,
|
32
|
-
multiple_values: true
|
33
|
-
).params
|
34
|
-
end
|
35
|
-
@loaded = true
|
36
|
-
@content
|
37
|
-
end
|
38
|
-
|
39
|
-
# ensures the content is loaded before we return the params
|
40
|
-
def params
|
41
|
-
read_content if @loaded == false
|
42
|
-
@params
|
43
|
-
end
|
44
|
-
|
45
|
-
def content
|
46
|
-
read_content if @loaded == false
|
47
|
-
@content
|
48
|
-
end
|
49
|
-
|
50
|
-
def exist?
|
51
|
-
@file.exist?
|
52
|
-
end
|
53
|
-
|
54
|
-
def has_interface?(interface)
|
55
|
-
params["Slave Interface"].include?(interface)
|
56
|
-
end
|
57
|
-
|
58
|
-
def interfaces
|
59
|
-
params["Slave Interface"]
|
60
|
-
end
|
61
|
-
|
62
|
-
def mode
|
63
|
-
params["Bonding Mode"].first
|
64
|
-
end
|
65
|
-
|
66
|
-
def to_s
|
67
|
-
"Bond #{@bond}"
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|