contrast-agent 3.11.0 → 3.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (217) hide show
  1. checksums.yaml +4 -4
  2. data/.flayignore +1 -0
  3. data/ext/cs__assess_active_record_named/cs__active_record_named.c +7 -2
  4. data/ext/cs__assess_active_record_named/cs__active_record_named.h +1 -0
  5. data/ext/cs__assess_array/cs__assess_array.c +2 -1
  6. data/ext/cs__assess_array/cs__assess_array.h +1 -0
  7. data/ext/cs__assess_basic_object/cs__assess_basic_object.c +3 -7
  8. data/ext/cs__assess_basic_object/cs__assess_basic_object.h +2 -1
  9. data/ext/cs__assess_kernel/cs__assess_kernel.c +1 -1
  10. data/ext/cs__assess_module/cs__assess_module.c +5 -7
  11. data/ext/cs__assess_module/cs__assess_module.h +3 -0
  12. data/ext/cs__common/cs__common.c +1 -1
  13. data/ext/cs__protect_kernel/cs__protect_kernel.c +4 -2
  14. data/ext/cs__protect_kernel/cs__protect_kernel.h +1 -0
  15. data/funchook/autom4te.cache/output.0 +13 -1
  16. data/funchook/autom4te.cache/requests +49 -48
  17. data/funchook/autom4te.cache/traces.0 +3 -0
  18. data/funchook/config.log +217 -378
  19. data/funchook/config.status +24 -23
  20. data/funchook/configure +13 -1
  21. data/funchook/src/Makefile +7 -7
  22. data/funchook/src/config.h +2 -2
  23. data/funchook/src/decoder.o +0 -0
  24. data/funchook/src/distorm.o +0 -0
  25. data/funchook/src/funchook.o +0 -0
  26. data/funchook/src/funchook_io.o +0 -0
  27. data/funchook/src/funchook_syscall.o +0 -0
  28. data/funchook/src/funchook_unix.o +0 -0
  29. data/funchook/src/funchook_x86.o +0 -0
  30. data/funchook/src/instructions.o +0 -0
  31. data/funchook/src/insts.o +0 -0
  32. data/funchook/src/libfunchook.so +0 -0
  33. data/funchook/src/mnemonics.o +0 -0
  34. data/funchook/src/operands.o +0 -0
  35. data/funchook/src/os_func.o +0 -0
  36. data/funchook/src/os_func_unix.o +0 -0
  37. data/funchook/src/prefix.o +0 -0
  38. data/funchook/src/printf_base.o +0 -0
  39. data/funchook/src/textdefs.o +0 -0
  40. data/funchook/src/wstring.o +0 -0
  41. data/funchook/test/Makefile +2 -2
  42. data/funchook/test/funchook_test +0 -0
  43. data/funchook/test/libfunchook_test.so +0 -0
  44. data/funchook/test/test_main.o +0 -0
  45. data/funchook/test/x86_64_test.o +0 -0
  46. data/lib/contrast.rb +0 -1
  47. data/lib/contrast/agent.rb +19 -22
  48. data/lib/contrast/agent/assess.rb +0 -9
  49. data/lib/contrast/agent/assess/policy/patcher.rb +1 -0
  50. data/lib/contrast/agent/assess/policy/policy_node.rb +1 -1
  51. data/lib/contrast/agent/assess/policy/policy_scanner.rb +1 -1
  52. data/lib/contrast/agent/assess/policy/propagation_method.rb +3 -0
  53. data/lib/contrast/agent/assess/policy/propagator/custom.rb +1 -1
  54. data/lib/contrast/agent/assess/policy/propagator/database_write.rb +1 -3
  55. data/lib/contrast/agent/assess/policy/trigger/reflected_xss.rb +90 -0
  56. data/lib/contrast/agent/assess/policy/trigger/xpath.rb +57 -0
  57. data/lib/contrast/agent/assess/policy/trigger_method.rb +3 -7
  58. data/lib/contrast/agent/assess/policy/trigger_node.rb +4 -1
  59. data/lib/contrast/agent/assess/rule/base.rb +0 -15
  60. data/lib/contrast/agent/assess/rule/provider/hardcoded_value_rule.rb +22 -5
  61. data/lib/contrast/agent/assess/rule/redos.rb +0 -1
  62. data/lib/contrast/agent/at_exit_hook.rb +2 -2
  63. data/lib/contrast/agent/class_reopener.rb +9 -4
  64. data/lib/contrast/agent/exclusion_matcher.rb +0 -1
  65. data/lib/contrast/agent/inventory/policy/datastores.rb +54 -0
  66. data/lib/contrast/agent/inventory/policy/policy.rb +1 -1
  67. data/lib/contrast/agent/middleware.rb +38 -34
  68. data/lib/contrast/agent/patching/policy/after_load_patch.rb +11 -2
  69. data/lib/contrast/agent/patching/policy/after_load_patcher.rb +51 -56
  70. data/lib/contrast/agent/patching/policy/patch.rb +2 -1
  71. data/lib/contrast/agent/patching/policy/patcher.rb +10 -12
  72. data/lib/contrast/agent/patching/policy/policy_node.rb +1 -1
  73. data/lib/contrast/agent/patching/policy/trigger_node.rb +1 -1
  74. data/lib/contrast/agent/protect/policy/applies_command_injection_rule.rb +63 -0
  75. data/lib/contrast/agent/protect/policy/applies_deserialization_rule.rb +52 -0
  76. data/lib/contrast/agent/protect/policy/applies_no_sqli_rule.rb +68 -0
  77. data/lib/contrast/agent/protect/policy/applies_path_traversal_rule.rb +117 -0
  78. data/lib/contrast/agent/protect/policy/applies_sqli_rule.rb +54 -0
  79. data/lib/contrast/agent/protect/policy/applies_xxe_rule.rb +129 -0
  80. data/lib/contrast/agent/protect/policy/policy.rb +6 -6
  81. data/lib/contrast/agent/protect/policy/rule_applicator.rb +51 -0
  82. data/lib/contrast/agent/protect/rule.rb +0 -5
  83. data/lib/contrast/agent/protect/rule/base.rb +6 -5
  84. data/lib/contrast/agent/protect/rule/cmd_injection.rb +3 -3
  85. data/lib/contrast/agent/protect/rule/path_traversal.rb +2 -7
  86. data/lib/contrast/agent/protect/rule/sqli.rb +4 -4
  87. data/lib/contrast/agent/railtie.rb +1 -0
  88. data/lib/contrast/agent/request.rb +2 -6
  89. data/lib/contrast/agent/request_context.rb +5 -6
  90. data/lib/contrast/agent/request_handler.rb +2 -2
  91. data/lib/contrast/agent/response.rb +0 -69
  92. data/lib/contrast/agent/service_heartbeat.rb +2 -2
  93. data/lib/contrast/agent/socket_client.rb +8 -8
  94. data/lib/contrast/agent/static_analysis.rb +2 -3
  95. data/lib/contrast/agent/version.rb +1 -1
  96. data/lib/contrast/api/decorators/application_settings.rb +1 -1
  97. data/lib/contrast/api/speedracer.rb +1 -1
  98. data/lib/contrast/components/agent.rb +17 -12
  99. data/lib/contrast/components/app_context.rb +33 -1
  100. data/lib/contrast/components/assess.rb +25 -15
  101. data/lib/contrast/components/contrast_service.rb +23 -67
  102. data/lib/contrast/components/interface.rb +4 -12
  103. data/lib/contrast/components/inventory.rb +5 -1
  104. data/lib/contrast/components/logger.rb +2 -2
  105. data/lib/contrast/components/protect.rb +40 -4
  106. data/lib/contrast/components/scope.rb +2 -52
  107. data/lib/contrast/components/settings.rb +24 -18
  108. data/lib/contrast/config/protect_rules_configuration.rb +0 -1
  109. data/lib/contrast/{extensions/ruby_core → extension}/assess.rb +12 -14
  110. data/lib/contrast/extension/assess/array.rb +77 -0
  111. data/lib/contrast/{extensions/ruby_core → extension}/assess/assess_extension.rb +2 -2
  112. data/lib/contrast/{extensions/ruby_core → extension}/assess/erb.rb +0 -0
  113. data/lib/contrast/extension/assess/eval_trigger.rb +78 -0
  114. data/lib/contrast/{extensions/ruby_core → extension}/assess/exec_trigger.rb +1 -1
  115. data/lib/contrast/{extensions/ruby_core → extension}/assess/fiber.rb +6 -5
  116. data/lib/contrast/{extensions/ruby_core → extension}/assess/hash.rb +2 -2
  117. data/lib/contrast/extension/assess/kernel.rb +110 -0
  118. data/lib/contrast/{extensions/ruby_core → extension}/assess/regexp.rb +4 -4
  119. data/lib/contrast/{extensions/ruby_core → extension}/assess/string.rb +5 -5
  120. data/lib/contrast/{extensions/ruby_core → extension}/delegator.rb +0 -0
  121. data/lib/contrast/{extensions/ruby_core → extension}/inventory.rb +2 -2
  122. data/lib/contrast/extension/kernel.rb +54 -0
  123. data/lib/contrast/{extensions/ruby_core → extension}/module.rb +0 -0
  124. data/lib/contrast/{extensions/ruby_core → extension}/protect.rb +2 -2
  125. data/lib/contrast/extension/protect/kernel.rb +44 -0
  126. data/lib/contrast/{extensions/ruby_core → extension}/protect/psych.rb +1 -1
  127. data/lib/contrast/{extensions/ruby_core → extension}/thread.rb +0 -0
  128. data/lib/contrast/framework/base_support.rb +22 -0
  129. data/lib/contrast/framework/manager.rb +33 -8
  130. data/lib/contrast/framework/rack/patch/session_cookie.rb +126 -0
  131. data/lib/contrast/framework/rack/patch/support.rb +24 -0
  132. data/lib/contrast/framework/rack/support.rb +22 -0
  133. data/lib/contrast/framework/rails/patch/action_controller_live_buffer.rb +43 -0
  134. data/lib/contrast/framework/rails/patch/assess_configuration.rb +103 -0
  135. data/lib/contrast/framework/rails/patch/rails_application_configuration.rb +31 -0
  136. data/lib/contrast/framework/rails/patch/support.rb +67 -0
  137. data/lib/contrast/framework/rails/rewrite/action_controller_railties_helper_inherited.rb +34 -0
  138. data/lib/contrast/framework/rails/rewrite/active_record_attribute_methods_read.rb +39 -0
  139. data/lib/contrast/framework/rails/rewrite/active_record_named.rb +73 -0
  140. data/lib/contrast/framework/rails/rewrite/active_record_time_zone_inherited.rb +33 -0
  141. data/lib/contrast/framework/rails/support.rb +115 -0
  142. data/lib/contrast/framework/sinatra/application_helper.rb +51 -0
  143. data/lib/contrast/framework/sinatra/patch/base.rb +83 -0
  144. data/lib/contrast/framework/sinatra/patch/support.rb +27 -0
  145. data/lib/contrast/framework/sinatra/support.rb +109 -0
  146. data/lib/contrast/logger/application.rb +80 -0
  147. data/lib/contrast/{agent/logger.rb → logger/log.rb} +23 -54
  148. data/lib/contrast/logger/time.rb +50 -0
  149. data/lib/contrast/tasks/config.rb +54 -0
  150. data/lib/contrast/tasks/service.rb +1 -5
  151. data/lib/contrast/utils/class_util.rb +1 -1
  152. data/lib/contrast/utils/gemfile_reader.rb +2 -2
  153. data/lib/contrast/utils/hash_digest.rb +2 -7
  154. data/lib/contrast/utils/invalid_configuration_util.rb +3 -3
  155. data/lib/contrast/utils/job_servers_running.rb +4 -2
  156. data/lib/contrast/utils/object_share.rb +0 -1
  157. data/lib/contrast/utils/service_response_util.rb +14 -12
  158. data/lib/contrast/utils/service_sender_util.rb +78 -21
  159. data/resources/assess/policy.json +9 -50
  160. data/resources/inventory/policy.json +2 -2
  161. data/resources/protect/policy.json +6 -6
  162. data/ruby-agent.gemspec +5 -1
  163. data/service_executables/VERSION +1 -1
  164. data/service_executables/linux/contrast-service +0 -0
  165. data/service_executables/mac/contrast-service +0 -0
  166. metadata +69 -83
  167. data/funchook/src/libfunchook.dylib +0 -0
  168. data/funchook/test/libfunchook_test.so.dSYM/Contents/Info.plist +0 -20
  169. data/funchook/test/libfunchook_test.so.dSYM/Contents/Resources/DWARF/libfunchook_test.so +0 -0
  170. data/lib/contrast/agent/assess/rule/csrf.rb +0 -66
  171. data/lib/contrast/agent/assess/rule/csrf/csrf_action.rb +0 -28
  172. data/lib/contrast/agent/assess/rule/csrf/csrf_applicator.rb +0 -53
  173. data/lib/contrast/agent/assess/rule/csrf/csrf_watcher.rb +0 -136
  174. data/lib/contrast/agent/assess/rule/response_scanning_rule.rb +0 -47
  175. data/lib/contrast/agent/assess/rule/response_watcher.rb +0 -36
  176. data/lib/contrast/agent/assess/rule/watcher.rb +0 -36
  177. data/lib/contrast/agent/feature_state.rb +0 -346
  178. data/lib/contrast/agent/protect/rule/csrf.rb +0 -119
  179. data/lib/contrast/agent/protect/rule/csrf/csrf_evaluator.rb +0 -100
  180. data/lib/contrast/agent/protect/rule/csrf/csrf_token_injector.rb +0 -85
  181. data/lib/contrast/agent/settings_state.rb +0 -88
  182. data/lib/contrast/api/decorators/exclusion.rb +0 -20
  183. data/lib/contrast/extensions/framework/rack/cookie.rb +0 -24
  184. data/lib/contrast/extensions/framework/rack/request.rb +0 -24
  185. data/lib/contrast/extensions/framework/rack/response.rb +0 -23
  186. data/lib/contrast/extensions/framework/rails/action_controller_inheritance.rb +0 -39
  187. data/lib/contrast/extensions/framework/rails/action_controller_railties_helper_inherited.rb +0 -20
  188. data/lib/contrast/extensions/framework/rails/active_record.rb +0 -26
  189. data/lib/contrast/extensions/framework/rails/active_record_named.rb +0 -58
  190. data/lib/contrast/extensions/framework/rails/active_record_time_zone_inherited.rb +0 -21
  191. data/lib/contrast/extensions/framework/rails/buffer.rb +0 -28
  192. data/lib/contrast/extensions/framework/rails/configuration.rb +0 -27
  193. data/lib/contrast/extensions/framework/sinatra/base.rb +0 -59
  194. data/lib/contrast/extensions/ruby_core/assess/array.rb +0 -59
  195. data/lib/contrast/extensions/ruby_core/assess/basic_object.rb +0 -15
  196. data/lib/contrast/extensions/ruby_core/assess/kernel.rb +0 -96
  197. data/lib/contrast/extensions/ruby_core/assess/module.rb +0 -14
  198. data/lib/contrast/extensions/ruby_core/assess/tilt_template_trigger.rb +0 -78
  199. data/lib/contrast/extensions/ruby_core/assess/xpath_library_trigger.rb +0 -40
  200. data/lib/contrast/extensions/ruby_core/eval_trigger.rb +0 -51
  201. data/lib/contrast/extensions/ruby_core/inventory/datastores.rb +0 -37
  202. data/lib/contrast/extensions/ruby_core/protect/applies_command_injection_rule.rb +0 -61
  203. data/lib/contrast/extensions/ruby_core/protect/applies_deserialization_rule.rb +0 -50
  204. data/lib/contrast/extensions/ruby_core/protect/applies_no_sqli_rule.rb +0 -66
  205. data/lib/contrast/extensions/ruby_core/protect/applies_path_traversal_rule.rb +0 -115
  206. data/lib/contrast/extensions/ruby_core/protect/applies_sqli_rule.rb +0 -53
  207. data/lib/contrast/extensions/ruby_core/protect/applies_xxe_rule.rb +0 -127
  208. data/lib/contrast/extensions/ruby_core/protect/kernel.rb +0 -30
  209. data/lib/contrast/extensions/ruby_core/protect/rule_applicator.rb +0 -50
  210. data/lib/contrast/framework/rails_support.rb +0 -104
  211. data/lib/contrast/framework/sinatra_application_helper.rb +0 -49
  212. data/lib/contrast/framework/sinatra_support.rb +0 -104
  213. data/lib/contrast/utils/data_store_util.rb +0 -23
  214. data/lib/contrast/utils/rack_assess_session_cookie.rb +0 -104
  215. data/lib/contrast/utils/rails_assess_configuration.rb +0 -95
  216. data/lib/contrast/utils/random_util.rb +0 -22
  217. data/resources/csrf/inject.js +0 -44
@@ -2,8 +2,8 @@
2
2
  "rules":[
3
3
  {
4
4
  "name":"data_store",
5
- "applicator": "Contrast::CoreExtensions::Inventory::DataStores",
6
- "applicator_method": "patched_report_data_store",
5
+ "applicator": "Contrast::Agent::Inventory::Policy::DataStores",
6
+ "applicator_method": "report_data_store",
7
7
  "required_properties": ["data_store"],
8
8
  "optional_properties": [],
9
9
  "triggers":[
@@ -2,7 +2,7 @@
2
2
  "rules":[
3
3
  {
4
4
  "name": "cmd-injection",
5
- "applicator": "Contrast::CoreExtensions::Protect::AppliesCommandInjectionRule",
5
+ "applicator": "Contrast::Agent::Protect::Policy::AppliesCommandInjectionRule",
6
6
  "applicator_method": "apply_rule",
7
7
  "required_properties": [],
8
8
  "optional_properties": [],
@@ -114,7 +114,7 @@
114
114
  },
115
115
  {
116
116
  "name": "nosql-injection",
117
- "applicator": "Contrast::CoreExtensions::Protect::AppliesNoSqliRule",
117
+ "applicator": "Contrast::Agent::Protect::Policy::AppliesNoSqliRule",
118
118
  "applicator_method": "apply_rule",
119
119
  "required_properties": ["database"],
120
120
  "optional_properties": [],
@@ -156,7 +156,7 @@
156
156
  },
157
157
  {
158
158
  "name":"path-traversal",
159
- "applicator": "Contrast::CoreExtensions::Protect::AppliesPathTraversalRule",
159
+ "applicator": "Contrast::Agent::Protect::Policy::AppliesPathTraversalRule",
160
160
  "applicator_method": "apply_rule",
161
161
  "required_properties": ["action"],
162
162
  "optional_properties": [],
@@ -254,7 +254,7 @@
254
254
  },
255
255
  {
256
256
  "name": "sql-injection",
257
- "applicator": "Contrast::CoreExtensions::Protect::AppliesSqliRule",
257
+ "applicator": "Contrast::Agent::Protect::Policy::AppliesSqliRule",
258
258
  "applicator_method": "apply_rule",
259
259
  "required_properties": ["index", "database"],
260
260
  "optional_properties": [],
@@ -336,7 +336,7 @@
336
336
  },
337
337
  {
338
338
  "name": "untrusted-deserialization",
339
- "applicator": "Contrast::CoreExtensions::Protect::AppliesDeserializationRule",
339
+ "applicator": "Contrast::Agent::Protect::Policy::AppliesDeserializationRule",
340
340
  "applicator_method": "apply_rule",
341
341
  "required_properties": [],
342
342
  "optional_properties": [],
@@ -361,7 +361,7 @@
361
361
  },
362
362
  {
363
363
  "name": "xxe",
364
- "applicator": "Contrast::CoreExtensions::Protect::AppliesXxeRule",
364
+ "applicator": "Contrast::Agent::Protect::Policy::AppliesXxeRule",
365
365
  "applicator_method": "apply_rule",
366
366
  "required_properties": [],
367
367
  "optional_properties": [],
@@ -71,7 +71,7 @@ def self.add_dependencies spec
71
71
  spec.add_dependency 'google-protobuf', '~> 3.9.0'
72
72
  spec.add_dependency 'ougai', '~> 1.8'
73
73
  spec.add_dependency 'parser', '~> 2.6'
74
- spec.add_dependency 'rack', '>= 1.0', '< 3.0'
74
+ spec.add_dependency 'rack', '>= 2.0', '< 3.0'
75
75
  end
76
76
 
77
77
  # Enumerate the files required to build the Agent.
@@ -126,6 +126,10 @@ Gem::Specification.new do |spec|
126
126
  spec.extensions = Dir['ext/cs__common/extconf.rb', 'ext/**/extconf.rb']
127
127
  spec.require_paths = ['lib']
128
128
 
129
+ unless File.exist?(File.join(Dir.pwd, 'contrast_security.yaml'))
130
+ spec.post_install_message = 'To generate the required contrast_security.yaml file you can run: bundle exec rake contrast:config:create'
131
+ end
132
+
129
133
  add_authors(spec)
130
134
  add_files(spec)
131
135
  add_dev_dependencies(spec)
@@ -1 +1 @@
1
- 2.6.4
1
+ 2.8.1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contrast-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.11.0
4
+ version: 3.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - galen.palmer@contrastsecurity.com
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: exe
14
14
  cert_chain: []
15
- date: 2020-05-26 00:00:00.000000000 Z
15
+ date: 2020-06-22 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: amazing_print
@@ -440,7 +440,7 @@ dependencies:
440
440
  requirements:
441
441
  - - ">="
442
442
  - !ruby/object:Gem::Version
443
- version: '1.0'
443
+ version: '2.0'
444
444
  - - "<"
445
445
  - !ruby/object:Gem::Version
446
446
  version: '3.0'
@@ -450,7 +450,7 @@ dependencies:
450
450
  requirements:
451
451
  - - ">="
452
452
  - !ruby/object:Gem::Version
453
- version: '1.0'
453
+ version: '2.0'
454
454
  - - "<"
455
455
  - !ruby/object:Gem::Version
456
456
  version: '3.0'
@@ -462,24 +462,25 @@ executables:
462
462
  - contrast_service
463
463
  extensions:
464
464
  - ext/cs__common/extconf.rb
465
- - ext/cs__assess_module/extconf.rb
466
- - ext/cs__assess_yield_track/extconf.rb
467
- - ext/cs__assess_hash/extconf.rb
468
- - ext/cs__protect_kernel/extconf.rb
469
- - ext/cs__assess_regexp/extconf.rb
465
+ - ext/cs__assess_marshal_module/extconf.rb
466
+ - ext/cs__assess_basic_object/extconf.rb
467
+ - ext/cs__assess_fiber_track/extconf.rb
470
468
  - ext/cs__assess_string_interpolation26/extconf.rb
471
- - ext/cs__assess_kernel/extconf.rb
469
+ - ext/cs__contrast_patch/extconf.rb
472
470
  - ext/cs__assess_array/extconf.rb
473
- - ext/cs__assess_fiber_track/extconf.rb
474
- - ext/cs__assess_marshal_module/extconf.rb
471
+ - ext/cs__assess_kernel/extconf.rb
475
472
  - ext/cs__assess_string/extconf.rb
476
- - ext/cs__contrast_patch/extconf.rb
477
- - ext/cs__assess_basic_object/extconf.rb
473
+ - ext/cs__assess_hash/extconf.rb
474
+ - ext/cs__assess_module/extconf.rb
475
+ - ext/cs__assess_regexp/extconf.rb
476
+ - ext/cs__assess_yield_track/extconf.rb
478
477
  - ext/cs__assess_active_record_named/extconf.rb
478
+ - ext/cs__protect_kernel/extconf.rb
479
479
  extra_rdoc_files: []
480
480
  files:
481
481
  - ".clang-format"
482
482
  - ".dockerignore"
483
+ - ".flayignore"
483
484
  - ".gitignore"
484
485
  - ".gitmodules"
485
486
  - ".rspec"
@@ -663,7 +664,7 @@ files:
663
664
  - funchook/src/funchook_x86.o
664
665
  - funchook/src/instructions.o
665
666
  - funchook/src/insts.o
666
- - funchook/src/libfunchook.dylib
667
+ - funchook/src/libfunchook.so
667
668
  - funchook/src/mnemonics.o
668
669
  - funchook/src/operands.o
669
670
  - funchook/src/os_func.c
@@ -683,8 +684,6 @@ files:
683
684
  - funchook/test/funchook_test
684
685
  - funchook/test/libfunchook_test.c
685
686
  - funchook/test/libfunchook_test.so
686
- - funchook/test/libfunchook_test.so.dSYM/Contents/Info.plist
687
- - funchook/test/libfunchook_test.so.dSYM/Contents/Resources/DWARF/libfunchook_test.so
688
687
  - funchook/test/libfunchook_test2.c
689
688
  - funchook/test/suffix.list
690
689
  - funchook/test/test_main.c
@@ -742,6 +741,8 @@ files:
742
741
  - lib/contrast/agent/assess/policy/source_node.rb
743
742
  - lib/contrast/agent/assess/policy/source_validation/cross_site_validator.rb
744
743
  - lib/contrast/agent/assess/policy/source_validation/source_validation.rb
744
+ - lib/contrast/agent/assess/policy/trigger/reflected_xss.rb
745
+ - lib/contrast/agent/assess/policy/trigger/xpath.rb
745
746
  - lib/contrast/agent/assess/policy/trigger_method.rb
746
747
  - lib/contrast/agent/assess/policy/trigger_node.rb
747
748
  - lib/contrast/agent/assess/policy/trigger_validation/ssrf_validator.rb
@@ -750,18 +751,11 @@ files:
750
751
  - lib/contrast/agent/assess/properties.rb
751
752
  - lib/contrast/agent/assess/rule.rb
752
753
  - lib/contrast/agent/assess/rule/base.rb
753
- - lib/contrast/agent/assess/rule/csrf.rb
754
- - lib/contrast/agent/assess/rule/csrf/csrf_action.rb
755
- - lib/contrast/agent/assess/rule/csrf/csrf_applicator.rb
756
- - lib/contrast/agent/assess/rule/csrf/csrf_watcher.rb
757
754
  - lib/contrast/agent/assess/rule/provider.rb
758
755
  - lib/contrast/agent/assess/rule/provider/hardcoded_key.rb
759
756
  - lib/contrast/agent/assess/rule/provider/hardcoded_password.rb
760
757
  - lib/contrast/agent/assess/rule/provider/hardcoded_value_rule.rb
761
758
  - lib/contrast/agent/assess/rule/redos.rb
762
- - lib/contrast/agent/assess/rule/response_scanning_rule.rb
763
- - lib/contrast/agent/assess/rule/response_watcher.rb
764
- - lib/contrast/agent/assess/rule/watcher.rb
765
759
  - lib/contrast/agent/assess/tag.rb
766
760
  - lib/contrast/agent/at_exit_hook.rb
767
761
  - lib/contrast/agent/class_reopener.rb
@@ -769,10 +763,9 @@ files:
769
763
  - lib/contrast/agent/deadzone/policy/policy.rb
770
764
  - lib/contrast/agent/disable_reaction.rb
771
765
  - lib/contrast/agent/exclusion_matcher.rb
772
- - lib/contrast/agent/feature_state.rb
766
+ - lib/contrast/agent/inventory/policy/datastores.rb
773
767
  - lib/contrast/agent/inventory/policy/policy.rb
774
768
  - lib/contrast/agent/inventory/policy/trigger_node.rb
775
- - lib/contrast/agent/logger.rb
776
769
  - lib/contrast/agent/middleware.rb
777
770
  - lib/contrast/agent/module_data.rb
778
771
  - lib/contrast/agent/patching/policy/after_load_patch.rb
@@ -785,15 +778,19 @@ files:
785
778
  - lib/contrast/agent/patching/policy/policy.rb
786
779
  - lib/contrast/agent/patching/policy/policy_node.rb
787
780
  - lib/contrast/agent/patching/policy/trigger_node.rb
781
+ - lib/contrast/agent/protect/policy/applies_command_injection_rule.rb
782
+ - lib/contrast/agent/protect/policy/applies_deserialization_rule.rb
783
+ - lib/contrast/agent/protect/policy/applies_no_sqli_rule.rb
784
+ - lib/contrast/agent/protect/policy/applies_path_traversal_rule.rb
785
+ - lib/contrast/agent/protect/policy/applies_sqli_rule.rb
786
+ - lib/contrast/agent/protect/policy/applies_xxe_rule.rb
788
787
  - lib/contrast/agent/protect/policy/policy.rb
788
+ - lib/contrast/agent/protect/policy/rule_applicator.rb
789
789
  - lib/contrast/agent/protect/policy/trigger_node.rb
790
790
  - lib/contrast/agent/protect/rule.rb
791
791
  - lib/contrast/agent/protect/rule/base.rb
792
792
  - lib/contrast/agent/protect/rule/base_service.rb
793
793
  - lib/contrast/agent/protect/rule/cmd_injection.rb
794
- - lib/contrast/agent/protect/rule/csrf.rb
795
- - lib/contrast/agent/protect/rule/csrf/csrf_evaluator.rb
796
- - lib/contrast/agent/protect/rule/csrf/csrf_token_injector.rb
797
794
  - lib/contrast/agent/protect/rule/default_scanner.rb
798
795
  - lib/contrast/agent/protect/rule/deserialization.rb
799
796
  - lib/contrast/agent/protect/rule/http_method_tampering.rb
@@ -820,7 +817,6 @@ files:
820
817
  - lib/contrast/agent/rule_set.rb
821
818
  - lib/contrast/agent/scope.rb
822
819
  - lib/contrast/agent/service_heartbeat.rb
823
- - lib/contrast/agent/settings_state.rb
824
820
  - lib/contrast/agent/socket_client.rb
825
821
  - lib/contrast/agent/static_analysis.rb
826
822
  - lib/contrast/agent/thread.rb
@@ -832,7 +828,6 @@ files:
832
828
  - lib/contrast/api/decorators.rb
833
829
  - lib/contrast/api/decorators/application_settings.rb
834
830
  - lib/contrast/api/decorators/application_update.rb
835
- - lib/contrast/api/decorators/exclusion.rb
836
831
  - lib/contrast/api/decorators/input_analysis.rb
837
832
  - lib/contrast/api/decorators/server_features.rb
838
833
  - lib/contrast/api/dtm_pb.rb
@@ -875,63 +870,57 @@ files:
875
870
  - lib/contrast/config/server_configuration.rb
876
871
  - lib/contrast/config/service_configuration.rb
877
872
  - lib/contrast/configuration.rb
878
- - lib/contrast/extensions/framework/rack/cookie.rb
879
- - lib/contrast/extensions/framework/rack/request.rb
880
- - lib/contrast/extensions/framework/rack/response.rb
881
- - lib/contrast/extensions/framework/rails/action_controller_inheritance.rb
882
- - lib/contrast/extensions/framework/rails/action_controller_railties_helper_inherited.rb
883
- - lib/contrast/extensions/framework/rails/active_record.rb
884
- - lib/contrast/extensions/framework/rails/active_record_named.rb
885
- - lib/contrast/extensions/framework/rails/active_record_time_zone_inherited.rb
886
- - lib/contrast/extensions/framework/rails/buffer.rb
887
- - lib/contrast/extensions/framework/rails/configuration.rb
888
- - lib/contrast/extensions/framework/sinatra/base.rb
889
- - lib/contrast/extensions/ruby_core/assess.rb
890
- - lib/contrast/extensions/ruby_core/assess/array.rb
891
- - lib/contrast/extensions/ruby_core/assess/assess_extension.rb
892
- - lib/contrast/extensions/ruby_core/assess/basic_object.rb
893
- - lib/contrast/extensions/ruby_core/assess/erb.rb
894
- - lib/contrast/extensions/ruby_core/assess/exec_trigger.rb
895
- - lib/contrast/extensions/ruby_core/assess/fiber.rb
896
- - lib/contrast/extensions/ruby_core/assess/hash.rb
897
- - lib/contrast/extensions/ruby_core/assess/kernel.rb
898
- - lib/contrast/extensions/ruby_core/assess/module.rb
899
- - lib/contrast/extensions/ruby_core/assess/regexp.rb
900
- - lib/contrast/extensions/ruby_core/assess/string.rb
901
- - lib/contrast/extensions/ruby_core/assess/tilt_template_trigger.rb
902
- - lib/contrast/extensions/ruby_core/assess/xpath_library_trigger.rb
903
- - lib/contrast/extensions/ruby_core/delegator.rb
904
- - lib/contrast/extensions/ruby_core/eval_trigger.rb
905
- - lib/contrast/extensions/ruby_core/inventory.rb
906
- - lib/contrast/extensions/ruby_core/inventory/datastores.rb
907
- - lib/contrast/extensions/ruby_core/module.rb
908
- - lib/contrast/extensions/ruby_core/protect.rb
909
- - lib/contrast/extensions/ruby_core/protect/applies_command_injection_rule.rb
910
- - lib/contrast/extensions/ruby_core/protect/applies_deserialization_rule.rb
911
- - lib/contrast/extensions/ruby_core/protect/applies_no_sqli_rule.rb
912
- - lib/contrast/extensions/ruby_core/protect/applies_path_traversal_rule.rb
913
- - lib/contrast/extensions/ruby_core/protect/applies_sqli_rule.rb
914
- - lib/contrast/extensions/ruby_core/protect/applies_xxe_rule.rb
915
- - lib/contrast/extensions/ruby_core/protect/kernel.rb
916
- - lib/contrast/extensions/ruby_core/protect/psych.rb
917
- - lib/contrast/extensions/ruby_core/protect/rule_applicator.rb
918
- - lib/contrast/extensions/ruby_core/thread.rb
873
+ - lib/contrast/extension/assess.rb
874
+ - lib/contrast/extension/assess/array.rb
875
+ - lib/contrast/extension/assess/assess_extension.rb
876
+ - lib/contrast/extension/assess/erb.rb
877
+ - lib/contrast/extension/assess/eval_trigger.rb
878
+ - lib/contrast/extension/assess/exec_trigger.rb
879
+ - lib/contrast/extension/assess/fiber.rb
880
+ - lib/contrast/extension/assess/hash.rb
881
+ - lib/contrast/extension/assess/kernel.rb
882
+ - lib/contrast/extension/assess/regexp.rb
883
+ - lib/contrast/extension/assess/string.rb
884
+ - lib/contrast/extension/delegator.rb
885
+ - lib/contrast/extension/inventory.rb
886
+ - lib/contrast/extension/kernel.rb
887
+ - lib/contrast/extension/module.rb
888
+ - lib/contrast/extension/protect.rb
889
+ - lib/contrast/extension/protect/kernel.rb
890
+ - lib/contrast/extension/protect/psych.rb
891
+ - lib/contrast/extension/thread.rb
919
892
  - lib/contrast/framework/base_support.rb
920
893
  - lib/contrast/framework/manager.rb
921
894
  - lib/contrast/framework/platform_version.rb
922
- - lib/contrast/framework/rails_support.rb
923
- - lib/contrast/framework/sinatra_application_helper.rb
924
- - lib/contrast/framework/sinatra_support.rb
895
+ - lib/contrast/framework/rack/patch/session_cookie.rb
896
+ - lib/contrast/framework/rack/patch/support.rb
897
+ - lib/contrast/framework/rack/support.rb
898
+ - lib/contrast/framework/rails/patch/action_controller_live_buffer.rb
899
+ - lib/contrast/framework/rails/patch/assess_configuration.rb
900
+ - lib/contrast/framework/rails/patch/rails_application_configuration.rb
901
+ - lib/contrast/framework/rails/patch/support.rb
902
+ - lib/contrast/framework/rails/rewrite/action_controller_railties_helper_inherited.rb
903
+ - lib/contrast/framework/rails/rewrite/active_record_attribute_methods_read.rb
904
+ - lib/contrast/framework/rails/rewrite/active_record_named.rb
905
+ - lib/contrast/framework/rails/rewrite/active_record_time_zone_inherited.rb
906
+ - lib/contrast/framework/rails/support.rb
907
+ - lib/contrast/framework/sinatra/application_helper.rb
908
+ - lib/contrast/framework/sinatra/patch/base.rb
909
+ - lib/contrast/framework/sinatra/patch/support.rb
910
+ - lib/contrast/framework/sinatra/support.rb
925
911
  - lib/contrast/framework/view_technologies_descriptor.rb
926
912
  - lib/contrast/internal_exception.rb
913
+ - lib/contrast/logger/application.rb
914
+ - lib/contrast/logger/log.rb
915
+ - lib/contrast/logger/time.rb
927
916
  - lib/contrast/security_exception.rb
917
+ - lib/contrast/tasks/config.rb
928
918
  - lib/contrast/tasks/service.rb
929
919
  - lib/contrast/utils/assess/sampling_util.rb
930
920
  - lib/contrast/utils/assess/tracking_util.rb
931
921
  - lib/contrast/utils/boolean_util.rb
932
922
  - lib/contrast/utils/cache.rb
933
923
  - lib/contrast/utils/class_util.rb
934
- - lib/contrast/utils/data_store_util.rb
935
924
  - lib/contrast/utils/duck_utils.rb
936
925
  - lib/contrast/utils/env_configuration_item.rb
937
926
  - lib/contrast/utils/freeze_util.rb
@@ -946,9 +935,6 @@ files:
946
935
  - lib/contrast/utils/os.rb
947
936
  - lib/contrast/utils/preflight_util.rb
948
937
  - lib/contrast/utils/prevent_serialization.rb
949
- - lib/contrast/utils/rack_assess_session_cookie.rb
950
- - lib/contrast/utils/rails_assess_configuration.rb
951
- - lib/contrast/utils/random_util.rb
952
938
  - lib/contrast/utils/resource_loader.rb
953
939
  - lib/contrast/utils/ruby_ast_rewriter.rb
954
940
  - lib/contrast/utils/service_response_util.rb
@@ -961,7 +947,6 @@ files:
961
947
  - lib/contrast/utils/thread_tracker.rb
962
948
  - lib/contrast/utils/timer.rb
963
949
  - resources/assess/policy.json
964
- - resources/csrf/inject.js
965
950
  - resources/deadzone/policy.json
966
951
  - resources/inventory/policy.json
967
952
  - resources/protect/policy.json
@@ -973,7 +958,7 @@ files:
973
958
  - service_executables/mac/contrast-service
974
959
  - shared_libraries/.gitkeep
975
960
  - shared_libraries/funchook.h
976
- - shared_libraries/libfunchook.dylib
961
+ - shared_libraries/libfunchook.so
977
962
  homepage: https://www.contrastsecurity.com
978
963
  licenses:
979
964
  - CONTRAST SECURITY (see license file)
@@ -982,7 +967,8 @@ metadata:
982
967
  support_uri: https://support.contrastsecurity.com
983
968
  trouble_shooting_uri: https://support.contrastsecurity.com/hc/en-us/search?utf8=%E2%9C%93&query=Ruby
984
969
  wiki_uri: https://docs.contrastsecurity.com/
985
- post_install_message:
970
+ post_install_message: 'To generate the required contrast_security.yaml file you can
971
+ run: bundle exec rake contrast:config:create'
986
972
  rdoc_options: []
987
973
  require_paths:
988
974
  - lib
@@ -1000,7 +986,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1000
986
  - !ruby/object:Gem::Version
1001
987
  version: '0'
1002
988
  requirements: []
1003
- rubygems_version: 3.1.2
989
+ rubygems_version: 3.0.3
1004
990
  signing_key:
1005
991
  specification_version: 4
1006
992
  summary: Contrast Security's agent for rack-based applications.
@@ -1,20 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>CFBundleDevelopmentRegion</key>
6
- <string>English</string>
7
- <key>CFBundleIdentifier</key>
8
- <string>com.apple.xcode.dsym.libfunchook_test.so</string>
9
- <key>CFBundleInfoDictionaryVersion</key>
10
- <string>6.0</string>
11
- <key>CFBundlePackageType</key>
12
- <string>dSYM</string>
13
- <key>CFBundleSignature</key>
14
- <string>????</string>
15
- <key>CFBundleShortVersionString</key>
16
- <string>1.0</string>
17
- <key>CFBundleVersion</key>
18
- <string>1</string>
19
- </dict>
20
- </plist>
@@ -1,66 +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 Assess
7
- module Rule
8
- # The Ruby implementation of the CSRF Assess Rule.
9
- class Csrf < Contrast::Agent::Assess::Rule::ResponseScanningRule
10
- NAME = 'csrf'
11
- def name
12
- NAME
13
- end
14
-
15
- DB_STATE_CHANGE = 'db'
16
- ACTION_LIMIT = 3
17
- QUERY_SIZE_LIMIT = 50
18
- STATE_CHANGING_ACTIONS_KEY = 'csrf.statechange.actions'
19
- def record_db_state_change context, query
20
- return unless context
21
-
22
- changes = context.get_property(STATE_CHANGING_ACTIONS_KEY)
23
- changes ||= []
24
- return unless changes.length < ACTION_LIMIT
25
-
26
- return unless state_change?(query)
27
-
28
- action = Contrast::Agent::Assess::Rule::Csrf::CsrfAction.new
29
- action.type = DB_STATE_CHANGE
30
- action.evidence = query[0..QUERY_SIZE_LIMIT]
31
-
32
- changes << action
33
-
34
- context.add_property(STATE_CHANGING_ACTIONS_KEY, changes)
35
- end
36
-
37
- STATE_CHANGE_QUERY_ACTIONS = %w[
38
- insert
39
- update
40
- delete
41
- drop
42
- create
43
- alter
44
- upsert
45
- ].cs__freeze
46
- # Returns true if the given query starts with any
47
- # of the STATE_CHANGE_QUERY_ACTIONS listed above
48
- def state_change? query
49
- return false unless query.is_a?(String) && !query.empty?
50
-
51
- query.downcase.start_with?(*STATE_CHANGE_QUERY_ACTIONS)
52
- end
53
-
54
- # some watchers keep state and need to be reset in each request.
55
- # this one is not one of those.
56
- def watcher
57
- @_watcher ||= Contrast::Agent::Assess::Rule::Csrf::Watcher.new
58
- end
59
-
60
- # Indicates if this request has been checked for a CSRF token
61
- CHECKED = 'csrf.token.checked'
62
- end
63
- end
64
- end
65
- end
66
- end