contrast-agent 3.10.0 → 3.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (318) hide show
  1. checksums.yaml +4 -4
  2. data/.flayignore +1 -0
  3. data/.simplecov +5 -2
  4. data/ext/build_funchook.rb +12 -7
  5. data/ext/cs__assess_active_record_named/cs__active_record_named.c +12 -14
  6. data/ext/cs__assess_active_record_named/cs__active_record_named.h +1 -0
  7. data/ext/cs__assess_active_record_named/extconf.rb +3 -0
  8. data/ext/cs__assess_array/cs__assess_array.c +5 -6
  9. data/ext/cs__assess_array/cs__assess_array.h +1 -0
  10. data/ext/cs__assess_array/extconf.rb +3 -0
  11. data/ext/cs__assess_basic_object/cs__assess_basic_object.c +13 -11
  12. data/ext/cs__assess_basic_object/cs__assess_basic_object.h +2 -1
  13. data/ext/cs__assess_basic_object/extconf.rb +3 -0
  14. data/ext/cs__assess_fiber_track/cs__assess_fiber_track.c +4 -3
  15. data/ext/cs__assess_fiber_track/cs__assess_fiber_track.h +3 -3
  16. data/ext/cs__assess_fiber_track/extconf.rb +3 -0
  17. data/ext/cs__assess_hash/cs__assess_hash.c +40 -17
  18. data/ext/cs__assess_hash/cs__assess_hash.h +4 -6
  19. data/ext/cs__assess_hash/extconf.rb +3 -0
  20. data/ext/cs__assess_kernel/cs__assess_kernel.c +11 -9
  21. data/ext/cs__assess_kernel/cs__assess_kernel.h +1 -0
  22. data/ext/cs__assess_kernel/extconf.rb +3 -0
  23. data/ext/cs__assess_marshal_module/cs__assess_marshal_module.c +3 -6
  24. data/ext/cs__assess_marshal_module/extconf.rb +3 -0
  25. data/ext/cs__assess_module/cs__assess_module.c +16 -14
  26. data/ext/cs__assess_module/cs__assess_module.h +3 -0
  27. data/ext/cs__assess_module/extconf.rb +3 -0
  28. data/ext/cs__assess_regexp/cs__assess_regexp.c +13 -9
  29. data/ext/cs__assess_regexp/cs__assess_regexp.h +1 -0
  30. data/ext/cs__assess_regexp/extconf.rb +3 -0
  31. data/ext/cs__assess_string/cs__assess_string.c +5 -8
  32. data/ext/cs__assess_string/cs__assess_string.h +2 -1
  33. data/ext/cs__assess_string/extconf.rb +3 -0
  34. data/ext/cs__assess_string_interpolation26/cs__assess_string_interpolation26.c +2 -2
  35. data/ext/cs__assess_string_interpolation26/cs__assess_string_interpolation26.h +3 -3
  36. data/ext/cs__assess_string_interpolation26/extconf.rb +3 -0
  37. data/ext/cs__assess_yield_track/cs__assess_yield_track.h +1 -1
  38. data/ext/cs__assess_yield_track/extconf.rb +3 -0
  39. data/ext/cs__common/cs__common.c +80 -1
  40. data/ext/cs__common/cs__common.h +34 -0
  41. data/ext/cs__common/extconf.rb +9 -8
  42. data/ext/cs__contrast_patch/cs__contrast_patch.h +1 -6
  43. data/ext/cs__contrast_patch/extconf.rb +3 -0
  44. data/ext/cs__protect_kernel/cs__protect_kernel.c +23 -12
  45. data/ext/cs__protect_kernel/cs__protect_kernel.h +1 -0
  46. data/ext/cs__protect_kernel/extconf.rb +3 -0
  47. data/ext/extconf_common.rb +10 -8
  48. data/funchook/autom4te.cache/requests +45 -45
  49. data/funchook/config.log +4 -4
  50. data/lib/contrast.rb +1 -1
  51. data/lib/contrast/agent.rb +32 -29
  52. data/lib/contrast/agent/assess.rb +1 -11
  53. data/lib/contrast/agent/assess/adjusted_span.rb +3 -1
  54. data/lib/contrast/agent/assess/contrast_event.rb +16 -62
  55. data/lib/contrast/agent/assess/events/event_factory.rb +25 -0
  56. data/lib/contrast/agent/assess/events/source_event.rb +83 -0
  57. data/lib/contrast/agent/assess/insulator.rb +0 -4
  58. data/lib/contrast/agent/assess/policy/patcher.rb +6 -2
  59. data/lib/contrast/agent/assess/policy/policy_node.rb +1 -8
  60. data/lib/contrast/agent/assess/policy/policy_scanner.rb +2 -2
  61. data/lib/contrast/agent/assess/policy/preshift.rb +1 -1
  62. data/lib/contrast/agent/assess/policy/propagation_method.rb +68 -33
  63. data/lib/contrast/agent/assess/policy/propagation_node.rb +2 -1
  64. data/lib/contrast/agent/assess/policy/propagator.rb +1 -0
  65. data/lib/contrast/agent/assess/policy/propagator/custom.rb +1 -1
  66. data/lib/contrast/agent/assess/policy/propagator/database_write.rb +1 -3
  67. data/lib/contrast/agent/assess/policy/propagator/match_data.rb +80 -0
  68. data/lib/contrast/agent/assess/policy/propagator/select.rb +35 -22
  69. data/lib/contrast/agent/assess/policy/propagator/split.rb +26 -6
  70. data/lib/contrast/agent/assess/policy/propagator/substitution.rb +2 -0
  71. data/lib/contrast/agent/assess/policy/rewriter_patch.rb +37 -26
  72. data/lib/contrast/agent/assess/policy/source_method.rb +20 -20
  73. data/lib/contrast/agent/assess/policy/source_node.rb +0 -15
  74. data/lib/contrast/agent/assess/policy/trigger/reflected_xss.rb +90 -0
  75. data/lib/contrast/agent/assess/policy/trigger/xpath.rb +57 -0
  76. data/lib/contrast/agent/assess/policy/trigger_method.rb +30 -45
  77. data/lib/contrast/agent/assess/policy/trigger_node.rb +7 -7
  78. data/lib/contrast/agent/assess/policy/trigger_validation/ssrf_validator.rb +2 -31
  79. data/lib/contrast/agent/assess/properties.rb +5 -3
  80. data/lib/contrast/agent/assess/rule/base.rb +1 -20
  81. data/lib/contrast/agent/assess/rule/provider/hardcoded_value_rule.rb +23 -6
  82. data/lib/contrast/agent/assess/rule/redos.rb +4 -5
  83. data/lib/contrast/agent/assess/tag.rb +24 -14
  84. data/lib/contrast/agent/at_exit_hook.rb +16 -13
  85. data/lib/contrast/agent/class_reopener.rb +23 -8
  86. data/lib/contrast/agent/deadzone/policy/policy.rb +2 -2
  87. data/lib/contrast/agent/disable_reaction.rb +3 -4
  88. data/lib/contrast/agent/exclusion_matcher.rb +7 -48
  89. data/lib/contrast/agent/inventory/policy/datastores.rb +54 -0
  90. data/lib/contrast/agent/inventory/policy/policy.rb +1 -1
  91. data/lib/contrast/agent/middleware.rb +101 -260
  92. data/lib/contrast/agent/module_data.rb +2 -1
  93. data/lib/contrast/agent/patching/policy/after_load_patch.rb +13 -3
  94. data/lib/contrast/agent/patching/policy/after_load_patcher.rb +59 -47
  95. data/lib/contrast/agent/patching/policy/method_policy.rb +3 -3
  96. data/lib/contrast/agent/patching/policy/module_policy.rb +0 -25
  97. data/lib/contrast/agent/patching/policy/patch.rb +97 -23
  98. data/lib/contrast/agent/patching/policy/patcher.rb +28 -30
  99. data/lib/contrast/agent/patching/policy/policy.rb +7 -7
  100. data/lib/contrast/agent/patching/policy/policy_node.rb +3 -11
  101. data/lib/contrast/agent/patching/policy/trigger_node.rb +2 -5
  102. data/lib/contrast/agent/protect/policy/applies_command_injection_rule.rb +63 -0
  103. data/lib/contrast/agent/protect/policy/applies_deserialization_rule.rb +52 -0
  104. data/lib/contrast/agent/protect/policy/applies_no_sqli_rule.rb +68 -0
  105. data/lib/contrast/agent/protect/policy/applies_path_traversal_rule.rb +117 -0
  106. data/lib/contrast/agent/protect/policy/applies_sqli_rule.rb +54 -0
  107. data/lib/contrast/agent/protect/policy/applies_xxe_rule.rb +129 -0
  108. data/lib/contrast/agent/protect/policy/policy.rb +6 -6
  109. data/lib/contrast/agent/protect/policy/rule_applicator.rb +51 -0
  110. data/lib/contrast/agent/protect/rule.rb +0 -5
  111. data/lib/contrast/agent/protect/rule/base.rb +19 -37
  112. data/lib/contrast/agent/protect/rule/base_service.rb +3 -1
  113. data/lib/contrast/agent/protect/rule/cmd_injection.rb +12 -15
  114. data/lib/contrast/agent/protect/rule/default_scanner.rb +0 -13
  115. data/lib/contrast/agent/protect/rule/deserialization.rb +2 -0
  116. data/lib/contrast/agent/protect/rule/http_method_tampering.rb +2 -2
  117. data/lib/contrast/agent/protect/rule/no_sqli.rb +4 -4
  118. data/lib/contrast/agent/protect/rule/path_traversal.rb +6 -10
  119. data/lib/contrast/agent/protect/rule/sqli.rb +5 -4
  120. data/lib/contrast/agent/protect/rule/unsafe_file_upload.rb +2 -0
  121. data/lib/contrast/agent/protect/rule/xss.rb +2 -0
  122. data/lib/contrast/agent/protect/rule/xxe.rb +10 -4
  123. data/lib/contrast/agent/railtie.rb +3 -8
  124. data/lib/contrast/agent/reaction_processor.rb +5 -5
  125. data/lib/contrast/agent/request.rb +11 -18
  126. data/lib/contrast/agent/request_context.rb +16 -19
  127. data/lib/contrast/agent/request_handler.rb +35 -0
  128. data/lib/contrast/agent/response.rb +39 -86
  129. data/lib/contrast/agent/rewriter.rb +22 -10
  130. data/lib/contrast/agent/rule_set.rb +49 -0
  131. data/lib/contrast/agent/scope.rb +0 -6
  132. data/lib/contrast/agent/service_heartbeat.rb +3 -4
  133. data/lib/contrast/agent/socket_client.rb +25 -19
  134. data/lib/contrast/agent/static_analysis.rb +41 -0
  135. data/lib/contrast/agent/thread.rb +1 -1
  136. data/lib/contrast/agent/tracepoint_hook.rb +1 -5
  137. data/lib/contrast/agent/version.rb +1 -1
  138. data/lib/contrast/api.rb +1 -1
  139. data/lib/contrast/api/decorators.rb +14 -0
  140. data/lib/contrast/api/decorators/application_settings.rb +37 -0
  141. data/lib/contrast/api/decorators/application_update.rb +66 -0
  142. data/lib/contrast/api/decorators/input_analysis.rb +17 -0
  143. data/lib/contrast/api/decorators/server_features.rb +24 -0
  144. data/lib/contrast/api/speedracer.rb +28 -24
  145. data/lib/contrast/api/tcp_socket.rb +0 -2
  146. data/lib/contrast/components/agent.rb +34 -24
  147. data/lib/contrast/components/app_context.rb +45 -38
  148. data/lib/contrast/components/assess.rb +25 -15
  149. data/lib/contrast/components/config.rb +7 -5
  150. data/lib/contrast/components/contrast_service.rb +23 -71
  151. data/lib/contrast/components/heap_dump.rb +12 -8
  152. data/lib/contrast/components/interface.rb +15 -22
  153. data/lib/contrast/components/inventory.rb +5 -1
  154. data/lib/contrast/components/logger.rb +3 -68
  155. data/lib/contrast/components/protect.rb +40 -4
  156. data/lib/contrast/components/sampling.rb +22 -11
  157. data/lib/contrast/components/scope.rb +2 -52
  158. data/lib/contrast/components/settings.rb +42 -23
  159. data/lib/contrast/config/base_configuration.rb +1 -0
  160. data/lib/contrast/config/default_value.rb +1 -0
  161. data/lib/contrast/config/protect_rule_configuration.rb +0 -14
  162. data/lib/contrast/config/protect_rules_configuration.rb +0 -1
  163. data/lib/contrast/configuration.rb +2 -2
  164. data/lib/contrast/{extensions/ruby_core → extension}/assess.rb +12 -15
  165. data/lib/contrast/extension/assess/array.rb +77 -0
  166. data/lib/contrast/{extensions/ruby_core → extension}/assess/assess_extension.rb +29 -24
  167. data/lib/contrast/{extensions/ruby_core → extension}/assess/erb.rb +0 -8
  168. data/lib/contrast/extension/assess/eval_trigger.rb +78 -0
  169. data/lib/contrast/{extensions/ruby_core → extension}/assess/exec_trigger.rb +7 -9
  170. data/lib/contrast/extension/assess/fiber.rb +113 -0
  171. data/lib/contrast/extension/assess/hash.rb +39 -0
  172. data/lib/contrast/extension/assess/kernel.rb +110 -0
  173. data/lib/contrast/extension/assess/regexp.rb +84 -0
  174. data/lib/contrast/{extensions/ruby_core → extension}/assess/string.rb +18 -10
  175. data/lib/contrast/{extensions/ruby_core → extension}/delegator.rb +0 -0
  176. data/lib/contrast/{extensions/ruby_core → extension}/inventory.rb +2 -2
  177. data/lib/contrast/extension/kernel.rb +54 -0
  178. data/lib/contrast/{extensions/ruby_core → extension}/module.rb +0 -0
  179. data/lib/contrast/{extensions/ruby_core → extension}/protect.rb +2 -2
  180. data/lib/contrast/extension/protect/kernel.rb +44 -0
  181. data/lib/contrast/{extensions/ruby_core → extension}/protect/psych.rb +1 -1
  182. data/lib/contrast/{extensions/ruby_core → extension}/thread.rb +0 -0
  183. data/lib/contrast/framework/base_support.rb +32 -0
  184. data/lib/contrast/framework/manager.rb +59 -8
  185. data/lib/contrast/framework/platform_version.rb +1 -0
  186. data/lib/contrast/framework/rack/patch/session_cookie.rb +126 -0
  187. data/lib/contrast/framework/rack/patch/support.rb +24 -0
  188. data/lib/contrast/framework/rack/support.rb +22 -0
  189. data/lib/contrast/framework/rails/patch/action_controller_live_buffer.rb +43 -0
  190. data/lib/contrast/framework/rails/patch/assess_configuration.rb +103 -0
  191. data/lib/contrast/framework/rails/patch/rails_application_configuration.rb +31 -0
  192. data/lib/contrast/framework/rails/patch/support.rb +67 -0
  193. data/lib/contrast/framework/rails/rewrite/action_controller_railties_helper_inherited.rb +34 -0
  194. data/lib/contrast/framework/rails/rewrite/active_record_attribute_methods_read.rb +39 -0
  195. data/lib/contrast/framework/rails/rewrite/active_record_named.rb +73 -0
  196. data/lib/contrast/framework/rails/rewrite/active_record_time_zone_inherited.rb +33 -0
  197. data/lib/contrast/framework/rails/support.rb +115 -0
  198. data/lib/contrast/framework/sinatra/application_helper.rb +51 -0
  199. data/lib/contrast/framework/sinatra/patch/base.rb +83 -0
  200. data/lib/contrast/framework/sinatra/patch/support.rb +27 -0
  201. data/lib/contrast/framework/sinatra/support.rb +109 -0
  202. data/lib/contrast/framework/view_technologies_descriptor.rb +1 -0
  203. data/lib/contrast/logger/application.rb +80 -0
  204. data/lib/contrast/logger/log.rb +143 -0
  205. data/lib/contrast/logger/time.rb +50 -0
  206. data/lib/contrast/tasks/config.rb +54 -0
  207. data/lib/contrast/tasks/service.rb +3 -13
  208. data/lib/contrast/utils/assess/sampling_util.rb +4 -9
  209. data/lib/contrast/utils/assess/tracking_util.rb +7 -1
  210. data/lib/contrast/utils/boolean_util.rb +2 -2
  211. data/lib/contrast/utils/cache.rb +0 -11
  212. data/lib/contrast/utils/class_util.rb +21 -2
  213. data/lib/contrast/utils/gemfile_reader.rb +7 -5
  214. data/lib/contrast/utils/hash_digest.rb +2 -11
  215. data/lib/contrast/utils/heap_dump_util.rb +12 -11
  216. data/lib/contrast/utils/invalid_configuration_util.rb +4 -4
  217. data/lib/contrast/utils/inventory_util.rb +2 -2
  218. data/lib/contrast/utils/io_util.rb +1 -11
  219. data/lib/contrast/utils/job_servers_running.rb +6 -4
  220. data/lib/contrast/utils/object_share.rb +1 -28
  221. data/lib/contrast/utils/os.rb +1 -25
  222. data/lib/contrast/utils/service_response_util.rb +36 -60
  223. data/lib/contrast/utils/service_sender_util.rb +84 -23
  224. data/lib/contrast/utils/sinatra_helper.rb +0 -6
  225. data/lib/contrast/utils/stack_trace_utils.rb +86 -182
  226. data/lib/contrast/utils/string_utils.rb +18 -2
  227. data/lib/contrast/utils/tag_util.rb +11 -1
  228. data/lib/contrast/utils/thread_tracker.rb +2 -2
  229. data/lib/contrast/utils/timer.rb +0 -40
  230. data/resources/assess/policy.json +42 -71
  231. data/resources/inventory/policy.json +2 -2
  232. data/resources/protect/policy.json +15 -15
  233. data/ruby-agent.gemspec +11 -4
  234. data/service_executables/VERSION +1 -1
  235. data/service_executables/linux/contrast-service +0 -0
  236. data/service_executables/mac/contrast-service +0 -0
  237. metadata +122 -111
  238. data/ext/cs__assess_regexp_track/cs__assess_regexp_track.c +0 -63
  239. data/ext/cs__assess_regexp_track/cs__assess_regexp_track.h +0 -29
  240. data/ext/cs__assess_regexp_track/extconf.rb +0 -2
  241. data/lib/contrast/agent/assess/frozen_properties.rb +0 -41
  242. data/lib/contrast/agent/assess/rule/csrf.rb +0 -66
  243. data/lib/contrast/agent/assess/rule/csrf/csrf_action.rb +0 -28
  244. data/lib/contrast/agent/assess/rule/csrf/csrf_applicator.rb +0 -73
  245. data/lib/contrast/agent/assess/rule/csrf/csrf_watcher.rb +0 -132
  246. data/lib/contrast/agent/assess/rule/response_scanning_rule.rb +0 -47
  247. data/lib/contrast/agent/assess/rule/response_watcher.rb +0 -36
  248. data/lib/contrast/agent/assess/rule/watcher.rb +0 -36
  249. data/lib/contrast/agent/feature_state.rb +0 -376
  250. data/lib/contrast/agent/logger_manager.rb +0 -116
  251. data/lib/contrast/agent/protect/rule/csrf.rb +0 -118
  252. data/lib/contrast/agent/protect/rule/csrf/csrf_evaluator.rb +0 -103
  253. data/lib/contrast/agent/protect/rule/csrf/csrf_token_injector.rb +0 -85
  254. data/lib/contrast/agent/settings_state.rb +0 -152
  255. data/lib/contrast/delegators.rb +0 -9
  256. data/lib/contrast/delegators/application_update.rb +0 -32
  257. data/lib/contrast/extensions/framework/rack/cookie.rb +0 -24
  258. data/lib/contrast/extensions/framework/rack/request.rb +0 -24
  259. data/lib/contrast/extensions/framework/rack/response.rb +0 -23
  260. data/lib/contrast/extensions/framework/rails/action_controller_railties_helper_inherited.rb +0 -20
  261. data/lib/contrast/extensions/framework/rails/active_record.rb +0 -26
  262. data/lib/contrast/extensions/framework/rails/active_record_named.rb +0 -53
  263. data/lib/contrast/extensions/framework/rails/active_record_time_zone_inherited.rb +0 -21
  264. data/lib/contrast/extensions/framework/rails/buffer.rb +0 -28
  265. data/lib/contrast/extensions/framework/rails/configuration.rb +0 -27
  266. data/lib/contrast/extensions/framework/sinatra/base.rb +0 -59
  267. data/lib/contrast/extensions/ruby_core/assess/array.rb +0 -59
  268. data/lib/contrast/extensions/ruby_core/assess/basic_object.rb +0 -15
  269. data/lib/contrast/extensions/ruby_core/assess/fiber.rb +0 -124
  270. data/lib/contrast/extensions/ruby_core/assess/hash.rb +0 -22
  271. data/lib/contrast/extensions/ruby_core/assess/kernel.rb +0 -95
  272. data/lib/contrast/extensions/ruby_core/assess/module.rb +0 -14
  273. data/lib/contrast/extensions/ruby_core/assess/regexp.rb +0 -206
  274. data/lib/contrast/extensions/ruby_core/assess/tilt_template_trigger.rb +0 -73
  275. data/lib/contrast/extensions/ruby_core/assess/xpath_library_trigger.rb +0 -40
  276. data/lib/contrast/extensions/ruby_core/eval_trigger.rb +0 -52
  277. data/lib/contrast/extensions/ruby_core/inventory/datastores.rb +0 -37
  278. data/lib/contrast/extensions/ruby_core/protect/applies_command_injection_rule.rb +0 -72
  279. data/lib/contrast/extensions/ruby_core/protect/applies_deserialization_rule.rb +0 -60
  280. data/lib/contrast/extensions/ruby_core/protect/applies_no_sqli_rule.rb +0 -83
  281. data/lib/contrast/extensions/ruby_core/protect/applies_path_traversal_rule.rb +0 -123
  282. data/lib/contrast/extensions/ruby_core/protect/applies_sqli_rule.rb +0 -65
  283. data/lib/contrast/extensions/ruby_core/protect/applies_xxe_rule.rb +0 -143
  284. data/lib/contrast/extensions/ruby_core/protect/kernel.rb +0 -30
  285. data/lib/contrast/framework/rails_support.rb +0 -88
  286. data/lib/contrast/framework/sinatra_application_helper.rb +0 -49
  287. data/lib/contrast/framework/sinatra_support.rb +0 -94
  288. data/lib/contrast/utils/comment_range.rb +0 -19
  289. data/lib/contrast/utils/data_store_util.rb +0 -23
  290. data/lib/contrast/utils/environment_util.rb +0 -81
  291. data/lib/contrast/utils/performs_logging.rb +0 -152
  292. data/lib/contrast/utils/rack_assess_session_cookie.rb +0 -104
  293. data/lib/contrast/utils/rails_assess_configuration.rb +0 -95
  294. data/lib/contrast/utils/random_util.rb +0 -22
  295. data/resources/csrf/inject.js +0 -44
  296. data/resources/factory-bot-spec/spec_helper.rb +0 -30
  297. data/resources/rubocops/kernel/catch_cop.rb +0 -37
  298. data/resources/rubocops/kernel/require_cop.rb +0 -37
  299. data/resources/rubocops/kernel/require_relative_cop.rb +0 -33
  300. data/resources/rubocops/module/autoload_cop.rb +0 -37
  301. data/resources/rubocops/module/const_defined_cop.rb +0 -37
  302. data/resources/rubocops/module/const_get_cop.rb +0 -37
  303. data/resources/rubocops/module/const_set_cop.rb +0 -37
  304. data/resources/rubocops/module/constants_cop.rb +0 -37
  305. data/resources/rubocops/module/name_cop.rb +0 -37
  306. data/resources/rubocops/object/class_cop.rb +0 -37
  307. data/resources/rubocops/object/freeze_cop.rb +0 -37
  308. data/resources/rubocops/object/frozen_cop.rb +0 -37
  309. data/resources/rubocops/object/is_a_cop.rb +0 -37
  310. data/resources/rubocops/object/method_cop.rb +0 -37
  311. data/resources/rubocops/object/respond_to_cop.rb +0 -37
  312. data/resources/rubocops/object/singleton_class_cop.rb +0 -37
  313. data/resources/rubocops/regexp/spelling_cop.rb +0 -44
  314. data/resources/rubocops/thread/new_cop.rb +0 -39
  315. data/resources/ruby-spec/ancestors_spec.rb +0 -70
  316. data/resources/ruby-spec/modulo_spec.rb +0 -831
  317. data/resources/ruby-spec/parameters_spec.rb +0 -261
  318. data/resources/ruby-spec/ruby_spec_spec_helper.rb +0 -35
@@ -1 +1 @@
1
- 2.6.2
1
+ 2.9.2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contrast-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.0
4
+ version: 3.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - galen.palmer@contrastsecurity.com
@@ -12,8 +12,22 @@ authors:
12
12
  autorequire:
13
13
  bindir: exe
14
14
  cert_chain: []
15
- date: 2020-04-27 00:00:00.000000000 Z
15
+ date: 2020-07-01 00:00:00.000000000 Z
16
16
  dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ name: amazing_print
19
+ requirement: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: '0'
24
+ type: :development
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ version: '0'
17
31
  - !ruby/object:Gem::Dependency
18
32
  name: bundler
19
33
  requirement: !ruby/object:Gem::Requirement
@@ -42,6 +56,20 @@ dependencies:
42
56
  - - ">="
43
57
  - !ruby/object:Gem::Version
44
58
  version: '0'
59
+ - !ruby/object:Gem::Dependency
60
+ name: debride
61
+ requirement: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
45
73
  - !ruby/object:Gem::Dependency
46
74
  name: execjs
47
75
  requirement: !ruby/object:Gem::Requirement
@@ -230,14 +258,14 @@ dependencies:
230
258
  requirements:
231
259
  - - '='
232
260
  - !ruby/object:Gem::Version
233
- version: 0.80.0
261
+ version: 0.83.0
234
262
  type: :development
235
263
  prerelease: false
236
264
  version_requirements: !ruby/object:Gem::Requirement
237
265
  requirements:
238
266
  - - '='
239
267
  - !ruby/object:Gem::Version
240
- version: 0.80.0
268
+ version: 0.83.0
241
269
  - !ruby/object:Gem::Dependency
242
270
  name: rubocop-performance
243
271
  requirement: !ruby/object:Gem::Requirement
@@ -258,14 +286,14 @@ dependencies:
258
286
  requirements:
259
287
  - - '='
260
288
  - !ruby/object:Gem::Version
261
- version: 1.38.1
289
+ version: 1.39.0
262
290
  type: :development
263
291
  prerelease: false
264
292
  version_requirements: !ruby/object:Gem::Requirement
265
293
  requirements:
266
294
  - - '='
267
295
  - !ruby/object:Gem::Version
268
- version: 1.38.1
296
+ version: 1.39.0
269
297
  - !ruby/object:Gem::Dependency
270
298
  name: simplecov
271
299
  requirement: !ruby/object:Gem::Requirement
@@ -378,6 +406,20 @@ dependencies:
378
406
  - - "~>"
379
407
  - !ruby/object:Gem::Version
380
408
  version: 3.9.0
409
+ - !ruby/object:Gem::Dependency
410
+ name: ougai
411
+ requirement: !ruby/object:Gem::Requirement
412
+ requirements:
413
+ - - "~>"
414
+ - !ruby/object:Gem::Version
415
+ version: '1.8'
416
+ type: :runtime
417
+ prerelease: false
418
+ version_requirements: !ruby/object:Gem::Requirement
419
+ requirements:
420
+ - - "~>"
421
+ - !ruby/object:Gem::Version
422
+ version: '1.8'
381
423
  - !ruby/object:Gem::Dependency
382
424
  name: parser
383
425
  requirement: !ruby/object:Gem::Requirement
@@ -398,7 +440,7 @@ dependencies:
398
440
  requirements:
399
441
  - - ">="
400
442
  - !ruby/object:Gem::Version
401
- version: '1.0'
443
+ version: '2.0'
402
444
  - - "<"
403
445
  - !ruby/object:Gem::Version
404
446
  version: '3.0'
@@ -408,7 +450,7 @@ dependencies:
408
450
  requirements:
409
451
  - - ">="
410
452
  - !ruby/object:Gem::Version
411
- version: '1.0'
453
+ version: '2.0'
412
454
  - - "<"
413
455
  - !ruby/object:Gem::Version
414
456
  version: '3.0'
@@ -420,25 +462,25 @@ executables:
420
462
  - contrast_service
421
463
  extensions:
422
464
  - ext/cs__common/extconf.rb
423
- - ext/cs__assess_regexp/extconf.rb
424
- - ext/cs__assess_regexp_track/extconf.rb
425
- - ext/cs__contrast_patch/extconf.rb
426
- - ext/cs__assess_string/extconf.rb
427
465
  - ext/cs__assess_active_record_named/extconf.rb
428
- - ext/cs__assess_fiber_track/extconf.rb
429
466
  - ext/cs__assess_basic_object/extconf.rb
430
- - ext/cs__assess_yield_track/extconf.rb
431
- - ext/cs__assess_array/extconf.rb
467
+ - ext/cs__assess_string/extconf.rb
432
468
  - ext/cs__assess_string_interpolation26/extconf.rb
433
- - ext/cs__assess_module/extconf.rb
434
- - ext/cs__assess_hash/extconf.rb
435
- - ext/cs__assess_kernel/extconf.rb
469
+ - ext/cs__assess_array/extconf.rb
436
470
  - ext/cs__protect_kernel/extconf.rb
471
+ - ext/cs__assess_yield_track/extconf.rb
472
+ - ext/cs__assess_kernel/extconf.rb
473
+ - ext/cs__assess_hash/extconf.rb
474
+ - ext/cs__assess_module/extconf.rb
475
+ - ext/cs__contrast_patch/extconf.rb
476
+ - ext/cs__assess_regexp/extconf.rb
477
+ - ext/cs__assess_fiber_track/extconf.rb
437
478
  - ext/cs__assess_marshal_module/extconf.rb
438
479
  extra_rdoc_files: []
439
480
  files:
440
481
  - ".clang-format"
441
482
  - ".dockerignore"
483
+ - ".flayignore"
442
484
  - ".gitignore"
443
485
  - ".gitmodules"
444
486
  - ".rspec"
@@ -475,9 +517,6 @@ files:
475
517
  - ext/cs__assess_regexp/cs__assess_regexp.c
476
518
  - ext/cs__assess_regexp/cs__assess_regexp.h
477
519
  - ext/cs__assess_regexp/extconf.rb
478
- - ext/cs__assess_regexp_track/cs__assess_regexp_track.c
479
- - ext/cs__assess_regexp_track/cs__assess_regexp_track.h
480
- - ext/cs__assess_regexp_track/extconf.rb
481
520
  - ext/cs__assess_string/cs__assess_string.c
482
521
  - ext/cs__assess_string/cs__assess_string.h
483
522
  - ext/cs__assess_string/extconf.rb
@@ -667,7 +706,8 @@ files:
667
706
  - lib/contrast/agent/assess.rb
668
707
  - lib/contrast/agent/assess/adjusted_span.rb
669
708
  - lib/contrast/agent/assess/contrast_event.rb
670
- - lib/contrast/agent/assess/frozen_properties.rb
709
+ - lib/contrast/agent/assess/events/event_factory.rb
710
+ - lib/contrast/agent/assess/events/source_event.rb
671
711
  - lib/contrast/agent/assess/insulator.rb
672
712
  - lib/contrast/agent/assess/policy/dynamic_source_factory.rb
673
713
  - lib/contrast/agent/assess/policy/patcher.rb
@@ -685,6 +725,7 @@ files:
685
725
  - lib/contrast/agent/assess/policy/propagator/database_write.rb
686
726
  - lib/contrast/agent/assess/policy/propagator/insert.rb
687
727
  - lib/contrast/agent/assess/policy/propagator/keep.rb
728
+ - lib/contrast/agent/assess/policy/propagator/match_data.rb
688
729
  - lib/contrast/agent/assess/policy/propagator/next.rb
689
730
  - lib/contrast/agent/assess/policy/propagator/prepend.rb
690
731
  - lib/contrast/agent/assess/policy/propagator/remove.rb
@@ -700,6 +741,8 @@ files:
700
741
  - lib/contrast/agent/assess/policy/source_node.rb
701
742
  - lib/contrast/agent/assess/policy/source_validation/cross_site_validator.rb
702
743
  - lib/contrast/agent/assess/policy/source_validation/source_validation.rb
744
+ - lib/contrast/agent/assess/policy/trigger/reflected_xss.rb
745
+ - lib/contrast/agent/assess/policy/trigger/xpath.rb
703
746
  - lib/contrast/agent/assess/policy/trigger_method.rb
704
747
  - lib/contrast/agent/assess/policy/trigger_node.rb
705
748
  - lib/contrast/agent/assess/policy/trigger_validation/ssrf_validator.rb
@@ -708,18 +751,11 @@ files:
708
751
  - lib/contrast/agent/assess/properties.rb
709
752
  - lib/contrast/agent/assess/rule.rb
710
753
  - lib/contrast/agent/assess/rule/base.rb
711
- - lib/contrast/agent/assess/rule/csrf.rb
712
- - lib/contrast/agent/assess/rule/csrf/csrf_action.rb
713
- - lib/contrast/agent/assess/rule/csrf/csrf_applicator.rb
714
- - lib/contrast/agent/assess/rule/csrf/csrf_watcher.rb
715
754
  - lib/contrast/agent/assess/rule/provider.rb
716
755
  - lib/contrast/agent/assess/rule/provider/hardcoded_key.rb
717
756
  - lib/contrast/agent/assess/rule/provider/hardcoded_password.rb
718
757
  - lib/contrast/agent/assess/rule/provider/hardcoded_value_rule.rb
719
758
  - lib/contrast/agent/assess/rule/redos.rb
720
- - lib/contrast/agent/assess/rule/response_scanning_rule.rb
721
- - lib/contrast/agent/assess/rule/response_watcher.rb
722
- - lib/contrast/agent/assess/rule/watcher.rb
723
759
  - lib/contrast/agent/assess/tag.rb
724
760
  - lib/contrast/agent/at_exit_hook.rb
725
761
  - lib/contrast/agent/class_reopener.rb
@@ -727,10 +763,9 @@ files:
727
763
  - lib/contrast/agent/deadzone/policy/policy.rb
728
764
  - lib/contrast/agent/disable_reaction.rb
729
765
  - lib/contrast/agent/exclusion_matcher.rb
730
- - lib/contrast/agent/feature_state.rb
766
+ - lib/contrast/agent/inventory/policy/datastores.rb
731
767
  - lib/contrast/agent/inventory/policy/policy.rb
732
768
  - lib/contrast/agent/inventory/policy/trigger_node.rb
733
- - lib/contrast/agent/logger_manager.rb
734
769
  - lib/contrast/agent/middleware.rb
735
770
  - lib/contrast/agent/module_data.rb
736
771
  - lib/contrast/agent/patching/policy/after_load_patch.rb
@@ -743,15 +778,19 @@ files:
743
778
  - lib/contrast/agent/patching/policy/policy.rb
744
779
  - lib/contrast/agent/patching/policy/policy_node.rb
745
780
  - lib/contrast/agent/patching/policy/trigger_node.rb
781
+ - lib/contrast/agent/protect/policy/applies_command_injection_rule.rb
782
+ - lib/contrast/agent/protect/policy/applies_deserialization_rule.rb
783
+ - lib/contrast/agent/protect/policy/applies_no_sqli_rule.rb
784
+ - lib/contrast/agent/protect/policy/applies_path_traversal_rule.rb
785
+ - lib/contrast/agent/protect/policy/applies_sqli_rule.rb
786
+ - lib/contrast/agent/protect/policy/applies_xxe_rule.rb
746
787
  - lib/contrast/agent/protect/policy/policy.rb
788
+ - lib/contrast/agent/protect/policy/rule_applicator.rb
747
789
  - lib/contrast/agent/protect/policy/trigger_node.rb
748
790
  - lib/contrast/agent/protect/rule.rb
749
791
  - lib/contrast/agent/protect/rule/base.rb
750
792
  - lib/contrast/agent/protect/rule/base_service.rb
751
793
  - lib/contrast/agent/protect/rule/cmd_injection.rb
752
- - lib/contrast/agent/protect/rule/csrf.rb
753
- - lib/contrast/agent/protect/rule/csrf/csrf_evaluator.rb
754
- - lib/contrast/agent/protect/rule/csrf/csrf_token_injector.rb
755
794
  - lib/contrast/agent/protect/rule/default_scanner.rb
756
795
  - lib/contrast/agent/protect/rule/deserialization.rb
757
796
  - lib/contrast/agent/protect/rule/http_method_tampering.rb
@@ -771,19 +810,26 @@ files:
771
810
  - lib/contrast/agent/reaction_processor.rb
772
811
  - lib/contrast/agent/request.rb
773
812
  - lib/contrast/agent/request_context.rb
813
+ - lib/contrast/agent/request_handler.rb
774
814
  - lib/contrast/agent/require_state.rb
775
815
  - lib/contrast/agent/response.rb
776
816
  - lib/contrast/agent/rewriter.rb
817
+ - lib/contrast/agent/rule_set.rb
777
818
  - lib/contrast/agent/scope.rb
778
819
  - lib/contrast/agent/service_heartbeat.rb
779
- - lib/contrast/agent/settings_state.rb
780
820
  - lib/contrast/agent/socket_client.rb
821
+ - lib/contrast/agent/static_analysis.rb
781
822
  - lib/contrast/agent/thread.rb
782
823
  - lib/contrast/agent/tracepoint_hook.rb
783
824
  - lib/contrast/agent/version.rb
784
825
  - lib/contrast/api.rb
785
826
  - lib/contrast/api/.gitkeep
786
827
  - lib/contrast/api/connection_status.rb
828
+ - lib/contrast/api/decorators.rb
829
+ - lib/contrast/api/decorators/application_settings.rb
830
+ - lib/contrast/api/decorators/application_update.rb
831
+ - lib/contrast/api/decorators/input_analysis.rb
832
+ - lib/contrast/api/decorators/server_features.rb
787
833
  - lib/contrast/api/dtm_pb.rb
788
834
  - lib/contrast/api/settings_pb.rb
789
835
  - lib/contrast/api/socket.rb
@@ -824,67 +870,59 @@ files:
824
870
  - lib/contrast/config/server_configuration.rb
825
871
  - lib/contrast/config/service_configuration.rb
826
872
  - lib/contrast/configuration.rb
827
- - lib/contrast/delegators.rb
828
- - lib/contrast/delegators/application_update.rb
829
- - lib/contrast/extensions/framework/rack/cookie.rb
830
- - lib/contrast/extensions/framework/rack/request.rb
831
- - lib/contrast/extensions/framework/rack/response.rb
832
- - lib/contrast/extensions/framework/rails/action_controller_railties_helper_inherited.rb
833
- - lib/contrast/extensions/framework/rails/active_record.rb
834
- - lib/contrast/extensions/framework/rails/active_record_named.rb
835
- - lib/contrast/extensions/framework/rails/active_record_time_zone_inherited.rb
836
- - lib/contrast/extensions/framework/rails/buffer.rb
837
- - lib/contrast/extensions/framework/rails/configuration.rb
838
- - lib/contrast/extensions/framework/sinatra/base.rb
839
- - lib/contrast/extensions/ruby_core/assess.rb
840
- - lib/contrast/extensions/ruby_core/assess/array.rb
841
- - lib/contrast/extensions/ruby_core/assess/assess_extension.rb
842
- - lib/contrast/extensions/ruby_core/assess/basic_object.rb
843
- - lib/contrast/extensions/ruby_core/assess/erb.rb
844
- - lib/contrast/extensions/ruby_core/assess/exec_trigger.rb
845
- - lib/contrast/extensions/ruby_core/assess/fiber.rb
846
- - lib/contrast/extensions/ruby_core/assess/hash.rb
847
- - lib/contrast/extensions/ruby_core/assess/kernel.rb
848
- - lib/contrast/extensions/ruby_core/assess/module.rb
849
- - lib/contrast/extensions/ruby_core/assess/regexp.rb
850
- - lib/contrast/extensions/ruby_core/assess/string.rb
851
- - lib/contrast/extensions/ruby_core/assess/tilt_template_trigger.rb
852
- - lib/contrast/extensions/ruby_core/assess/xpath_library_trigger.rb
853
- - lib/contrast/extensions/ruby_core/delegator.rb
854
- - lib/contrast/extensions/ruby_core/eval_trigger.rb
855
- - lib/contrast/extensions/ruby_core/inventory.rb
856
- - lib/contrast/extensions/ruby_core/inventory/datastores.rb
857
- - lib/contrast/extensions/ruby_core/module.rb
858
- - lib/contrast/extensions/ruby_core/protect.rb
859
- - lib/contrast/extensions/ruby_core/protect/applies_command_injection_rule.rb
860
- - lib/contrast/extensions/ruby_core/protect/applies_deserialization_rule.rb
861
- - lib/contrast/extensions/ruby_core/protect/applies_no_sqli_rule.rb
862
- - lib/contrast/extensions/ruby_core/protect/applies_path_traversal_rule.rb
863
- - lib/contrast/extensions/ruby_core/protect/applies_sqli_rule.rb
864
- - lib/contrast/extensions/ruby_core/protect/applies_xxe_rule.rb
865
- - lib/contrast/extensions/ruby_core/protect/kernel.rb
866
- - lib/contrast/extensions/ruby_core/protect/psych.rb
867
- - lib/contrast/extensions/ruby_core/thread.rb
873
+ - lib/contrast/extension/assess.rb
874
+ - lib/contrast/extension/assess/array.rb
875
+ - lib/contrast/extension/assess/assess_extension.rb
876
+ - lib/contrast/extension/assess/erb.rb
877
+ - lib/contrast/extension/assess/eval_trigger.rb
878
+ - lib/contrast/extension/assess/exec_trigger.rb
879
+ - lib/contrast/extension/assess/fiber.rb
880
+ - lib/contrast/extension/assess/hash.rb
881
+ - lib/contrast/extension/assess/kernel.rb
882
+ - lib/contrast/extension/assess/regexp.rb
883
+ - lib/contrast/extension/assess/string.rb
884
+ - lib/contrast/extension/delegator.rb
885
+ - lib/contrast/extension/inventory.rb
886
+ - lib/contrast/extension/kernel.rb
887
+ - lib/contrast/extension/module.rb
888
+ - lib/contrast/extension/protect.rb
889
+ - lib/contrast/extension/protect/kernel.rb
890
+ - lib/contrast/extension/protect/psych.rb
891
+ - lib/contrast/extension/thread.rb
868
892
  - lib/contrast/framework/base_support.rb
869
893
  - lib/contrast/framework/manager.rb
870
894
  - lib/contrast/framework/platform_version.rb
871
- - lib/contrast/framework/rails_support.rb
872
- - lib/contrast/framework/sinatra_application_helper.rb
873
- - lib/contrast/framework/sinatra_support.rb
895
+ - lib/contrast/framework/rack/patch/session_cookie.rb
896
+ - lib/contrast/framework/rack/patch/support.rb
897
+ - lib/contrast/framework/rack/support.rb
898
+ - lib/contrast/framework/rails/patch/action_controller_live_buffer.rb
899
+ - lib/contrast/framework/rails/patch/assess_configuration.rb
900
+ - lib/contrast/framework/rails/patch/rails_application_configuration.rb
901
+ - lib/contrast/framework/rails/patch/support.rb
902
+ - lib/contrast/framework/rails/rewrite/action_controller_railties_helper_inherited.rb
903
+ - lib/contrast/framework/rails/rewrite/active_record_attribute_methods_read.rb
904
+ - lib/contrast/framework/rails/rewrite/active_record_named.rb
905
+ - lib/contrast/framework/rails/rewrite/active_record_time_zone_inherited.rb
906
+ - lib/contrast/framework/rails/support.rb
907
+ - lib/contrast/framework/sinatra/application_helper.rb
908
+ - lib/contrast/framework/sinatra/patch/base.rb
909
+ - lib/contrast/framework/sinatra/patch/support.rb
910
+ - lib/contrast/framework/sinatra/support.rb
874
911
  - lib/contrast/framework/view_technologies_descriptor.rb
875
912
  - lib/contrast/internal_exception.rb
913
+ - lib/contrast/logger/application.rb
914
+ - lib/contrast/logger/log.rb
915
+ - lib/contrast/logger/time.rb
876
916
  - lib/contrast/security_exception.rb
917
+ - lib/contrast/tasks/config.rb
877
918
  - lib/contrast/tasks/service.rb
878
919
  - lib/contrast/utils/assess/sampling_util.rb
879
920
  - lib/contrast/utils/assess/tracking_util.rb
880
921
  - lib/contrast/utils/boolean_util.rb
881
922
  - lib/contrast/utils/cache.rb
882
923
  - lib/contrast/utils/class_util.rb
883
- - lib/contrast/utils/comment_range.rb
884
- - lib/contrast/utils/data_store_util.rb
885
924
  - lib/contrast/utils/duck_utils.rb
886
925
  - lib/contrast/utils/env_configuration_item.rb
887
- - lib/contrast/utils/environment_util.rb
888
926
  - lib/contrast/utils/freeze_util.rb
889
927
  - lib/contrast/utils/gemfile_reader.rb
890
928
  - lib/contrast/utils/hash_digest.rb
@@ -895,12 +933,8 @@ files:
895
933
  - lib/contrast/utils/job_servers_running.rb
896
934
  - lib/contrast/utils/object_share.rb
897
935
  - lib/contrast/utils/os.rb
898
- - lib/contrast/utils/performs_logging.rb
899
936
  - lib/contrast/utils/preflight_util.rb
900
937
  - lib/contrast/utils/prevent_serialization.rb
901
- - lib/contrast/utils/rack_assess_session_cookie.rb
902
- - lib/contrast/utils/rails_assess_configuration.rb
903
- - lib/contrast/utils/random_util.rb
904
938
  - lib/contrast/utils/resource_loader.rb
905
939
  - lib/contrast/utils/ruby_ast_rewriter.rb
906
940
  - lib/contrast/utils/service_response_util.rb
@@ -913,33 +947,9 @@ files:
913
947
  - lib/contrast/utils/thread_tracker.rb
914
948
  - lib/contrast/utils/timer.rb
915
949
  - resources/assess/policy.json
916
- - resources/csrf/inject.js
917
950
  - resources/deadzone/policy.json
918
- - resources/factory-bot-spec/spec_helper.rb
919
951
  - resources/inventory/policy.json
920
952
  - resources/protect/policy.json
921
- - resources/rubocops/kernel/catch_cop.rb
922
- - resources/rubocops/kernel/require_cop.rb
923
- - resources/rubocops/kernel/require_relative_cop.rb
924
- - resources/rubocops/module/autoload_cop.rb
925
- - resources/rubocops/module/const_defined_cop.rb
926
- - resources/rubocops/module/const_get_cop.rb
927
- - resources/rubocops/module/const_set_cop.rb
928
- - resources/rubocops/module/constants_cop.rb
929
- - resources/rubocops/module/name_cop.rb
930
- - resources/rubocops/object/class_cop.rb
931
- - resources/rubocops/object/freeze_cop.rb
932
- - resources/rubocops/object/frozen_cop.rb
933
- - resources/rubocops/object/is_a_cop.rb
934
- - resources/rubocops/object/method_cop.rb
935
- - resources/rubocops/object/respond_to_cop.rb
936
- - resources/rubocops/object/singleton_class_cop.rb
937
- - resources/rubocops/regexp/spelling_cop.rb
938
- - resources/rubocops/thread/new_cop.rb
939
- - resources/ruby-spec/ancestors_spec.rb
940
- - resources/ruby-spec/modulo_spec.rb
941
- - resources/ruby-spec/parameters_spec.rb
942
- - resources/ruby-spec/ruby_spec_spec_helper.rb
943
953
  - resources/test_marker.txt
944
954
  - ruby-agent.gemspec
945
955
  - service_executables/.gitkeep
@@ -957,7 +967,8 @@ metadata:
957
967
  support_uri: https://support.contrastsecurity.com
958
968
  trouble_shooting_uri: https://support.contrastsecurity.com/hc/en-us/search?utf8=%E2%9C%93&query=Ruby
959
969
  wiki_uri: https://docs.contrastsecurity.com/
960
- post_install_message:
970
+ post_install_message: 'To generate the required contrast_security.yaml file you can
971
+ run: bundle exec rake contrast:config:create'
961
972
  rdoc_options: []
962
973
  require_paths:
963
974
  - lib
@@ -1,63 +0,0 @@
1
- /* Copyright (c) 2020 Contrast Security, Inc. See
2
- * https://www.contrastsecurity.com/enduser-terms-0317a for more details. */
3
-
4
- #include "cs__assess_regexp_track.h"
5
- #include <funchook.h>
6
- #include <ruby.h>
7
-
8
- static VALUE rb_reg_match_pre_hook(VALUE match) {
9
- VALUE result = rb_reg_match_pre_original(match);
10
- result = rb_funcall(regexp_class, track_rb_pre_match, 2, match, result);
11
- return result;
12
- }
13
-
14
- static VALUE rb_reg_match_post_hook(VALUE match) {
15
- VALUE result = rb_reg_match_post_original(match);
16
- result = rb_funcall(regexp_class, track_rb_post_match, 2, match, result);
17
- return result;
18
- }
19
-
20
- static VALUE rb_reg_match_last_hook(VALUE match) {
21
- VALUE result = rb_reg_match_last_original(match);
22
- result =
23
- rb_funcall(regexp_class, track_rb_reg_match_last, 2, match, result);
24
- return result;
25
- }
26
-
27
- static VALUE rb_reg_nth_match_hook(int nth, VALUE match) {
28
- VALUE result = rb_reg_nth_match_original(nth, match);
29
- result = rb_funcall(regexp_class, track_rb_n_match, 2, match, result);
30
- return result;
31
- }
32
-
33
- static int install_regexp_hooks() {
34
- funchook_t *funchook = funchook_create();
35
-
36
- rb_reg_match_pre_original = rb_reg_match_pre;
37
- funchook_prepare(funchook, (void **)&rb_reg_match_pre_original,
38
- rb_reg_match_pre_hook);
39
-
40
- rb_reg_match_post_original = rb_reg_match_post;
41
- funchook_prepare(funchook, (void **)&rb_reg_match_post_original,
42
- rb_reg_match_post_hook);
43
-
44
- rb_reg_match_last_original = rb_reg_match_last;
45
- funchook_prepare(funchook, (void **)&rb_reg_match_last_original,
46
- rb_reg_match_last_hook);
47
-
48
- rb_reg_nth_match_original = rb_reg_nth_match;
49
- funchook_prepare(funchook, (void **)&rb_reg_nth_match_original,
50
- rb_reg_nth_match_hook);
51
-
52
- funchook_install(funchook, 0);
53
- return 0;
54
- }
55
-
56
- void Init_cs__assess_regexp_track(void) {
57
- regexp_class = rb_define_class("Regexp", rb_cObject);
58
- track_rb_n_match = rb_intern("track_rb_n_match");
59
- track_rb_pre_match = rb_intern("track_rb_pre_match");
60
- track_rb_post_match = rb_intern("track_rb_post_match");
61
- track_rb_reg_match_last = rb_intern("track_rb_reg_match_last");
62
- install_regexp_hooks();
63
- }