contrast-agent 5.2.0 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (228) hide show
  1. checksums.yaml +4 -4
  2. data/ext/cs__assess_array/cs__assess_array.c +7 -0
  3. data/ext/cs__assess_basic_object/cs__assess_basic_object.c +19 -5
  4. data/ext/cs__assess_fiber_track/cs__assess_fiber_track.c +1 -1
  5. data/ext/cs__assess_hash/cs__assess_hash.c +3 -4
  6. data/ext/cs__assess_kernel/cs__assess_kernel.c +1 -2
  7. data/ext/cs__assess_marshal_module/cs__assess_marshal_module.c +26 -12
  8. data/ext/cs__assess_module/cs__assess_module.c +1 -1
  9. data/ext/cs__assess_regexp/cs__assess_regexp.c +15 -2
  10. data/ext/cs__assess_regexp/cs__assess_regexp.h +2 -0
  11. data/ext/cs__assess_string/cs__assess_string.c +21 -1
  12. data/ext/cs__assess_test/cs__assess_test.h +9 -0
  13. data/ext/cs__assess_test/cs__assess_tests.c +22 -0
  14. data/ext/cs__assess_test/extconf.rb +5 -0
  15. data/ext/cs__common/cs__common.c +113 -11
  16. data/ext/cs__common/cs__common.h +29 -5
  17. data/ext/cs__contrast_patch/cs__contrast_patch.c +55 -44
  18. data/ext/cs__os_information/cs__os_information.c +13 -10
  19. data/ext/cs__scope/cs__scope.c +146 -97
  20. data/ext/cs__tests/cs__tests.c +12 -0
  21. data/ext/cs__tests/cs__tests.h +3 -0
  22. data/ext/cs__tests/extconf.rb +5 -0
  23. data/lib/contrast/agent/assess/contrast_object.rb +16 -16
  24. data/lib/contrast/agent/assess/events/source_event.rb +17 -19
  25. data/lib/contrast/agent/assess/finalizers/hash.rb +2 -0
  26. data/lib/contrast/agent/assess/policy/policy_node.rb +50 -27
  27. data/lib/contrast/agent/assess/policy/policy_node_utils.rb +51 -0
  28. data/lib/contrast/agent/assess/policy/policy_scanner.rb +2 -16
  29. data/lib/contrast/agent/assess/policy/preshift.rb +8 -2
  30. data/lib/contrast/agent/assess/policy/propagation_method.rb +47 -13
  31. data/lib/contrast/agent/assess/policy/propagator/buffer.rb +118 -0
  32. data/lib/contrast/agent/assess/policy/propagator/keep.rb +19 -4
  33. data/lib/contrast/agent/assess/policy/propagator/remove.rb +18 -2
  34. data/lib/contrast/agent/assess/policy/propagator/splat.rb +17 -3
  35. data/lib/contrast/agent/assess/policy/propagator/split.rb +15 -19
  36. data/lib/contrast/agent/assess/policy/propagator/substitution.rb +1 -1
  37. data/lib/contrast/agent/assess/policy/propagator/substitution_utils.rb +1 -1
  38. data/lib/contrast/agent/assess/policy/propagator/trim.rb +1 -1
  39. data/lib/contrast/agent/assess/policy/propagator.rb +1 -0
  40. data/lib/contrast/agent/assess/policy/source_method.rb +7 -7
  41. data/lib/contrast/agent/assess/policy/trigger_method.rb +4 -10
  42. data/lib/contrast/agent/assess/property/tagged.rb +1 -1
  43. data/lib/contrast/agent/assess/rule/provider/hardcoded_value_rule.rb +7 -2
  44. data/lib/contrast/agent/assess/rule/response/auto_complete_rule.rb +1 -1
  45. data/lib/contrast/agent/assess/rule/response/base_rule.rb +11 -3
  46. data/lib/contrast/agent/assess/rule/response/body_rule.rb +3 -3
  47. data/lib/contrast/agent/assess/rule/response/cache_control_header_rule.rb +60 -36
  48. data/lib/contrast/agent/assess/rule/response/framework/rails_support.rb +3 -3
  49. data/lib/contrast/agent/assess/rule/response/parameters_pollution_rule.rb +1 -1
  50. data/lib/contrast/agent/assess/rule/response/x_xss_protection_header_rule.rb +1 -2
  51. data/lib/contrast/agent/at_exit_hook.rb +1 -1
  52. data/lib/contrast/agent/deadzone/policy/deadzone_node.rb +0 -7
  53. data/lib/contrast/agent/deadzone/policy/policy.rb +0 -6
  54. data/lib/contrast/agent/exclusion_matcher.rb +3 -3
  55. data/lib/contrast/agent/inventory/database_config.rb +10 -3
  56. data/lib/contrast/agent/middleware.rb +5 -3
  57. data/lib/contrast/agent/patching/policy/after_load_patch.rb +0 -2
  58. data/lib/contrast/agent/patching/policy/patch.rb +13 -12
  59. data/lib/contrast/agent/patching/policy/patcher.rb +4 -4
  60. data/lib/contrast/agent/patching/policy/policy_node.rb +15 -2
  61. data/lib/contrast/agent/protect/exploitable_collection.rb +38 -0
  62. data/lib/contrast/agent/protect/input_analyzer/input_analyzer.rb +66 -9
  63. data/lib/contrast/agent/protect/policy/applies_no_sqli_rule.rb +2 -1
  64. data/lib/contrast/agent/protect/policy/applies_path_traversal_rule.rb +2 -2
  65. data/lib/contrast/agent/protect/rule/base.rb +37 -5
  66. data/lib/contrast/agent/protect/rule/base_service.rb +3 -1
  67. data/lib/contrast/agent/protect/rule/cmd_injection.rb +13 -0
  68. data/lib/contrast/agent/protect/rule/cmdi/cmdi_input_classification.rb +83 -0
  69. data/lib/contrast/agent/protect/rule/cmdi/cmdi_worth_watching.rb +64 -0
  70. data/lib/contrast/agent/protect/rule/http_method_tampering/http_method_tampering_input_classification.rb +96 -0
  71. data/lib/contrast/agent/protect/rule/http_method_tampering.rb +8 -0
  72. data/lib/contrast/agent/protect/rule/no_sqli/no_sqli_input_classification.rb +231 -0
  73. data/lib/contrast/agent/protect/rule/no_sqli.rb +27 -0
  74. data/lib/contrast/agent/protect/rule/sqli/sqli_input_classification.rb +18 -54
  75. data/lib/contrast/agent/protect/rule/sqli/sqli_worth_watching.rb +1 -4
  76. data/lib/contrast/agent/protect/rule/unsafe_file_upload/unsafe_file_upload_input_classification.rb +82 -0
  77. data/lib/contrast/agent/protect/rule/unsafe_file_upload/unsafe_file_upload_matcher.rb +45 -0
  78. data/lib/contrast/agent/protect/rule/unsafe_file_upload.rb +42 -0
  79. data/lib/contrast/agent/reporting/attack_result/attack_result.rb +63 -0
  80. data/lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb +52 -0
  81. data/lib/contrast/agent/reporting/attack_result/response_type.rb +29 -0
  82. data/lib/contrast/agent/reporting/attack_result/user_input.rb +87 -0
  83. data/lib/contrast/agent/reporting/masker/masker.rb +243 -0
  84. data/lib/contrast/agent/reporting/masker/masker_utils.rb +62 -0
  85. data/lib/contrast/agent/reporting/report.rb +2 -0
  86. data/lib/contrast/agent/reporting/reporter.rb +29 -22
  87. data/lib/contrast/agent/reporting/reporter_heartbeat.rb +49 -0
  88. data/lib/contrast/agent/reporting/reporting_events/agent_startup.rb +34 -0
  89. data/lib/contrast/agent/reporting/reporting_events/application_activity.rb +53 -0
  90. data/lib/contrast/agent/reporting/reporting_events/application_defend_activity.rb +48 -0
  91. data/lib/contrast/agent/reporting/reporting_events/application_defend_attack_activity.rb +64 -0
  92. data/lib/contrast/agent/reporting/reporting_events/application_defend_attack_sample.rb +70 -0
  93. data/lib/contrast/agent/reporting/reporting_events/application_defend_attack_sample_activity.rb +57 -0
  94. data/lib/contrast/agent/reporting/reporting_events/application_defend_attacker_activity.rb +56 -0
  95. data/lib/contrast/agent/reporting/reporting_events/application_inventory.rb +12 -4
  96. data/lib/contrast/agent/reporting/reporting_events/application_inventory_activity.rb +58 -0
  97. data/lib/contrast/agent/reporting/reporting_events/application_reporting_event.rb +27 -0
  98. data/lib/contrast/agent/reporting/reporting_events/application_startup.rb +50 -0
  99. data/lib/contrast/agent/reporting/reporting_events/application_startup_instrumentation.rb +27 -0
  100. data/lib/contrast/agent/reporting/reporting_events/application_update.rb +7 -12
  101. data/lib/contrast/agent/reporting/reporting_events/finding.rb +10 -4
  102. data/lib/contrast/agent/reporting/reporting_events/finding_event.rb +2 -4
  103. data/lib/contrast/agent/reporting/reporting_events/finding_event_object.rb +3 -3
  104. data/lib/contrast/agent/reporting/reporting_events/library_usage_observation.rb +5 -5
  105. data/lib/contrast/agent/reporting/reporting_events/observed_library_usage.rb +6 -2
  106. data/lib/contrast/agent/reporting/reporting_events/observed_route.rb +16 -12
  107. data/lib/contrast/agent/reporting/reporting_events/poll.rb +6 -2
  108. data/lib/contrast/agent/reporting/reporting_events/preflight.rb +10 -8
  109. data/lib/contrast/agent/reporting/reporting_events/preflight_message.rb +8 -11
  110. data/lib/contrast/agent/reporting/reporting_events/reporting_event.rb +2 -1
  111. data/lib/contrast/agent/reporting/reporting_events/route_coverage.rb +8 -6
  112. data/lib/contrast/agent/reporting/reporting_events/server_activity.rb +12 -20
  113. data/lib/contrast/agent/reporting/reporting_events/server_reporting_event.rb +27 -0
  114. data/lib/contrast/agent/reporting/reporting_utilities/audit.rb +17 -27
  115. data/lib/contrast/agent/reporting/reporting_utilities/build_preflight.rb +38 -0
  116. data/lib/contrast/agent/reporting/reporting_utilities/dtm_message.rb +8 -0
  117. data/lib/contrast/agent/reporting/reporting_utilities/endpoints.rb +6 -0
  118. data/lib/contrast/agent/reporting/reporting_utilities/reporter_client.rb +23 -7
  119. data/lib/contrast/agent/reporting/reporting_utilities/reporter_client_utils.rb +64 -76
  120. data/lib/contrast/agent/reporting/reporting_utilities/reporting_storage.rb +1 -1
  121. data/lib/contrast/agent/reporting/reporting_utilities/response.rb +17 -7
  122. data/lib/contrast/agent/reporting/reporting_utilities/response_extractor.rb +100 -0
  123. data/lib/contrast/agent/reporting/reporting_utilities/response_handler.rb +75 -13
  124. data/lib/contrast/agent/reporting/reporting_utilities/response_handler_mode.rb +63 -0
  125. data/lib/contrast/agent/reporting/reporting_utilities/response_handler_utils.rb +154 -113
  126. data/lib/contrast/agent/reporting/settings/application_settings.rb +9 -0
  127. data/lib/contrast/agent/reporting/settings/assess_server_feature.rb +5 -33
  128. data/lib/contrast/agent/reporting/settings/protect.rb +1 -1
  129. data/lib/contrast/agent/reporting/settings/protect_server_feature.rb +2 -2
  130. data/lib/contrast/agent/reporting/settings/sampling.rb +36 -0
  131. data/lib/contrast/agent/reporting/settings/sensitive_data_masking.rb +110 -0
  132. data/lib/contrast/agent/reporting/settings/sensitive_data_masking_rule.rb +58 -0
  133. data/lib/contrast/agent/request.rb +3 -3
  134. data/lib/contrast/agent/request_context.rb +1 -1
  135. data/lib/contrast/agent/request_context_extend.rb +2 -2
  136. data/lib/contrast/agent/request_handler.rb +7 -3
  137. data/lib/contrast/agent/response.rb +2 -0
  138. data/lib/contrast/agent/service_heartbeat.rb +6 -48
  139. data/lib/contrast/agent/static_analysis.rb +1 -1
  140. data/lib/contrast/agent/telemetry/base.rb +151 -0
  141. data/lib/contrast/agent/telemetry/events/event.rb +35 -0
  142. data/lib/contrast/agent/telemetry/events/exceptions/telemetry_exception_base.rb +59 -0
  143. data/lib/contrast/agent/telemetry/events/exceptions/telemetry_exception_event.rb +44 -0
  144. data/lib/contrast/agent/telemetry/events/exceptions/telemetry_exception_message.rb +115 -0
  145. data/lib/contrast/agent/telemetry/events/exceptions/telemetry_exception_message_exception.rb +83 -0
  146. data/lib/contrast/agent/telemetry/events/exceptions/telemetry_exception_stack_frame.rb +64 -0
  147. data/lib/contrast/agent/telemetry/events/exceptions/telemetry_exceptions.rb +20 -0
  148. data/lib/contrast/agent/telemetry/events/exceptions/telemetry_exceptions_report.rb +32 -0
  149. data/lib/contrast/agent/telemetry/events/metric_event.rb +28 -0
  150. data/lib/contrast/agent/telemetry/events/startup_metrics_event.rb +123 -0
  151. data/lib/contrast/agent/thread_watcher.rb +52 -68
  152. data/lib/contrast/agent/version.rb +1 -1
  153. data/lib/contrast/agent/worker_thread.rb +8 -0
  154. data/lib/contrast/agent.rb +4 -3
  155. data/lib/contrast/api/communication/messaging_queue.rb +28 -11
  156. data/lib/contrast/api/communication/response_processor.rb +7 -10
  157. data/lib/contrast/api/communication/speedracer.rb +1 -1
  158. data/lib/contrast/api/decorators/activity.rb +33 -0
  159. data/lib/contrast/api/decorators/address.rb +1 -1
  160. data/lib/contrast/api/decorators/http_request.rb +1 -1
  161. data/lib/contrast/api/decorators/response_type.rb +30 -0
  162. data/lib/contrast/api/decorators.rb +1 -0
  163. data/lib/contrast/components/app_context.rb +0 -4
  164. data/lib/contrast/components/assess.rb +14 -0
  165. data/lib/contrast/components/config.rb +13 -22
  166. data/lib/contrast/components/contrast_service.rb +9 -0
  167. data/lib/contrast/components/protect.rb +2 -2
  168. data/lib/contrast/components/sampling.rb +7 -11
  169. data/lib/contrast/components/settings.rb +116 -8
  170. data/lib/contrast/config/agent_configuration.rb +34 -41
  171. data/lib/contrast/config/api_configuration.rb +16 -75
  172. data/lib/contrast/config/api_proxy_configuration.rb +9 -48
  173. data/lib/contrast/config/application_configuration.rb +24 -95
  174. data/lib/contrast/config/assess_configuration.rb +21 -76
  175. data/lib/contrast/config/assess_rules_configuration.rb +13 -38
  176. data/lib/contrast/config/base_configuration.rb +11 -76
  177. data/lib/contrast/config/certification_configuration.rb +15 -68
  178. data/lib/contrast/config/exception_configuration.rb +15 -59
  179. data/lib/contrast/config/heap_dump_configuration.rb +19 -73
  180. data/lib/contrast/config/inventory_configuration.rb +11 -55
  181. data/lib/contrast/config/logger_configuration.rb +8 -41
  182. data/lib/contrast/config/protect_configuration.rb +23 -10
  183. data/lib/contrast/config/protect_rule_configuration.rb +23 -37
  184. data/lib/contrast/config/protect_rules_configuration.rb +39 -43
  185. data/lib/contrast/config/request_audit_configuration.rb +16 -55
  186. data/lib/contrast/config/root_configuration.rb +70 -13
  187. data/lib/contrast/config/ruby_configuration.rb +14 -47
  188. data/lib/contrast/config/sampling_configuration.rb +12 -65
  189. data/lib/contrast/config/server_configuration.rb +13 -45
  190. data/lib/contrast/config/service_configuration.rb +36 -17
  191. data/lib/contrast/configuration.rb +21 -13
  192. data/lib/contrast/extension/assess/string.rb +20 -1
  193. data/lib/contrast/extension/module.rb +0 -1
  194. data/lib/contrast/framework/manager.rb +2 -2
  195. data/lib/contrast/framework/rails/patch/support.rb +13 -45
  196. data/lib/contrast/logger/aliased_logging.rb +87 -0
  197. data/lib/contrast/logger/application.rb +1 -5
  198. data/lib/contrast/logger/cef_log.rb +1 -1
  199. data/lib/contrast/tasks/config.rb +100 -4
  200. data/lib/contrast/utils/assess/object_store.rb +36 -0
  201. data/lib/contrast/utils/assess/propagation_method_utils.rb +6 -0
  202. data/lib/contrast/utils/class_util.rb +5 -18
  203. data/lib/contrast/utils/input_classification.rb +73 -0
  204. data/lib/contrast/utils/invalid_configuration_util.rb +1 -1
  205. data/lib/contrast/utils/log_utils.rb +3 -1
  206. data/lib/contrast/utils/middleware_utils.rb +10 -9
  207. data/lib/contrast/utils/net_http_base.rb +1 -1
  208. data/lib/contrast/utils/object_share.rb +2 -1
  209. data/lib/contrast/utils/os.rb +0 -5
  210. data/lib/contrast/utils/patching/policy/patch_utils.rb +4 -5
  211. data/lib/contrast/utils/response_utils.rb +18 -33
  212. data/lib/contrast/utils/telemetry.rb +20 -2
  213. data/lib/contrast/utils/telemetry_client.rb +23 -11
  214. data/lib/contrast/utils/telemetry_hash.rb +41 -0
  215. data/lib/contrast/utils/telemetry_identifier.rb +16 -1
  216. data/lib/contrast.rb +9 -0
  217. data/resources/assess/policy.json +98 -0
  218. data/resources/deadzone/policy.json +0 -86
  219. data/ruby-agent.gemspec +10 -9
  220. data/service_executables/VERSION +1 -1
  221. data/service_executables/linux/contrast-service +0 -0
  222. data/service_executables/mac/contrast-service +0 -0
  223. metadata +98 -30
  224. data/lib/contrast/agent/metric_telemetry_event.rb +0 -26
  225. data/lib/contrast/agent/startup_metrics_telemetry_event.rb +0 -121
  226. data/lib/contrast/agent/telemetry.rb +0 -137
  227. data/lib/contrast/agent/telemetry_event.rb +0 -33
  228. data/lib/contrast/utils/exclude_key.rb +0 -20
@@ -0,0 +1,41 @@
1
+ # Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
+ # frozen_string_literal: true
3
+
4
+ require 'contrast/components/logger'
5
+
6
+ module Contrast
7
+ module Utils
8
+ # This is the TelemetryHash, which will take data type, so we can push freely, without worrying about
9
+ # validating the event before that
10
+ class TelemetryHash < Hash
11
+ include Contrast::Components::Logger::InstanceMethods
12
+
13
+ attr_reader :data_type
14
+
15
+ def initialize data_type, *_several_variants
16
+ super()
17
+ @data_type = data_type
18
+ end
19
+
20
+ def []= key, value
21
+ return unless valid_value? value
22
+
23
+ super(key, value)
24
+ end
25
+
26
+ def increment key
27
+ self[key].exceptions[0].increment_occurrences
28
+ :incremented!
29
+ end
30
+
31
+ def valid_value? value
32
+ unless value.cs__is_a?(data_type)
33
+ logger.debug('The following key will be omitted', value: value)
34
+ return false
35
+ end
36
+
37
+ true
38
+ end
39
+ end
40
+ end
41
+ end
@@ -1,8 +1,8 @@
1
1
  # Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'contrast/agent/telemetry'
5
4
  require 'contrast/utils/os'
5
+ require 'digest'
6
6
  require 'socket'
7
7
 
8
8
  module Contrast
@@ -38,6 +38,21 @@ module Contrast
38
38
  @_mac = find_mac(primary) || find_mac
39
39
  end
40
40
 
41
+ def self.application_id
42
+ @_application_id ||= begin
43
+ id = nil
44
+ mac = Contrast::Utils::Telemetry::Identifier.mac
45
+ app_name = Contrast::Utils::Telemetry::Identifier.app_name
46
+ id = mac + app_name if mac && app_name
47
+ Digest::SHA2.new(256).hexdigest(id || "_#{ SecureRandom.uuid }")
48
+ end
49
+ end
50
+
51
+ def self.instance_id
52
+ @_instance_id ||= Digest::SHA2.new(256).hexdigest(Contrast::Utils::Telemetry::Identifier.mac ||
53
+ "_#{ SecureRandom.uuid }")
54
+ end
55
+
41
56
  class << self
42
57
  private
43
58
 
data/lib/contrast.rb CHANGED
@@ -47,6 +47,9 @@ require 'contrast/components/protect'
47
47
  require 'contrast/components/sampling'
48
48
  require 'contrast/components/scope'
49
49
  require 'contrast/components/settings'
50
+ require 'contrast/utils/telemetry_hash'
51
+ require 'contrast/utils/telemetry'
52
+ require 'contrast/agent/telemetry/events/exceptions/telemetry_exception_event'
50
53
 
51
54
  module Contrast
52
55
  API = Contrast::Components::Api::Interface.new
@@ -62,6 +65,12 @@ module Contrast
62
65
  APP_CONTEXT = Contrast::Components::AppContext::Interface.new
63
66
  end
64
67
 
68
+ module Contrast
69
+ TELEMETRY_EXCEPTIONS = if Contrast::Utils::Telemetry.exceptions_enabled?
70
+ Contrast::Utils::TelemetryHash.new(Contrast::Agent::Telemetry::TelemetryException::Event)
71
+ end
72
+ end
73
+
65
74
  # This needs to be required very early, after component interfaces, and before instrumentation attempts
66
75
  require 'contrast/funchook/funchook'
67
76
 
@@ -790,6 +790,16 @@
790
790
  "patch_method": "select_tagger",
791
791
  "source": "O",
792
792
  "target": "R"
793
+ },{
794
+ "class_name": "String",
795
+ "instance_method": true,
796
+ "method_visibility": "public",
797
+ "method_name": "slice",
798
+ "action": "CUSTOM",
799
+ "patch_class": "Contrast::Agent::Assess::Policy::Propagator::Select",
800
+ "patch_method": "select_tagger",
801
+ "source": "O",
802
+ "target": "R"
793
803
  },{
794
804
  "class_name":"CGI::Util",
795
805
  "method_name":"unescape",
@@ -1112,6 +1122,67 @@
1112
1122
  "target":"O",
1113
1123
  "action":"SPLAT"
1114
1124
  },
1125
+ {
1126
+ "class_name": "IO::Buffer",
1127
+ "instance_method": true,
1128
+ "method_visibility": "public",
1129
+ "method_name": "get_string",
1130
+ "source": "O",
1131
+ "target": "R",
1132
+ "action": "CUSTOM",
1133
+ "patch_class": "Contrast::Agent::Assess::Policy::Propagator::Buffer",
1134
+ "patch_method": "propagate_keep_select"
1135
+ },
1136
+ {
1137
+ "class_name": "IO::Buffer",
1138
+ "instance_method": true,
1139
+ "method_visibility": "public",
1140
+ "method_name": "slice",
1141
+ "source": "O",
1142
+ "target": "R",
1143
+ "action": "CUSTOM",
1144
+ "patch_class": "Contrast::Agent::Assess::Policy::Propagator::Buffer",
1145
+ "patch_method": "propagate_keep_select"
1146
+ },
1147
+ {
1148
+ "class_name": "IO::Buffer",
1149
+ "instance_method": true,
1150
+ "method_visibility": "public",
1151
+ "method_name": "set_string",
1152
+ "source":"P0,O",
1153
+ "target":"O",
1154
+ "action": "BUFFER",
1155
+ "patch_method": "propagate_insert"
1156
+ },
1157
+ {
1158
+ "class_name": "IO::Buffer",
1159
+ "instance_method": false,
1160
+ "method_visibility": "public",
1161
+ "method_name": "for",
1162
+ "source":"P0",
1163
+ "target":"R",
1164
+ "action": "KEEP"
1165
+ },
1166
+ {
1167
+ "class_name": "IO::Buffer",
1168
+ "instance_method": true,
1169
+ "method_visibility": "public",
1170
+ "method_name": "copy",
1171
+ "source":"P0,O",
1172
+ "target":"O",
1173
+ "action": "BUFFER",
1174
+ "patch_method": "buffer_keep_splat"
1175
+ },
1176
+ {
1177
+ "class_name": "IO::Buffer",
1178
+ "instance_method": true,
1179
+ "method_visibility": "public",
1180
+ "method_name": "pread",
1181
+ "source":"P0,O",
1182
+ "target":"O",
1183
+ "action": "BUFFER",
1184
+ "patch_method": "buffer_keep_splat"
1185
+ },
1115
1186
  {
1116
1187
  "class_name": "ERB",
1117
1188
  "method_name": "result",
@@ -1177,6 +1248,33 @@
1177
1248
  "action": "REMOVE",
1178
1249
  "tags":["HTML_ENCODED"],
1179
1250
  "untags":["HTML_DECODED"]
1251
+ },
1252
+ {
1253
+ "class_name": "IO::Buffer",
1254
+ "instance_method": false,
1255
+ "method_visibility": "public",
1256
+ "method_name": "map",
1257
+ "source": "P0,O",
1258
+ "target": "R",
1259
+ "action": "KEEP"
1260
+ },
1261
+ {
1262
+ "class_name": "IO::Buffer",
1263
+ "method_name": "pwrite",
1264
+ "instance_method": true,
1265
+ "method_visibility": "public",
1266
+ "source": "O",
1267
+ "target": "P0",
1268
+ "action": "KEEP"
1269
+ },
1270
+ {
1271
+ "class_name": "IO::Buffer",
1272
+ "method_name": "write",
1273
+ "instance_method": true,
1274
+ "method_visibility": "public",
1275
+ "source": "O",
1276
+ "target": "P0",
1277
+ "action": "KEEP"
1180
1278
  }
1181
1279
  ],
1182
1280
  "rules":[
@@ -200,92 +200,6 @@
200
200
  "method_visibility": "public",
201
201
  "method_name":"exists?",
202
202
  "code": "https://github.com/rails/rails/blob/v6.0.3.4/actionpack/lib/action_dispatch/request/session.rb#L201"
203
- },{
204
- "class_name": "RSpec::Matchers::BuiltIn::BaseMatcher"
205
- },{
206
- "class_name": "RSpec::Matchers::BuiltIn::BeAKindOf"
207
- },{
208
- "class_name": "RSpec::Matchers::BuiltIn::BeAnInstanceOf"
209
- },{
210
- "class_name": "RSpec::Matchers::BuiltIn::BeBetween"
211
- },{
212
- "class_name": "RSpec::Matchers::BuiltIn::Be"
213
- },{
214
- "class_name": "RSpec::Matchers::BuiltIn::BeComparedTo"
215
- },{
216
- "class_name": "RSpec::Matchers::BuiltIn::BeFalsey"
217
- },{
218
- "class_name": "RSpec::Matchers::BuiltIn::BeHelpers"
219
- },{
220
- "class_name": "RSpec::Matchers::BuiltIn::BeNil"
221
- },{
222
- "class_name": "RSpec::Matchers::BuiltIn::BePredicate"
223
- },{
224
- "class_name": "RSpec::Matchers::BuiltIn::BeTruthy"
225
- },{
226
- "class_name": "RSpec::Matchers::BuiltIn::BeWithin"
227
- },{
228
- "class_name": "RSpec::Matchers::BuiltIn::Change"
229
- },{
230
- "class_name": "RSpec::Matchers::BuiltIn::ChangeRelatively"
231
- },{
232
- "class_name": "RSpec::Matchers::BuiltIn::SpecificValuesChange"
233
- },{
234
- "class_name": "RSpec::Matchers::BuiltIn::Compound"
235
- },{
236
- "class_name": "RSpec::Matchers::BuiltIn::Compound::And"
237
- }, {
238
- "class_name": "RSpec::Matchers::BuiltIn::Compound::Or"
239
- },{
240
- "class_name": "RSpec::Matchers::BuiltIn::ContainExactly"
241
- },{
242
- "class_name": "RSpec::Matchers::BuiltIn::Cover"
243
- },{
244
- "class_name": "RSpec::Matchers::BuiltIn::EndWith"
245
- },{
246
- "class_name": "RSpec::Matchers::BuiltIn::Eq"
247
- },{
248
- "class_name": "RSpec::Matchers::BuiltIn::Eql"
249
- },{
250
- "class_name": "RSpec::Matchers::BuiltIn::Equal"
251
- },{
252
- "class_name": "RSpec::Matchers::BuiltIn::Exist"
253
- },{
254
- "class_name": "RSpec::Matchers::BuiltIn::Has"
255
- },{
256
- "class_name": "RSpec::Matchers::BuiltIn::HaveAttributes"
257
- },{
258
- "class_name": "RSpec::Matchers::BuiltIn::All"
259
- },{
260
- "class_name": "RSpec::Matchers::BuiltIn::Match"
261
- },{
262
- "class_name": "RSpec::Matchers::BuiltIn::NegativeOperatorMatcher"
263
- },{
264
- "class_name": "RSpec::Matchers::BuiltIn::OperatorMatcher"
265
- },{
266
- "class_name": "RSpec::Matchers::BuiltIn::Output"
267
- },{
268
- "class_name": "RSpec::Matchers::BuiltIn::PositiveOperatorMatcher"
269
- },{
270
- "class_name": "RSpec::Matchers::BuiltIn::RaiseError"
271
- },{
272
- "class_name": "RSpec::Matchers::BuiltIn::RespondTo"
273
- },{
274
- "class_name": "RSpec::Matchers::BuiltIn::Satisfy"
275
- },{
276
- "class_name": "RSpec::Matchers::BuiltIn::StartWith"
277
- },{
278
- "class_name": "RSpec::Matchers::BuiltIn::ThrowSymbol"
279
- },{
280
- "class_name": "RSpec::Matchers::BuiltIn::YieldControl"
281
- },{
282
- "class_name": "RSpec::Matchers::BuiltIn::YieldSuccessiveArgs"
283
- },{
284
- "class_name": "RSpec::Matchers::BuiltIn::YieldWithArgs"
285
- },{
286
- "class_name": "RSpec::Matchers::BuiltIn::YieldWithNoArgs"
287
- },{
288
- "class_name": "SimpleCov"
289
203
  }
290
204
  ]
291
205
  }
data/ruby-agent.gemspec CHANGED
@@ -50,7 +50,7 @@ end
50
50
  def self.add_frameworks spec
51
51
  spec.add_development_dependency 'grape', '~> 1.5', '>= 1.5.2'
52
52
  spec.add_development_dependency 'rack-protection', '>= 2'
53
- spec.add_development_dependency 'rails', '6.0.3.5'
53
+ spec.add_development_dependency 'rails', '~> 7'
54
54
  spec.add_development_dependency 'sinatra', '>= 2'
55
55
  end
56
56
 
@@ -70,6 +70,7 @@ def self.add_specs spec
70
70
  add_tested_gems(spec)
71
71
 
72
72
  spec.add_development_dependency 'benchmark-ips'
73
+ spec.add_development_dependency 'benchmark-memory', '~> 0.1'
73
74
  spec.add_development_dependency 'climate_control' # mock ENV
74
75
  spec.add_development_dependency 'factory_bot'
75
76
  spec.add_development_dependency 'fake_ftp'
@@ -89,11 +90,11 @@ end
89
90
 
90
91
  # Dependencies used to run all of our Rubocop during the linting phase.
91
92
  def self.add_rubocop spec
92
- spec.add_development_dependency 'rubocop', '1.22.3'
93
- spec.add_development_dependency 'rubocop-performance', '1.12.0'
94
- spec.add_development_dependency 'rubocop-rails', '2.12.4'
93
+ spec.add_development_dependency 'rubocop', '1.26.1'
94
+ spec.add_development_dependency 'rubocop-performance', '1.13.3'
95
+ spec.add_development_dependency 'rubocop-rails', '2.14.2'
95
96
  spec.add_development_dependency 'rubocop-rake', '0.6.0'
96
- spec.add_development_dependency 'rubocop-rspec', '2.6.0'
97
+ spec.add_development_dependency 'rubocop-rspec', '2.9.0'
97
98
  end
98
99
 
99
100
  # Dependencies not mocked out during RSpec that we test real code of, beyond just frameworks.
@@ -155,7 +156,7 @@ def self.add_files spec
155
156
  end
156
157
 
157
158
  def self.add_metadata spec
158
- spec.metadata['changelog_uri'] = 'https://docs.contrastsecurity.com/release.html'
159
+ spec.metadata['changelog_uri'] = 'https://docs.contrastsecurity.com/en/ruby-agent-release-notes-and-archive.html'
159
160
  spec.metadata['support_uri'] = 'https://support.contrastsecurity.com'
160
161
  spec.metadata['trouble_shooting_uri'] = 'https://support.contrastsecurity.com/hc/en-us/search?utf8=%E2%9C%93&query=Ruby'
161
162
  spec.metadata['wiki_uri'] = 'https://docs.contrastsecurity.com/'
@@ -169,11 +170,11 @@ Gem::Specification.new do |spec|
169
170
 
170
171
  spec.summary = 'Contrast Security\'s agent for rack-based applications.'
171
172
  spec.description = 'This gem instantiates a Rack middleware for rack-based ' \
172
- 'web applications in order to provide Interactive Application Security ' \
173
- 'Testing and Protection.'
173
+ 'web applications in order to provide Interactive Application Security ' \
174
+ 'Testing and Protection.'
174
175
  spec.homepage = 'https://www.contrastsecurity.com'
175
176
  spec.license = 'CONTRAST SECURITY (see license file)'
176
- spec.required_ruby_version = ['>= 2.6.0', '< 3.2.0']
177
+ spec.required_ruby_version = ['>= 2.7.0', '< 3.2.0']
177
178
 
178
179
  spec.bindir = 'exe'
179
180
  spec.executables = ['contrast_service']
@@ -1 +1 @@
1
- 2.28.6
1
+ 2.28.20