contrast-agent 6.7.0 → 6.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (280) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -2
  3. data/.simplecov +0 -1
  4. data/Rakefile +0 -1
  5. data/ext/cs__assess_array/cs__assess_array.c +41 -10
  6. data/ext/cs__assess_array/cs__assess_array.h +4 -1
  7. data/lib/contrast/agent/assess/policy/trigger_method.rb +3 -3
  8. data/lib/contrast/agent/assess/policy/trigger_validation/redos_validator.rb +1 -1
  9. data/lib/contrast/agent/assess/policy/trigger_validation/ssrf_validator.rb +1 -1
  10. data/lib/contrast/agent/assess/policy/trigger_validation/xss_validator.rb +1 -1
  11. data/lib/contrast/agent/assess/property/evented.rb +11 -11
  12. data/lib/contrast/agent/assess.rb +0 -1
  13. data/lib/contrast/agent/excluder.rb +53 -35
  14. data/lib/contrast/agent/exclusion_matcher.rb +21 -9
  15. data/lib/contrast/agent/middleware.rb +12 -6
  16. data/lib/contrast/agent/patching/policy/after_load_patcher.rb +6 -0
  17. data/lib/contrast/agent/protect/input_analyzer/input_analyzer.rb +146 -127
  18. data/lib/contrast/agent/protect/input_analyzer/worth_watching_analyzer.rb +116 -0
  19. data/lib/contrast/agent/protect/policy/applies_path_traversal_rule.rb +20 -0
  20. data/lib/contrast/agent/protect/policy/rule_applicator.rb +1 -1
  21. data/lib/contrast/agent/protect/rule/base.rb +47 -55
  22. data/lib/contrast/agent/protect/rule/base_service.rb +48 -24
  23. data/lib/contrast/agent/protect/rule/bot_blocker/bot_blocker_input_classification.rb +98 -0
  24. data/lib/contrast/agent/protect/rule/bot_blocker.rb +81 -0
  25. data/lib/contrast/agent/protect/rule/cmd_injection.rb +20 -2
  26. data/lib/contrast/agent/protect/rule/cmdi/cmdi_backdoors.rb +8 -5
  27. data/lib/contrast/agent/protect/rule/cmdi/cmdi_base_rule.rb +22 -22
  28. data/lib/contrast/agent/protect/rule/cmdi/cmdi_chained_command.rb +64 -0
  29. data/lib/contrast/agent/protect/rule/cmdi/cmdi_dangerous_path.rb +63 -0
  30. data/lib/contrast/agent/protect/rule/cmdi/cmdi_input_classification.rb +2 -58
  31. data/lib/contrast/agent/protect/rule/default_scanner.rb +1 -1
  32. data/lib/contrast/agent/protect/rule/deserialization.rb +3 -14
  33. data/lib/contrast/agent/protect/rule/http_method_tampering/http_method_tampering_input_classification.rb +2 -2
  34. data/lib/contrast/agent/protect/rule/http_method_tampering.rb +0 -11
  35. data/lib/contrast/agent/protect/rule/no_sqli/no_sqli_input_classification.rb +29 -34
  36. data/lib/contrast/agent/protect/rule/no_sqli.rb +25 -18
  37. data/lib/contrast/agent/protect/rule/path_traversal/path_traversal_input_classification.rb +61 -0
  38. data/lib/contrast/agent/protect/rule/path_traversal/path_traversal_semantic_security_bypass.rb +114 -0
  39. data/lib/contrast/agent/protect/rule/path_traversal.rb +40 -13
  40. data/lib/contrast/agent/protect/rule/sql_sample_builder.rb +33 -15
  41. data/lib/contrast/agent/protect/rule/sqli/sqli_base_rule.rb +0 -14
  42. data/lib/contrast/agent/protect/rule/sqli/sqli_input_classification.rb +2 -62
  43. data/lib/contrast/agent/protect/rule/sqli.rb +74 -3
  44. data/lib/contrast/agent/protect/rule/unsafe_file_upload/unsafe_file_upload_input_classification.rb +39 -63
  45. data/lib/contrast/agent/protect/rule/unsafe_file_upload.rb +6 -33
  46. data/lib/contrast/agent/protect/rule/xss/reflected_xss_input_classification.rb +58 -0
  47. data/lib/contrast/agent/protect/rule/xss.rb +15 -20
  48. data/lib/contrast/agent/protect/rule/xxe.rb +4 -24
  49. data/lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb +19 -40
  50. data/lib/contrast/agent/reporting/attack_result/response_type.rb +9 -9
  51. data/lib/contrast/agent/reporting/details/ip_denylist_details.rb +10 -2
  52. data/lib/contrast/agent/reporting/details/virtual_patch_details.rb +8 -2
  53. data/lib/contrast/agent/reporting/input_analysis/details/bot_blocker_details.rb +27 -0
  54. data/lib/contrast/agent/reporting/input_analysis/details/protect_rule_details.rb +15 -0
  55. data/lib/contrast/agent/reporting/input_analysis/input_analysis.rb +1 -2
  56. data/lib/contrast/agent/reporting/input_analysis/input_analysis_result.rb +16 -2
  57. data/lib/contrast/agent/reporting/masker/masker.rb +2 -0
  58. data/lib/contrast/agent/reporting/report.rb +1 -0
  59. data/lib/contrast/agent/reporting/reporter.rb +35 -14
  60. data/lib/contrast/agent/reporting/reporter_heartbeat.rb +3 -9
  61. data/lib/contrast/agent/reporting/reporting_events/application_activity.rb +16 -13
  62. data/lib/contrast/agent/reporting/reporting_events/application_defend_activity.rb +12 -7
  63. data/lib/contrast/agent/reporting/reporting_events/application_defend_attack_activity.rb +3 -3
  64. data/lib/contrast/agent/reporting/reporting_events/application_defend_attack_sample.rb +1 -2
  65. data/lib/contrast/agent/reporting/reporting_events/application_inventory_activity.rb +6 -1
  66. data/lib/contrast/agent/reporting/reporting_events/application_update.rb +0 -2
  67. data/lib/contrast/agent/reporting/reporting_events/architecture_component.rb +0 -1
  68. data/lib/contrast/agent/reporting/reporting_events/finding.rb +6 -6
  69. data/lib/contrast/agent/reporting/reporting_events/finding_event.rb +239 -93
  70. data/lib/contrast/agent/reporting/reporting_events/finding_event_signature.rb +10 -23
  71. data/lib/contrast/agent/reporting/reporting_events/finding_event_source.rb +10 -9
  72. data/lib/contrast/agent/reporting/reporting_events/finding_request.rb +0 -5
  73. data/lib/contrast/agent/reporting/reporting_events/library_discovery.rb +0 -1
  74. data/lib/contrast/agent/reporting/reporting_events/observed_route.rb +12 -0
  75. data/lib/contrast/agent/reporting/reporting_events/poll.rb +1 -11
  76. data/lib/contrast/agent/reporting/reporting_events/route_discovery.rb +0 -1
  77. data/lib/contrast/agent/reporting/reporting_events/route_discovery_observation.rb +0 -1
  78. data/lib/contrast/agent/reporting/reporting_events/server_reporting_event.rb +8 -0
  79. data/lib/contrast/agent/reporting/reporting_events/server_settings.rb +40 -0
  80. data/lib/contrast/agent/reporting/reporting_utilities/audit.rb +2 -2
  81. data/lib/contrast/agent/reporting/reporting_utilities/endpoints.rb +6 -0
  82. data/lib/contrast/agent/reporting/reporting_utilities/reporter_client.rb +43 -1
  83. data/lib/contrast/agent/reporting/reporting_utilities/reporter_client_utils.rb +8 -4
  84. data/lib/contrast/agent/reporting/reporting_utilities/response.rb +1 -1
  85. data/lib/contrast/agent/reporting/reporting_utilities/response_extractor.rb +58 -4
  86. data/lib/contrast/agent/reporting/reporting_utilities/response_handler.rb +4 -6
  87. data/lib/contrast/agent/reporting/reporting_utilities/response_handler_utils.rb +77 -16
  88. data/lib/contrast/agent/reporting/server_settings_worker.rb +44 -0
  89. data/lib/contrast/agent/reporting/settings/assess_server_feature.rb +14 -2
  90. data/lib/contrast/agent/reporting/settings/code_exclusion.rb +6 -1
  91. data/lib/contrast/agent/reporting/settings/exclusion_base.rb +18 -0
  92. data/lib/contrast/agent/reporting/settings/exclusions.rb +2 -1
  93. data/lib/contrast/agent/reporting/settings/helpers.rb +7 -0
  94. data/lib/contrast/agent/reporting/settings/input_exclusion.rb +9 -3
  95. data/lib/contrast/agent/reporting/settings/protect.rb +15 -15
  96. data/lib/contrast/agent/reporting/settings/protect_server_feature.rb +39 -2
  97. data/lib/contrast/agent/reporting/settings/rule_definition.rb +3 -0
  98. data/lib/contrast/agent/reporting/settings/security_logger.rb +77 -0
  99. data/lib/contrast/agent/reporting/settings/server_features.rb +9 -0
  100. data/lib/contrast/agent/reporting/settings/syslog.rb +34 -5
  101. data/lib/contrast/agent/request.rb +3 -14
  102. data/lib/contrast/agent/request_context.rb +6 -9
  103. data/lib/contrast/agent/request_context_extend.rb +9 -148
  104. data/lib/contrast/agent/request_handler.rb +5 -10
  105. data/lib/contrast/agent/telemetry/events/exceptions/telemetry_exception_event.rb +1 -1
  106. data/lib/contrast/agent/thread_watcher.rb +37 -18
  107. data/lib/contrast/agent/version.rb +1 -1
  108. data/lib/contrast/agent.rb +6 -11
  109. data/lib/contrast/agent_lib/api/command_injection.rb +46 -0
  110. data/lib/contrast/agent_lib/api/init.rb +101 -0
  111. data/lib/contrast/agent_lib/api/input_tracing.rb +267 -0
  112. data/lib/contrast/agent_lib/api/method_tempering.rb +29 -0
  113. data/lib/contrast/agent_lib/api/panic.rb +87 -0
  114. data/lib/contrast/agent_lib/api/path_semantic_file_security_bypass.rb +40 -0
  115. data/lib/contrast/agent_lib/interface.rb +260 -0
  116. data/lib/contrast/agent_lib/interface_base.rb +118 -0
  117. data/lib/contrast/agent_lib/return_types/eval_result.rb +44 -0
  118. data/lib/contrast/agent_lib/test.rb +29 -0
  119. data/lib/contrast/api/communication/connection_status.rb +20 -5
  120. data/lib/contrast/components/agent.rb +34 -14
  121. data/lib/contrast/components/api.rb +23 -0
  122. data/lib/contrast/components/app_context.rb +23 -5
  123. data/lib/contrast/components/app_context_extend.rb +0 -25
  124. data/lib/contrast/components/assess.rb +34 -4
  125. data/lib/contrast/components/assess_rules.rb +18 -0
  126. data/lib/contrast/components/base.rb +40 -0
  127. data/lib/contrast/components/config/sources.rb +95 -0
  128. data/lib/contrast/components/config.rb +19 -19
  129. data/lib/contrast/components/heap_dump.rb +10 -0
  130. data/lib/contrast/components/inventory.rb +15 -2
  131. data/lib/contrast/components/logger.rb +18 -0
  132. data/lib/contrast/components/polling.rb +36 -0
  133. data/lib/contrast/components/protect.rb +52 -2
  134. data/lib/contrast/components/ruby_component.rb +16 -1
  135. data/lib/contrast/components/sampling.rb +70 -13
  136. data/lib/contrast/components/security_logger.rb +13 -0
  137. data/lib/contrast/components/settings.rb +105 -90
  138. data/lib/contrast/config/certification_configuration.rb +14 -0
  139. data/lib/contrast/config/config.rb +46 -0
  140. data/lib/contrast/config/diagnostics.rb +114 -0
  141. data/lib/contrast/config/diagnostics_tools.rb +98 -0
  142. data/lib/contrast/config/effective_config.rb +65 -0
  143. data/lib/contrast/config/effective_config_value.rb +32 -0
  144. data/lib/contrast/config/exception_configuration.rb +12 -0
  145. data/lib/contrast/config/protect_rule_configuration.rb +8 -8
  146. data/lib/contrast/config/protect_rules_configuration.rb +23 -60
  147. data/lib/contrast/config/request_audit_configuration.rb +13 -0
  148. data/lib/contrast/config/server_configuration.rb +41 -2
  149. data/lib/contrast/configuration.rb +29 -12
  150. data/lib/contrast/extension/assess/array.rb +9 -0
  151. data/lib/contrast/extension/assess/erb.rb +1 -1
  152. data/lib/contrast/extension/delegator.rb +2 -0
  153. data/lib/contrast/framework/manager.rb +3 -1
  154. data/lib/contrast/framework/rails/railtie.rb +0 -1
  155. data/lib/contrast/framework/rails/support.rb +0 -1
  156. data/lib/contrast/tasks/config.rb +1 -8
  157. data/lib/contrast/utils/assess/event_limit_utils.rb +31 -9
  158. data/lib/contrast/utils/assess/trigger_method_utils.rb +5 -4
  159. data/lib/contrast/utils/duck_utils.rb +1 -0
  160. data/lib/contrast/utils/hash_digest.rb +2 -2
  161. data/lib/contrast/utils/input_classification_base.rb +155 -0
  162. data/lib/contrast/utils/os.rb +0 -20
  163. data/lib/contrast/utils/reporting/application_activity_batch_utils.rb +81 -0
  164. data/lib/contrast/utils/response_utils.rb +0 -16
  165. data/lib/contrast/utils/routes_sent.rb +60 -0
  166. data/lib/contrast/utils/stack_trace_utils.rb +3 -15
  167. data/lib/contrast/utils/string_utils.rb +10 -7
  168. data/lib/contrast/utils/telemetry_client.rb +1 -2
  169. data/lib/contrast/utils/timer.rb +16 -0
  170. data/lib/contrast.rb +5 -4
  171. data/resources/protect/policy.json +1 -2
  172. data/ruby-agent.gemspec +7 -6
  173. metadata +69 -130
  174. data/exe/contrast_service +0 -23
  175. data/lib/contrast/agent/assess/contrast_event.rb +0 -157
  176. data/lib/contrast/agent/assess/events/event_factory.rb +0 -34
  177. data/lib/contrast/agent/assess/events/source_event.rb +0 -46
  178. data/lib/contrast/agent/protect/rule/cmdi/cmdi_worth_watching.rb +0 -64
  179. data/lib/contrast/agent/protect/rule/sqli/sqli_worth_watching.rb +0 -118
  180. data/lib/contrast/agent/protect/rule/unsafe_file_upload/unsafe_file_upload_matcher.rb +0 -45
  181. data/lib/contrast/agent/reaction_processor.rb +0 -47
  182. data/lib/contrast/agent/reporting/reporting_events/server_activity.rb +0 -36
  183. data/lib/contrast/agent/service_heartbeat.rb +0 -35
  184. data/lib/contrast/api/communication/messaging_queue.rb +0 -128
  185. data/lib/contrast/api/communication/response_processor.rb +0 -90
  186. data/lib/contrast/api/communication/service_lifecycle.rb +0 -77
  187. data/lib/contrast/api/communication/socket.rb +0 -44
  188. data/lib/contrast/api/communication/socket_client.rb +0 -130
  189. data/lib/contrast/api/communication/speedracer.rb +0 -138
  190. data/lib/contrast/api/communication/tcp_socket.rb +0 -32
  191. data/lib/contrast/api/communication/unix_socket.rb +0 -28
  192. data/lib/contrast/api/communication.rb +0 -20
  193. data/lib/contrast/api/decorators/address.rb +0 -59
  194. data/lib/contrast/api/decorators/agent_startup.rb +0 -56
  195. data/lib/contrast/api/decorators/application_settings.rb +0 -43
  196. data/lib/contrast/api/decorators/application_startup.rb +0 -56
  197. data/lib/contrast/api/decorators/bot_blocker.rb +0 -37
  198. data/lib/contrast/api/decorators/http_request.rb +0 -137
  199. data/lib/contrast/api/decorators/input_analysis.rb +0 -18
  200. data/lib/contrast/api/decorators/instrumentation_mode.rb +0 -35
  201. data/lib/contrast/api/decorators/ip_denylist.rb +0 -37
  202. data/lib/contrast/api/decorators/message.rb +0 -67
  203. data/lib/contrast/api/decorators/rasp_rule_sample.rb +0 -52
  204. data/lib/contrast/api/decorators/response_type.rb +0 -17
  205. data/lib/contrast/api/decorators/server_features.rb +0 -25
  206. data/lib/contrast/api/decorators/user_input.rb +0 -51
  207. data/lib/contrast/api/decorators/virtual_patch.rb +0 -34
  208. data/lib/contrast/api/decorators.rb +0 -22
  209. data/lib/contrast/api/dtm.pb.rb +0 -363
  210. data/lib/contrast/api/settings.pb.rb +0 -500
  211. data/lib/contrast/api.rb +0 -16
  212. data/lib/contrast/components/contrast_service.rb +0 -88
  213. data/lib/contrast/components/service.rb +0 -55
  214. data/lib/contrast/tasks/service.rb +0 -84
  215. data/lib/contrast/utils/input_classification.rb +0 -73
  216. data/lib/protobuf/code_generator.rb +0 -129
  217. data/lib/protobuf/decoder.rb +0 -28
  218. data/lib/protobuf/deprecation.rb +0 -117
  219. data/lib/protobuf/descriptors/google/protobuf/compiler/plugin.pb.rb +0 -79
  220. data/lib/protobuf/descriptors/google/protobuf/descriptor.pb.rb +0 -360
  221. data/lib/protobuf/descriptors.rb +0 -3
  222. data/lib/protobuf/encoder.rb +0 -11
  223. data/lib/protobuf/enum.rb +0 -365
  224. data/lib/protobuf/exceptions.rb +0 -9
  225. data/lib/protobuf/field/base_field.rb +0 -380
  226. data/lib/protobuf/field/base_field_object_definitions.rb +0 -504
  227. data/lib/protobuf/field/bool_field.rb +0 -64
  228. data/lib/protobuf/field/bytes_field.rb +0 -67
  229. data/lib/protobuf/field/double_field.rb +0 -25
  230. data/lib/protobuf/field/enum_field.rb +0 -56
  231. data/lib/protobuf/field/field_array.rb +0 -102
  232. data/lib/protobuf/field/field_hash.rb +0 -122
  233. data/lib/protobuf/field/fixed32_field.rb +0 -25
  234. data/lib/protobuf/field/fixed64_field.rb +0 -28
  235. data/lib/protobuf/field/float_field.rb +0 -43
  236. data/lib/protobuf/field/int32_field.rb +0 -21
  237. data/lib/protobuf/field/int64_field.rb +0 -34
  238. data/lib/protobuf/field/integer_field.rb +0 -23
  239. data/lib/protobuf/field/message_field.rb +0 -51
  240. data/lib/protobuf/field/sfixed32_field.rb +0 -27
  241. data/lib/protobuf/field/sfixed64_field.rb +0 -28
  242. data/lib/protobuf/field/signed_integer_field.rb +0 -29
  243. data/lib/protobuf/field/sint32_field.rb +0 -21
  244. data/lib/protobuf/field/sint64_field.rb +0 -21
  245. data/lib/protobuf/field/string_field.rb +0 -51
  246. data/lib/protobuf/field/uint32_field.rb +0 -21
  247. data/lib/protobuf/field/uint64_field.rb +0 -21
  248. data/lib/protobuf/field/varint_field.rb +0 -77
  249. data/lib/protobuf/field.rb +0 -74
  250. data/lib/protobuf/generators/base.rb +0 -85
  251. data/lib/protobuf/generators/enum_generator.rb +0 -39
  252. data/lib/protobuf/generators/extension_generator.rb +0 -27
  253. data/lib/protobuf/generators/field_generator.rb +0 -193
  254. data/lib/protobuf/generators/file_generator.rb +0 -262
  255. data/lib/protobuf/generators/group_generator.rb +0 -122
  256. data/lib/protobuf/generators/message_generator.rb +0 -104
  257. data/lib/protobuf/generators/option_generator.rb +0 -17
  258. data/lib/protobuf/generators/printable.rb +0 -160
  259. data/lib/protobuf/generators/service_generator.rb +0 -50
  260. data/lib/protobuf/lifecycle.rb +0 -33
  261. data/lib/protobuf/logging.rb +0 -39
  262. data/lib/protobuf/message/fields.rb +0 -233
  263. data/lib/protobuf/message/serialization.rb +0 -85
  264. data/lib/protobuf/message.rb +0 -241
  265. data/lib/protobuf/optionable.rb +0 -72
  266. data/lib/protobuf/tasks/compile.rake +0 -80
  267. data/lib/protobuf/tasks.rb +0 -1
  268. data/lib/protobuf/varint.rb +0 -20
  269. data/lib/protobuf/varint_pure.rb +0 -31
  270. data/lib/protobuf/version.rb +0 -3
  271. data/lib/protobuf/wire_type.rb +0 -10
  272. data/lib/protobuf.rb +0 -91
  273. data/proto/dynamic_discovery.proto +0 -46
  274. data/proto/google/protobuf/compiler/plugin.proto +0 -183
  275. data/proto/google/protobuf/descriptor.proto +0 -911
  276. data/proto/rpc.proto +0 -71
  277. data/service_executables/.gitkeep +0 -0
  278. data/service_executables/VERSION +0 -1
  279. data/service_executables/linux/contrast-service +0 -0
  280. data/service_executables/mac/contrast-service +0 -0
@@ -1,51 +0,0 @@
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/utils/string_utils'
5
- require 'contrast/utils/assess/tracking_util'
6
- require 'base64'
7
-
8
- module Contrast
9
- module Api
10
- module Decorators
11
- # Used to decorate the {Contrast::Api::Dtm::UserInput} protobuf model.
12
- module UserInput
13
- UNKNOWN_USER_INPUT = Contrast::Api::Dtm::UserInput.new.tap do |user_input|
14
- user_input.input_type = :UNKNOWN
15
- end
16
- UNKNOWN_USER_INPUT.cs__freeze
17
-
18
- def self.included klass
19
- klass.extend(ClassMethods)
20
- end
21
-
22
- # Used to add class methods to UserInput
23
- module ClassMethods
24
- def build_from_ia_result ia_result
25
- return UNKNOWN_USER_INPUT.dup unless ia_result
26
-
27
- user_input = new
28
- user_input.matcher_ids = ia_result.ids
29
- user_input.path = ia_result.path.to_s
30
- user_input.key = ia_result.key.to_s
31
- user_input.value = ia_result.value.to_s
32
- if ia_result.input_type
33
- #
34
- # InputAnalysis have local Agent implementation, so we need ot take care of difference
35
- # if we pass data from wrong place - we need to handle the TypeError in throws
36
- begin
37
- user_input.input_type = ia_result.input_type.to_i
38
- rescue TypeError, NoMethodError => _e
39
- user_input.input_type = ia_result.input_type
40
- end
41
- end
42
-
43
- user_input
44
- end
45
- end
46
- end
47
- end
48
- end
49
- end
50
-
51
- Contrast::Api::Dtm::UserInput.include(Contrast::Api::Decorators::UserInput)
@@ -1,34 +0,0 @@
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/api/dtm.pb'
5
- require 'contrast/utils/string_utils'
6
- require 'contrast/components/base'
7
-
8
- module Contrast
9
- module Api
10
- module Decorators
11
- # Used to decorate the {Contrast::Api::Dtm::VirtualPatchDetails} protobuf
12
- # model so it can own the request which its data is for.
13
- module VirtualPatchDetails
14
- def self.included klass
15
- klass.extend(ClassMethods)
16
- end
17
-
18
- # Used to add class methods to the AgentStartup class on inclusion of the decorator
19
- module ClassMethods
20
- def build
21
- new
22
- end
23
-
24
- # @param result [Contrast::Api::Dtm::VirtualPatchDetails]
25
- def to_controlled_hash result
26
- { uuid: result.uuid }
27
- end
28
- end
29
- end
30
- end
31
- end
32
- end
33
-
34
- Contrast::Api::Dtm::VirtualPatchDetails.include(Contrast::Api::Decorators::VirtualPatchDetails)
@@ -1,22 +0,0 @@
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
- module Contrast
5
- module Api
6
- # Used to decorate protobuf models
7
- module Decorators
8
- end
9
- end
10
- end
11
-
12
- require 'contrast/api/decorators/message'
13
- require 'contrast/api/decorators/agent_startup'
14
- require 'contrast/api/decorators/application_startup'
15
- require 'contrast/api/decorators/input_analysis'
16
- require 'contrast/api/decorators/application_settings'
17
- require 'contrast/api/decorators/server_features'
18
- require 'contrast/api/decorators/rasp_rule_sample'
19
- require 'contrast/api/decorators/user_input'
20
- require 'contrast/api/decorators/address'
21
- require 'contrast/api/decorators/http_request'
22
- require 'contrast/api/decorators/response_type'
@@ -1,363 +0,0 @@
1
- # encoding: utf-8
2
-
3
- ##
4
- # This file is auto-generated. DO NOT EDIT!
5
- #
6
- require 'protobuf'
7
-
8
- module Contrast
9
- module Api
10
- module Dtm
11
- ::Protobuf::Optionable.inject(self) { ::CSGoogle::Protobuf::FileOptions }
12
-
13
- ##
14
- # Message Classes
15
- #
16
- class Message < ::Protobuf::Message; end
17
- class Poll < ::Protobuf::Message; end
18
-
19
- class AgentStartup < ::Protobuf::Message; end
20
- class ApplicationCreate < ::Protobuf::Message; end
21
- class InstrumentationMode < ::Protobuf::Message; end
22
-
23
- class Address < ::Protobuf::Message; end
24
- class HttpRequest < ::Protobuf::Message
25
- class Authentication < ::Protobuf::Enum
26
- define :UNAUTHENTICATED, 0
27
- define :AUTHENTICATED, 1
28
- define :LOGIN_FAIL, 2
29
- define :LOGIN_SUCCESS, 3
30
- define :LOGIN_UNKNOWN, 4
31
- end
32
-
33
- class DocumentType < ::Protobuf::Enum
34
- define :NORMAL, 0
35
- define :JSON, 1
36
- define :XML, 2
37
- end
38
-
39
- end
40
-
41
- class SimplePair < ::Protobuf::Message; end
42
- class Pair < ::Protobuf::Message; end
43
- class AttackResult < ::Protobuf::Message
44
- class ResponseType < ::Protobuf::Enum
45
- define :NO_ACTION, 0
46
- define :BLOCKED, 1
47
- define :MONITORED, 2
48
- define :PROBED, 3
49
- define :BLOCKED_AT_PERIMETER, 4
50
- define :AGGREGATED, 5
51
- end
52
-
53
- end
54
-
55
- class RaspRuleSample < ::Protobuf::Message; end
56
-
57
- class BotBlockerDetails < ::Protobuf::Message; end
58
- class CmdInjectionDetails < ::Protobuf::Message; end
59
-
60
- class HttpMethodTamperingDetails < ::Protobuf::Message; end
61
- class UntrustedDeserializationDetails < ::Protobuf::Message; end
62
- class IpDenylistDetails < ::Protobuf::Message; end
63
- class PathTraversalDetails < ::Protobuf::Message; end
64
- class PathTraversalSemanticAnalysisDetails < ::Protobuf::Message
65
- class Finding < ::Protobuf::Enum
66
- define :CUSTOM_CODE_ACCESSING_SYSTEM_FILES, 0
67
- define :COMMON_FILE_EXPLOITS, 1
68
- end
69
-
70
- end
71
-
72
- class ReDosDetails < ::Protobuf::Message; end
73
- class SqlInjectionDetails < ::Protobuf::Message; end
74
-
75
- class NoSqlInjectionDetails < ::Protobuf::Message; end
76
- class SsrfDetails < ::Protobuf::Message; end
77
- class VirtualPatchDetails < ::Protobuf::Message; end
78
- class XssDetails < ::Protobuf::Message; end
79
- class XssMatch < ::Protobuf::Message; end
80
- class XxeDetails < ::Protobuf::Message; end
81
- class XxeMatch < ::Protobuf::Message; end
82
- class XxeWrapper < ::Protobuf::Message; end
83
- class UserInput < ::Protobuf::Message
84
- class InputType < ::Protobuf::Enum
85
- define :UNDEFINED_TYPE, 0
86
- define :BODY, 1
87
- define :COOKIE_NAME, 2
88
- define :COOKIE_VALUE, 3
89
- define :HEADER, 4
90
- define :PARAMETER_NAME, 5
91
- define :PARAMETER_VALUE, 6
92
- define :QUERYSTRING, 7
93
- define :URI, 8
94
- define :SOCKET, 9
95
- define :JSON_VALUE, 10
96
- define :JSON_ARRAYED_VALUE, 11
97
- define :MULTIPART_CONTENT_TYPE, 16
98
- define :MULTIPART_VALUE, 17
99
- define :MULTIPART_FIELD_NAME, 18
100
- define :MULTIPART_NAME, 19
101
- define :XML_VALUE, 20
102
- define :DWR_VALUE, 21
103
- define :METHOD, 22
104
- define :REQUEST, 23
105
- define :URL_PARAMETER, 24
106
- define :UNKNOWN, 99
107
- end
108
-
109
- end
110
-
111
- class StackTraceElement < ::Protobuf::Message; end
112
-
113
- ##
114
- # File Options
115
- #
116
- set_option :go_package, "bitbucket.org/contrastsecurity/go-speedracer-go/from_agent"
117
-
118
-
119
- ##
120
- # Message Fields
121
- #
122
- class Message
123
- optional :string, :client_id, 1
124
- optional :int32, :client_number, 2, :deprecated => true
125
- optional :int32, :client_total, 3, :deprecated => true
126
- optional :int64, :pid, 8
127
- optional :int64, :ppid, 9
128
- optional :int32, :message_count, 4
129
- optional :int64, :timestamp_ms, 5
130
- optional :string, :app_name, 6
131
- optional :string, :app_language, 7
132
- optional :string, :app_path, 28
133
- optional ::Contrast::Api::Dtm::AgentStartup, :agent_startup, 11
134
- optional ::Contrast::Api::Dtm::ApplicationCreate, :application_create, 12
135
- optional ::Contrast::Api::Dtm::HttpRequest, :prefilter, 20
136
- optional ::Contrast::Api::Dtm::Poll, :poll, 27
137
- end
138
-
139
- class AgentStartup
140
- optional :string, :version, 2, :deprecated => true
141
- optional :string, :environment, 3
142
- optional :string, :tags, 4, :deprecated => true
143
- optional :string, :server_name, 5
144
- optional :string, :server_path, 6
145
- optional :string, :server_type, 7
146
- optional :string, :server_version, 8
147
- optional :int32, :heartbeat_ms, 9
148
- optional :string, :server_tags, 10
149
- optional :string, :application_tags, 11
150
- optional :string, :library_tags, 12
151
- optional :string, :finding_tags, 13
152
- optional :string, :agent_version, 14
153
- end
154
-
155
- class ApplicationCreate
156
- optional :string, :group, 1
157
- optional :string, :app_version, 2
158
- optional :string, :tags, 3, :deprecated => true
159
- optional :string, :code, 4
160
- optional :string, :metadata, 5
161
- optional :string, :session_id, 6
162
- optional :string, :session_metadata, 7
163
- optional ::Contrast::Api::Dtm::InstrumentationMode, :mode, 10
164
- end
165
-
166
- class InstrumentationMode
167
- optional :bool, :protect, 1
168
- optional :bool, :assess, 2
169
- end
170
-
171
- class Address
172
- optional :string, :ip, 1
173
- optional :string, :host, 2
174
- optional :int32, :port, 3
175
- end
176
-
177
- class HttpRequest
178
- optional :string, :uuid, 1
179
- optional :int64, :timestamp_ms, 2
180
- optional ::Contrast::Api::Dtm::Address, :sender, 3
181
- optional ::Contrast::Api::Dtm::Address, :receiver, 4
182
- optional :string, :protocol, 5
183
- optional :string, :version, 6
184
- optional :string, :method, 7
185
- optional :string, :raw, 8
186
- optional :bool, :parsed_connection, 9
187
- optional :string, :uri, 10
188
- optional :string, :normalized_uri, 11
189
- optional :string, :context, 12
190
- optional :string, :path, 13
191
- optional :string, :query_string, 14
192
- map :string, ::Contrast::Api::Dtm::Pair, :normalized_request_params, 16
193
- repeated ::Contrast::Api::Dtm::SimplePair, :multipart_headers, 51
194
- map :string, :string, :request_headers, 20
195
- optional :bool, :parsed_request_headers, 21
196
- map :string, ::Contrast::Api::Dtm::Pair, :normalized_request_headers, 22, :deprecated => true
197
- map :string, ::Contrast::Api::Dtm::Pair, :normalized_cookies, 23
198
- optional :string, :request_body, 30, :deprecated => true
199
- optional :bool, :parsed_request_body, 31
200
- optional ::Contrast::Api::Dtm::HttpRequest::DocumentType, :document_type, 32
201
- optional :bytes, :request_body_binary, 33
202
- optional ::Contrast::Api::Dtm::HttpRequest::Authentication, :authentication, 40
203
- optional :string, :principal, 41
204
- optional :string, :server_info, 50
205
- end
206
-
207
- class SimplePair
208
- optional :string, :key, 1
209
- optional :string, :value, 2
210
- end
211
-
212
- class Pair
213
- optional :string, :key, 1
214
- repeated :string, :values, 2
215
- end
216
-
217
- class AttackResult
218
- optional ::Contrast::Api::Dtm::AttackResult::ResponseType, :response, 1
219
- optional :string, :rule_id, 2
220
- repeated ::Contrast::Api::Dtm::RaspRuleSample, :samples, 6
221
- optional :string, :tags, 7, :deprecated => true
222
- optional :int64, :acc_updated_ms, 16
223
- optional :int32, :acc_limit, 17
224
- optional :int64, :acc_window_ms, 18
225
- optional :int32, :acc_count, 19
226
- optional :string, :acc_mode, 21
227
- optional :string, :acc_msg, 22
228
- end
229
-
230
- class RaspRuleSample
231
- optional :int64, :timestamp_ms, 2
232
- repeated ::Contrast::Api::Dtm::StackTraceElement, :stack_trace_elements, 4
233
- optional ::Contrast::Api::Dtm::UserInput, :user_input, 5
234
- optional ::Contrast::Api::Dtm::BotBlockerDetails, :bot_blocker, 17
235
- optional ::Contrast::Api::Dtm::CmdInjectionDetails, :cmdi, 18
236
- optional ::Contrast::Api::Dtm::UntrustedDeserializationDetails, :untrusted_deserialization, 21
237
- optional ::Contrast::Api::Dtm::IpDenylistDetails, :ip_denylist, 45
238
- optional ::Contrast::Api::Dtm::PathTraversalDetails, :path_traversal, 26
239
- optional ::Contrast::Api::Dtm::ReDosDetails, :re_dos, 27
240
- optional ::Contrast::Api::Dtm::SqlInjectionDetails, :sqli, 28
241
- optional ::Contrast::Api::Dtm::SsrfDetails, :ssrf, 29
242
- optional ::Contrast::Api::Dtm::VirtualPatchDetails, :virtual_patch, 30
243
- optional ::Contrast::Api::Dtm::XssDetails, :xss, 31
244
- optional ::Contrast::Api::Dtm::XxeDetails, :xxe, 32
245
- optional ::Contrast::Api::Dtm::NoSqlInjectionDetails, :no_sqli, 33
246
- optional ::Contrast::Api::Dtm::HttpMethodTamperingDetails, :method_tampering, 34
247
- optional ::Contrast::Api::Dtm::PathTraversalSemanticAnalysisDetails, :path_traversal_semantic, 43
248
- end
249
-
250
- class BotBlockerDetails
251
- optional :string, :bot, 1
252
- optional :string, :user_agent, 2
253
- end
254
-
255
- class CmdInjectionDetails
256
- optional :string, :command, 1
257
- optional :int32, :start_idx, 2
258
- optional :int32, :end_idx, 3
259
- end
260
-
261
- class HttpMethodTamperingDetails
262
- optional :string, :method, 1
263
- optional :int32, :response_code, 2
264
- end
265
-
266
- class UntrustedDeserializationDetails
267
- optional :bool, :command, 1
268
- optional :string, :deserializer, 2
269
- end
270
-
271
- class IpDenylistDetails
272
- optional :string, :ip, 1
273
- optional :string, :uuid, 2
274
- end
275
-
276
- class PathTraversalDetails
277
- optional :string, :path, 1
278
- end
279
-
280
- class PathTraversalSemanticAnalysisDetails
281
- optional :string, :path, 1
282
- repeated ::Contrast::Api::Dtm::PathTraversalSemanticAnalysisDetails::Finding, :findings, 2
283
- end
284
-
285
- class ReDosDetails
286
- optional :int32, :times_accessed, 1
287
- optional :int64, :execution_time_ms, 2
288
- optional :string, :pattern, 3
289
- optional :string, :offending_string, 4
290
- end
291
-
292
- class SqlInjectionDetails
293
- optional :int32, :start_idx, 1
294
- optional :int32, :end_idx, 2
295
- optional :int32, :boundary_overrun_idx, 3
296
- optional :int32, :input_boundary_idx, 4
297
- optional :string, :query, 5
298
- end
299
-
300
- class NoSqlInjectionDetails
301
- optional :int32, :start_idx, 1
302
- optional :int32, :end_idx, 2
303
- optional :int32, :boundary_overrun_idx, 3
304
- optional :int32, :input_boundary_idx, 4
305
- optional :string, :query, 5
306
- end
307
-
308
- class SsrfDetails
309
- optional :string, :url, 1
310
- end
311
-
312
- class VirtualPatchDetails
313
- optional :string, :uuid, 1
314
- end
315
-
316
- class XssDetails
317
- optional :string, :input, 1
318
- repeated ::Contrast::Api::Dtm::XssMatch, :matches, 2
319
- end
320
-
321
- class XssMatch
322
- optional :int64, :evidence_start_ms, 1
323
- optional :string, :evidence, 2
324
- optional :int32, :offset, 3
325
- end
326
-
327
- class XxeDetails
328
- optional :string, :xml, 1
329
- repeated ::Contrast::Api::Dtm::XxeMatch, :declared_entities, 2
330
- repeated ::Contrast::Api::Dtm::XxeWrapper, :entities_resolved, 3
331
- end
332
-
333
- class XxeMatch
334
- optional :int32, :start_idx, 1
335
- optional :int32, :end_idx, 2
336
- end
337
-
338
- class XxeWrapper
339
- optional :string, :system_id, 1
340
- optional :string, :public_id, 2
341
- end
342
-
343
- class UserInput
344
- optional :string, :path, 2
345
- optional :string, :key, 3
346
- optional :string, :value, 4
347
- optional ::Contrast::Api::Dtm::UserInput::InputType, :input_type, 5
348
- optional ::Contrast::Api::Dtm::HttpRequest::DocumentType, :document_type, 6
349
- repeated :string, :matcher_ids, 7
350
- end
351
-
352
- class StackTraceElement
353
- optional :string, :declaring_class, 1
354
- optional :string, :method_name, 2
355
- optional :string, :file_name, 3
356
- optional :int32, :line_number, 4
357
- end
358
- end
359
-
360
- end
361
-
362
- end
363
-