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,2 +0,0 @@
1
- # This is just here to make the dynamic loader happy.
2
- require "inspec/resources/service"
@@ -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 LimitsConf < Inspec.resource(1)
8
- name "limits_conf"
9
- supports platform: "unix"
10
- desc "Use the limits_conf InSpec audit resource to test configuration settings in the /etc/security/limits.conf file. The limits.conf defines limits for processes (by user and/or group names) and helps ensure that the system on which those processes are running remains stable. Each process may be assigned a hard or soft limit."
11
- example <<~EXAMPLE
12
- describe limits_conf do
13
- its('*') { should include ['hard','core','0'] }
14
- end
15
- EXAMPLE
16
-
17
- include FileReader
18
-
19
- def initialize(path = nil)
20
- @conf_path = path || "/etc/security/limits.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 read_params
29
- return @params if defined?(@params)
30
-
31
- # parse the file
32
- conf = SimpleConfig.new(
33
- @content,
34
- assignment_regex: /^\s*(\S+?)\s+(.*?)\s+(.*?)\s+(.*?)\s*$/,
35
- key_values: 3,
36
- multiple_values: true
37
- )
38
- @params = conf.params
39
- end
40
-
41
- def to_s
42
- "limits.conf"
43
- end
44
- end
45
- end
@@ -1,2 +0,0 @@
1
- # This is just here to make the dynamic loader happy.
2
- require "inspec/resources/kernel_parameter"
@@ -1,56 +0,0 @@
1
- # copyright: 2015, Vulcano Security GmbH
2
-
3
- require "inspec/utils/simpleconfig"
4
- require "inspec/utils/file_reader"
5
-
6
- # Usage:
7
- #
8
- # describe login_def do
9
- # its('UMASK') {
10
- # should eq '077'
11
- # }
12
- #
13
- # its('PASS_MAX_DAYS.to_i') {
14
- # should be <= 90
15
- # }
16
- # end
17
-
18
- module Inspec::Resources
19
- class LoginDefs < Inspec.resource(1)
20
- name "login_defs"
21
- supports platform: "unix"
22
- desc "Use the login_defs InSpec audit resource to test configuration settings in the /etc/login.defs file. The logins.defs file defines site-specific configuration for the shadow password suite on Linux and UNIX platforms, such as password expiration ranges, minimum/maximum values for automatic selection of user and group identifiers, or the method with which passwords are encrypted."
23
- example <<~EXAMPLE
24
- describe login_defs do
25
- its('ENCRYPT_METHOD') { should eq 'SHA512' }
26
- end
27
- EXAMPLE
28
-
29
- include FileReader
30
-
31
- def initialize(path = nil)
32
- @conf_path = path || "/etc/login.defs"
33
- @content = read_file_content(@conf_path)
34
- end
35
-
36
- def method_missing(name)
37
- read_params[name.to_s]
38
- end
39
-
40
- def read_params
41
- return @params if defined?(@params)
42
-
43
- # parse the file
44
- conf = SimpleConfig.new(
45
- @content,
46
- assignment_regex: /^\s*(\S+)\s+(\S*)\s*$/,
47
- multiple_values: false
48
- )
49
- @params = conf.params
50
- end
51
-
52
- def to_s
53
- "login.defs"
54
- end
55
- end
56
- end
@@ -1,88 +0,0 @@
1
- require "inspec/utils/simpleconfig"
2
-
3
- module Inspec::Resources
4
- class Mount < Inspec.resource(1)
5
- name "mount"
6
- supports platform: "unix"
7
- desc "Use the mount InSpec audit resource to test if mount points."
8
- example <<~EXAMPLE
9
- describe mount('/') do
10
- it { should be_mounted }
11
- its('count') { should eq 1 }
12
- its('device') { should eq '/dev/mapper/VolGroup-lv_root' }
13
- its('type') { should eq 'ext4' }
14
- its('options') { should eq ['rw', 'mode=620'] }
15
- its('options') { should include 'nodev' }
16
- end
17
- EXAMPLE
18
- attr_reader :file
19
-
20
- def initialize(path)
21
- @path = path
22
- @mount_manager = mount_manager_for_os
23
- return skip_resource "The `mount` resource is not supported on your OS yet." if @mount_manager.nil?
24
-
25
- @file = inspec.backend.file(@path)
26
- end
27
-
28
- def mounted?
29
- file.mounted?
30
- end
31
-
32
- def count
33
- mounted = file.mounted
34
- return nil if mounted.nil? || mounted.stdout.nil?
35
-
36
- mounted.stdout.lines.count
37
- end
38
-
39
- def method_missing(name)
40
- return nil unless file.mounted?
41
-
42
- mounted = file.mounted
43
- return nil if mounted.nil? || mounted.stdout.nil?
44
-
45
- line = mounted.stdout
46
- # if we got multiple lines, only use the last entry
47
- line = mounted.stdout.lines.to_a.last if mounted.stdout.lines.count > 1
48
-
49
- # parse content if we are on linux
50
- @mount_options ||= @mount_manager.parse_mount_options(line)
51
- @mount_options[name]
52
- end
53
-
54
- def to_s
55
- "Mount #{@path}"
56
- end
57
-
58
- private
59
-
60
- def mount_manager_for_os
61
- os = inspec.os
62
- if os.linux?
63
- LinuxMounts.new(inspec)
64
- elsif ["freebsd"].include?(os[:family])
65
- BsdMounts.new(inspec)
66
- end
67
- end
68
- end
69
-
70
- class MountsInfo
71
- attr_reader :inspec
72
- def initialize(inspec)
73
- @inspec = inspec
74
- end
75
-
76
- def parse_mount_options(_mount_line, _compatibility = false)
77
- raise NotImplementedError
78
- end
79
- end
80
-
81
- class LinuxMounts < MountsInfo
82
- include LinuxMountParser
83
- end
84
-
85
- class BsdMounts < MountsInfo
86
- include BsdMountParser
87
- end
88
- end
@@ -1,117 +0,0 @@
1
- require "inspec/resources/command"
2
- require "hashie/mash"
3
- require "inspec/utils/database_helpers"
4
-
5
- module Inspec::Resources
6
- # STABILITY: Experimental
7
- # This resource needs further testing and refinement
8
- #
9
- # This requires the `sqlcmd` tool available on platform
10
- # @see https://docs.microsoft.com/en-us/sql/relational-databases/scripting/sqlcmd-use-the-utility
11
- # @see https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-connect-and-query-sqlcmd
12
- class MssqlSession < Inspec.resource(1)
13
- name "mssql_session"
14
- supports platform: "windows"
15
- desc "Use the mssql_session InSpec audit resource to test SQL commands run against a MS Sql Server database."
16
- example <<~EXAMPLE
17
- # Using SQL authentication
18
- sql = mssql_session(user: 'myuser', pass: 'mypassword')
19
- describe sql.query('SELECT * FROM table').row(0).column('columnname') do
20
- its('value') { should cmp == 1 }
21
- end
22
-
23
- # Passing no credentials to mssql_session forces it to use Windows authentication
24
- sql_windows_auth = mssql_session
25
- describe sql_windows_auth.query(\"SELECT SERVERPROPERTY('IsIntegratedSecurityOnly') as \\\"login_mode\\\";\").row(0).column('login_mode') do
26
- its('value') { should_not be_empty }
27
- its('value') { should cmp == 1 }
28
- end
29
- EXAMPLE
30
-
31
- attr_reader :user, :password, :host, :port, :instance, :local_mode, :db_name
32
- def initialize(opts = {})
33
- @user = opts[:user]
34
- @password = opts[:password] || opts[:pass]
35
- if opts[:pass]
36
- Inspec.deprecate(:mssql_session_pass_option, "The mssql_session `pass` option is deprecated. Please use `password`.")
37
- end
38
- @local_mode = opts[:local_mode]
39
- unless local_mode?
40
- @host = opts[:host] || "localhost"
41
- if opts.key?(:port)
42
- @port = opts[:port]
43
- else
44
- @port = "1433"
45
- end
46
- end
47
- @instance = opts[:instance]
48
- @db_name = opts[:db_name]
49
-
50
- # check if sqlcmd is available
51
- raise Inspec::Exceptions::ResourceSkipped, "sqlcmd is missing" unless inspec.command("sqlcmd").exist?
52
- # check that database is reachable
53
- raise Inspec::Exceptions::ResourceSkipped, "Can't connect to the MS SQL Server." unless test_connection
54
- end
55
-
56
- def query(q) # rubocop:disable Metrics/PerceivedComplexity
57
- escaped_query = q.gsub(/\\/, '\\\\').gsub(/"/, '""').gsub(/\$/, '\\$')
58
- # surpress 'x rows affected' in SQLCMD with 'set nocount on;'
59
- cmd_string = "sqlcmd -Q \"set nocount on; #{escaped_query}\" -W -w 1024 -s ','"
60
- cmd_string += " -U '#{@user}' -P '#{@password}'" unless @user.nil? || @password.nil?
61
- cmd_string += " -d '#{@db_name}'" unless @db_name.nil?
62
- unless local_mode?
63
- if @port.nil?
64
- cmd_string += " -S '#{@host}"
65
- else
66
- cmd_string += " -S '#{@host},#{@port}"
67
- end
68
- if @instance.nil?
69
- cmd_string += "'"
70
- else
71
- cmd_string += "\\#{@instance}'"
72
- end
73
- end
74
- cmd = inspec.command(cmd_string)
75
- out = cmd.stdout + "\n" + cmd.stderr
76
- if cmd.exit_status != 0 || out =~ /Sqlcmd: Error/
77
- raise Inspec::Exceptions::ResourceFailed, "Could not execute the sql query #{out}"
78
- else
79
- DatabaseHelper::SQLQueryResult.new(cmd, parse_csv_result(cmd))
80
- end
81
- end
82
-
83
- def to_s
84
- "MSSQL session"
85
- end
86
-
87
- private
88
-
89
- def local_mode?
90
- !!@local_mode # rubocop:disable Style/DoubleNegation
91
- end
92
-
93
- def test_connection
94
- !query("select getdate()").empty?
95
- end
96
-
97
- def parse_csv_result(cmd)
98
- require "csv"
99
- table = CSV.parse(cmd.stdout, headers: true)
100
-
101
- # remove first row, since it will be a seperator line
102
- table.delete(0)
103
-
104
- # convert to hash
105
- headers = table.headers
106
-
107
- results = table.map do |row|
108
- res = {}
109
- headers.each do |header|
110
- res[header.downcase] = row[header] if header
111
- end
112
- Hashie::Mash.new(res)
113
- end
114
- results
115
- end
116
- end
117
- end
@@ -1,81 +0,0 @@
1
- # copyright: 2015, Vulcano Security GmbH
2
-
3
- module Inspec::Resources
4
- class Mysql < Inspec.resource(1)
5
- name "mysql"
6
- supports platform: "unix"
7
- desc "The 'mysql' resource is a helper for the 'mysql_conf' & 'mysql_session' resources. Please use those instead."
8
-
9
- attr_reader :package, :service, :conf_dir, :conf_path, :data_dir, :log_dir, :log_path, :log_group, :log_dir_group
10
- def initialize
11
- # set OS-dependent filenames and paths
12
- case inspec.os[:family]
13
- when "debian"
14
- init_ubuntu
15
- when "redhat", "fedora"
16
- init_redhat
17
- when "arch"
18
- init_arch
19
- else
20
- # TODO: could not detect
21
- init_default
22
- end
23
- end
24
-
25
- def init_ubuntu
26
- @package = "mysql-server"
27
- @service = "mysql"
28
- @conf_path = "/etc/mysql/my.cnf"
29
- @conf_dir = "/etc/mysql/"
30
- @data_dir = "/var/lib/mysql/"
31
- @log_dir = "/var/log/"
32
- @log_path = "/var/log/mysql.log"
33
- @log_group = "adm"
34
- case inspec.os[:release]
35
- when "14.04"
36
- @log_dir_group = "syslog"
37
- else
38
- @log_dir_group = "root"
39
- end
40
- end
41
-
42
- def init_redhat
43
- @package = "mysql-server"
44
- @service = "mysqld"
45
- @conf_path = "/etc/my.cnf"
46
- @conf_dir = "/etc/"
47
- @data_dir = "/var/lib/mysql/"
48
- @log_dir = "/var/log/"
49
- @log_path = "/var/log/mysqld.log"
50
- @log_group = "mysql"
51
- @log_dir_group = "root"
52
- end
53
-
54
- def init_arch
55
- @package = "mariadb"
56
- @service = "mysql"
57
- @conf_path = "/etc/mysql/my.cnf"
58
- @conf_dir = "/etc/mysql/"
59
- @data_dir = "/var/lib/mysql/"
60
- @log_dir = "/var/log/"
61
- @log_path = "/var/log/mysql.log"
62
- @log_group = "mysql"
63
- @log_dir_group = "root"
64
- end
65
-
66
- def init_default
67
- @service = "mysqld"
68
- @conf_path = "/etc/my.cnf"
69
- @conf_dir = "/etc/"
70
- @data_dir = "/var/lib/mysql/"
71
- @log_dir = "/var/log/"
72
- @log_path = "/var/log/mysqld.log"
73
- @log_group = "mysql"
74
- @log_dir_group = "root"
75
- end
76
-
77
- def to_s
78
- "MySQL"
79
- end
80
- end
81
- end
@@ -1,128 +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
- require "inspec/utils/hash"
7
- require "inspec/resources/mysql"
8
-
9
- module Inspec::Resources
10
- class MysqlConfEntry
11
- def initialize(path, params)
12
- @params = params
13
- @path = path
14
- end
15
-
16
- def method_missing(name, *_)
17
- k = name.to_s
18
- res = @params[k]
19
- return true if res.nil? && @params.key?(k)
20
-
21
- @params[k]
22
- end
23
-
24
- def to_s
25
- "MySQL Config entry [#{@path.join(" ")}]"
26
- end
27
- end
28
-
29
- class MysqlConf < Inspec.resource(1)
30
- name "mysql_conf"
31
- supports platform: "unix"
32
- supports platform: "windows"
33
- desc "Use the mysql_conf InSpec audit resource to test the contents of the configuration file for MySQL, typically located at /etc/mysql/my.cnf or /etc/my.cnf."
34
- example <<~EXAMPLE
35
- describe mysql_conf('path') do
36
- its('setting') { should eq 'value' }
37
- end
38
-
39
- # Test a parameter set within the [mysqld] section
40
- describe mysql_conf do
41
- its('mysqld.port') { should cmp 3306 }
42
- end
43
-
44
- # Test a parameter set within the [mariadb] section using array notation
45
- describe mysql_conf do
46
- its(['mariadb', 'max-connections']) { should_not be_nil }
47
- end
48
- EXAMPLE
49
-
50
- include FindFiles
51
- include FileReader
52
-
53
- def initialize(conf_path = nil)
54
- @conf_path = conf_path || inspec.mysql.conf_path
55
- @files_contents = {}
56
- @content = nil
57
- @params = nil
58
- read_content
59
- end
60
-
61
- def content
62
- @content ||= read_content
63
- end
64
-
65
- def params(*opts)
66
- @params || read_content
67
- res = @params
68
- opts.each do |opt|
69
- res = res[opt] unless res.nil?
70
- end
71
- MysqlConfEntry.new(opts, res)
72
- end
73
-
74
- def method_missing(name)
75
- @params || read_content
76
- @params[name.to_s]
77
- end
78
-
79
- def read_content
80
- @content = ""
81
- @params = {}
82
-
83
- to_read = [@conf_path]
84
- until to_read.empty?
85
- cur_file = to_read[0]
86
- raw_conf = read_file(cur_file)
87
- @content += raw_conf
88
-
89
- params = SimpleConfig.new(raw_conf).params
90
- @params = @params.deep_merge(params)
91
-
92
- to_read = to_read.drop(1)
93
- # see if there is more stuff to include
94
-
95
- dir = File.dirname(cur_file)
96
- to_read += include_files(dir, raw_conf).find_all do |fp|
97
- not @files_contents.key? fp
98
- end
99
- end
100
- #
101
- @content
102
- end
103
-
104
- def include_files(reldir, conf)
105
- files = conf.scan(/^!include\s+(.*)\s*/).flatten.compact.map { |x| abs_path(reldir, x) }
106
- dirs = conf.scan(/^!includedir\s+(.*)\s*/).flatten.compact.map { |x| abs_path(reldir, x) }
107
- dirs.map do |dir|
108
- # @TODO: non local glob
109
- files += find_files(dir, depth: 1, type: "file")
110
- end
111
- files
112
- end
113
-
114
- def abs_path(dir, f)
115
- return f if f.start_with? "/"
116
-
117
- File.join(dir, f)
118
- end
119
-
120
- def read_file(path)
121
- @files_contents[path] ||= read_file_content(path)
122
- end
123
-
124
- def to_s
125
- "MySQL Configuration"
126
- end
127
- end
128
- end