contrast-agent 4.3.1 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (315) hide show
  1. checksums.yaml +4 -4
  2. data/.simplecov +1 -1
  3. data/Gemfile +1 -1
  4. data/LICENSE.txt +1 -1
  5. data/Rakefile +1 -1
  6. data/exe/contrast_service +1 -1
  7. data/ext/build_funchook.rb +1 -1
  8. data/ext/cs__assess_active_record_named/cs__active_record_named.c +1 -1
  9. data/ext/cs__assess_active_record_named/extconf.rb +1 -1
  10. data/ext/cs__assess_array/cs__assess_array.c +1 -1
  11. data/ext/cs__assess_array/extconf.rb +1 -1
  12. data/ext/cs__assess_basic_object/cs__assess_basic_object.c +1 -1
  13. data/ext/cs__assess_basic_object/extconf.rb +1 -1
  14. data/ext/cs__assess_fiber_track/cs__assess_fiber_track.c +1 -1
  15. data/ext/cs__assess_fiber_track/extconf.rb +1 -1
  16. data/ext/cs__assess_hash/cs__assess_hash.c +4 -2
  17. data/ext/cs__assess_hash/extconf.rb +1 -1
  18. data/ext/cs__assess_kernel/cs__assess_kernel.c +1 -1
  19. data/ext/cs__assess_kernel/extconf.rb +1 -1
  20. data/ext/cs__assess_marshal_module/cs__assess_marshal_module.c +1 -1
  21. data/ext/cs__assess_marshal_module/extconf.rb +1 -1
  22. data/ext/cs__assess_module/cs__assess_module.c +1 -1
  23. data/ext/cs__assess_module/extconf.rb +1 -1
  24. data/ext/cs__assess_regexp/cs__assess_regexp.c +1 -1
  25. data/ext/cs__assess_regexp/extconf.rb +1 -1
  26. data/ext/cs__assess_string/cs__assess_string.c +1 -1
  27. data/ext/cs__assess_string/extconf.rb +1 -1
  28. data/ext/cs__assess_string_interpolation26/cs__assess_string_interpolation26.c +1 -1
  29. data/ext/cs__assess_string_interpolation26/extconf.rb +1 -1
  30. data/ext/cs__assess_yield_track/cs__assess_yield_track.c +1 -1
  31. data/ext/cs__assess_yield_track/extconf.rb +1 -1
  32. data/ext/cs__common/cs__common.c +5 -5
  33. data/ext/cs__common/cs__common.h +4 -4
  34. data/ext/cs__common/extconf.rb +1 -1
  35. data/ext/cs__contrast_patch/cs__contrast_patch.c +22 -25
  36. data/ext/cs__contrast_patch/extconf.rb +1 -1
  37. data/ext/cs__protect_kernel/cs__protect_kernel.c +1 -1
  38. data/ext/cs__protect_kernel/extconf.rb +1 -1
  39. data/ext/extconf_common.rb +1 -1
  40. data/lib/contrast-agent.rb +1 -1
  41. data/lib/contrast.rb +20 -1
  42. data/lib/contrast/agent.rb +6 -4
  43. data/lib/contrast/agent/assess.rb +1 -10
  44. data/lib/contrast/agent/assess/contrast_event.rb +54 -71
  45. data/lib/contrast/agent/assess/contrast_object.rb +6 -3
  46. data/lib/contrast/agent/assess/events/event_factory.rb +1 -1
  47. data/lib/contrast/agent/assess/events/source_event.rb +7 -2
  48. data/lib/contrast/agent/assess/finalizers/freeze.rb +1 -1
  49. data/lib/contrast/agent/assess/finalizers/hash.rb +33 -34
  50. data/lib/contrast/agent/assess/policy/dynamic_source_factory.rb +30 -15
  51. data/lib/contrast/agent/assess/policy/patcher.rb +1 -1
  52. data/lib/contrast/agent/assess/policy/policy.rb +1 -1
  53. data/lib/contrast/agent/assess/policy/policy_node.rb +1 -1
  54. data/lib/contrast/agent/assess/policy/policy_scanner.rb +1 -1
  55. data/lib/contrast/agent/assess/policy/preshift.rb +1 -1
  56. data/lib/contrast/agent/assess/policy/propagation_method.rb +30 -19
  57. data/lib/contrast/agent/assess/policy/propagation_node.rb +1 -1
  58. data/lib/contrast/agent/assess/policy/propagator.rb +1 -1
  59. data/lib/contrast/agent/assess/policy/propagator/append.rb +29 -14
  60. data/lib/contrast/agent/assess/policy/propagator/base.rb +1 -1
  61. data/lib/contrast/agent/assess/policy/propagator/center.rb +1 -1
  62. data/lib/contrast/agent/assess/policy/propagator/custom.rb +1 -1
  63. data/lib/contrast/agent/assess/policy/propagator/database_write.rb +22 -17
  64. data/lib/contrast/agent/assess/policy/propagator/insert.rb +1 -1
  65. data/lib/contrast/agent/assess/policy/propagator/keep.rb +1 -1
  66. data/lib/contrast/agent/assess/policy/propagator/match_data.rb +1 -1
  67. data/lib/contrast/agent/assess/policy/propagator/next.rb +1 -1
  68. data/lib/contrast/agent/assess/policy/propagator/prepend.rb +1 -1
  69. data/lib/contrast/agent/assess/policy/propagator/remove.rb +23 -19
  70. data/lib/contrast/agent/assess/policy/propagator/replace.rb +1 -1
  71. data/lib/contrast/agent/assess/policy/propagator/reverse.rb +1 -1
  72. data/lib/contrast/agent/assess/policy/propagator/select.rb +1 -1
  73. data/lib/contrast/agent/assess/policy/propagator/splat.rb +24 -14
  74. data/lib/contrast/agent/assess/policy/propagator/split.rb +15 -8
  75. data/lib/contrast/agent/assess/policy/propagator/substitution.rb +31 -15
  76. data/lib/contrast/agent/assess/policy/propagator/trim.rb +66 -35
  77. data/lib/contrast/agent/assess/policy/rewriter_patch.rb +1 -1
  78. data/lib/contrast/agent/assess/policy/source_method.rb +87 -76
  79. data/lib/contrast/agent/assess/policy/source_node.rb +1 -1
  80. data/lib/contrast/agent/assess/policy/source_validation/cross_site_validator.rb +8 -6
  81. data/lib/contrast/agent/assess/policy/source_validation/source_validation.rb +1 -1
  82. data/lib/contrast/agent/assess/policy/trigger/reflected_xss.rb +3 -3
  83. data/lib/contrast/agent/assess/policy/trigger/xpath.rb +7 -8
  84. data/lib/contrast/agent/assess/policy/trigger_method.rb +106 -64
  85. data/lib/contrast/agent/assess/policy/trigger_node.rb +31 -10
  86. data/lib/contrast/agent/assess/policy/trigger_validation/redos_validator.rb +59 -0
  87. data/lib/contrast/agent/assess/policy/trigger_validation/ssrf_validator.rb +2 -3
  88. data/lib/contrast/agent/assess/policy/trigger_validation/trigger_validation.rb +7 -5
  89. data/lib/contrast/agent/assess/policy/trigger_validation/xss_validator.rb +3 -5
  90. data/lib/contrast/agent/assess/properties.rb +1 -3
  91. data/lib/contrast/agent/assess/property/evented.rb +1 -1
  92. data/lib/contrast/agent/assess/property/tagged.rb +38 -20
  93. data/lib/contrast/agent/assess/property/updated.rb +1 -1
  94. data/lib/contrast/agent/assess/rule/provider.rb +1 -1
  95. data/lib/contrast/agent/assess/rule/provider/hardcoded_key.rb +1 -1
  96. data/lib/contrast/agent/assess/rule/provider/hardcoded_password.rb +1 -1
  97. data/lib/contrast/agent/assess/rule/provider/hardcoded_value_rule.rb +1 -1
  98. data/lib/contrast/agent/assess/tag.rb +1 -1
  99. data/lib/contrast/agent/assess/tracker.rb +2 -2
  100. data/lib/contrast/agent/at_exit_hook.rb +1 -1
  101. data/lib/contrast/agent/class_reopener.rb +1 -1
  102. data/lib/contrast/agent/deadzone/policy/deadzone_node.rb +1 -1
  103. data/lib/contrast/agent/deadzone/policy/policy.rb +7 -3
  104. data/lib/contrast/agent/disable_reaction.rb +1 -1
  105. data/lib/contrast/agent/exclusion_matcher.rb +1 -1
  106. data/lib/contrast/agent/inventory.rb +1 -2
  107. data/lib/contrast/agent/inventory/dependencies.rb +1 -1
  108. data/lib/contrast/agent/inventory/dependency_analysis.rb +1 -1
  109. data/lib/contrast/agent/inventory/dependency_usage_analysis.rb +35 -23
  110. data/lib/contrast/agent/inventory/policy/datastores.rb +1 -1
  111. data/lib/contrast/agent/inventory/policy/policy.rb +1 -1
  112. data/lib/contrast/agent/inventory/policy/trigger_node.rb +1 -1
  113. data/lib/contrast/agent/middleware.rb +112 -109
  114. data/lib/contrast/agent/module_data.rb +1 -1
  115. data/lib/contrast/agent/patching/policy/after_load_patch.rb +1 -1
  116. data/lib/contrast/agent/patching/policy/after_load_patcher.rb +5 -1
  117. data/lib/contrast/agent/patching/policy/method_policy.rb +1 -1
  118. data/lib/contrast/agent/patching/policy/module_policy.rb +1 -1
  119. data/lib/contrast/agent/patching/policy/patch.rb +12 -13
  120. data/lib/contrast/agent/patching/policy/patch_status.rb +2 -2
  121. data/lib/contrast/agent/patching/policy/patcher.rb +59 -54
  122. data/lib/contrast/agent/patching/policy/policy.rb +14 -21
  123. data/lib/contrast/agent/patching/policy/policy_node.rb +1 -1
  124. data/lib/contrast/agent/patching/policy/trigger_node.rb +6 -3
  125. data/lib/contrast/agent/protect/policy/applies_command_injection_rule.rb +1 -1
  126. data/lib/contrast/agent/protect/policy/applies_deserialization_rule.rb +1 -1
  127. data/lib/contrast/agent/protect/policy/applies_no_sqli_rule.rb +1 -1
  128. data/lib/contrast/agent/protect/policy/applies_path_traversal_rule.rb +1 -1
  129. data/lib/contrast/agent/protect/policy/applies_sqli_rule.rb +1 -1
  130. data/lib/contrast/agent/protect/policy/applies_xxe_rule.rb +1 -1
  131. data/lib/contrast/agent/protect/policy/policy.rb +1 -1
  132. data/lib/contrast/agent/protect/policy/rule_applicator.rb +1 -1
  133. data/lib/contrast/agent/protect/policy/trigger_node.rb +1 -1
  134. data/lib/contrast/agent/protect/rule.rb +1 -1
  135. data/lib/contrast/agent/protect/rule/base.rb +7 -18
  136. data/lib/contrast/agent/protect/rule/base_service.rb +2 -2
  137. data/lib/contrast/agent/protect/rule/cmd_injection.rb +2 -2
  138. data/lib/contrast/agent/protect/rule/default_scanner.rb +1 -1
  139. data/lib/contrast/agent/protect/rule/deserialization.rb +1 -1
  140. data/lib/contrast/agent/protect/rule/http_method_tampering.rb +1 -1
  141. data/lib/contrast/agent/protect/rule/no_sqli.rb +2 -2
  142. data/lib/contrast/agent/protect/rule/no_sqli/mongo_no_sql_scanner.rb +1 -1
  143. data/lib/contrast/agent/protect/rule/path_traversal.rb +1 -1
  144. data/lib/contrast/agent/protect/rule/sqli.rb +18 -12
  145. data/lib/contrast/agent/protect/rule/sqli/default_sql_scanner.rb +1 -1
  146. data/lib/contrast/agent/protect/rule/sqli/mysql_sql_scanner.rb +1 -1
  147. data/lib/contrast/agent/protect/rule/sqli/postgres_sql_scanner.rb +2 -2
  148. data/lib/contrast/agent/protect/rule/sqli/sqlite_sql_scanner.rb +1 -1
  149. data/lib/contrast/agent/protect/rule/unsafe_file_upload.rb +1 -1
  150. data/lib/contrast/agent/protect/rule/xss.rb +1 -1
  151. data/lib/contrast/agent/protect/rule/xxe.rb +1 -1
  152. data/lib/contrast/agent/protect/rule/xxe/entity_wrapper.rb +1 -1
  153. data/lib/contrast/agent/railtie.rb +1 -1
  154. data/lib/contrast/agent/reaction_processor.rb +1 -1
  155. data/lib/contrast/agent/request.rb +2 -1
  156. data/lib/contrast/agent/request_context.rb +17 -10
  157. data/lib/contrast/agent/request_handler.rb +1 -1
  158. data/lib/contrast/agent/response.rb +1 -1
  159. data/lib/contrast/agent/rewriter.rb +1 -1
  160. data/lib/contrast/agent/rule_set.rb +3 -3
  161. data/lib/contrast/agent/scope.rb +1 -1
  162. data/lib/contrast/agent/service_heartbeat.rb +1 -1
  163. data/lib/contrast/agent/static_analysis.rb +1 -1
  164. data/lib/contrast/agent/thread.rb +2 -2
  165. data/lib/contrast/agent/thread_watcher.rb +21 -6
  166. data/lib/contrast/agent/tracepoint_hook.rb +1 -1
  167. data/lib/contrast/agent/version.rb +2 -2
  168. data/lib/contrast/agent/worker_thread.rb +1 -1
  169. data/lib/contrast/api.rb +1 -1
  170. data/lib/contrast/api/communication.rb +1 -1
  171. data/lib/contrast/api/communication/connection_status.rb +1 -1
  172. data/lib/contrast/api/communication/messaging_queue.rb +19 -22
  173. data/lib/contrast/api/communication/response_processor.rb +11 -4
  174. data/lib/contrast/api/communication/service_lifecycle.rb +1 -1
  175. data/lib/contrast/api/communication/socket.rb +1 -1
  176. data/lib/contrast/api/communication/socket_client.rb +23 -15
  177. data/lib/contrast/api/communication/speedracer.rb +3 -3
  178. data/lib/contrast/api/communication/tcp_socket.rb +1 -1
  179. data/lib/contrast/api/communication/unix_socket.rb +1 -1
  180. data/lib/contrast/api/decorators.rb +3 -1
  181. data/lib/contrast/api/decorators/address.rb +1 -1
  182. data/lib/contrast/api/decorators/agent_startup.rb +58 -0
  183. data/lib/contrast/api/decorators/application_settings.rb +1 -1
  184. data/lib/contrast/api/decorators/application_startup.rb +53 -0
  185. data/lib/contrast/api/decorators/application_update.rb +1 -1
  186. data/lib/contrast/api/decorators/http_request.rb +1 -1
  187. data/lib/contrast/api/decorators/input_analysis.rb +1 -1
  188. data/lib/contrast/api/decorators/instrumentation_mode.rb +37 -0
  189. data/lib/contrast/api/decorators/library.rb +1 -1
  190. data/lib/contrast/api/decorators/library_usage_update.rb +1 -1
  191. data/lib/contrast/api/decorators/message.rb +1 -1
  192. data/lib/contrast/api/decorators/rasp_rule_sample.rb +1 -1
  193. data/lib/contrast/api/decorators/route_coverage.rb +16 -6
  194. data/lib/contrast/api/decorators/server_features.rb +1 -1
  195. data/lib/contrast/api/decorators/trace_event.rb +43 -15
  196. data/lib/contrast/api/decorators/trace_event_object.rb +1 -1
  197. data/lib/contrast/api/decorators/trace_event_signature.rb +1 -1
  198. data/lib/contrast/api/decorators/trace_taint_range.rb +1 -1
  199. data/lib/contrast/api/decorators/trace_taint_range_tags.rb +1 -1
  200. data/lib/contrast/api/decorators/user_input.rb +1 -1
  201. data/lib/contrast/components/agent.rb +7 -11
  202. data/lib/contrast/components/app_context.rb +5 -23
  203. data/lib/contrast/components/assess.rb +6 -11
  204. data/lib/contrast/components/config.rb +1 -1
  205. data/lib/contrast/components/contrast_service.rb +1 -1
  206. data/lib/contrast/components/heap_dump.rb +1 -1
  207. data/lib/contrast/components/interface.rb +1 -1
  208. data/lib/contrast/components/inventory.rb +1 -1
  209. data/lib/contrast/components/logger.rb +1 -1
  210. data/lib/contrast/components/protect.rb +11 -14
  211. data/lib/contrast/components/sampling.rb +49 -7
  212. data/lib/contrast/components/scope.rb +2 -1
  213. data/lib/contrast/components/settings.rb +27 -99
  214. data/lib/contrast/config.rb +1 -1
  215. data/lib/contrast/config/agent_configuration.rb +1 -1
  216. data/lib/contrast/config/application_configuration.rb +1 -1
  217. data/lib/contrast/config/assess_configuration.rb +1 -1
  218. data/lib/contrast/config/assess_rules_configuration.rb +1 -1
  219. data/lib/contrast/config/base_configuration.rb +1 -1
  220. data/lib/contrast/config/default_value.rb +1 -1
  221. data/lib/contrast/config/exception_configuration.rb +1 -1
  222. data/lib/contrast/config/heap_dump_configuration.rb +1 -1
  223. data/lib/contrast/config/inventory_configuration.rb +1 -1
  224. data/lib/contrast/config/logger_configuration.rb +1 -1
  225. data/lib/contrast/config/protect_configuration.rb +1 -1
  226. data/lib/contrast/config/protect_rule_configuration.rb +23 -1
  227. data/lib/contrast/config/protect_rules_configuration.rb +1 -1
  228. data/lib/contrast/config/root_configuration.rb +1 -1
  229. data/lib/contrast/config/ruby_configuration.rb +1 -1
  230. data/lib/contrast/config/sampling_configuration.rb +1 -1
  231. data/lib/contrast/config/server_configuration.rb +1 -1
  232. data/lib/contrast/config/service_configuration.rb +1 -1
  233. data/lib/contrast/configuration.rb +1 -1
  234. data/lib/contrast/delegators/input_analysis.rb +12 -0
  235. data/lib/contrast/extension/assess.rb +1 -1
  236. data/lib/contrast/extension/assess/array.rb +1 -1
  237. data/lib/contrast/extension/assess/erb.rb +1 -1
  238. data/lib/contrast/extension/assess/eval_trigger.rb +1 -5
  239. data/lib/contrast/extension/assess/exec_trigger.rb +1 -5
  240. data/lib/contrast/extension/assess/fiber.rb +1 -1
  241. data/lib/contrast/extension/assess/hash.rb +1 -1
  242. data/lib/contrast/extension/assess/kernel.rb +1 -1
  243. data/lib/contrast/extension/assess/marshal.rb +1 -5
  244. data/lib/contrast/extension/assess/regexp.rb +1 -1
  245. data/lib/contrast/extension/assess/string.rb +1 -1
  246. data/lib/contrast/extension/delegator.rb +1 -1
  247. data/lib/contrast/extension/inventory.rb +1 -1
  248. data/lib/contrast/extension/kernel.rb +1 -1
  249. data/lib/contrast/extension/module.rb +1 -1
  250. data/lib/contrast/extension/protect.rb +1 -1
  251. data/lib/contrast/extension/protect/kernel.rb +1 -1
  252. data/lib/contrast/extension/protect/psych.rb +1 -1
  253. data/lib/contrast/extension/thread.rb +1 -1
  254. data/lib/contrast/framework/base_support.rb +1 -1
  255. data/lib/contrast/framework/manager.rb +13 -15
  256. data/lib/contrast/framework/platform_version.rb +1 -1
  257. data/lib/contrast/framework/rack/patch/session_cookie.rb +1 -1
  258. data/lib/contrast/framework/rack/patch/support.rb +1 -1
  259. data/lib/contrast/framework/rack/support.rb +1 -1
  260. data/lib/contrast/framework/rails/patch/action_controller_live_buffer.rb +1 -1
  261. data/lib/contrast/framework/rails/patch/assess_configuration.rb +1 -1
  262. data/lib/contrast/framework/rails/patch/rails_application_configuration.rb +4 -4
  263. data/lib/contrast/framework/rails/patch/support.rb +1 -1
  264. data/lib/contrast/framework/rails/rewrite/action_controller_railties_helper_inherited.rb +1 -1
  265. data/lib/contrast/framework/rails/rewrite/active_record_attribute_methods_read.rb +1 -1
  266. data/lib/contrast/framework/rails/rewrite/active_record_named.rb +1 -1
  267. data/lib/contrast/framework/rails/rewrite/active_record_time_zone_inherited.rb +1 -1
  268. data/lib/contrast/framework/rails/support.rb +43 -44
  269. data/lib/contrast/framework/sinatra/support.rb +101 -42
  270. data/lib/contrast/funchook/funchook.rb +1 -1
  271. data/lib/contrast/logger/application.rb +1 -1
  272. data/lib/contrast/logger/format.rb +1 -1
  273. data/lib/contrast/logger/log.rb +32 -16
  274. data/lib/contrast/logger/request.rb +1 -1
  275. data/lib/contrast/logger/time.rb +1 -1
  276. data/lib/contrast/security_exception.rb +1 -1
  277. data/lib/contrast/tasks/config.rb +1 -1
  278. data/lib/contrast/tasks/service.rb +1 -1
  279. data/lib/contrast/utils/assess/sampling_util.rb +1 -1
  280. data/lib/contrast/utils/assess/tracking_util.rb +1 -1
  281. data/lib/contrast/utils/class_util.rb +18 -4
  282. data/lib/contrast/utils/duck_utils.rb +1 -1
  283. data/lib/contrast/utils/env_configuration_item.rb +1 -1
  284. data/lib/contrast/utils/hash_digest.rb +14 -19
  285. data/lib/contrast/utils/heap_dump_util.rb +104 -88
  286. data/lib/contrast/utils/invalid_configuration_util.rb +22 -13
  287. data/lib/contrast/utils/inventory_util.rb +1 -1
  288. data/lib/contrast/utils/io_util.rb +1 -1
  289. data/lib/contrast/utils/job_servers_running.rb +1 -1
  290. data/lib/contrast/utils/object_share.rb +1 -1
  291. data/lib/contrast/utils/os.rb +1 -1
  292. data/lib/contrast/utils/preflight_util.rb +1 -1
  293. data/lib/contrast/utils/resource_loader.rb +1 -1
  294. data/lib/contrast/utils/ruby_ast_rewriter.rb +1 -1
  295. data/lib/contrast/utils/sha256_builder.rb +1 -1
  296. data/lib/contrast/utils/stack_trace_utils.rb +1 -1
  297. data/lib/contrast/utils/string_utils.rb +1 -1
  298. data/lib/contrast/utils/tag_util.rb +1 -1
  299. data/lib/contrast/utils/thread_tracker.rb +1 -1
  300. data/lib/contrast/utils/timer.rb +1 -1
  301. data/resources/assess/policy.json +8 -11
  302. data/resources/deadzone/policy.json +7 -17
  303. data/ruby-agent.gemspec +59 -19
  304. data/service_executables/VERSION +1 -1
  305. data/service_executables/linux/contrast-service +0 -0
  306. data/service_executables/mac/contrast-service +0 -0
  307. metadata +134 -137
  308. data/lib/contrast/agent/assess/rule.rb +0 -18
  309. data/lib/contrast/agent/assess/rule/base.rb +0 -52
  310. data/lib/contrast/agent/assess/rule/redos.rb +0 -67
  311. data/lib/contrast/agent/inventory/gemfile_digest_cache.rb +0 -38
  312. data/lib/contrast/common_agent_configuration.rb +0 -87
  313. data/lib/contrast/framework/sinatra/patch/base.rb +0 -83
  314. data/lib/contrast/framework/sinatra/patch/support.rb +0 -27
  315. data/lib/contrast/utils/prevent_serialization.rb +0 -52
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
1
+ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'contrast/agent/assess/policy/trigger_method'
@@ -26,19 +26,9 @@ module Contrast
26
26
  def cs__report_finding rule_id, user_provided_options, call_location
27
27
  with_contrast_scope do
28
28
  finding = Contrast::Api::Dtm::Finding.new
29
- finding.rule_id = rule_id
30
- path = call_location.path
31
- # just get the file name, not the full path
32
- path = path.split(Contrast::Utils::ObjectShare::SLASH).last
33
- session_id = user_provided_options[:key].to_s if user_provided_options
34
-
35
29
  finding.version = Contrast::Agent::Assess::Policy::TriggerMethod::CURRENT_FINDING_VERSION
36
- finding.properties[CS__SESSION_ID] = Contrast::Utils::StringUtils.force_utf8(session_id)
37
- finding.properties[CS__PATH] = Contrast::Utils::StringUtils.force_utf8(path)
38
- file_path = call_location.absolute_path
39
- snippet = file_snippet(file_path, call_location)
40
- finding.properties[CS__SNIPPET] = Contrast::Utils::StringUtils.force_utf8(snippet)
41
-
30
+ finding.rule_id = rule_id
31
+ set_properties(finding, user_provided_options, call_location)
42
32
  hash = Contrast::Utils::HashDigest.generate_config_hash(finding)
43
33
  finding.hash_code = Contrast::Utils::StringUtils.force_utf8(hash)
44
34
  finding.preflight = Contrast::Utils::PreflightUtil.create_preflight(finding)
@@ -50,6 +40,25 @@ module Contrast
50
40
 
51
41
  private
52
42
 
43
+ # Set the properties needed to report and subsequently render this finding on the finding given.
44
+ #
45
+ # @param finding [Contrast::Api::Dtm::Finding] the configuration finding to populate
46
+ # @param user_provided_options [Hash] the configuration value(s) which
47
+ # violated the rule
48
+ # @param call_location [Thread::Backtrace::Location] the location where
49
+ # the bad configuration was set
50
+ def set_properties finding, user_provided_options, call_location
51
+ path = call_location.path
52
+ # just get the file name, not the full path
53
+ path = path.split(Contrast::Utils::ObjectShare::SLASH).last
54
+ session_id = user_provided_options[:key].to_s if user_provided_options
55
+ finding.properties[CS__SESSION_ID] = Contrast::Utils::StringUtils.force_utf8(session_id)
56
+ finding.properties[CS__PATH] = Contrast::Utils::StringUtils.force_utf8(path)
57
+ file_path = call_location.absolute_path
58
+ snippet = file_snippet(file_path, call_location)
59
+ finding.properties[CS__SNIPPET] = Contrast::Utils::StringUtils.force_utf8(snippet)
60
+ end
61
+
53
62
  def file_snippet file_path, call_location
54
63
  idx = call_location&.lineno
55
64
  if file_path && idx && File.exist?(file_path)
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
1
+ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'contrast/utils/timer'
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
1
+ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'contrast/components/interface'
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
1
+ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Contrast
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
1
+ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
4
  # rubocop:disable Security/Object/Freeze
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
1
+ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'contrast/components/interface'
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
1
+ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Contrast
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
1
+ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Contrast
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
1
+ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'parser/current'
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
1
+ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'singleton'
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
1
+ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'contrast/utils/object_share'
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
1
+ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'contrast/components/interface'
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
1
+ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Contrast
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
1
+ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Contrast
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
1
+ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Contrast
@@ -1173,27 +1173,19 @@
1173
1173
  "instance_method": true,
1174
1174
  "method_visibility": "public",
1175
1175
  "method_name":"match",
1176
- "source":"P0",
1177
- "trigger_class": "Contrast::Agent::Assess::Rule::Redos",
1178
- "trigger_method": "regexp_complexity_check"
1179
-
1176
+ "source":"P0"
1180
1177
  }, {
1181
1178
  "class_name":"String",
1182
1179
  "instance_method": true,
1183
1180
  "method_visibility": "public",
1184
1181
  "method_name":"=~",
1185
- "source":"O",
1186
- "trigger_class": "Contrast::Agent::Assess::Rule::Redos",
1187
- "trigger_method": "regexp_complexity_check"
1182
+ "source":"O"
1188
1183
  }, {
1189
1184
  "class_name":"Regexp",
1190
1185
  "instance_method": true,
1191
1186
  "method_visibility": "public",
1192
1187
  "method_name":"=~",
1193
- "source":"P0",
1194
- "trigger_class": "Contrast::Agent::Assess::Rule::Redos",
1195
- "trigger_method": "regexp_complexity_check"
1196
-
1188
+ "source":"P0"
1197
1189
  }
1198
1190
  ]
1199
1191
  }, {
@@ -1429,6 +1421,11 @@
1429
1421
  "instance_method": true,
1430
1422
  "method_visibility": "public",
1431
1423
  "method_name":"rand"
1424
+ }, {
1425
+ "class_name":"Random::Base",
1426
+ "instance_method": true,
1427
+ "method_visibility": "public",
1428
+ "method_name":"rand"
1432
1429
  }
1433
1430
  ]
1434
1431
  }, {
@@ -5,16 +5,6 @@
5
5
  "instance_method":true,
6
6
  "method_visibility": "public",
7
7
  "method_name":"content_type"
8
- }, {
9
- "class_name":"Rack::Request::Helpers",
10
- "instance_method":true,
11
- "method_visibility": "public",
12
- "method_name":"host_authority"
13
- }, {
14
- "class_name":"Rack::Request::Helpers",
15
- "instance_method":true,
16
- "method_visibility": "public",
17
- "method_name":"host_with_port"
18
8
  }, {
19
9
  "class_name":"Rack::Request::Helpers",
20
10
  "instance_method":true,
@@ -61,18 +51,18 @@
61
51
  "method_visibility": "private",
62
52
  "method_name":"session_exists?",
63
53
  "code": "https://github.com/rack/rack/blob/master/lib/rack/session/abstract/id.rb#L334"
64
- }, {
65
- "class_name":"ActionDispatch::Http::MimeNegotiation",
66
- "instance_method":true,
67
- "method_visibility": "public",
68
- "method_name":"formats",
69
- "code": "https://github.com/rails/rails/blob/v6.0.3.4/actionpack/lib/action_dispatch/http/mime_negotiation.rb#L63"
70
54
  }, {
71
55
  "class_name":"ActionDispatch::FileHandler",
72
56
  "instance_method":true,
73
57
  "method_visibility": "public",
74
58
  "method_name":"match?",
75
59
  "code": "https://github.com/rails/rails/blob/v6.0.3.4/actionpack/lib/action_dispatch/middleware/static.rb#L30"
60
+ }, {
61
+ "class_name":"ActionDispatch::Http::MimeNegotiation",
62
+ "instance_method":true,
63
+ "method_visibility": "public",
64
+ "method_name":"formats",
65
+ "code": "https://github.com/rails/rails/blob/v6.0.3.4/actionpack/lib/action_dispatch/http/mime_negotiation.rb#L63"
76
66
  }, {
77
67
  "class_name":"ActionDispatch::Journey::Router",
78
68
  "instance_method":true,
@@ -83,7 +73,7 @@
83
73
  "class_name":"ActionDispatch::Request",
84
74
  "instance_method":true,
85
75
  "method_visibility": "public",
86
- "method_name":"controler_class_for",
76
+ "method_name":"controller_class_for",
87
77
  "code": "https://github.com/rails/rails/blob/v6.0.3.4/actionpack/lib/action_dispatch/http/request.rb#L84"
88
78
  }, {
89
79
  "class_name":"ActionDispatch::Request",
data/ruby-agent.gemspec CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
1
+ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require_relative './lib/contrast/agent/version'
@@ -20,39 +20,79 @@ end
20
20
 
21
21
  # Add those dependencies required to develop or test the Agent
22
22
  def self.add_dev_dependencies spec
23
- spec.add_development_dependency 'amazing_print'
24
- spec.add_development_dependency 'benchmark-ips'
23
+ add_builders(spec)
24
+ add_debuggers(spec)
25
+ add_linters(spec)
26
+ add_specs(spec)
27
+ end
28
+
29
+ # Dependencies used to build the agent during development.
30
+ def self.add_builders spec
25
31
  spec.add_development_dependency 'bundler'
26
- spec.add_development_dependency 'climate_control' # mock ENV
27
- spec.add_development_dependency 'debase'
32
+ spec.add_development_dependency 'rake', '>= 12.3.3'
33
+ spec.add_development_dependency 'rake-compiler', '~> 0'
34
+ end
35
+
36
+ # Dependencies used for local debugging during development.
37
+ def self.add_debuggers spec
38
+ spec.add_development_dependency 'pry'
39
+ spec.add_development_dependency 'ruby-debug-ide'
40
+ end
41
+
42
+ # Dependencies used for framework testing.
43
+ def self.add_frameworks spec
44
+ spec.add_development_dependency 'rails', '6.0.3.5'
45
+ spec.add_development_dependency 'sinatra', '>= 2'
46
+ end
47
+
48
+ # Dependencies used for linting prior to commit.
49
+ def self.add_linters spec
28
50
  spec.add_development_dependency 'debride'
29
- spec.add_development_dependency 'execjs'
30
- spec.add_development_dependency 'factory_bot'
31
- spec.add_development_dependency 'fake_ftp'
32
51
  spec.add_development_dependency 'fasterer'
33
52
  spec.add_development_dependency 'flay'
53
+ add_rubocop(spec)
54
+ end
55
+
56
+ # Dependencies used to run our current RSpec test suite.
57
+ def self.add_specs spec
58
+ add_coverage(spec)
59
+ add_frameworks(spec)
60
+ add_tested_gems(spec)
61
+
62
+ spec.add_development_dependency 'benchmark-ips'
63
+ spec.add_development_dependency 'climate_control' # mock ENV
64
+ spec.add_development_dependency 'factory_bot'
65
+ spec.add_development_dependency 'fake_ftp'
34
66
  spec.add_development_dependency 'openssl'
35
- spec.add_development_dependency 'parser', '~> 2.6'
36
- spec.add_development_dependency 'pry'
37
- spec.add_development_dependency 'rails', '>= 3'
38
- spec.add_development_dependency 'rake', '>= 12.3.3'
39
- spec.add_development_dependency 'rake-compiler', '~> 0'
40
67
  spec.add_development_dependency 'rspec', '~> 3.0'
41
68
  spec.add_development_dependency 'rspec-benchmark'
42
69
  spec.add_development_dependency 'rspec_junit_formatter', '0.3.0'
70
+ spec.add_development_dependency 'rspec-rails', '5.0'
71
+ spec.add_development_dependency 'tzinfo-data' # Alpine rspec-rails requirement.
72
+ end
73
+
74
+ def self.add_coverage spec
75
+ spec.add_development_dependency 'codecov'
76
+ spec.add_development_dependency 'simplecov', '0.20.0'
77
+ end
78
+
79
+ # Dependencies used to run all of our Rubocop during the linting phase.
80
+ def self.add_rubocop spec
43
81
  spec.add_development_dependency 'rubocop', '1.6.1'
44
82
  spec.add_development_dependency 'rubocop-performance', '1.9.1'
45
83
  spec.add_development_dependency 'rubocop-rails', '2.9.1'
46
84
  spec.add_development_dependency 'rubocop-rake', '0.5.1'
47
85
  spec.add_development_dependency 'rubocop-rspec', '2.1.0'
48
- spec.add_development_dependency 'ruby-debug-ide'
49
- spec.add_development_dependency 'simplecov', '0.20.0'
50
- spec.add_development_dependency 'sinatra', '>= 2'
51
- spec.add_development_dependency 'sqlite3', '1.3.9'
86
+ end
87
+
88
+ # Dependencies not mocked out during RSpec that we test real code of, beyond just frameworks.
89
+ def self.add_tested_gems spec
90
+ spec.add_development_dependency 'async'
91
+ spec.add_development_dependency 'execjs'
92
+ spec.add_development_dependency 'sqlite3'
52
93
  spec.add_development_dependency 'therubyracer'
53
94
  spec.add_development_dependency 'tilt'
54
95
  spec.add_development_dependency 'xpath'
55
- spec.add_development_dependency 'yarjuf', '~> 2.0'
56
96
  end
57
97
 
58
98
  # Add those dependencies required to run the Agent in customer applications.
@@ -124,7 +164,7 @@ Gem::Specification.new do |spec|
124
164
  'Testing and Protection.'
125
165
  spec.homepage = 'https://www.contrastsecurity.com'
126
166
  spec.license = 'CONTRAST SECURITY (see license file)'
127
- spec.required_ruby_version = ['>= 2.5.0', '< 2.8.0']
167
+ spec.required_ruby_version = ['>= 2.5.0', '< 3.1.0']
128
168
 
129
169
  spec.bindir = 'exe'
130
170
  spec.executables = ['contrast_service']
@@ -1 +1 @@
1
- 2.17.2
1
+ 2.19.0
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: 4.3.1
4
+ version: 4.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - galen.palmer@contrastsecurity.com
@@ -13,10 +13,10 @@ authors:
13
13
  autorequire:
14
14
  bindir: exe
15
15
  cert_chain: []
16
- date: 2021-02-04 00:00:00.000000000 Z
16
+ date: 2021-04-22 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
- name: amazing_print
19
+ name: bundler
20
20
  requirement: !ruby/object:Gem::Requirement
21
21
  requirements:
22
22
  - - ">="
@@ -30,35 +30,35 @@ dependencies:
30
30
  - !ruby/object:Gem::Version
31
31
  version: '0'
32
32
  - !ruby/object:Gem::Dependency
33
- name: benchmark-ips
33
+ name: rake
34
34
  requirement: !ruby/object:Gem::Requirement
35
35
  requirements:
36
36
  - - ">="
37
37
  - !ruby/object:Gem::Version
38
- version: '0'
38
+ version: 12.3.3
39
39
  type: :development
40
40
  prerelease: false
41
41
  version_requirements: !ruby/object:Gem::Requirement
42
42
  requirements:
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: '0'
45
+ version: 12.3.3
46
46
  - !ruby/object:Gem::Dependency
47
- name: bundler
47
+ name: rake-compiler
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  requirements:
50
- - - ">="
50
+ - - "~>"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0'
53
53
  type: :development
54
54
  prerelease: false
55
55
  version_requirements: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - ">="
57
+ - - "~>"
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0'
60
60
  - !ruby/object:Gem::Dependency
61
- name: climate_control
61
+ name: pry
62
62
  requirement: !ruby/object:Gem::Requirement
63
63
  requirements:
64
64
  - - ">="
@@ -72,7 +72,7 @@ dependencies:
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  - !ruby/object:Gem::Dependency
75
- name: debase
75
+ name: ruby-debug-ide
76
76
  requirement: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - ">="
@@ -100,7 +100,7 @@ dependencies:
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  - !ruby/object:Gem::Dependency
103
- name: execjs
103
+ name: fasterer
104
104
  requirement: !ruby/object:Gem::Requirement
105
105
  requirements:
106
106
  - - ">="
@@ -114,7 +114,7 @@ dependencies:
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  - !ruby/object:Gem::Dependency
117
- name: factory_bot
117
+ name: flay
118
118
  requirement: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - ">="
@@ -128,77 +128,77 @@ dependencies:
128
128
  - !ruby/object:Gem::Version
129
129
  version: '0'
130
130
  - !ruby/object:Gem::Dependency
131
- name: fake_ftp
131
+ name: rubocop
132
132
  requirement: !ruby/object:Gem::Requirement
133
133
  requirements:
134
- - - ">="
134
+ - - '='
135
135
  - !ruby/object:Gem::Version
136
- version: '0'
136
+ version: 1.6.1
137
137
  type: :development
138
138
  prerelease: false
139
139
  version_requirements: !ruby/object:Gem::Requirement
140
140
  requirements:
141
- - - ">="
141
+ - - '='
142
142
  - !ruby/object:Gem::Version
143
- version: '0'
143
+ version: 1.6.1
144
144
  - !ruby/object:Gem::Dependency
145
- name: fasterer
145
+ name: rubocop-performance
146
146
  requirement: !ruby/object:Gem::Requirement
147
147
  requirements:
148
- - - ">="
148
+ - - '='
149
149
  - !ruby/object:Gem::Version
150
- version: '0'
150
+ version: 1.9.1
151
151
  type: :development
152
152
  prerelease: false
153
153
  version_requirements: !ruby/object:Gem::Requirement
154
154
  requirements:
155
- - - ">="
155
+ - - '='
156
156
  - !ruby/object:Gem::Version
157
- version: '0'
157
+ version: 1.9.1
158
158
  - !ruby/object:Gem::Dependency
159
- name: flay
159
+ name: rubocop-rails
160
160
  requirement: !ruby/object:Gem::Requirement
161
161
  requirements:
162
- - - ">="
162
+ - - '='
163
163
  - !ruby/object:Gem::Version
164
- version: '0'
164
+ version: 2.9.1
165
165
  type: :development
166
166
  prerelease: false
167
167
  version_requirements: !ruby/object:Gem::Requirement
168
168
  requirements:
169
- - - ">="
169
+ - - '='
170
170
  - !ruby/object:Gem::Version
171
- version: '0'
171
+ version: 2.9.1
172
172
  - !ruby/object:Gem::Dependency
173
- name: openssl
173
+ name: rubocop-rake
174
174
  requirement: !ruby/object:Gem::Requirement
175
175
  requirements:
176
- - - ">="
176
+ - - '='
177
177
  - !ruby/object:Gem::Version
178
- version: '0'
178
+ version: 0.5.1
179
179
  type: :development
180
180
  prerelease: false
181
181
  version_requirements: !ruby/object:Gem::Requirement
182
182
  requirements:
183
- - - ">="
183
+ - - '='
184
184
  - !ruby/object:Gem::Version
185
- version: '0'
185
+ version: 0.5.1
186
186
  - !ruby/object:Gem::Dependency
187
- name: parser
187
+ name: rubocop-rspec
188
188
  requirement: !ruby/object:Gem::Requirement
189
189
  requirements:
190
- - - "~>"
190
+ - - '='
191
191
  - !ruby/object:Gem::Version
192
- version: '2.6'
192
+ version: 2.1.0
193
193
  type: :development
194
194
  prerelease: false
195
195
  version_requirements: !ruby/object:Gem::Requirement
196
196
  requirements:
197
- - - "~>"
197
+ - - '='
198
198
  - !ruby/object:Gem::Version
199
- version: '2.6'
199
+ version: 2.1.0
200
200
  - !ruby/object:Gem::Dependency
201
- name: pry
201
+ name: codecov
202
202
  requirement: !ruby/object:Gem::Requirement
203
203
  requirements:
204
204
  - - ">="
@@ -212,63 +212,63 @@ dependencies:
212
212
  - !ruby/object:Gem::Version
213
213
  version: '0'
214
214
  - !ruby/object:Gem::Dependency
215
- name: rails
215
+ name: simplecov
216
216
  requirement: !ruby/object:Gem::Requirement
217
217
  requirements:
218
- - - ">="
218
+ - - '='
219
219
  - !ruby/object:Gem::Version
220
- version: '3'
220
+ version: 0.20.0
221
221
  type: :development
222
222
  prerelease: false
223
223
  version_requirements: !ruby/object:Gem::Requirement
224
224
  requirements:
225
- - - ">="
225
+ - - '='
226
226
  - !ruby/object:Gem::Version
227
- version: '3'
227
+ version: 0.20.0
228
228
  - !ruby/object:Gem::Dependency
229
- name: rake
229
+ name: rails
230
230
  requirement: !ruby/object:Gem::Requirement
231
231
  requirements:
232
- - - ">="
232
+ - - '='
233
233
  - !ruby/object:Gem::Version
234
- version: 12.3.3
234
+ version: 6.0.3.5
235
235
  type: :development
236
236
  prerelease: false
237
237
  version_requirements: !ruby/object:Gem::Requirement
238
238
  requirements:
239
- - - ">="
239
+ - - '='
240
240
  - !ruby/object:Gem::Version
241
- version: 12.3.3
241
+ version: 6.0.3.5
242
242
  - !ruby/object:Gem::Dependency
243
- name: rake-compiler
243
+ name: sinatra
244
244
  requirement: !ruby/object:Gem::Requirement
245
245
  requirements:
246
- - - "~>"
246
+ - - ">="
247
247
  - !ruby/object:Gem::Version
248
- version: '0'
248
+ version: '2'
249
249
  type: :development
250
250
  prerelease: false
251
251
  version_requirements: !ruby/object:Gem::Requirement
252
252
  requirements:
253
- - - "~>"
253
+ - - ">="
254
254
  - !ruby/object:Gem::Version
255
- version: '0'
255
+ version: '2'
256
256
  - !ruby/object:Gem::Dependency
257
- name: rspec
257
+ name: async
258
258
  requirement: !ruby/object:Gem::Requirement
259
259
  requirements:
260
- - - "~>"
260
+ - - ">="
261
261
  - !ruby/object:Gem::Version
262
- version: '3.0'
262
+ version: '0'
263
263
  type: :development
264
264
  prerelease: false
265
265
  version_requirements: !ruby/object:Gem::Requirement
266
266
  requirements:
267
- - - "~>"
267
+ - - ">="
268
268
  - !ruby/object:Gem::Version
269
- version: '3.0'
269
+ version: '0'
270
270
  - !ruby/object:Gem::Dependency
271
- name: rspec-benchmark
271
+ name: execjs
272
272
  requirement: !ruby/object:Gem::Requirement
273
273
  requirements:
274
274
  - - ">="
@@ -282,91 +282,91 @@ dependencies:
282
282
  - !ruby/object:Gem::Version
283
283
  version: '0'
284
284
  - !ruby/object:Gem::Dependency
285
- name: rspec_junit_formatter
285
+ name: sqlite3
286
286
  requirement: !ruby/object:Gem::Requirement
287
287
  requirements:
288
- - - '='
288
+ - - ">="
289
289
  - !ruby/object:Gem::Version
290
- version: 0.3.0
290
+ version: '0'
291
291
  type: :development
292
292
  prerelease: false
293
293
  version_requirements: !ruby/object:Gem::Requirement
294
294
  requirements:
295
- - - '='
295
+ - - ">="
296
296
  - !ruby/object:Gem::Version
297
- version: 0.3.0
297
+ version: '0'
298
298
  - !ruby/object:Gem::Dependency
299
- name: rubocop
299
+ name: therubyracer
300
300
  requirement: !ruby/object:Gem::Requirement
301
301
  requirements:
302
- - - '='
302
+ - - ">="
303
303
  - !ruby/object:Gem::Version
304
- version: 1.6.1
304
+ version: '0'
305
305
  type: :development
306
306
  prerelease: false
307
307
  version_requirements: !ruby/object:Gem::Requirement
308
308
  requirements:
309
- - - '='
309
+ - - ">="
310
310
  - !ruby/object:Gem::Version
311
- version: 1.6.1
311
+ version: '0'
312
312
  - !ruby/object:Gem::Dependency
313
- name: rubocop-performance
313
+ name: tilt
314
314
  requirement: !ruby/object:Gem::Requirement
315
315
  requirements:
316
- - - '='
316
+ - - ">="
317
317
  - !ruby/object:Gem::Version
318
- version: 1.9.1
318
+ version: '0'
319
319
  type: :development
320
320
  prerelease: false
321
321
  version_requirements: !ruby/object:Gem::Requirement
322
322
  requirements:
323
- - - '='
323
+ - - ">="
324
324
  - !ruby/object:Gem::Version
325
- version: 1.9.1
325
+ version: '0'
326
326
  - !ruby/object:Gem::Dependency
327
- name: rubocop-rails
327
+ name: xpath
328
328
  requirement: !ruby/object:Gem::Requirement
329
329
  requirements:
330
- - - '='
330
+ - - ">="
331
331
  - !ruby/object:Gem::Version
332
- version: 2.9.1
332
+ version: '0'
333
333
  type: :development
334
334
  prerelease: false
335
335
  version_requirements: !ruby/object:Gem::Requirement
336
336
  requirements:
337
- - - '='
337
+ - - ">="
338
338
  - !ruby/object:Gem::Version
339
- version: 2.9.1
339
+ version: '0'
340
340
  - !ruby/object:Gem::Dependency
341
- name: rubocop-rake
341
+ name: benchmark-ips
342
342
  requirement: !ruby/object:Gem::Requirement
343
343
  requirements:
344
- - - '='
344
+ - - ">="
345
345
  - !ruby/object:Gem::Version
346
- version: 0.5.1
346
+ version: '0'
347
347
  type: :development
348
348
  prerelease: false
349
349
  version_requirements: !ruby/object:Gem::Requirement
350
350
  requirements:
351
- - - '='
351
+ - - ">="
352
352
  - !ruby/object:Gem::Version
353
- version: 0.5.1
353
+ version: '0'
354
354
  - !ruby/object:Gem::Dependency
355
- name: rubocop-rspec
355
+ name: climate_control
356
356
  requirement: !ruby/object:Gem::Requirement
357
357
  requirements:
358
- - - '='
358
+ - - ">="
359
359
  - !ruby/object:Gem::Version
360
- version: 2.1.0
360
+ version: '0'
361
361
  type: :development
362
362
  prerelease: false
363
363
  version_requirements: !ruby/object:Gem::Requirement
364
364
  requirements:
365
- - - '='
365
+ - - ">="
366
366
  - !ruby/object:Gem::Version
367
- version: 2.1.0
367
+ version: '0'
368
368
  - !ruby/object:Gem::Dependency
369
- name: ruby-debug-ide
369
+ name: factory_bot
370
370
  requirement: !ruby/object:Gem::Requirement
371
371
  requirements:
372
372
  - - ">="
@@ -380,49 +380,49 @@ dependencies:
380
380
  - !ruby/object:Gem::Version
381
381
  version: '0'
382
382
  - !ruby/object:Gem::Dependency
383
- name: simplecov
383
+ name: fake_ftp
384
384
  requirement: !ruby/object:Gem::Requirement
385
385
  requirements:
386
- - - '='
386
+ - - ">="
387
387
  - !ruby/object:Gem::Version
388
- version: 0.20.0
388
+ version: '0'
389
389
  type: :development
390
390
  prerelease: false
391
391
  version_requirements: !ruby/object:Gem::Requirement
392
392
  requirements:
393
- - - '='
393
+ - - ">="
394
394
  - !ruby/object:Gem::Version
395
- version: 0.20.0
395
+ version: '0'
396
396
  - !ruby/object:Gem::Dependency
397
- name: sinatra
397
+ name: openssl
398
398
  requirement: !ruby/object:Gem::Requirement
399
399
  requirements:
400
400
  - - ">="
401
401
  - !ruby/object:Gem::Version
402
- version: '2'
402
+ version: '0'
403
403
  type: :development
404
404
  prerelease: false
405
405
  version_requirements: !ruby/object:Gem::Requirement
406
406
  requirements:
407
407
  - - ">="
408
408
  - !ruby/object:Gem::Version
409
- version: '2'
409
+ version: '0'
410
410
  - !ruby/object:Gem::Dependency
411
- name: sqlite3
411
+ name: rspec
412
412
  requirement: !ruby/object:Gem::Requirement
413
413
  requirements:
414
- - - '='
414
+ - - "~>"
415
415
  - !ruby/object:Gem::Version
416
- version: 1.3.9
416
+ version: '3.0'
417
417
  type: :development
418
418
  prerelease: false
419
419
  version_requirements: !ruby/object:Gem::Requirement
420
420
  requirements:
421
- - - '='
421
+ - - "~>"
422
422
  - !ruby/object:Gem::Version
423
- version: 1.3.9
423
+ version: '3.0'
424
424
  - !ruby/object:Gem::Dependency
425
- name: therubyracer
425
+ name: rspec-benchmark
426
426
  requirement: !ruby/object:Gem::Requirement
427
427
  requirements:
428
428
  - - ">="
@@ -436,47 +436,47 @@ dependencies:
436
436
  - !ruby/object:Gem::Version
437
437
  version: '0'
438
438
  - !ruby/object:Gem::Dependency
439
- name: tilt
439
+ name: rspec_junit_formatter
440
440
  requirement: !ruby/object:Gem::Requirement
441
441
  requirements:
442
- - - ">="
442
+ - - '='
443
443
  - !ruby/object:Gem::Version
444
- version: '0'
444
+ version: 0.3.0
445
445
  type: :development
446
446
  prerelease: false
447
447
  version_requirements: !ruby/object:Gem::Requirement
448
448
  requirements:
449
- - - ">="
449
+ - - '='
450
450
  - !ruby/object:Gem::Version
451
- version: '0'
451
+ version: 0.3.0
452
452
  - !ruby/object:Gem::Dependency
453
- name: xpath
453
+ name: rspec-rails
454
454
  requirement: !ruby/object:Gem::Requirement
455
455
  requirements:
456
- - - ">="
456
+ - - '='
457
457
  - !ruby/object:Gem::Version
458
- version: '0'
458
+ version: '5.0'
459
459
  type: :development
460
460
  prerelease: false
461
461
  version_requirements: !ruby/object:Gem::Requirement
462
462
  requirements:
463
- - - ">="
463
+ - - '='
464
464
  - !ruby/object:Gem::Version
465
- version: '0'
465
+ version: '5.0'
466
466
  - !ruby/object:Gem::Dependency
467
- name: yarjuf
467
+ name: tzinfo-data
468
468
  requirement: !ruby/object:Gem::Requirement
469
469
  requirements:
470
- - - "~>"
470
+ - - ">="
471
471
  - !ruby/object:Gem::Version
472
- version: '2.0'
472
+ version: '0'
473
473
  type: :development
474
474
  prerelease: false
475
475
  version_requirements: !ruby/object:Gem::Requirement
476
476
  requirements:
477
- - - "~>"
477
+ - - ">="
478
478
  - !ruby/object:Gem::Version
479
- version: '2.0'
479
+ version: '0'
480
480
  - !ruby/object:Gem::Dependency
481
481
  name: ougai
482
482
  requirement: !ruby/object:Gem::Requirement
@@ -541,20 +541,20 @@ executables:
541
541
  - contrast_service
542
542
  extensions:
543
543
  - ext/cs__common/extconf.rb
544
+ - ext/cs__assess_array/extconf.rb
544
545
  - ext/cs__assess_string_interpolation26/extconf.rb
545
- - ext/cs__contrast_patch/extconf.rb
546
- - ext/cs__assess_module/extconf.rb
547
546
  - ext/cs__assess_marshal_module/extconf.rb
548
547
  - ext/cs__assess_hash/extconf.rb
549
- - ext/cs__assess_array/extconf.rb
550
- - ext/cs__assess_basic_object/extconf.rb
551
- - ext/cs__protect_kernel/extconf.rb
548
+ - ext/cs__assess_yield_track/extconf.rb
552
549
  - ext/cs__assess_string/extconf.rb
553
- - ext/cs__assess_active_record_named/extconf.rb
550
+ - ext/cs__protect_kernel/extconf.rb
551
+ - ext/cs__assess_basic_object/extconf.rb
552
+ - ext/cs__contrast_patch/extconf.rb
554
553
  - ext/cs__assess_regexp/extconf.rb
555
- - ext/cs__assess_yield_track/extconf.rb
556
554
  - ext/cs__assess_fiber_track/extconf.rb
557
555
  - ext/cs__assess_kernel/extconf.rb
556
+ - ext/cs__assess_active_record_named/extconf.rb
557
+ - ext/cs__assess_module/extconf.rb
558
558
  extra_rdoc_files: []
559
559
  files:
560
560
  - ".clang-format"
@@ -792,6 +792,7 @@ files:
792
792
  - lib/contrast/agent/assess/policy/trigger/xpath.rb
793
793
  - lib/contrast/agent/assess/policy/trigger_method.rb
794
794
  - lib/contrast/agent/assess/policy/trigger_node.rb
795
+ - lib/contrast/agent/assess/policy/trigger_validation/redos_validator.rb
795
796
  - lib/contrast/agent/assess/policy/trigger_validation/ssrf_validator.rb
796
797
  - lib/contrast/agent/assess/policy/trigger_validation/trigger_validation.rb
797
798
  - lib/contrast/agent/assess/policy/trigger_validation/xss_validator.rb
@@ -799,13 +800,10 @@ files:
799
800
  - lib/contrast/agent/assess/property/evented.rb
800
801
  - lib/contrast/agent/assess/property/tagged.rb
801
802
  - lib/contrast/agent/assess/property/updated.rb
802
- - lib/contrast/agent/assess/rule.rb
803
- - lib/contrast/agent/assess/rule/base.rb
804
803
  - lib/contrast/agent/assess/rule/provider.rb
805
804
  - lib/contrast/agent/assess/rule/provider/hardcoded_key.rb
806
805
  - lib/contrast/agent/assess/rule/provider/hardcoded_password.rb
807
806
  - lib/contrast/agent/assess/rule/provider/hardcoded_value_rule.rb
808
- - lib/contrast/agent/assess/rule/redos.rb
809
807
  - lib/contrast/agent/assess/tag.rb
810
808
  - lib/contrast/agent/assess/tracker.rb
811
809
  - lib/contrast/agent/at_exit_hook.rb
@@ -818,7 +816,6 @@ files:
818
816
  - lib/contrast/agent/inventory/dependencies.rb
819
817
  - lib/contrast/agent/inventory/dependency_analysis.rb
820
818
  - lib/contrast/agent/inventory/dependency_usage_analysis.rb
821
- - lib/contrast/agent/inventory/gemfile_digest_cache.rb
822
819
  - lib/contrast/agent/inventory/policy/datastores.rb
823
820
  - lib/contrast/agent/inventory/policy/policy.rb
824
821
  - lib/contrast/agent/inventory/policy/trigger_node.rb
@@ -892,10 +889,13 @@ files:
892
889
  - lib/contrast/api/communication/unix_socket.rb
893
890
  - lib/contrast/api/decorators.rb
894
891
  - lib/contrast/api/decorators/address.rb
892
+ - lib/contrast/api/decorators/agent_startup.rb
895
893
  - lib/contrast/api/decorators/application_settings.rb
894
+ - lib/contrast/api/decorators/application_startup.rb
896
895
  - lib/contrast/api/decorators/application_update.rb
897
896
  - lib/contrast/api/decorators/http_request.rb
898
897
  - lib/contrast/api/decorators/input_analysis.rb
898
+ - lib/contrast/api/decorators/instrumentation_mode.rb
899
899
  - lib/contrast/api/decorators/library.rb
900
900
  - lib/contrast/api/decorators/library_usage_update.rb
901
901
  - lib/contrast/api/decorators/message.rb
@@ -910,7 +910,6 @@ files:
910
910
  - lib/contrast/api/decorators/user_input.rb
911
911
  - lib/contrast/api/dtm.pb.rb
912
912
  - lib/contrast/api/settings.pb.rb
913
- - lib/contrast/common_agent_configuration.rb
914
913
  - lib/contrast/components/agent.rb
915
914
  - lib/contrast/components/app_context.rb
916
915
  - lib/contrast/components/assess.rb
@@ -944,6 +943,7 @@ files:
944
943
  - lib/contrast/config/server_configuration.rb
945
944
  - lib/contrast/config/service_configuration.rb
946
945
  - lib/contrast/configuration.rb
946
+ - lib/contrast/delegators/input_analysis.rb
947
947
  - lib/contrast/extension/assess.rb
948
948
  - lib/contrast/extension/assess/array.rb
949
949
  - lib/contrast/extension/assess/erb.rb
@@ -978,8 +978,6 @@ files:
978
978
  - lib/contrast/framework/rails/rewrite/active_record_named.rb
979
979
  - lib/contrast/framework/rails/rewrite/active_record_time_zone_inherited.rb
980
980
  - lib/contrast/framework/rails/support.rb
981
- - lib/contrast/framework/sinatra/patch/base.rb
982
- - lib/contrast/framework/sinatra/patch/support.rb
983
981
  - lib/contrast/framework/sinatra/support.rb
984
982
  - lib/contrast/funchook/funchook.rb
985
983
  - lib/contrast/logger/application.rb
@@ -1004,7 +1002,6 @@ files:
1004
1002
  - lib/contrast/utils/object_share.rb
1005
1003
  - lib/contrast/utils/os.rb
1006
1004
  - lib/contrast/utils/preflight_util.rb
1007
- - lib/contrast/utils/prevent_serialization.rb
1008
1005
  - lib/contrast/utils/resource_loader.rb
1009
1006
  - lib/contrast/utils/ruby_ast_rewriter.rb
1010
1007
  - lib/contrast/utils/sha256_builder.rb
@@ -1044,14 +1041,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
1044
1041
  version: 2.5.0
1045
1042
  - - "<"
1046
1043
  - !ruby/object:Gem::Version
1047
- version: 2.8.0
1044
+ version: 3.1.0
1048
1045
  required_rubygems_version: !ruby/object:Gem::Requirement
1049
1046
  requirements:
1050
1047
  - - ">="
1051
1048
  - !ruby/object:Gem::Version
1052
1049
  version: '0'
1053
1050
  requirements: []
1054
- rubygems_version: 3.0.3
1051
+ rubygems_version: 3.1.6
1055
1052
  signing_key:
1056
1053
  specification_version: 4
1057
1054
  summary: Contrast Security's agent for rack-based applications.