contrast-agent 4.4.1 → 4.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (309) 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 +1 -1
  43. data/lib/contrast/agent/assess.rb +1 -1
  44. data/lib/contrast/agent/assess/contrast_event.rb +54 -69
  45. data/lib/contrast/agent/assess/contrast_object.rb +1 -1
  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 +26 -34
  50. data/lib/contrast/agent/assess/policy/dynamic_source_factory.rb +20 -19
  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 +2 -6
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  74. data/lib/contrast/agent/assess/policy/propagator/split.rb +1 -1
  75. data/lib/contrast/agent/assess/policy/propagator/substitution.rb +1 -1
  76. data/lib/contrast/agent/assess/policy/propagator/trim.rb +1 -1
  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 +99 -62
  85. data/lib/contrast/agent/assess/policy/trigger_node.rb +3 -3
  86. data/lib/contrast/agent/assess/policy/trigger_validation/redos_validator.rb +1 -1
  87. data/lib/contrast/agent/assess/policy/trigger_validation/ssrf_validator.rb +1 -1
  88. data/lib/contrast/agent/assess/policy/trigger_validation/trigger_validation.rb +1 -1
  89. data/lib/contrast/agent/assess/policy/trigger_validation/xss_validator.rb +1 -1
  90. data/lib/contrast/agent/assess/properties.rb +1 -1
  91. data/lib/contrast/agent/assess/property/evented.rb +1 -1
  92. data/lib/contrast/agent/assess/property/tagged.rb +1 -1
  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 +1 -1
  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 +1 -1
  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 +8 -9
  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 +1 -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 +8 -6
  120. data/lib/contrast/agent/patching/policy/patch_status.rb +1 -1
  121. data/lib/contrast/agent/patching/policy/patcher.rb +8 -10
  122. data/lib/contrast/agent/patching/policy/policy.rb +1 -1
  123. data/lib/contrast/agent/patching/policy/policy_node.rb +1 -1
  124. data/lib/contrast/agent/patching/policy/trigger_node.rb +1 -1
  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 +2 -2
  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 +5 -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 +1 -1
  165. data/lib/contrast/agent/thread_watcher.rb +1 -1
  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 +1 -1
  173. data/lib/contrast/api/communication/response_processor.rb +1 -1
  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 +1 -1
  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 +1 -1
  181. data/lib/contrast/api/decorators/address.rb +1 -1
  182. data/lib/contrast/api/decorators/agent_startup.rb +1 -1
  183. data/lib/contrast/api/decorators/application_settings.rb +1 -1
  184. data/lib/contrast/api/decorators/application_startup.rb +4 -2
  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 +1 -1
  194. data/lib/contrast/api/decorators/server_features.rb +1 -1
  195. data/lib/contrast/api/decorators/trace_event.rb +1 -1
  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/common_agent_configuration.rb +1 -1
  202. data/lib/contrast/components/agent.rb +1 -1
  203. data/lib/contrast/components/app_context.rb +1 -1
  204. data/lib/contrast/components/assess.rb +1 -1
  205. data/lib/contrast/components/config.rb +1 -1
  206. data/lib/contrast/components/contrast_service.rb +1 -1
  207. data/lib/contrast/components/heap_dump.rb +1 -1
  208. data/lib/contrast/components/interface.rb +1 -1
  209. data/lib/contrast/components/inventory.rb +1 -1
  210. data/lib/contrast/components/logger.rb +1 -1
  211. data/lib/contrast/components/protect.rb +4 -2
  212. data/lib/contrast/components/sampling.rb +1 -1
  213. data/lib/contrast/components/scope.rb +1 -1
  214. data/lib/contrast/components/settings.rb +2 -2
  215. data/lib/contrast/config.rb +1 -1
  216. data/lib/contrast/config/agent_configuration.rb +1 -1
  217. data/lib/contrast/config/application_configuration.rb +1 -1
  218. data/lib/contrast/config/assess_configuration.rb +1 -1
  219. data/lib/contrast/config/assess_rules_configuration.rb +1 -1
  220. data/lib/contrast/config/base_configuration.rb +1 -1
  221. data/lib/contrast/config/default_value.rb +1 -1
  222. data/lib/contrast/config/exception_configuration.rb +1 -1
  223. data/lib/contrast/config/heap_dump_configuration.rb +1 -1
  224. data/lib/contrast/config/inventory_configuration.rb +1 -1
  225. data/lib/contrast/config/logger_configuration.rb +1 -1
  226. data/lib/contrast/config/protect_configuration.rb +1 -1
  227. data/lib/contrast/config/protect_rule_configuration.rb +23 -1
  228. data/lib/contrast/config/protect_rules_configuration.rb +1 -1
  229. data/lib/contrast/config/root_configuration.rb +1 -1
  230. data/lib/contrast/config/ruby_configuration.rb +1 -1
  231. data/lib/contrast/config/sampling_configuration.rb +1 -1
  232. data/lib/contrast/config/server_configuration.rb +1 -1
  233. data/lib/contrast/config/service_configuration.rb +1 -1
  234. data/lib/contrast/configuration.rb +1 -1
  235. data/lib/contrast/delegators/input_analysis.rb +12 -0
  236. data/lib/contrast/extension/assess.rb +1 -1
  237. data/lib/contrast/extension/assess/array.rb +1 -1
  238. data/lib/contrast/extension/assess/erb.rb +1 -1
  239. data/lib/contrast/extension/assess/eval_trigger.rb +1 -5
  240. data/lib/contrast/extension/assess/exec_trigger.rb +1 -5
  241. data/lib/contrast/extension/assess/fiber.rb +1 -1
  242. data/lib/contrast/extension/assess/hash.rb +1 -1
  243. data/lib/contrast/extension/assess/kernel.rb +1 -1
  244. data/lib/contrast/extension/assess/marshal.rb +1 -5
  245. data/lib/contrast/extension/assess/regexp.rb +1 -1
  246. data/lib/contrast/extension/assess/string.rb +1 -1
  247. data/lib/contrast/extension/delegator.rb +1 -1
  248. data/lib/contrast/extension/inventory.rb +1 -1
  249. data/lib/contrast/extension/kernel.rb +1 -1
  250. data/lib/contrast/extension/module.rb +1 -1
  251. data/lib/contrast/extension/protect.rb +1 -1
  252. data/lib/contrast/extension/protect/kernel.rb +1 -1
  253. data/lib/contrast/extension/protect/psych.rb +1 -1
  254. data/lib/contrast/extension/thread.rb +1 -1
  255. data/lib/contrast/framework/base_support.rb +1 -1
  256. data/lib/contrast/framework/manager.rb +3 -3
  257. data/lib/contrast/framework/platform_version.rb +1 -1
  258. data/lib/contrast/framework/rack/patch/session_cookie.rb +1 -1
  259. data/lib/contrast/framework/rack/patch/support.rb +1 -1
  260. data/lib/contrast/framework/rack/support.rb +1 -1
  261. data/lib/contrast/framework/rails/patch/action_controller_live_buffer.rb +1 -1
  262. data/lib/contrast/framework/rails/patch/assess_configuration.rb +1 -1
  263. data/lib/contrast/framework/rails/patch/rails_application_configuration.rb +4 -4
  264. data/lib/contrast/framework/rails/patch/support.rb +1 -1
  265. data/lib/contrast/framework/rails/rewrite/action_controller_railties_helper_inherited.rb +1 -1
  266. data/lib/contrast/framework/rails/rewrite/active_record_attribute_methods_read.rb +1 -1
  267. data/lib/contrast/framework/rails/rewrite/active_record_named.rb +1 -1
  268. data/lib/contrast/framework/rails/rewrite/active_record_time_zone_inherited.rb +1 -1
  269. data/lib/contrast/framework/rails/support.rb +1 -1
  270. data/lib/contrast/framework/sinatra/support.rb +1 -1
  271. data/lib/contrast/funchook/funchook.rb +1 -1
  272. data/lib/contrast/logger/application.rb +1 -1
  273. data/lib/contrast/logger/format.rb +1 -1
  274. data/lib/contrast/logger/log.rb +1 -1
  275. data/lib/contrast/logger/request.rb +1 -1
  276. data/lib/contrast/logger/time.rb +1 -1
  277. data/lib/contrast/security_exception.rb +1 -1
  278. data/lib/contrast/tasks/config.rb +1 -1
  279. data/lib/contrast/tasks/service.rb +1 -1
  280. data/lib/contrast/utils/assess/sampling_util.rb +1 -1
  281. data/lib/contrast/utils/assess/tracking_util.rb +1 -1
  282. data/lib/contrast/utils/class_util.rb +15 -3
  283. data/lib/contrast/utils/duck_utils.rb +1 -1
  284. data/lib/contrast/utils/env_configuration_item.rb +1 -1
  285. data/lib/contrast/utils/hash_digest.rb +14 -19
  286. data/lib/contrast/utils/heap_dump_util.rb +1 -1
  287. data/lib/contrast/utils/invalid_configuration_util.rb +1 -1
  288. data/lib/contrast/utils/inventory_util.rb +1 -1
  289. data/lib/contrast/utils/io_util.rb +1 -1
  290. data/lib/contrast/utils/job_servers_running.rb +1 -1
  291. data/lib/contrast/utils/object_share.rb +1 -1
  292. data/lib/contrast/utils/os.rb +1 -1
  293. data/lib/contrast/utils/preflight_util.rb +1 -1
  294. data/lib/contrast/utils/resource_loader.rb +1 -1
  295. data/lib/contrast/utils/ruby_ast_rewriter.rb +1 -1
  296. data/lib/contrast/utils/sha256_builder.rb +1 -1
  297. data/lib/contrast/utils/stack_trace_utils.rb +1 -1
  298. data/lib/contrast/utils/string_utils.rb +1 -1
  299. data/lib/contrast/utils/tag_util.rb +1 -1
  300. data/lib/contrast/utils/thread_tracker.rb +1 -1
  301. data/lib/contrast/utils/timer.rb +1 -1
  302. data/resources/assess/policy.json +5 -2
  303. data/resources/deadzone/policy.json +7 -17
  304. data/ruby-agent.gemspec +4 -5
  305. data/service_executables/VERSION +1 -1
  306. data/service_executables/linux/contrast-service +0 -0
  307. data/service_executables/mac/contrast-service +0 -0
  308. metadata +20 -33
  309. data/lib/contrast/agent/inventory/gemfile_digest_cache.rb +0 -38
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'
@@ -41,7 +41,7 @@ end
41
41
 
42
42
  # Dependencies used for framework testing.
43
43
  def self.add_frameworks spec
44
- spec.add_development_dependency 'rails', '>= 3'
44
+ spec.add_development_dependency 'rails', '6.0.3.5'
45
45
  spec.add_development_dependency 'sinatra', '>= 2'
46
46
  end
47
47
 
@@ -85,9 +85,8 @@ end
85
85
 
86
86
  # Dependencies not mocked out during RSpec that we test real code of, beyond just frameworks.
87
87
  def self.add_tested_gems spec
88
- spec.add_development_dependency 'debase'
89
88
  spec.add_development_dependency 'execjs'
90
- spec.add_development_dependency 'sqlite3', '1.3.9'
89
+ spec.add_development_dependency 'sqlite3'
91
90
  spec.add_development_dependency 'therubyracer'
92
91
  spec.add_development_dependency 'tilt'
93
92
  spec.add_development_dependency 'xpath'
@@ -162,7 +161,7 @@ Gem::Specification.new do |spec|
162
161
  'Testing and Protection.'
163
162
  spec.homepage = 'https://www.contrastsecurity.com'
164
163
  spec.license = 'CONTRAST SECURITY (see license file)'
165
- spec.required_ruby_version = ['>= 2.5.0', '< 2.8.0']
164
+ spec.required_ruby_version = ['>= 2.5.0', '< 3.1.0']
166
165
 
167
166
  spec.bindir = 'exe'
168
167
  spec.executables = ['contrast_service']
@@ -1 +1 @@
1
- 2.17.4
1
+ 2.18.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.4.1
4
+ version: 4.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - galen.palmer@contrastsecurity.com
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: exe
15
15
  cert_chain: []
16
- date: 2021-03-10 00:00:00.000000000 Z
16
+ date: 2021-03-25 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: bundler
@@ -229,16 +229,16 @@ dependencies:
229
229
  name: rails
230
230
  requirement: !ruby/object:Gem::Requirement
231
231
  requirements:
232
- - - ">="
232
+ - - '='
233
233
  - !ruby/object:Gem::Version
234
- version: '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: '3'
241
+ version: 6.0.3.5
242
242
  - !ruby/object:Gem::Dependency
243
243
  name: sinatra
244
244
  requirement: !ruby/object:Gem::Requirement
@@ -254,7 +254,7 @@ dependencies:
254
254
  - !ruby/object:Gem::Version
255
255
  version: '2'
256
256
  - !ruby/object:Gem::Dependency
257
- name: debase
257
+ name: execjs
258
258
  requirement: !ruby/object:Gem::Requirement
259
259
  requirements:
260
260
  - - ">="
@@ -268,7 +268,7 @@ dependencies:
268
268
  - !ruby/object:Gem::Version
269
269
  version: '0'
270
270
  - !ruby/object:Gem::Dependency
271
- name: execjs
271
+ name: sqlite3
272
272
  requirement: !ruby/object:Gem::Requirement
273
273
  requirements:
274
274
  - - ">="
@@ -281,20 +281,6 @@ dependencies:
281
281
  - - ">="
282
282
  - !ruby/object:Gem::Version
283
283
  version: '0'
284
- - !ruby/object:Gem::Dependency
285
- name: sqlite3
286
- requirement: !ruby/object:Gem::Requirement
287
- requirements:
288
- - - '='
289
- - !ruby/object:Gem::Version
290
- version: 1.3.9
291
- type: :development
292
- prerelease: false
293
- version_requirements: !ruby/object:Gem::Requirement
294
- requirements:
295
- - - '='
296
- - !ruby/object:Gem::Version
297
- version: 1.3.9
298
284
  - !ruby/object:Gem::Dependency
299
285
  name: therubyracer
300
286
  requirement: !ruby/object:Gem::Requirement
@@ -513,20 +499,20 @@ executables:
513
499
  - contrast_service
514
500
  extensions:
515
501
  - ext/cs__common/extconf.rb
516
- - ext/cs__assess_basic_object/extconf.rb
502
+ - ext/cs__contrast_patch/extconf.rb
517
503
  - ext/cs__assess_string_interpolation26/extconf.rb
518
- - ext/cs__assess_array/extconf.rb
504
+ - ext/cs__assess_hash/extconf.rb
519
505
  - ext/cs__protect_kernel/extconf.rb
506
+ - ext/cs__assess_fiber_track/extconf.rb
507
+ - ext/cs__assess_array/extconf.rb
508
+ - ext/cs__assess_active_record_named/extconf.rb
509
+ - ext/cs__assess_string/extconf.rb
520
510
  - ext/cs__assess_kernel/extconf.rb
521
511
  - ext/cs__assess_module/extconf.rb
522
- - ext/cs__assess_string/extconf.rb
523
- - ext/cs__assess_active_record_named/extconf.rb
512
+ - ext/cs__assess_basic_object/extconf.rb
513
+ - ext/cs__assess_marshal_module/extconf.rb
524
514
  - ext/cs__assess_yield_track/extconf.rb
525
- - ext/cs__contrast_patch/extconf.rb
526
- - ext/cs__assess_hash/extconf.rb
527
515
  - ext/cs__assess_regexp/extconf.rb
528
- - ext/cs__assess_marshal_module/extconf.rb
529
- - ext/cs__assess_fiber_track/extconf.rb
530
516
  extra_rdoc_files: []
531
517
  files:
532
518
  - ".clang-format"
@@ -788,7 +774,6 @@ files:
788
774
  - lib/contrast/agent/inventory/dependencies.rb
789
775
  - lib/contrast/agent/inventory/dependency_analysis.rb
790
776
  - lib/contrast/agent/inventory/dependency_usage_analysis.rb
791
- - lib/contrast/agent/inventory/gemfile_digest_cache.rb
792
777
  - lib/contrast/agent/inventory/policy/datastores.rb
793
778
  - lib/contrast/agent/inventory/policy/policy.rb
794
779
  - lib/contrast/agent/inventory/policy/trigger_node.rb
@@ -868,6 +853,7 @@ files:
868
853
  - lib/contrast/api/decorators/application_update.rb
869
854
  - lib/contrast/api/decorators/http_request.rb
870
855
  - lib/contrast/api/decorators/input_analysis.rb
856
+ - lib/contrast/api/decorators/instrumentation_mode.rb
871
857
  - lib/contrast/api/decorators/library.rb
872
858
  - lib/contrast/api/decorators/library_usage_update.rb
873
859
  - lib/contrast/api/decorators/message.rb
@@ -916,6 +902,7 @@ files:
916
902
  - lib/contrast/config/server_configuration.rb
917
903
  - lib/contrast/config/service_configuration.rb
918
904
  - lib/contrast/configuration.rb
905
+ - lib/contrast/delegators/input_analysis.rb
919
906
  - lib/contrast/extension/assess.rb
920
907
  - lib/contrast/extension/assess/array.rb
921
908
  - lib/contrast/extension/assess/erb.rb
@@ -1013,14 +1000,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
1013
1000
  version: 2.5.0
1014
1001
  - - "<"
1015
1002
  - !ruby/object:Gem::Version
1016
- version: 2.8.0
1003
+ version: 3.1.0
1017
1004
  required_rubygems_version: !ruby/object:Gem::Requirement
1018
1005
  requirements:
1019
1006
  - - ">="
1020
1007
  - !ruby/object:Gem::Version
1021
1008
  version: '0'
1022
1009
  requirements: []
1023
- rubygems_version: 3.0.3
1010
+ rubygems_version: 3.1.4
1024
1011
  signing_key:
1025
1012
  specification_version: 4
1026
1013
  summary: Contrast Security's agent for rack-based applications.
@@ -1,38 +0,0 @@
1
- # Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
- # frozen_string_literal: true
3
-
4
- module Contrast
5
- module Agent
6
- module Inventory
7
- # Keeps a map of gem digest to files for reporting file usage
8
- class GemfileDigestCache
9
- extend Forwardable
10
- def_delegator :@gem_spec_digest_to_files,
11
- :empty?
12
-
13
- def initialize
14
- @gem_spec_digest_to_files = {}
15
- end
16
-
17
- def generate_usage_data activity
18
- return unless activity
19
-
20
- @gem_spec_digest_to_files.each_pair do |digest, files|
21
- usage = Contrast::Api::Dtm::LibraryUsageUpdate.build(digest, files)
22
- activity.library_usages[usage.hash_code] = usage if activity
23
- end
24
- @gem_spec_digest_to_files.clear
25
- end
26
-
27
- def use_cache digest
28
- yield get(digest)
29
- end
30
-
31
- def get digest
32
- @gem_spec_digest_to_files[digest] = Set.new unless @gem_spec_digest_to_files.key?(digest)
33
- @gem_spec_digest_to_files[digest]
34
- end
35
- end
36
- end
37
- end
38
- end