inspec 4.18.51 → 4.18.85

Sign up to get free protection for your applications and to get access to all the features.
Files changed (371) hide show
  1. checksums.yaml +4 -4
  2. data/inspec.gemspec +15 -37
  3. data/lib/resource_support/aws/aws_resource_mixin.rb +1 -1
  4. metadata +22 -709
  5. data/Gemfile +0 -61
  6. data/LICENSE +0 -14
  7. data/README.md +0 -474
  8. data/etc/deprecations.json +0 -125
  9. data/etc/plugin_filters.json +0 -45
  10. data/lib/bundles/README.md +0 -3
  11. data/lib/bundles/inspec-compliance/api.rb +0 -7
  12. data/lib/bundles/inspec-compliance/configuration.rb +0 -7
  13. data/lib/bundles/inspec-compliance/http.rb +0 -7
  14. data/lib/bundles/inspec-compliance/support.rb +0 -7
  15. data/lib/bundles/inspec-compliance/target.rb +0 -7
  16. data/lib/bundles/inspec-supermarket.rb +0 -9
  17. data/lib/bundles/inspec-supermarket/README.md +0 -45
  18. data/lib/bundles/inspec-supermarket/api.rb +0 -87
  19. data/lib/bundles/inspec-supermarket/cli.rb +0 -71
  20. data/lib/bundles/inspec-supermarket/target.rb +0 -31
  21. data/lib/inspec.rb +0 -30
  22. data/lib/inspec/archive/tar.rb +0 -25
  23. data/lib/inspec/archive/zip.rb +0 -15
  24. data/lib/inspec/backend.rb +0 -101
  25. data/lib/inspec/base_cli.rb +0 -318
  26. data/lib/inspec/cached_fetcher.rb +0 -65
  27. data/lib/inspec/cli.rb +0 -469
  28. data/lib/inspec/completions/bash.sh.erb +0 -45
  29. data/lib/inspec/completions/fish.sh.erb +0 -34
  30. data/lib/inspec/completions/zsh.sh.erb +0 -61
  31. data/lib/inspec/config.rb +0 -511
  32. data/lib/inspec/control_eval_context.rb +0 -248
  33. data/lib/inspec/dependencies/cache.rb +0 -74
  34. data/lib/inspec/dependencies/dependency_set.rb +0 -93
  35. data/lib/inspec/dependencies/lockfile.rb +0 -115
  36. data/lib/inspec/dependencies/requirement.rb +0 -135
  37. data/lib/inspec/dependencies/resolver.rb +0 -86
  38. data/lib/inspec/describe_base.rb +0 -53
  39. data/lib/inspec/dist.rb +0 -20
  40. data/lib/inspec/dsl.rb +0 -115
  41. data/lib/inspec/dsl_shared.rb +0 -32
  42. data/lib/inspec/env_printer.rb +0 -156
  43. data/lib/inspec/errors.rb +0 -18
  44. data/lib/inspec/exceptions.rb +0 -11
  45. data/lib/inspec/expect.rb +0 -42
  46. data/lib/inspec/fetcher.rb +0 -48
  47. data/lib/inspec/fetcher/git.rb +0 -211
  48. data/lib/inspec/fetcher/local.rb +0 -116
  49. data/lib/inspec/fetcher/mock.rb +0 -34
  50. data/lib/inspec/fetcher/url.rb +0 -281
  51. data/lib/inspec/file_provider.rb +0 -318
  52. data/lib/inspec/formatters.rb +0 -3
  53. data/lib/inspec/formatters/base.rb +0 -269
  54. data/lib/inspec/formatters/json_rspec.rb +0 -20
  55. data/lib/inspec/formatters/show_progress.rb +0 -12
  56. data/lib/inspec/globals.rb +0 -9
  57. data/lib/inspec/impact.rb +0 -36
  58. data/lib/inspec/input.rb +0 -421
  59. data/lib/inspec/input_dsl_helpers.rb +0 -26
  60. data/lib/inspec/input_registry.rb +0 -315
  61. data/lib/inspec/library_eval_context.rb +0 -55
  62. data/lib/inspec/log.rb +0 -7
  63. data/lib/inspec/metadata.rb +0 -253
  64. data/lib/inspec/method_source.rb +0 -20
  65. data/lib/inspec/objects.rb +0 -14
  66. data/lib/inspec/objects/control.rb +0 -85
  67. data/lib/inspec/objects/describe.rb +0 -106
  68. data/lib/inspec/objects/each_loop.rb +0 -41
  69. data/lib/inspec/objects/input.rb +0 -49
  70. data/lib/inspec/objects/list.rb +0 -15
  71. data/lib/inspec/objects/or_test.rb +0 -45
  72. data/lib/inspec/objects/ruby_helper.rb +0 -13
  73. data/lib/inspec/objects/tag.rb +0 -32
  74. data/lib/inspec/objects/test.rb +0 -94
  75. data/lib/inspec/objects/value.rb +0 -32
  76. data/lib/inspec/plugin/v1.rb +0 -2
  77. data/lib/inspec/plugin/v1/plugin_types/cli.rb +0 -22
  78. data/lib/inspec/plugin/v1/plugin_types/fetcher.rb +0 -83
  79. data/lib/inspec/plugin/v1/plugin_types/resource.rb +0 -176
  80. data/lib/inspec/plugin/v1/plugin_types/secret.rb +0 -11
  81. data/lib/inspec/plugin/v1/plugin_types/source_reader.rb +0 -36
  82. data/lib/inspec/plugin/v1/plugins.rb +0 -59
  83. data/lib/inspec/plugin/v1/registry.rb +0 -90
  84. data/lib/inspec/plugin/v2.rb +0 -46
  85. data/lib/inspec/plugin/v2/activator.rb +0 -40
  86. data/lib/inspec/plugin/v2/config_file.rb +0 -151
  87. data/lib/inspec/plugin/v2/filter.rb +0 -96
  88. data/lib/inspec/plugin/v2/installer.rb +0 -512
  89. data/lib/inspec/plugin/v2/loader.rb +0 -321
  90. data/lib/inspec/plugin/v2/plugin_base.rb +0 -112
  91. data/lib/inspec/plugin/v2/plugin_types/cli.rb +0 -49
  92. data/lib/inspec/plugin/v2/plugin_types/dsl.rb +0 -11
  93. data/lib/inspec/plugin/v2/plugin_types/input.rb +0 -34
  94. data/lib/inspec/plugin/v2/plugin_types/mock.rb +0 -12
  95. data/lib/inspec/plugin/v2/registry.rb +0 -98
  96. data/lib/inspec/plugin/v2/status.rb +0 -29
  97. data/lib/inspec/profile.rb +0 -658
  98. data/lib/inspec/profile_context.rb +0 -203
  99. data/lib/inspec/profile_vendor.rb +0 -84
  100. data/lib/inspec/reporters.rb +0 -73
  101. data/lib/inspec/reporters/automate.rb +0 -78
  102. data/lib/inspec/reporters/base.rb +0 -25
  103. data/lib/inspec/reporters/cli.rb +0 -370
  104. data/lib/inspec/reporters/json.rb +0 -113
  105. data/lib/inspec/reporters/json_automate.rb +0 -80
  106. data/lib/inspec/reporters/json_min.rb +0 -48
  107. data/lib/inspec/reporters/junit.rb +0 -77
  108. data/lib/inspec/reporters/yaml.rb +0 -20
  109. data/lib/inspec/require_loader.rb +0 -29
  110. data/lib/inspec/resource.rb +0 -114
  111. data/lib/inspec/resources.rb +0 -130
  112. data/lib/inspec/resources/aide_conf.rb +0 -153
  113. data/lib/inspec/resources/apache.rb +0 -47
  114. data/lib/inspec/resources/apache_conf.rb +0 -156
  115. data/lib/inspec/resources/apt.rb +0 -151
  116. data/lib/inspec/resources/audit_policy.rb +0 -64
  117. data/lib/inspec/resources/auditd.rb +0 -251
  118. data/lib/inspec/resources/auditd_conf.rb +0 -45
  119. data/lib/inspec/resources/bash.rb +0 -33
  120. data/lib/inspec/resources/bond.rb +0 -70
  121. data/lib/inspec/resources/bridge.rb +0 -125
  122. data/lib/inspec/resources/bsd_service.rb +0 -2
  123. data/lib/inspec/resources/chocolatey_package.rb +0 -82
  124. data/lib/inspec/resources/command.rb +0 -91
  125. data/lib/inspec/resources/cpan.rb +0 -58
  126. data/lib/inspec/resources/cran.rb +0 -64
  127. data/lib/inspec/resources/crontab.rb +0 -173
  128. data/lib/inspec/resources/csv.rb +0 -56
  129. data/lib/inspec/resources/dh_params.rb +0 -83
  130. data/lib/inspec/resources/directory.rb +0 -23
  131. data/lib/inspec/resources/docker.rb +0 -274
  132. data/lib/inspec/resources/docker_container.rb +0 -91
  133. data/lib/inspec/resources/docker_image.rb +0 -84
  134. data/lib/inspec/resources/docker_object.rb +0 -52
  135. data/lib/inspec/resources/docker_plugin.rb +0 -64
  136. data/lib/inspec/resources/docker_service.rb +0 -91
  137. data/lib/inspec/resources/elasticsearch.rb +0 -165
  138. data/lib/inspec/resources/etc_fstab.rb +0 -96
  139. data/lib/inspec/resources/etc_group.rb +0 -157
  140. data/lib/inspec/resources/etc_hosts.rb +0 -68
  141. data/lib/inspec/resources/etc_hosts_allow.rb +0 -2
  142. data/lib/inspec/resources/etc_hosts_allow_deny.rb +0 -114
  143. data/lib/inspec/resources/etc_hosts_deny.rb +0 -2
  144. data/lib/inspec/resources/file.rb +0 -339
  145. data/lib/inspec/resources/filesystem.rb +0 -139
  146. data/lib/inspec/resources/firewalld.rb +0 -148
  147. data/lib/inspec/resources/gem.rb +0 -80
  148. data/lib/inspec/resources/group.rb +0 -2
  149. data/lib/inspec/resources/groups.rb +0 -241
  150. data/lib/inspec/resources/grub_conf.rb +0 -230
  151. data/lib/inspec/resources/host.rb +0 -310
  152. data/lib/inspec/resources/http.rb +0 -275
  153. data/lib/inspec/resources/iis_app.rb +0 -101
  154. data/lib/inspec/resources/iis_app_pool.rb +0 -127
  155. data/lib/inspec/resources/iis_site.rb +0 -148
  156. data/lib/inspec/resources/iis_website.rb +0 -2
  157. data/lib/inspec/resources/inetd_conf.rb +0 -53
  158. data/lib/inspec/resources/ini.rb +0 -28
  159. data/lib/inspec/resources/interface.rb +0 -204
  160. data/lib/inspec/resources/ip6tables.rb +0 -79
  161. data/lib/inspec/resources/iptables.rb +0 -80
  162. data/lib/inspec/resources/json.rb +0 -116
  163. data/lib/inspec/resources/kernel_module.rb +0 -106
  164. data/lib/inspec/resources/kernel_parameter.rb +0 -54
  165. data/lib/inspec/resources/key_rsa.rb +0 -66
  166. data/lib/inspec/resources/ksh.rb +0 -33
  167. data/lib/inspec/resources/launchd_service.rb +0 -2
  168. data/lib/inspec/resources/limits_conf.rb +0 -45
  169. data/lib/inspec/resources/linux_kernel_parameter.rb +0 -2
  170. data/lib/inspec/resources/login_defs.rb +0 -56
  171. data/lib/inspec/resources/mount.rb +0 -88
  172. data/lib/inspec/resources/mssql_session.rb +0 -117
  173. data/lib/inspec/resources/mysql.rb +0 -81
  174. data/lib/inspec/resources/mysql_conf.rb +0 -128
  175. data/lib/inspec/resources/mysql_session.rb +0 -88
  176. data/lib/inspec/resources/nginx.rb +0 -96
  177. data/lib/inspec/resources/nginx_conf.rb +0 -232
  178. data/lib/inspec/resources/noop.rb +0 -9
  179. data/lib/inspec/resources/npm.rb +0 -68
  180. data/lib/inspec/resources/ntp_conf.rb +0 -51
  181. data/lib/inspec/resources/oneget.rb +0 -71
  182. data/lib/inspec/resources/oracledb_session.rb +0 -149
  183. data/lib/inspec/resources/os.rb +0 -34
  184. data/lib/inspec/resources/os_env.rb +0 -86
  185. data/lib/inspec/resources/package.rb +0 -391
  186. data/lib/inspec/resources/packages.rb +0 -111
  187. data/lib/inspec/resources/parse_config.rb +0 -112
  188. data/lib/inspec/resources/parse_config_file.rb +0 -2
  189. data/lib/inspec/resources/passwd.rb +0 -73
  190. data/lib/inspec/resources/pip.rb +0 -132
  191. data/lib/inspec/resources/platform.rb +0 -112
  192. data/lib/inspec/resources/port.rb +0 -791
  193. data/lib/inspec/resources/postfix_conf.rb +0 -35
  194. data/lib/inspec/resources/postgres.rb +0 -152
  195. data/lib/inspec/resources/postgres_conf.rb +0 -116
  196. data/lib/inspec/resources/postgres_hba_conf.rb +0 -86
  197. data/lib/inspec/resources/postgres_ident_conf.rb +0 -75
  198. data/lib/inspec/resources/postgres_session.rb +0 -70
  199. data/lib/inspec/resources/powershell.rb +0 -67
  200. data/lib/inspec/resources/ppa.rb +0 -2
  201. data/lib/inspec/resources/processes.rb +0 -219
  202. data/lib/inspec/resources/rabbitmq_conf.rb +0 -2
  203. data/lib/inspec/resources/rabbitmq_config.rb +0 -52
  204. data/lib/inspec/resources/registry_key.rb +0 -296
  205. data/lib/inspec/resources/runit_service.rb +0 -2
  206. data/lib/inspec/resources/script.rb +0 -1
  207. data/lib/inspec/resources/security_identifier.rb +0 -91
  208. data/lib/inspec/resources/security_policy.rb +0 -182
  209. data/lib/inspec/resources/service.rb +0 -820
  210. data/lib/inspec/resources/shadow.rb +0 -150
  211. data/lib/inspec/resources/ssh_config.rb +0 -98
  212. data/lib/inspec/resources/sshd_config.rb +0 -2
  213. data/lib/inspec/resources/ssl.rb +0 -99
  214. data/lib/inspec/resources/sys_info.rb +0 -119
  215. data/lib/inspec/resources/systemd_service.rb +0 -2
  216. data/lib/inspec/resources/sysv_service.rb +0 -2
  217. data/lib/inspec/resources/toml.rb +0 -30
  218. data/lib/inspec/resources/upstart_service.rb +0 -2
  219. data/lib/inspec/resources/user.rb +0 -1
  220. data/lib/inspec/resources/users.rb +0 -742
  221. data/lib/inspec/resources/vbscript.rb +0 -67
  222. data/lib/inspec/resources/virtualization.rb +0 -255
  223. data/lib/inspec/resources/windows_feature.rb +0 -126
  224. data/lib/inspec/resources/windows_hotfix.rb +0 -37
  225. data/lib/inspec/resources/windows_registry_key.rb +0 -2
  226. data/lib/inspec/resources/windows_task.rb +0 -112
  227. data/lib/inspec/resources/wmi.rb +0 -109
  228. data/lib/inspec/resources/x509_certificate.rb +0 -143
  229. data/lib/inspec/resources/xinetd_conf.rb +0 -103
  230. data/lib/inspec/resources/xml.rb +0 -48
  231. data/lib/inspec/resources/yaml.rb +0 -42
  232. data/lib/inspec/resources/yum.rb +0 -162
  233. data/lib/inspec/resources/zfs_dataset.rb +0 -62
  234. data/lib/inspec/resources/zfs_pool.rb +0 -50
  235. data/lib/inspec/rspec_extensions.rb +0 -116
  236. data/lib/inspec/rule.rb +0 -389
  237. data/lib/inspec/runner.rb +0 -333
  238. data/lib/inspec/runner_mock.rb +0 -37
  239. data/lib/inspec/runner_rspec.rb +0 -184
  240. data/lib/inspec/runtime_profile.rb +0 -23
  241. data/lib/inspec/schema.rb +0 -245
  242. data/lib/inspec/secrets.rb +0 -15
  243. data/lib/inspec/secrets/yaml.rb +0 -29
  244. data/lib/inspec/shell.rb +0 -211
  245. data/lib/inspec/shell_detector.rb +0 -89
  246. data/lib/inspec/source_reader.rb +0 -26
  247. data/lib/inspec/ui.rb +0 -213
  248. data/lib/inspec/ui_table_helper.rb +0 -12
  249. data/lib/inspec/utils/command_wrapper.rb +0 -23
  250. data/lib/inspec/utils/convert.rb +0 -8
  251. data/lib/inspec/utils/database_helpers.rb +0 -75
  252. data/lib/inspec/utils/deprecation.rb +0 -6
  253. data/lib/inspec/utils/deprecation/config_file.rb +0 -109
  254. data/lib/inspec/utils/deprecation/deprecator.rb +0 -118
  255. data/lib/inspec/utils/deprecation/errors.rb +0 -14
  256. data/lib/inspec/utils/deprecation/global_method.rb +0 -9
  257. data/lib/inspec/utils/enumerable_delegation.rb +0 -7
  258. data/lib/inspec/utils/erlang_parser.rb +0 -190
  259. data/lib/inspec/utils/file_reader.rb +0 -24
  260. data/lib/inspec/utils/filter.rb +0 -461
  261. data/lib/inspec/utils/filter_array.rb +0 -25
  262. data/lib/inspec/utils/find_files.rb +0 -44
  263. data/lib/inspec/utils/hash.rb +0 -37
  264. data/lib/inspec/utils/json_log.rb +0 -15
  265. data/lib/inspec/utils/modulator.rb +0 -9
  266. data/lib/inspec/utils/nginx_parser.rb +0 -101
  267. data/lib/inspec/utils/object_traversal.rb +0 -47
  268. data/lib/inspec/utils/parser.rb +0 -277
  269. data/lib/inspec/utils/pkey_reader.rb +0 -17
  270. data/lib/inspec/utils/simpleconfig.rb +0 -121
  271. data/lib/inspec/utils/spdx.rb +0 -10
  272. data/lib/inspec/utils/spdx.txt +0 -383
  273. data/lib/inspec/utils/telemetry.rb +0 -3
  274. data/lib/inspec/utils/telemetry/collector.rb +0 -81
  275. data/lib/inspec/utils/telemetry/data_series.rb +0 -44
  276. data/lib/inspec/utils/telemetry/global_methods.rb +0 -22
  277. data/lib/inspec/version.rb +0 -3
  278. data/lib/matchers/matchers.rb +0 -341
  279. data/lib/plugins/README.md +0 -16
  280. data/lib/plugins/inspec-artifact/lib/inspec-artifact.rb +0 -12
  281. data/lib/plugins/inspec-artifact/lib/inspec-artifact/base.rb +0 -170
  282. data/lib/plugins/inspec-artifact/lib/inspec-artifact/cli.rb +0 -116
  283. data/lib/plugins/inspec-artifact/test/functional/inspec_artifact_test.rb +0 -50
  284. data/lib/plugins/inspec-compliance/README.md +0 -207
  285. data/lib/plugins/inspec-compliance/lib/inspec-compliance.rb +0 -12
  286. data/lib/plugins/inspec-compliance/lib/inspec-compliance/api.rb +0 -362
  287. data/lib/plugins/inspec-compliance/lib/inspec-compliance/api/login.rb +0 -198
  288. data/lib/plugins/inspec-compliance/lib/inspec-compliance/cli.rb +0 -269
  289. data/lib/plugins/inspec-compliance/lib/inspec-compliance/configuration.rb +0 -103
  290. data/lib/plugins/inspec-compliance/lib/inspec-compliance/http.rb +0 -117
  291. data/lib/plugins/inspec-compliance/lib/inspec-compliance/images/cc-token.png +0 -0
  292. data/lib/plugins/inspec-compliance/lib/inspec-compliance/support.rb +0 -34
  293. data/lib/plugins/inspec-compliance/lib/inspec-compliance/target.rb +0 -146
  294. data/lib/plugins/inspec-compliance/test/functional/inspec_compliance_test.rb +0 -53
  295. data/lib/plugins/inspec-compliance/test/integration/default/cli.rb +0 -91
  296. data/lib/plugins/inspec-compliance/test/unit/api/login_test.rb +0 -190
  297. data/lib/plugins/inspec-compliance/test/unit/api_test.rb +0 -386
  298. data/lib/plugins/inspec-compliance/test/unit/target_test.rb +0 -155
  299. data/lib/plugins/inspec-habitat/Berksfile +0 -5
  300. data/lib/plugins/inspec-habitat/README.md +0 -150
  301. data/lib/plugins/inspec-habitat/kitchen.yml +0 -28
  302. data/lib/plugins/inspec-habitat/lib/inspec-habitat.rb +0 -11
  303. data/lib/plugins/inspec-habitat/lib/inspec-habitat/cli.rb +0 -41
  304. data/lib/plugins/inspec-habitat/lib/inspec-habitat/profile.rb +0 -265
  305. data/lib/plugins/inspec-habitat/templates/habitat/plan.sh.erb +0 -6
  306. data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/Berksfile +0 -2
  307. data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/README.md +0 -3
  308. data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/files/hab_setup.exp +0 -28
  309. data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/metadata.rb +0 -9
  310. data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/recipes/default.rb +0 -61
  311. data/lib/plugins/inspec-habitat/test/functional/inspec_habitat_test.rb +0 -34
  312. data/lib/plugins/inspec-habitat/test/integration/default/inspec_habitat/README.md +0 -3
  313. data/lib/plugins/inspec-habitat/test/integration/default/inspec_habitat/controls/inspec_habitat.rb +0 -40
  314. data/lib/plugins/inspec-habitat/test/integration/default/inspec_habitat/inspec.yml +0 -10
  315. data/lib/plugins/inspec-habitat/test/support/example_profile/README.md +0 -3
  316. data/lib/plugins/inspec-habitat/test/support/example_profile/controls/example.rb +0 -7
  317. data/lib/plugins/inspec-habitat/test/support/example_profile/inspec.yml +0 -10
  318. data/lib/plugins/inspec-habitat/test/unit/profile_test.rb +0 -242
  319. data/lib/plugins/inspec-init/README.md +0 -31
  320. data/lib/plugins/inspec-init/lib/inspec-init.rb +0 -12
  321. data/lib/plugins/inspec-init/lib/inspec-init/cli.rb +0 -15
  322. data/lib/plugins/inspec-init/lib/inspec-init/cli_plugin.rb +0 -243
  323. data/lib/plugins/inspec-init/lib/inspec-init/cli_profile.rb +0 -47
  324. data/lib/plugins/inspec-init/lib/inspec-init/renderer.rb +0 -97
  325. data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/Gemfile +0 -11
  326. data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/LICENSE +0 -2
  327. data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/README.md +0 -28
  328. data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/Rakefile +0 -40
  329. data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/lib/inspec-plugin-template.rb +0 -14
  330. data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/lib/inspec-plugin-template/cli_command.rb +0 -62
  331. data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/lib/inspec-plugin-template/plugin.rb +0 -53
  332. data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/lib/inspec-plugin-template/version.rb +0 -8
  333. data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/fixtures/README.md +0 -24
  334. data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/functional/README.md +0 -12
  335. data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/functional/inspec_plugin_template_test.rb +0 -110
  336. data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/helper.rb +0 -24
  337. data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/unit/README.md +0 -17
  338. data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/unit/cli_args_test.rb +0 -67
  339. data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/unit/plugin_def_test.rb +0 -51
  340. data/lib/plugins/inspec-init/templates/profiles/aws/libraries/.gitkeep +0 -0
  341. data/lib/plugins/inspec-init/templates/profiles/azure/libraries/.gitkeep +0 -0
  342. data/lib/plugins/inspec-init/templates/profiles/gcp/libraries/.gitkeep +0 -0
  343. data/lib/plugins/inspec-init/templates/profiles/os/README.md +0 -3
  344. data/lib/plugins/inspec-init/templates/profiles/os/controls/example.rb +0 -18
  345. data/lib/plugins/inspec-init/templates/profiles/os/inspec.yml +0 -10
  346. data/lib/plugins/inspec-init/templates/profiles/os/libraries/.gitkeep +0 -0
  347. data/lib/plugins/inspec-init/test/functional/inspec_init_plugin_test.rb +0 -184
  348. data/lib/plugins/inspec-init/test/functional/inspec_init_profile_test.rb +0 -121
  349. data/lib/plugins/inspec-plugin-manager-cli/README.md +0 -6
  350. data/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli.rb +0 -17
  351. data/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/cli_command.rb +0 -518
  352. data/lib/plugins/inspec-plugin-manager-cli/lib/inspec-plugin-manager-cli/plugin.rb +0 -12
  353. data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/config_dirs/empty/.gitkeep +0 -0
  354. data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/plugins/inspec-egg-white-omelette/lib/inspec-egg-white-omelette.rb +0 -2
  355. data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/plugins/inspec-egg-white-omelette/lib/inspec-egg-white-omelette/.gitkeep +0 -0
  356. data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/plugins/inspec-wrong-structure/.gitkeep +0 -0
  357. data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/plugins/wrong-name/lib/wrong-name.rb +0 -1
  358. data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/plugins/wrong-name/lib/wrong-name/.gitkeep +0 -0
  359. data/lib/plugins/inspec-plugin-manager-cli/test/functional/help_test.rb +0 -23
  360. data/lib/plugins/inspec-plugin-manager-cli/test/functional/helper.rb +0 -62
  361. data/lib/plugins/inspec-plugin-manager-cli/test/functional/install_test.rb +0 -368
  362. data/lib/plugins/inspec-plugin-manager-cli/test/functional/list_test.rb +0 -101
  363. data/lib/plugins/inspec-plugin-manager-cli/test/functional/search_test.rb +0 -129
  364. data/lib/plugins/inspec-plugin-manager-cli/test/functional/uninstall_test.rb +0 -63
  365. data/lib/plugins/inspec-plugin-manager-cli/test/functional/update_test.rb +0 -84
  366. data/lib/plugins/inspec-plugin-manager-cli/test/unit/cli_args_test.rb +0 -77
  367. data/lib/plugins/inspec-plugin-manager-cli/test/unit/plugin_def_test.rb +0 -39
  368. data/lib/plugins/shared/core_plugin_test_helper.rb +0 -153
  369. data/lib/plugins/things-for-train-integration.rb +0 -14
  370. data/lib/source_readers/flat.rb +0 -36
  371. data/lib/source_readers/inspec.rb +0 -66
@@ -1,30 +0,0 @@
1
- # copyright: 2015, Dominik Richter
2
-
3
- libdir = File.dirname(__FILE__)
4
- $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
5
-
6
- require "inspec/version"
7
- require "inspec/exceptions"
8
- require "inspec/utils/deprecation"
9
- require "inspec/profile"
10
- require "inspec/rule"
11
- require "matchers/matchers"
12
- require "inspec/runner"
13
- require "inspec/shell"
14
- require "inspec/formatters"
15
- require "inspec/reporters"
16
- require "inspec/input_registry"
17
- require "inspec/rspec_extensions"
18
- require "inspec/globals"
19
- require "inspec/impact"
20
- require "inspec/utils/telemetry"
21
- require "inspec/utils/telemetry/global_methods"
22
-
23
- require "inspec/plugin/v2"
24
- require "inspec/plugin/v1"
25
-
26
- # all utils that may be required by legacy plugins
27
- require "inspec/base_cli"
28
- require "inspec/fetcher"
29
- require "inspec/source_reader"
30
- require "inspec/resource"
@@ -1,25 +0,0 @@
1
- require "rubygems/package"
2
-
3
- module Inspec::Archive
4
- class TarArchiveGenerator
5
- def archive(base_dir, files, archive)
6
- File.open(archive, "wb") do |file|
7
- Zlib::GzipWriter.wrap(file) do |gz|
8
- Gem::Package::TarWriter.new(gz) do |tar|
9
- files.each do |input_filename|
10
- path = Pathname.new(base_dir).join(input_filename)
11
- stat = File.stat(path)
12
- if path.directory?
13
- tar.mkdir(input_filename, stat.mode)
14
- else
15
- tar.add_file_simple(input_filename, stat.mode, stat.size) do |io|
16
- io.write(File.binread(path))
17
- end
18
- end
19
- end
20
- end
21
- end
22
- end
23
- end
24
- end
25
- end
@@ -1,15 +0,0 @@
1
- require "rubygems"
2
- require "zip"
3
- require "pathname"
4
-
5
- module Inspec::Archive
6
- class ZipArchiveGenerator
7
- def archive(base_dir, files, archive)
8
- Zip::File.open(archive, Zip::File::CREATE) do |zipfile|
9
- files.each do |input_filename|
10
- zipfile.add(input_filename, Pathname.new(base_dir).join(input_filename))
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,101 +0,0 @@
1
- # copyright: 2015, Dominik Richter
2
-
3
- require "train"
4
- require "inspec/config"
5
- require "inspec/version"
6
- require "inspec/resource"
7
- require "inspec/dsl" # for method_missing_resource
8
-
9
- module Inspec
10
- module Backend
11
- module Base
12
- attr_accessor :profile
13
-
14
- # Provide a shorthand to retrieve the inspec version from within a profile
15
- #
16
- # @return [String] inspec version
17
- def version
18
- Inspec::VERSION
19
- end
20
-
21
- # Determine whether the connection/transport is a local connection
22
- # Useful for resources to modify behavior as necessary, such as using
23
- # the Ruby stdlib for a better experience.
24
- def local_transport?
25
- return false unless defined?(Train::Transports::Local)
26
-
27
- backend.is_a?(Train::Transports::Local::Connection)
28
- end
29
-
30
- # Ruby internal for printing a nice name for this class
31
- def to_s
32
- "Inspec::Backend::Class"
33
- end
34
-
35
- # Ruby internal for pretty-printing a summary for this class
36
- def inspect
37
- "Inspec::Backend::Class @transport=#{backend.class}"
38
- end
39
- end
40
-
41
- # Create the transport backend with aggregated resources.
42
- #
43
- # @param [Inspec::Config] config for the transport backend
44
- # @return [TransportBackend] enriched transport instance
45
- def self.create(config) # rubocop:disable Metrics/AbcSize
46
- train_credentials = config.unpack_train_credentials
47
- transport_name = Train.validate_backend(train_credentials)
48
- transport = Train.create(transport_name, train_credentials)
49
- if transport.nil?
50
- raise "Can't find transport backend '#{transport_name}'."
51
- end
52
-
53
- connection = transport.connection
54
- if connection.nil?
55
- raise "Can't connect to transport backend '#{transport_name}'."
56
- end
57
-
58
- # Set caching settings. We always want to enable caching for
59
- # the Mock transport for testing.
60
- if config[:backend_cache] || config[:backend] == :mock
61
- Inspec::Log.debug "Option backend_cache is enabled"
62
- connection.enable_cache(:file)
63
- connection.enable_cache(:command)
64
- elsif config[:debug_shell]
65
- Inspec::Log.debug "Option backend_cache is disabled"
66
- connection.disable_cache(:file)
67
- connection.disable_cache(:command)
68
- else
69
- Inspec::Log.debug "Option backend_cache is disabled"
70
- connection.disable_cache(:file)
71
- connection.disable_cache(:command)
72
- end
73
-
74
- cls = Class.new do
75
- include Base
76
-
77
- define_method :backend do
78
- connection
79
- end
80
-
81
- def method_missing(id, *args, &blk)
82
- Inspec::DSL.method_missing_resource(self, id, *args)
83
- rescue LoadError
84
- super
85
- end
86
-
87
- Inspec::Resource.registry.each do |id, r|
88
- define_method id.to_sym do |*args|
89
- r.new(self, id.to_s, *args)
90
- end
91
- end
92
- end
93
-
94
- cls.new
95
- rescue Train::ClientError => e
96
- raise "Client error, can't connect to '#{transport_name}' backend: #{e.message}"
97
- rescue Train::TransportError => e
98
- raise "Transport error, can't connect to '#{transport_name}' backend: #{e.message}"
99
- end
100
- end
101
- end
@@ -1,318 +0,0 @@
1
- require "thor"
2
- require "inspec/log"
3
- require "inspec/ui"
4
- require "inspec/config"
5
- require "inspec/dist"
6
- require "inspec/utils/deprecation/global_method"
7
-
8
- # Allow end of options during array type parsing
9
- # https://github.com/erikhuda/thor/issues/631
10
- class Thor::Arguments
11
- alias old_parse_array parse_array
12
-
13
- def parse_array(_name)
14
- return shift if peek.is_a?(Array)
15
-
16
- array = []
17
- while current_is_value?
18
- break unless @parsing_options
19
-
20
- array << shift
21
- end
22
- array
23
- end
24
- end
25
-
26
- module Inspec
27
- class BaseCLI < Thor
28
- class << self
29
- attr_accessor :inspec_cli_command
30
- end
31
-
32
- def self.start(given_args = ARGV, config = {})
33
- check_license! if config[:enforce_license] || config[:enforce_license].nil?
34
-
35
- super(given_args, config)
36
- end
37
-
38
- # EULA acceptance
39
- def self.check_license!
40
- allowed_commands = ["-h", "--help", "help", "-v", "--version", "version"]
41
-
42
- require "license_acceptance/acceptor"
43
- begin
44
- if (allowed_commands & ARGV.map(&:downcase)).empty? && # Did they use a non-exempt command?
45
- !ARGV.empty? # Did they supply at least one command?
46
- LicenseAcceptance::Acceptor.check_and_persist(
47
- Inspec::Dist::EXEC_NAME,
48
- Inspec::VERSION,
49
- logger: Inspec::Log
50
- )
51
- end
52
- rescue LicenseAcceptance::LicenseNotAcceptedError
53
- Inspec::Log.error "#{Inspec::Dist::PRODUCT_NAME} cannot execute without accepting the license"
54
- Inspec::UI.new.exit(:license_not_accepted)
55
- end
56
- end
57
-
58
- # https://github.com/erikhuda/thor/issues/244
59
- def self.exit_on_failure?
60
- true
61
- end
62
-
63
- def self.target_options # rubocop:disable MethodLength
64
- option :target, aliases: :t, type: :string,
65
- desc: "Simple targeting option using URIs, e.g. ssh://user:pass@host:port"
66
- option :backend, aliases: :b, type: :string,
67
- desc: "Choose a backend: local, ssh, winrm, docker."
68
- option :host, type: :string,
69
- desc: "Specify a remote host which is tested."
70
- option :port, aliases: :p, type: :numeric,
71
- desc: "Specify the login port for a remote scan."
72
- option :user, type: :string,
73
- desc: "The login user for a remote scan."
74
- option :password, type: :string, lazy_default: -1,
75
- desc: "Login password for a remote scan, if required."
76
- option :enable_password, type: :string, lazy_default: -1,
77
- desc: "Password for enable mode on Cisco IOS devices."
78
- option :key_files, aliases: :i, type: :array,
79
- desc: "Login key or certificate file for a remote scan."
80
- option :path, type: :string,
81
- desc: "Login path to use when connecting to the target (WinRM)."
82
- option :sudo, type: :boolean,
83
- desc: "Run scans with sudo. Only activates on Unix and non-root user."
84
- option :sudo_password, type: :string, lazy_default: -1,
85
- desc: "Specify a sudo password, if it is required."
86
- option :sudo_options, type: :string,
87
- desc: "Additional sudo options for a remote scan."
88
- option :sudo_command, type: :string,
89
- desc: "Alternate command for sudo."
90
- option :shell, type: :boolean,
91
- desc: "Run scans in a subshell. Only activates on Unix."
92
- option :shell_options, type: :string,
93
- desc: "Additional shell options."
94
- option :shell_command, type: :string,
95
- desc: "Specify a particular shell to use."
96
- option :ssl, type: :boolean,
97
- desc: "Use SSL for transport layer encryption (WinRM)."
98
- option :self_signed, type: :boolean,
99
- desc: "Allow remote scans with self-signed certificates (WinRM)."
100
- option :winrm_transport, type: :string, default: "negotiate",
101
- desc: "Specify which transport to use, defaults to negotiate (WinRM)."
102
- option :winrm_disable_sspi, type: :boolean,
103
- desc: "Whether to use disable sspi authentication, defaults to false (WinRM)."
104
- option :winrm_basic_auth, type: :boolean,
105
- desc: "Whether to use basic authentication, defaults to false (WinRM)."
106
- option :config, type: :string,
107
- desc: "Read configuration from JSON file (`-` reads from stdin)."
108
- option :json_config, type: :string, hide: true
109
- option :proxy_command, type: :string,
110
- desc: "Specifies the command to use to connect to the server"
111
- option :bastion_host, type: :string,
112
- desc: "Specifies the bastion host if applicable"
113
- option :bastion_user, type: :string,
114
- desc: "Specifies the bastion user if applicable"
115
- option :bastion_port, type: :string,
116
- desc: "Specifies the bastion port if applicable"
117
- option :insecure, type: :boolean, default: false,
118
- desc: "Disable SSL verification on select targets"
119
- option :target_id, type: :string,
120
- desc: "Provide a ID which will be included on reports"
121
- end
122
-
123
- def self.profile_options
124
- option :profiles_path, type: :string,
125
- desc: "Folder which contains referenced profiles."
126
- option :vendor_cache, type: :string,
127
- desc: "Use the given path for caching dependencies. (default: ~/.inspec/cache)"
128
- end
129
-
130
- def self.exec_options
131
- target_options
132
- profile_options
133
- option :controls, type: :array,
134
- desc: "A list of control names to run, or a list of /regexes/ to match against control names. Ignore all other tests."
135
- option :reporter, type: :array,
136
- banner: "one two:/output/file/path",
137
- desc: "Enable one or more output reporters: cli, documentation, html, progress, json, json-min, json-rspec, junit, yaml"
138
- option :input, type: :array, banner: "name1=value1 name2=value2",
139
- desc: "Specify one or more inputs directly on the command line, as --input NAME=VALUE"
140
- option :input_file, type: :array,
141
- desc: "Load one or more input files, a YAML file with values for the profile to use"
142
- option :waiver_file, type: :array,
143
- desc: "Load one or more waiver files."
144
- option :attrs, type: :array,
145
- desc: "Legacy name for --input-file - deprecated."
146
- option :create_lockfile, type: :boolean,
147
- desc: "Write out a lockfile based on this execution (unless one already exists)"
148
- option :backend_cache, type: :boolean,
149
- desc: "Allow caching for backend command output. (default: true)"
150
- option :show_progress, type: :boolean,
151
- desc: "Show progress while executing tests."
152
- option :distinct_exit, type: :boolean, default: true,
153
- desc: "Exit with code 101 if any tests fail, and 100 if any are skipped (default). If disabled, exit 0 on skips and 1 for failures."
154
- end
155
-
156
- def self.format_platform_info(params: {}, indent: 0, color: 39)
157
- str = ""
158
- params.each do |item, info|
159
- data = info
160
-
161
- # Format Array for better output if applicable
162
- data = data.join(", ") if data.is_a?(Array)
163
-
164
- # Do not output fields of data is missing ('unknown' is fine)
165
- next if data.nil?
166
-
167
- data = "\e[1m\e[#{color}m#{data}\e[0m"
168
- str << format("#{" " * indent}%-10s %s\n", item.to_s.capitalize + ":", data)
169
- end
170
- str
171
- end
172
-
173
- # These need to be public methods on any BaseCLI instance,
174
- # but Thor interprets all methods as subcommands. The no_commands block
175
- # treats them as regular methods.
176
- no_commands do
177
- def ui
178
- return @ui if defined?(@ui)
179
-
180
- # Make a new UI object, respecting context
181
- if options[:color].nil?
182
- enable_color = true # If the command does not support the color option, default to on
183
- else
184
- enable_color = options[:color]
185
- end
186
-
187
- # UI will probe for TTY if nil - just send the raw option value
188
- enable_interactivity = options[:interactive]
189
-
190
- @ui = Inspec::UI.new(color: enable_color, interactive: enable_interactivity)
191
- end
192
-
193
- # Rationale: converting this to attr_writer breaks Thor
194
- def ui=(new_ui) # rubocop: disable Style/TrivialAccessors
195
- @ui = new_ui
196
- end
197
-
198
- def mark_text(text)
199
- Inspec.deprecate(:inspec_ui_methods)
200
- # Note that this one doesn't automatically print
201
- ui.emphasis(text, print: false)
202
- end
203
-
204
- def headline(title)
205
- Inspec.deprecate(:inspec_ui_methods)
206
- ui.headline(title)
207
- end
208
-
209
- def li(entry)
210
- Inspec.deprecate(:inspec_ui_methods)
211
- ui.list_item(entry)
212
- end
213
-
214
- def plain_text(msg)
215
- Inspec.deprecate(:inspec_ui_methods)
216
- ui.plain(msg + "\n")
217
- end
218
-
219
- def exit(code)
220
- Inspec.deprecate(:inspec_ui_methods)
221
- ui.exit code
222
- end
223
- end
224
-
225
- private
226
-
227
- ALL_OF_OUR_REPORTERS = %w{json json-min json-rspec json-automate junit html yaml documentation progress}.freeze # BUT WHY?!?!
228
-
229
- def suppress_log_output?(opts)
230
- return false if opts["reporter"].nil?
231
-
232
- match = ALL_OF_OUR_REPORTERS & opts["reporter"].keys
233
-
234
- unless match.empty?
235
- match.each do |m|
236
- # check to see if we are outputting to stdout
237
- return true if opts["reporter"][m]["stdout"] == true
238
- end
239
- end
240
-
241
- false
242
- end
243
-
244
- def diagnose(_ = nil)
245
- config.diagnose
246
- end
247
-
248
- def config
249
- @config ||= Inspec::Config.new(options) # 'options' here is CLI opts from Thor
250
- end
251
-
252
- # get the log level
253
- # DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN
254
- def get_log_level(level)
255
- valid = %w{debug info warn error fatal}
256
-
257
- if valid.include?(level)
258
- l = level
259
- else
260
- l = "info"
261
- end
262
-
263
- Logger.const_get(l.upcase)
264
- end
265
-
266
- def pretty_handle_exception(exception)
267
- case exception
268
- when Inspec::Error
269
- $stderr.puts exception.message
270
- exit(1)
271
- else
272
- raise exception
273
- end
274
- end
275
-
276
- def vendor_deps(path, opts)
277
- require "inspec/profile_vendor"
278
-
279
- profile_path = path || Dir.pwd
280
- profile_vendor = Inspec::ProfileVendor.new(profile_path)
281
-
282
- if (profile_vendor.cache_path.exist? || profile_vendor.lockfile.exist?) && !opts[:overwrite]
283
- puts "Profile is already vendored. Use --overwrite."
284
- return false
285
- end
286
-
287
- profile_vendor.vendor!
288
- puts "Dependencies for profile #{profile_path} successfully vendored to #{profile_vendor.cache_path}"
289
- rescue StandardError => e
290
- pretty_handle_exception(e)
291
- end
292
-
293
- def configure_logger(o)
294
- #
295
- # TODO(ssd): This is a bit gross, but this configures the
296
- # logging singleton Inspec::Log. Eventually it would be nice to
297
- # move internal debug logging to use this logging singleton.
298
- #
299
- loc = if o["log_location"]
300
- o["log_location"]
301
- elsif suppress_log_output?(o)
302
- $stderr
303
- else
304
- $stdout
305
- end
306
-
307
- Inspec::Log.init(loc)
308
- Inspec::Log.level = get_log_level(o["log_level"])
309
-
310
- o[:logger] = Logger.new(loc)
311
- # output json if we have activated the json formatter
312
- if o["log-format"] == "json"
313
- o[:logger].formatter = Logger::JSONFormatter.new
314
- end
315
- o[:logger].level = get_log_level(o["log_level"])
316
- end
317
- end
318
- end