contrast-agent 3.8.5 → 3.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/ext/cs__assess_array/cs__assess_array.c +1 -1
  3. data/ext/cs__assess_module/cs__assess_module.c +0 -1
  4. data/ext/cs__assess_yield_track/cs__assess_yield_track.c +34 -0
  5. data/ext/cs__assess_yield_track/cs__assess_yield_track.h +12 -0
  6. data/ext/{cs__scope → cs__assess_yield_track}/extconf.rb +0 -0
  7. data/ext/cs__common/cs__common.c +6 -6
  8. data/ext/cs__common/cs__common.h +3 -1
  9. data/ext/cs__contrast_patch/cs__contrast_patch.c +142 -119
  10. data/ext/cs__contrast_patch/cs__contrast_patch.h +3 -0
  11. data/funchook/autom4te.cache/requests +48 -48
  12. data/funchook/config.log +2 -2
  13. data/lib/contrast/agent.rb +15 -5
  14. data/lib/contrast/agent/assess.rb +0 -1
  15. data/lib/contrast/agent/assess/contrast_event.rb +9 -8
  16. data/lib/contrast/agent/assess/policy/dynamic_source_factory.rb +68 -18
  17. data/lib/contrast/agent/assess/policy/policy.rb +0 -14
  18. data/lib/contrast/agent/assess/policy/policy_scanner.rb +1 -1
  19. data/lib/contrast/agent/assess/policy/preshift.rb +1 -1
  20. data/lib/contrast/agent/assess/policy/propagation_method.rb +4 -2
  21. data/lib/contrast/agent/assess/policy/propagator/custom.rb +1 -1
  22. data/lib/contrast/agent/assess/policy/propagator/database_write.rb +1 -1
  23. data/lib/contrast/agent/assess/policy/propagator/splat.rb +2 -2
  24. data/lib/contrast/agent/assess/policy/propagator/split.rb +166 -1
  25. data/lib/contrast/agent/assess/policy/rewriter_patch.rb +1 -0
  26. data/lib/contrast/agent/assess/policy/source_method.rb +199 -140
  27. data/lib/contrast/agent/assess/policy/source_validation/cross_site_validator.rb +30 -0
  28. data/lib/contrast/agent/assess/policy/source_validation/source_validation.rb +36 -0
  29. data/lib/contrast/agent/assess/policy/trigger_method.rb +238 -153
  30. data/lib/contrast/agent/assess/policy/trigger_node.rb +54 -9
  31. data/lib/contrast/agent/assess/policy/trigger_validation/trigger_validation.rb +13 -0
  32. data/lib/contrast/agent/assess/properties.rb +29 -0
  33. data/lib/contrast/agent/assess/rule/csrf/csrf_applicator.rb +35 -31
  34. data/lib/contrast/agent/assess/rule/provider/hardcoded_value_rule.rb +1 -1
  35. data/lib/contrast/agent/class_reopener.rb +98 -55
  36. data/lib/contrast/agent/feature_state.rb +1 -1
  37. data/lib/contrast/agent/inventory/policy/policy.rb +1 -1
  38. data/lib/contrast/agent/logger_manager.rb +2 -2
  39. data/lib/contrast/agent/middleware.rb +1 -3
  40. data/lib/contrast/agent/patching/policy/after_load_patch.rb +40 -4
  41. data/lib/contrast/agent/patching/policy/after_load_patcher.rb +33 -8
  42. data/lib/contrast/agent/patching/policy/method_policy.rb +20 -7
  43. data/lib/contrast/agent/patching/policy/patch.rb +54 -23
  44. data/lib/contrast/agent/patching/policy/patch_status.rb +0 -2
  45. data/lib/contrast/agent/patching/policy/patcher.rb +10 -11
  46. data/lib/contrast/agent/patching/policy/policy.rb +4 -0
  47. data/lib/contrast/agent/patching/policy/policy_node.rb +14 -1
  48. data/lib/contrast/agent/patching/policy/trigger_node.rb +2 -1
  49. data/lib/contrast/agent/protect/policy/policy.rb +6 -6
  50. data/lib/contrast/agent/protect/rule/base.rb +1 -1
  51. data/lib/contrast/agent/protect/rule/deserialization.rb +3 -25
  52. data/lib/contrast/agent/protect/rule/sqli.rb +1 -1
  53. data/lib/contrast/agent/railtie.rb +11 -5
  54. data/lib/contrast/agent/request.rb +1 -19
  55. data/lib/contrast/agent/request_context.rb +1 -1
  56. data/lib/contrast/agent/rewriter.rb +4 -3
  57. data/lib/contrast/agent/scope.rb +116 -19
  58. data/lib/contrast/agent/service_heartbeat.rb +5 -2
  59. data/lib/contrast/agent/settings_state.rb +12 -8
  60. data/lib/contrast/agent/version.rb +1 -1
  61. data/lib/contrast/api.rb +1 -0
  62. data/lib/contrast/api/speedracer.rb +2 -2
  63. data/lib/contrast/components/agent.rb +26 -7
  64. data/lib/contrast/components/app_context.rb +8 -45
  65. data/lib/contrast/components/contrast_service.rb +3 -4
  66. data/lib/contrast/components/interface.rb +1 -1
  67. data/lib/contrast/components/scope.rb +56 -26
  68. data/lib/contrast/config/ruby_configuration.rb +8 -3
  69. data/lib/contrast/delegators.rb +9 -0
  70. data/lib/contrast/delegators/application_update.rb +32 -0
  71. data/lib/contrast/extensions/framework/rack/cookie.rb +24 -0
  72. data/lib/contrast/extensions/framework/rack/request.rb +24 -0
  73. data/lib/contrast/extensions/framework/rack/response.rb +23 -0
  74. data/lib/contrast/extensions/framework/rails/action_controller_railties_helper_inherited.rb +20 -0
  75. data/lib/contrast/extensions/framework/rails/active_record.rb +26 -0
  76. data/lib/contrast/extensions/framework/rails/active_record_named.rb +53 -0
  77. data/lib/contrast/extensions/framework/rails/active_record_time_zone_inherited.rb +21 -0
  78. data/lib/contrast/extensions/framework/rails/buffer.rb +28 -0
  79. data/lib/contrast/extensions/framework/rails/configuration.rb +27 -0
  80. data/lib/contrast/extensions/framework/sinatra/base.rb +59 -0
  81. data/lib/contrast/{core_extensions → extensions/ruby_core}/assess.rb +12 -11
  82. data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/array.rb +4 -3
  83. data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/assess_extension.rb +0 -2
  84. data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/basic_object.rb +1 -1
  85. data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/erb.rb +0 -0
  86. data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/exec_trigger.rb +0 -0
  87. data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/fiber.rb +3 -4
  88. data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/hash.rb +0 -0
  89. data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/kernel.rb +1 -1
  90. data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/module.rb +1 -1
  91. data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/regexp.rb +0 -0
  92. data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/string.rb +0 -0
  93. data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/tilt_template_trigger.rb +0 -0
  94. data/lib/contrast/extensions/ruby_core/assess/xpath_library_trigger.rb +40 -0
  95. data/lib/contrast/{core_extensions → extensions/ruby_core}/delegator.rb +0 -0
  96. data/lib/contrast/{core_extensions → extensions/ruby_core}/eval_trigger.rb +1 -1
  97. data/lib/contrast/{core_extensions → extensions/ruby_core}/inventory.rb +0 -0
  98. data/lib/contrast/{core_extensions → extensions/ruby_core}/inventory/datastores.rb +1 -1
  99. data/lib/contrast/extensions/ruby_core/module.rb +17 -0
  100. data/lib/contrast/{core_extensions → extensions/ruby_core}/protect.rb +0 -0
  101. data/lib/contrast/{core_extensions → extensions/ruby_core}/protect/applies_command_injection_rule.rb +8 -6
  102. data/lib/contrast/{core_extensions → extensions/ruby_core}/protect/applies_deserialization_rule.rb +7 -5
  103. data/lib/contrast/{core_extensions → extensions/ruby_core}/protect/applies_no_sqli_rule.rb +5 -3
  104. data/lib/contrast/{core_extensions → extensions/ruby_core}/protect/applies_path_traversal_rule.rb +31 -27
  105. data/lib/contrast/{core_extensions → extensions/ruby_core}/protect/applies_sqli_rule.rb +5 -3
  106. data/lib/contrast/{core_extensions → extensions/ruby_core}/protect/applies_xxe_rule.rb +9 -7
  107. data/lib/contrast/{core_extensions → extensions/ruby_core}/protect/kernel.rb +0 -0
  108. data/lib/contrast/{core_extensions → extensions/ruby_core}/protect/psych.rb +1 -1
  109. data/lib/contrast/{core_extensions → extensions/ruby_core}/thread.rb +0 -0
  110. data/lib/contrast/framework/base_support.rb +63 -0
  111. data/lib/contrast/framework/manager.rb +109 -0
  112. data/lib/contrast/framework/platform_version.rb +21 -0
  113. data/lib/contrast/framework/rails_support.rb +88 -0
  114. data/lib/contrast/framework/sinatra_application_helper.rb +49 -0
  115. data/lib/contrast/framework/sinatra_support.rb +94 -0
  116. data/lib/contrast/framework/view_technologies_descriptor.rb +20 -0
  117. data/lib/contrast/utils/assess/tracking_util.rb +2 -4
  118. data/lib/contrast/utils/class_util.rb +92 -37
  119. data/lib/contrast/utils/duck_utils.rb +59 -39
  120. data/lib/contrast/utils/environment_util.rb +5 -75
  121. data/lib/contrast/utils/freeze_util.rb +3 -7
  122. data/lib/contrast/utils/invalid_configuration_util.rb +5 -5
  123. data/lib/contrast/utils/job_servers_running.rb +39 -0
  124. data/lib/contrast/utils/ruby_ast_rewriter.rb +2 -2
  125. data/lib/contrast/utils/service_response_util.rb +0 -6
  126. data/lib/contrast/utils/sinatra_helper.rb +6 -0
  127. data/lib/contrast/utils/stack_trace_utils.rb +1 -1
  128. data/resources/assess/policy.json +74 -23
  129. data/resources/inventory/policy.json +1 -1
  130. data/resources/protect/policy.json +11 -9
  131. data/resources/rubocops/object/frozen_cop.rb +1 -1
  132. data/ruby-agent.gemspec +2 -0
  133. data/service_executables/VERSION +1 -1
  134. data/service_executables/linux/contrast-service +0 -0
  135. data/service_executables/mac/contrast-service +0 -0
  136. metadata +94 -57
  137. data/ext/cs__scope/cs__scope.c +0 -96
  138. data/ext/cs__scope/cs__scope.h +0 -33
  139. data/lib/contrast/agent/assess/class_reverter.rb +0 -82
  140. data/lib/contrast/agent/patching/policy/policy_unpatcher.rb +0 -28
  141. data/lib/contrast/core_extensions/module.rb +0 -42
  142. data/lib/contrast/core_extensions/object.rb +0 -27
  143. data/lib/contrast/rails_extensions/assess/action_controller_inheritance.rb +0 -48
  144. data/lib/contrast/rails_extensions/assess/active_record.rb +0 -32
  145. data/lib/contrast/rails_extensions/assess/active_record_named.rb +0 -61
  146. data/lib/contrast/rails_extensions/assess/configuration.rb +0 -26
  147. data/lib/contrast/rails_extensions/buffer.rb +0 -30
  148. data/lib/contrast/rails_extensions/rack.rb +0 -45
  149. data/lib/contrast/sinatra_extensions/assess/cookie.rb +0 -26
  150. data/lib/contrast/sinatra_extensions/inventory/sinatra_base.rb +0 -59
  151. data/lib/contrast/utils/operating_environment.rb +0 -38
  152. data/lib/contrast/utils/path_util.rb +0 -151
  153. data/lib/contrast/utils/scope_util.rb +0 -99
@@ -3,7 +3,7 @@
3
3
  {
4
4
  "name":"data_store",
5
5
  "applicator": "Contrast::CoreExtensions::Inventory::DataStores",
6
- "applicator_method": "cs__patched_report_data_store",
6
+ "applicator_method": "patched_report_data_store",
7
7
  "required_properties": ["data_store"],
8
8
  "optional_properties": [],
9
9
  "triggers":[
@@ -3,7 +3,7 @@
3
3
  {
4
4
  "name": "cmd-injection",
5
5
  "applicator": "Contrast::CoreExtensions::Protect::AppliesCommandInjectionRule",
6
- "applicator_method": "cs__patched_apply_command_injection_rule",
6
+ "applicator_method": "apply_command_injection_rule",
7
7
  "required_properties": [],
8
8
  "optional_properties": [],
9
9
  "triggers": [
@@ -115,7 +115,7 @@
115
115
  {
116
116
  "name": "nosql-injection",
117
117
  "applicator": "Contrast::CoreExtensions::Protect::AppliesNoSqliRule",
118
- "applicator_method": "cs__patched_apply_nosql_rule",
118
+ "applicator_method": "apply_nosql_rule",
119
119
  "required_properties": ["database"],
120
120
  "optional_properties": [],
121
121
  "triggers": [
@@ -157,7 +157,7 @@
157
157
  {
158
158
  "name":"path-traversal",
159
159
  "applicator": "Contrast::CoreExtensions::Protect::AppliesPathTraversalRule",
160
- "applicator_method": "cs__patched_apply_path_traversal_rule",
160
+ "applicator_method": "apply_path_traversal_rule",
161
161
  "required_properties": ["action"],
162
162
  "optional_properties": [],
163
163
  "triggers":[
@@ -255,7 +255,7 @@
255
255
  {
256
256
  "name": "sql-injection",
257
257
  "applicator": "Contrast::CoreExtensions::Protect::AppliesSqliRule",
258
- "applicator_method": "cs__patched_apply_sql_rule",
258
+ "applicator_method": "apply_sql_rule",
259
259
  "required_properties": ["index", "database"],
260
260
  "optional_properties": [],
261
261
  "triggers": [
@@ -337,7 +337,7 @@
337
337
  {
338
338
  "name": "untrusted-deserialization",
339
339
  "applicator": "Contrast::CoreExtensions::Protect::AppliesDeserializationRule",
340
- "applicator_method": "cs__patched_apply_deserialization_rule",
340
+ "applicator_method": "apply_deserialization_rule",
341
341
  "required_properties": [],
342
342
  "optional_properties": [],
343
343
  "triggers": [
@@ -346,6 +346,7 @@
346
346
  "method_name": "load",
347
347
  "instance_method": false,
348
348
  "method_visibility": "public",
349
+ "scope": "deserialization",
349
350
  "properties": {}
350
351
  },
351
352
  {
@@ -353,6 +354,7 @@
353
354
  "method_name": "load",
354
355
  "instance_method": false,
355
356
  "method_visibility": "public",
357
+ "scope": "deserialization",
356
358
  "properties": {}
357
359
  }
358
360
  ]
@@ -360,7 +362,7 @@
360
362
  {
361
363
  "name": "xxe",
362
364
  "applicator": "Contrast::CoreExtensions::Protect::AppliesXxeRule",
363
- "applicator_method": "cs__patched_apply_xxe_rule",
365
+ "applicator_method": "apply_xxe_rule",
364
366
  "required_properties": [],
365
367
  "optional_properties": [],
366
368
  "triggers": [
@@ -375,7 +377,7 @@
375
377
  "method_name": "read_io",
376
378
  "instance_method": false,
377
379
  "method_visibility": "public",
378
- "applicator_method": "cs__patched_apply_xxe_rule__io",
380
+ "applicator_method": "apply_xxe_rule__io",
379
381
  "properties": {}
380
382
  },{
381
383
  "class_name": "Nokogiri::XML::SAX::Parser",
@@ -388,7 +390,7 @@
388
390
  "method_name": "parse_io",
389
391
  "instance_method": true,
390
392
  "method_visibility": "public",
391
- "applicator_method": "cs__patched_apply_xxe_rule__io",
393
+ "applicator_method": "apply_xxe_rule__io",
392
394
  "properties": {}
393
395
  },{
394
396
  "class_name": "Ox",
@@ -407,7 +409,7 @@
407
409
  "method_name": "read_data",
408
410
  "instance_method": true,
409
411
  "method_visibility": "public",
410
- "applicator_method": "cs__patched_apply_xxe_rule__lexer",
412
+ "applicator_method": "apply_xxe_rule__lexer",
411
413
  "properties": {}
412
414
  }
413
415
 
@@ -15,7 +15,7 @@ module RuboCop
15
15
  # # good
16
16
  # Object.cs__frozen?
17
17
  class Frozen < Cop
18
- MSG = 'The use of `Object#is_a?` is a compatibility risk.'
18
+ MSG = 'The use of `Object#frozen?` is a compatibility risk.'
19
19
 
20
20
  def eligible_node? node
21
21
  node.method?(:frozen?)
@@ -38,6 +38,7 @@ def self.add_dev_dependencies spec
38
38
  spec.add_development_dependency 'execjs'
39
39
  spec.add_development_dependency 'factory_bot'
40
40
  spec.add_development_dependency 'fake_ftp'
41
+ spec.add_development_dependency 'fasterer'
41
42
  spec.add_development_dependency 'openssl'
42
43
  spec.add_development_dependency 'parser', '~> 2.6'
43
44
  spec.add_development_dependency 'pry'
@@ -55,6 +56,7 @@ def self.add_dev_dependencies spec
55
56
  spec.add_development_dependency 'sqlite3', '1.3.9'
56
57
  spec.add_development_dependency 'therubyracer'
57
58
  spec.add_development_dependency 'tilt'
59
+ spec.add_development_dependency 'xpath'
58
60
  spec.add_development_dependency 'yarjuf', '~> 2.0'
59
61
  end
60
62
 
@@ -1 +1 @@
1
- 2.5.3
1
+ 2.6.2
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.8.5
4
+ version: 3.9.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-04-22 00:00:00.000000000 Z
15
+ date: 2020-04-24 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bundler
@@ -84,6 +84,20 @@ dependencies:
84
84
  - - ">="
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
+ - !ruby/object:Gem::Dependency
88
+ name: fasterer
89
+ requirement: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ type: :development
95
+ prerelease: false
96
+ version_requirements: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
87
101
  - !ruby/object:Gem::Dependency
88
102
  name: openssl
89
103
  requirement: !ruby/object:Gem::Requirement
@@ -322,6 +336,20 @@ dependencies:
322
336
  - - ">="
323
337
  - !ruby/object:Gem::Version
324
338
  version: '0'
339
+ - !ruby/object:Gem::Dependency
340
+ name: xpath
341
+ requirement: !ruby/object:Gem::Requirement
342
+ requirements:
343
+ - - ">="
344
+ - !ruby/object:Gem::Version
345
+ version: '0'
346
+ type: :development
347
+ prerelease: false
348
+ version_requirements: !ruby/object:Gem::Requirement
349
+ requirements:
350
+ - - ">="
351
+ - !ruby/object:Gem::Version
352
+ version: '0'
325
353
  - !ruby/object:Gem::Dependency
326
354
  name: yarjuf
327
355
  requirement: !ruby/object:Gem::Requirement
@@ -392,21 +420,21 @@ executables:
392
420
  - contrast_service
393
421
  extensions:
394
422
  - ext/cs__common/extconf.rb
423
+ - ext/cs__assess_regexp_track/extconf.rb
424
+ - ext/cs__assess_regexp/extconf.rb
425
+ - ext/cs__assess_kernel/extconf.rb
426
+ - ext/cs__assess_active_record_named/extconf.rb
427
+ - ext/cs__contrast_patch/extconf.rb
428
+ - ext/cs__assess_yield_track/extconf.rb
429
+ - ext/cs__assess_string_interpolation26/extconf.rb
395
430
  - ext/cs__assess_basic_object/extconf.rb
396
431
  - ext/cs__assess_marshal_module/extconf.rb
397
- - ext/cs__scope/extconf.rb
398
- - ext/cs__assess_regexp/extconf.rb
399
432
  - ext/cs__assess_hash/extconf.rb
400
- - ext/cs__assess_fiber_track/extconf.rb
401
- - ext/cs__assess_array/extconf.rb
402
- - ext/cs__assess_active_record_named/extconf.rb
403
- - ext/cs__assess_kernel/extconf.rb
404
- - ext/cs__assess_regexp_track/extconf.rb
405
- - ext/cs__protect_kernel/extconf.rb
406
433
  - ext/cs__assess_string/extconf.rb
407
- - ext/cs__assess_string_interpolation26/extconf.rb
408
- - ext/cs__contrast_patch/extconf.rb
434
+ - ext/cs__assess_array/extconf.rb
409
435
  - ext/cs__assess_module/extconf.rb
436
+ - ext/cs__assess_fiber_track/extconf.rb
437
+ - ext/cs__protect_kernel/extconf.rb
410
438
  extra_rdoc_files: []
411
439
  files:
412
440
  - ".clang-format"
@@ -456,6 +484,9 @@ files:
456
484
  - ext/cs__assess_string_interpolation26/cs__assess_string_interpolation26.c
457
485
  - ext/cs__assess_string_interpolation26/cs__assess_string_interpolation26.h
458
486
  - ext/cs__assess_string_interpolation26/extconf.rb
487
+ - ext/cs__assess_yield_track/cs__assess_yield_track.c
488
+ - ext/cs__assess_yield_track/cs__assess_yield_track.h
489
+ - ext/cs__assess_yield_track/extconf.rb
459
490
  - ext/cs__common/cs__common.c
460
491
  - ext/cs__common/cs__common.h
461
492
  - ext/cs__common/extconf.rb
@@ -465,9 +496,6 @@ files:
465
496
  - ext/cs__protect_kernel/cs__protect_kernel.c
466
497
  - ext/cs__protect_kernel/cs__protect_kernel.h
467
498
  - ext/cs__protect_kernel/extconf.rb
468
- - ext/cs__scope/cs__scope.c
469
- - ext/cs__scope/cs__scope.h
470
- - ext/cs__scope/extconf.rb
471
499
  - ext/extconf_common.rb
472
500
  - funchook/LICENSE
473
501
  - funchook/Makefile
@@ -638,7 +666,6 @@ files:
638
666
  - lib/contrast/agent.rb
639
667
  - lib/contrast/agent/assess.rb
640
668
  - lib/contrast/agent/assess/adjusted_span.rb
641
- - lib/contrast/agent/assess/class_reverter.rb
642
669
  - lib/contrast/agent/assess/contrast_event.rb
643
670
  - lib/contrast/agent/assess/frozen_properties.rb
644
671
  - lib/contrast/agent/assess/insulator.rb
@@ -671,6 +698,8 @@ files:
671
698
  - lib/contrast/agent/assess/policy/rewriter_patch.rb
672
699
  - lib/contrast/agent/assess/policy/source_method.rb
673
700
  - lib/contrast/agent/assess/policy/source_node.rb
701
+ - lib/contrast/agent/assess/policy/source_validation/cross_site_validator.rb
702
+ - lib/contrast/agent/assess/policy/source_validation/source_validation.rb
674
703
  - lib/contrast/agent/assess/policy/trigger_method.rb
675
704
  - lib/contrast/agent/assess/policy/trigger_node.rb
676
705
  - lib/contrast/agent/assess/policy/trigger_validation/ssrf_validator.rb
@@ -713,7 +742,6 @@ files:
713
742
  - lib/contrast/agent/patching/policy/patcher.rb
714
743
  - lib/contrast/agent/patching/policy/policy.rb
715
744
  - lib/contrast/agent/patching/policy/policy_node.rb
716
- - lib/contrast/agent/patching/policy/policy_unpatcher.rb
717
745
  - lib/contrast/agent/patching/policy/trigger_node.rb
718
746
  - lib/contrast/agent/protect/policy/policy.rb
719
747
  - lib/contrast/agent/protect/policy/trigger_node.rb
@@ -796,45 +824,56 @@ files:
796
824
  - lib/contrast/config/server_configuration.rb
797
825
  - lib/contrast/config/service_configuration.rb
798
826
  - lib/contrast/configuration.rb
799
- - lib/contrast/core_extensions/assess.rb
800
- - lib/contrast/core_extensions/assess/array.rb
801
- - lib/contrast/core_extensions/assess/assess_extension.rb
802
- - lib/contrast/core_extensions/assess/basic_object.rb
803
- - lib/contrast/core_extensions/assess/erb.rb
804
- - lib/contrast/core_extensions/assess/exec_trigger.rb
805
- - lib/contrast/core_extensions/assess/fiber.rb
806
- - lib/contrast/core_extensions/assess/hash.rb
807
- - lib/contrast/core_extensions/assess/kernel.rb
808
- - lib/contrast/core_extensions/assess/module.rb
809
- - lib/contrast/core_extensions/assess/regexp.rb
810
- - lib/contrast/core_extensions/assess/string.rb
811
- - lib/contrast/core_extensions/assess/tilt_template_trigger.rb
812
- - lib/contrast/core_extensions/delegator.rb
813
- - lib/contrast/core_extensions/eval_trigger.rb
814
- - lib/contrast/core_extensions/inventory.rb
815
- - lib/contrast/core_extensions/inventory/datastores.rb
816
- - lib/contrast/core_extensions/module.rb
817
- - lib/contrast/core_extensions/object.rb
818
- - lib/contrast/core_extensions/protect.rb
819
- - lib/contrast/core_extensions/protect/applies_command_injection_rule.rb
820
- - lib/contrast/core_extensions/protect/applies_deserialization_rule.rb
821
- - lib/contrast/core_extensions/protect/applies_no_sqli_rule.rb
822
- - lib/contrast/core_extensions/protect/applies_path_traversal_rule.rb
823
- - lib/contrast/core_extensions/protect/applies_sqli_rule.rb
824
- - lib/contrast/core_extensions/protect/applies_xxe_rule.rb
825
- - lib/contrast/core_extensions/protect/kernel.rb
826
- - lib/contrast/core_extensions/protect/psych.rb
827
- - lib/contrast/core_extensions/thread.rb
827
+ - lib/contrast/delegators.rb
828
+ - lib/contrast/delegators/application_update.rb
829
+ - lib/contrast/extensions/framework/rack/cookie.rb
830
+ - lib/contrast/extensions/framework/rack/request.rb
831
+ - lib/contrast/extensions/framework/rack/response.rb
832
+ - lib/contrast/extensions/framework/rails/action_controller_railties_helper_inherited.rb
833
+ - lib/contrast/extensions/framework/rails/active_record.rb
834
+ - lib/contrast/extensions/framework/rails/active_record_named.rb
835
+ - lib/contrast/extensions/framework/rails/active_record_time_zone_inherited.rb
836
+ - lib/contrast/extensions/framework/rails/buffer.rb
837
+ - lib/contrast/extensions/framework/rails/configuration.rb
838
+ - lib/contrast/extensions/framework/sinatra/base.rb
839
+ - lib/contrast/extensions/ruby_core/assess.rb
840
+ - lib/contrast/extensions/ruby_core/assess/array.rb
841
+ - lib/contrast/extensions/ruby_core/assess/assess_extension.rb
842
+ - lib/contrast/extensions/ruby_core/assess/basic_object.rb
843
+ - lib/contrast/extensions/ruby_core/assess/erb.rb
844
+ - lib/contrast/extensions/ruby_core/assess/exec_trigger.rb
845
+ - lib/contrast/extensions/ruby_core/assess/fiber.rb
846
+ - lib/contrast/extensions/ruby_core/assess/hash.rb
847
+ - lib/contrast/extensions/ruby_core/assess/kernel.rb
848
+ - lib/contrast/extensions/ruby_core/assess/module.rb
849
+ - lib/contrast/extensions/ruby_core/assess/regexp.rb
850
+ - lib/contrast/extensions/ruby_core/assess/string.rb
851
+ - lib/contrast/extensions/ruby_core/assess/tilt_template_trigger.rb
852
+ - lib/contrast/extensions/ruby_core/assess/xpath_library_trigger.rb
853
+ - lib/contrast/extensions/ruby_core/delegator.rb
854
+ - lib/contrast/extensions/ruby_core/eval_trigger.rb
855
+ - lib/contrast/extensions/ruby_core/inventory.rb
856
+ - lib/contrast/extensions/ruby_core/inventory/datastores.rb
857
+ - lib/contrast/extensions/ruby_core/module.rb
858
+ - lib/contrast/extensions/ruby_core/protect.rb
859
+ - lib/contrast/extensions/ruby_core/protect/applies_command_injection_rule.rb
860
+ - lib/contrast/extensions/ruby_core/protect/applies_deserialization_rule.rb
861
+ - lib/contrast/extensions/ruby_core/protect/applies_no_sqli_rule.rb
862
+ - lib/contrast/extensions/ruby_core/protect/applies_path_traversal_rule.rb
863
+ - lib/contrast/extensions/ruby_core/protect/applies_sqli_rule.rb
864
+ - lib/contrast/extensions/ruby_core/protect/applies_xxe_rule.rb
865
+ - lib/contrast/extensions/ruby_core/protect/kernel.rb
866
+ - lib/contrast/extensions/ruby_core/protect/psych.rb
867
+ - lib/contrast/extensions/ruby_core/thread.rb
868
+ - lib/contrast/framework/base_support.rb
869
+ - lib/contrast/framework/manager.rb
870
+ - lib/contrast/framework/platform_version.rb
871
+ - lib/contrast/framework/rails_support.rb
872
+ - lib/contrast/framework/sinatra_application_helper.rb
873
+ - lib/contrast/framework/sinatra_support.rb
874
+ - lib/contrast/framework/view_technologies_descriptor.rb
828
875
  - lib/contrast/internal_exception.rb
829
- - lib/contrast/rails_extensions/assess/action_controller_inheritance.rb
830
- - lib/contrast/rails_extensions/assess/active_record.rb
831
- - lib/contrast/rails_extensions/assess/active_record_named.rb
832
- - lib/contrast/rails_extensions/assess/configuration.rb
833
- - lib/contrast/rails_extensions/buffer.rb
834
- - lib/contrast/rails_extensions/rack.rb
835
876
  - lib/contrast/security_exception.rb
836
- - lib/contrast/sinatra_extensions/assess/cookie.rb
837
- - lib/contrast/sinatra_extensions/inventory/sinatra_base.rb
838
877
  - lib/contrast/tasks/service.rb
839
878
  - lib/contrast/utils/assess/sampling_util.rb
840
879
  - lib/contrast/utils/assess/tracking_util.rb
@@ -853,10 +892,9 @@ files:
853
892
  - lib/contrast/utils/invalid_configuration_util.rb
854
893
  - lib/contrast/utils/inventory_util.rb
855
894
  - lib/contrast/utils/io_util.rb
895
+ - lib/contrast/utils/job_servers_running.rb
856
896
  - lib/contrast/utils/object_share.rb
857
- - lib/contrast/utils/operating_environment.rb
858
897
  - lib/contrast/utils/os.rb
859
- - lib/contrast/utils/path_util.rb
860
898
  - lib/contrast/utils/performs_logging.rb
861
899
  - lib/contrast/utils/preflight_util.rb
862
900
  - lib/contrast/utils/prevent_serialization.rb
@@ -865,7 +903,6 @@ files:
865
903
  - lib/contrast/utils/random_util.rb
866
904
  - lib/contrast/utils/resource_loader.rb
867
905
  - lib/contrast/utils/ruby_ast_rewriter.rb
868
- - lib/contrast/utils/scope_util.rb
869
906
  - lib/contrast/utils/service_response_util.rb
870
907
  - lib/contrast/utils/service_sender_util.rb
871
908
  - lib/contrast/utils/sha256_builder.rb
@@ -1,96 +0,0 @@
1
- /* Copyright (c) 2020 Contrast Security, Inc. See
2
- * https://www.contrastsecurity.com/enduser-terms-0317a for more details. */
3
-
4
- #include "cs__scope.h"
5
- #include <ruby.h>
6
-
7
- VALUE in_given_scope(const VALUE object, const char *scope) {
8
- VALUE level;
9
- level = rb_iv_get(object, scope);
10
- if (NUM2INT(level) > 0) {
11
- return Qtrue;
12
- }
13
- return Qfalse;
14
- }
15
-
16
- void enter_given_scope(const VALUE object, const char *scope) {
17
- int level = NUM2INT(rb_iv_get(object, scope));
18
- rb_iv_set(object, scope, INT2NUM(level + 1));
19
- }
20
-
21
- void exit_given_scope(const VALUE object, const char *scope) {
22
- int level = NUM2INT(rb_iv_get(object, scope));
23
- rb_iv_set(object, scope, INT2NUM(level - 1));
24
- }
25
-
26
- VALUE in_contrast_scope(const VALUE self) {
27
- return in_given_scope(self, ivar_contrast_scope);
28
- }
29
-
30
- VALUE enter_contrast_scope(const VALUE self) {
31
- enter_given_scope(self, ivar_contrast_scope);
32
- return Qnil;
33
- }
34
-
35
- VALUE exit_contrast_scope(const VALUE self) {
36
- exit_given_scope(self, ivar_contrast_scope);
37
- return Qnil;
38
- }
39
-
40
- VALUE run_in_scope(const VALUE self) {
41
- enter_contrast_scope(self);
42
- rb_ensure(rb_yield, Qundef, exit_contrast_scope, self);
43
- return Qnil;
44
- }
45
-
46
- VALUE enter_scope_for(const VALUE self, const VALUE scope_symbol) {
47
- enter_contrast_scope(self);
48
-
49
- return Qnil;
50
- }
51
-
52
- VALUE exit_scope_for(const VALUE self, const VALUE scope_symbol) {
53
- exit_contrast_scope(self);
54
-
55
- return Qnil;
56
- }
57
-
58
- VALUE initialize(const VALUE self) {
59
- rb_iv_set(self, ivar_contrast_scope, rbzero);
60
-
61
- return self;
62
- }
63
-
64
- VALUE deep_clone(const VALUE self) {
65
- VALUE new_scope = rb_funcall(scope_class, rb_sym_new, 0);
66
- rb_iv_set(new_scope, ivar_contrast_scope,
67
- rb_iv_get(self, ivar_contrast_scope));
68
- return new_scope;
69
- }
70
-
71
- void Init_cs__scope(void) {
72
- rb_sym_new = rb_intern("new");
73
- VALUE contrast = rb_define_module("Contrast");
74
- VALUE agent = rb_define_module_under(contrast, "Agent");
75
- scope_class = rb_define_class_under(agent, "Scope", rb_cObject);
76
- rb_define_method(scope_class, "initialize", initialize, 0);
77
-
78
- ivar_contrast_scope = "@contrast_scope";
79
-
80
- rb_define_const(scope_class, "CONTRAST_SCOPE",
81
- ID2SYM(rb_intern("contrast")));
82
- CONTRAST_SCOPE = rb_const_get(scope_class, rb_intern("CONTRAST_SCOPE"));
83
-
84
- rb_define_method(scope_class, "in_contrast_scope?", in_contrast_scope, 0);
85
-
86
- rb_define_method(scope_class, "enter_contrast_scope", enter_contrast_scope,
87
- 0);
88
- rb_define_method(scope_class, "exit_contrast_scope", exit_contrast_scope,
89
- 0);
90
-
91
- rb_define_method(scope_class, "run_in_scope", run_in_scope, 0);
92
- rb_define_method(scope_class, "enter_scope_for", enter_scope_for, 1);
93
- rb_define_method(scope_class, "exit_scope_for", exit_scope_for, 1);
94
-
95
- rb_define_method(scope_class, "deep_clone", deep_clone, 0);
96
- }