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.
- checksums.yaml +4 -4
- data/ext/cs__assess_array/cs__assess_array.c +1 -1
- data/ext/cs__assess_module/cs__assess_module.c +0 -1
- data/ext/cs__assess_yield_track/cs__assess_yield_track.c +34 -0
- data/ext/cs__assess_yield_track/cs__assess_yield_track.h +12 -0
- data/ext/{cs__scope → cs__assess_yield_track}/extconf.rb +0 -0
- data/ext/cs__common/cs__common.c +6 -6
- data/ext/cs__common/cs__common.h +3 -1
- data/ext/cs__contrast_patch/cs__contrast_patch.c +142 -119
- data/ext/cs__contrast_patch/cs__contrast_patch.h +3 -0
- data/funchook/autom4te.cache/requests +48 -48
- data/funchook/config.log +2 -2
- data/lib/contrast/agent.rb +15 -5
- data/lib/contrast/agent/assess.rb +0 -1
- data/lib/contrast/agent/assess/contrast_event.rb +9 -8
- data/lib/contrast/agent/assess/policy/dynamic_source_factory.rb +68 -18
- data/lib/contrast/agent/assess/policy/policy.rb +0 -14
- data/lib/contrast/agent/assess/policy/policy_scanner.rb +1 -1
- data/lib/contrast/agent/assess/policy/preshift.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagation_method.rb +4 -2
- data/lib/contrast/agent/assess/policy/propagator/custom.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/database_write.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/splat.rb +2 -2
- data/lib/contrast/agent/assess/policy/propagator/split.rb +166 -1
- data/lib/contrast/agent/assess/policy/rewriter_patch.rb +1 -0
- data/lib/contrast/agent/assess/policy/source_method.rb +199 -140
- data/lib/contrast/agent/assess/policy/source_validation/cross_site_validator.rb +30 -0
- data/lib/contrast/agent/assess/policy/source_validation/source_validation.rb +36 -0
- data/lib/contrast/agent/assess/policy/trigger_method.rb +238 -153
- data/lib/contrast/agent/assess/policy/trigger_node.rb +54 -9
- data/lib/contrast/agent/assess/policy/trigger_validation/trigger_validation.rb +13 -0
- data/lib/contrast/agent/assess/properties.rb +29 -0
- data/lib/contrast/agent/assess/rule/csrf/csrf_applicator.rb +35 -31
- data/lib/contrast/agent/assess/rule/provider/hardcoded_value_rule.rb +1 -1
- data/lib/contrast/agent/class_reopener.rb +98 -55
- data/lib/contrast/agent/feature_state.rb +1 -1
- data/lib/contrast/agent/inventory/policy/policy.rb +1 -1
- data/lib/contrast/agent/logger_manager.rb +2 -2
- data/lib/contrast/agent/middleware.rb +1 -3
- data/lib/contrast/agent/patching/policy/after_load_patch.rb +40 -4
- data/lib/contrast/agent/patching/policy/after_load_patcher.rb +33 -8
- data/lib/contrast/agent/patching/policy/method_policy.rb +20 -7
- data/lib/contrast/agent/patching/policy/patch.rb +54 -23
- data/lib/contrast/agent/patching/policy/patch_status.rb +0 -2
- data/lib/contrast/agent/patching/policy/patcher.rb +10 -11
- data/lib/contrast/agent/patching/policy/policy.rb +4 -0
- data/lib/contrast/agent/patching/policy/policy_node.rb +14 -1
- data/lib/contrast/agent/patching/policy/trigger_node.rb +2 -1
- data/lib/contrast/agent/protect/policy/policy.rb +6 -6
- data/lib/contrast/agent/protect/rule/base.rb +1 -1
- data/lib/contrast/agent/protect/rule/deserialization.rb +3 -25
- data/lib/contrast/agent/protect/rule/sqli.rb +1 -1
- data/lib/contrast/agent/railtie.rb +11 -5
- data/lib/contrast/agent/request.rb +1 -19
- data/lib/contrast/agent/request_context.rb +1 -1
- data/lib/contrast/agent/rewriter.rb +4 -3
- data/lib/contrast/agent/scope.rb +116 -19
- data/lib/contrast/agent/service_heartbeat.rb +5 -2
- data/lib/contrast/agent/settings_state.rb +12 -8
- data/lib/contrast/agent/version.rb +1 -1
- data/lib/contrast/api.rb +1 -0
- data/lib/contrast/api/speedracer.rb +2 -2
- data/lib/contrast/components/agent.rb +26 -7
- data/lib/contrast/components/app_context.rb +8 -45
- data/lib/contrast/components/contrast_service.rb +3 -4
- data/lib/contrast/components/interface.rb +1 -1
- data/lib/contrast/components/scope.rb +56 -26
- data/lib/contrast/config/ruby_configuration.rb +8 -3
- data/lib/contrast/delegators.rb +9 -0
- data/lib/contrast/delegators/application_update.rb +32 -0
- data/lib/contrast/extensions/framework/rack/cookie.rb +24 -0
- data/lib/contrast/extensions/framework/rack/request.rb +24 -0
- data/lib/contrast/extensions/framework/rack/response.rb +23 -0
- data/lib/contrast/extensions/framework/rails/action_controller_railties_helper_inherited.rb +20 -0
- data/lib/contrast/extensions/framework/rails/active_record.rb +26 -0
- data/lib/contrast/extensions/framework/rails/active_record_named.rb +53 -0
- data/lib/contrast/extensions/framework/rails/active_record_time_zone_inherited.rb +21 -0
- data/lib/contrast/extensions/framework/rails/buffer.rb +28 -0
- data/lib/contrast/extensions/framework/rails/configuration.rb +27 -0
- data/lib/contrast/extensions/framework/sinatra/base.rb +59 -0
- data/lib/contrast/{core_extensions → extensions/ruby_core}/assess.rb +12 -11
- data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/array.rb +4 -3
- data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/assess_extension.rb +0 -2
- data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/basic_object.rb +1 -1
- data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/erb.rb +0 -0
- data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/exec_trigger.rb +0 -0
- data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/fiber.rb +3 -4
- data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/hash.rb +0 -0
- data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/kernel.rb +1 -1
- data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/module.rb +1 -1
- data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/regexp.rb +0 -0
- data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/string.rb +0 -0
- data/lib/contrast/{core_extensions → extensions/ruby_core}/assess/tilt_template_trigger.rb +0 -0
- data/lib/contrast/extensions/ruby_core/assess/xpath_library_trigger.rb +40 -0
- data/lib/contrast/{core_extensions → extensions/ruby_core}/delegator.rb +0 -0
- data/lib/contrast/{core_extensions → extensions/ruby_core}/eval_trigger.rb +1 -1
- data/lib/contrast/{core_extensions → extensions/ruby_core}/inventory.rb +0 -0
- data/lib/contrast/{core_extensions → extensions/ruby_core}/inventory/datastores.rb +1 -1
- data/lib/contrast/extensions/ruby_core/module.rb +17 -0
- data/lib/contrast/{core_extensions → extensions/ruby_core}/protect.rb +0 -0
- data/lib/contrast/{core_extensions → extensions/ruby_core}/protect/applies_command_injection_rule.rb +8 -6
- data/lib/contrast/{core_extensions → extensions/ruby_core}/protect/applies_deserialization_rule.rb +7 -5
- data/lib/contrast/{core_extensions → extensions/ruby_core}/protect/applies_no_sqli_rule.rb +5 -3
- data/lib/contrast/{core_extensions → extensions/ruby_core}/protect/applies_path_traversal_rule.rb +31 -27
- data/lib/contrast/{core_extensions → extensions/ruby_core}/protect/applies_sqli_rule.rb +5 -3
- data/lib/contrast/{core_extensions → extensions/ruby_core}/protect/applies_xxe_rule.rb +9 -7
- data/lib/contrast/{core_extensions → extensions/ruby_core}/protect/kernel.rb +0 -0
- data/lib/contrast/{core_extensions → extensions/ruby_core}/protect/psych.rb +1 -1
- data/lib/contrast/{core_extensions → extensions/ruby_core}/thread.rb +0 -0
- data/lib/contrast/framework/base_support.rb +63 -0
- data/lib/contrast/framework/manager.rb +109 -0
- data/lib/contrast/framework/platform_version.rb +21 -0
- data/lib/contrast/framework/rails_support.rb +88 -0
- data/lib/contrast/framework/sinatra_application_helper.rb +49 -0
- data/lib/contrast/framework/sinatra_support.rb +94 -0
- data/lib/contrast/framework/view_technologies_descriptor.rb +20 -0
- data/lib/contrast/utils/assess/tracking_util.rb +2 -4
- data/lib/contrast/utils/class_util.rb +92 -37
- data/lib/contrast/utils/duck_utils.rb +59 -39
- data/lib/contrast/utils/environment_util.rb +5 -75
- data/lib/contrast/utils/freeze_util.rb +3 -7
- data/lib/contrast/utils/invalid_configuration_util.rb +5 -5
- data/lib/contrast/utils/job_servers_running.rb +39 -0
- data/lib/contrast/utils/ruby_ast_rewriter.rb +2 -2
- data/lib/contrast/utils/service_response_util.rb +0 -6
- data/lib/contrast/utils/sinatra_helper.rb +6 -0
- data/lib/contrast/utils/stack_trace_utils.rb +1 -1
- data/resources/assess/policy.json +74 -23
- data/resources/inventory/policy.json +1 -1
- data/resources/protect/policy.json +11 -9
- data/resources/rubocops/object/frozen_cop.rb +1 -1
- data/ruby-agent.gemspec +2 -0
- data/service_executables/VERSION +1 -1
- data/service_executables/linux/contrast-service +0 -0
- data/service_executables/mac/contrast-service +0 -0
- metadata +94 -57
- data/ext/cs__scope/cs__scope.c +0 -96
- data/ext/cs__scope/cs__scope.h +0 -33
- data/lib/contrast/agent/assess/class_reverter.rb +0 -82
- data/lib/contrast/agent/patching/policy/policy_unpatcher.rb +0 -28
- data/lib/contrast/core_extensions/module.rb +0 -42
- data/lib/contrast/core_extensions/object.rb +0 -27
- data/lib/contrast/rails_extensions/assess/action_controller_inheritance.rb +0 -48
- data/lib/contrast/rails_extensions/assess/active_record.rb +0 -32
- data/lib/contrast/rails_extensions/assess/active_record_named.rb +0 -61
- data/lib/contrast/rails_extensions/assess/configuration.rb +0 -26
- data/lib/contrast/rails_extensions/buffer.rb +0 -30
- data/lib/contrast/rails_extensions/rack.rb +0 -45
- data/lib/contrast/sinatra_extensions/assess/cookie.rb +0 -26
- data/lib/contrast/sinatra_extensions/inventory/sinatra_base.rb +0 -59
- data/lib/contrast/utils/operating_environment.rb +0 -38
- data/lib/contrast/utils/path_util.rb +0 -151
- 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": "
|
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": "
|
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": "
|
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": "
|
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": "
|
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": "
|
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": "
|
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": "
|
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": "
|
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": "
|
412
|
+
"applicator_method": "apply_xxe_rule__lexer",
|
411
413
|
"properties": {}
|
412
414
|
}
|
413
415
|
|
data/ruby-agent.gemspec
CHANGED
@@ -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
|
|
data/service_executables/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.6.2
|
Binary file
|
Binary file
|
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.
|
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-
|
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/
|
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/
|
800
|
-
- lib/contrast/
|
801
|
-
- lib/contrast/
|
802
|
-
- lib/contrast/
|
803
|
-
- lib/contrast/
|
804
|
-
- lib/contrast/
|
805
|
-
- lib/contrast/
|
806
|
-
- lib/contrast/
|
807
|
-
- lib/contrast/
|
808
|
-
- lib/contrast/
|
809
|
-
- lib/contrast/
|
810
|
-
- lib/contrast/
|
811
|
-
- lib/contrast/
|
812
|
-
- lib/contrast/
|
813
|
-
- lib/contrast/
|
814
|
-
- lib/contrast/
|
815
|
-
- lib/contrast/
|
816
|
-
- lib/contrast/
|
817
|
-
- lib/contrast/
|
818
|
-
- lib/contrast/
|
819
|
-
- lib/contrast/
|
820
|
-
- lib/contrast/
|
821
|
-
- lib/contrast/
|
822
|
-
- lib/contrast/
|
823
|
-
- lib/contrast/
|
824
|
-
- lib/contrast/
|
825
|
-
- lib/contrast/
|
826
|
-
- lib/contrast/
|
827
|
-
- lib/contrast/
|
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
|
data/ext/cs__scope/cs__scope.c
DELETED
@@ -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
|
-
}
|