contrast-agent 3.13.2 → 3.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/contrast_service +1 -7
- data/ext/cs__assess_active_record_named/cs__active_record_named.c +8 -7
- data/ext/cs__assess_array/cs__assess_array.c +6 -5
- data/ext/cs__assess_basic_object/cs__assess_basic_object.c +5 -5
- data/ext/cs__assess_fiber_track/cs__assess_fiber_track.c +2 -1
- data/ext/cs__assess_hash/cs__assess_hash.c +18 -17
- data/ext/cs__assess_hash/cs__assess_hash.h +2 -1
- data/ext/cs__assess_kernel/cs__assess_kernel.c +7 -8
- data/ext/cs__assess_marshal_module/cs__assess_marshal_module.c +4 -5
- data/ext/cs__assess_module/cs__assess_module.c +6 -6
- data/ext/cs__assess_regexp/cs__assess_regexp.c +4 -4
- data/ext/cs__assess_string/cs__assess_string.c +20 -4
- data/ext/cs__assess_string/cs__assess_string.h +4 -1
- data/ext/cs__assess_string_interpolation26/cs__assess_string_interpolation26.c +4 -2
- data/ext/cs__assess_yield_track/cs__assess_yield_track.c +2 -2
- data/ext/cs__common/cs__common.c +44 -37
- data/ext/cs__common/cs__common.h +15 -20
- data/ext/cs__contrast_patch/cs__contrast_patch.c +27 -25
- data/ext/cs__contrast_patch/cs__contrast_patch.h +5 -7
- data/ext/cs__protect_kernel/cs__protect_kernel.c +11 -12
- data/ext/cs__protect_kernel/cs__protect_kernel.h +2 -2
- data/lib/contrast-agent.rb +1 -1
- data/lib/contrast.rb +13 -23
- data/lib/contrast/agent.rb +39 -39
- data/lib/contrast/agent/assess.rb +11 -12
- data/lib/contrast/agent/assess/contrast_event.rb +11 -9
- data/lib/contrast/agent/assess/events/event_factory.rb +2 -2
- data/lib/contrast/agent/assess/events/source_event.rb +2 -2
- data/lib/contrast/agent/assess/finalizers/finalize.rb +21 -0
- data/lib/contrast/agent/assess/finalizers/freeze.rb +13 -0
- data/lib/contrast/agent/assess/finalizers/hash.rb +53 -0
- data/lib/contrast/agent/assess/policy/dynamic_source_factory.rb +1 -1
- data/lib/contrast/agent/assess/policy/patcher.rb +5 -5
- data/lib/contrast/agent/assess/policy/policy.rb +9 -9
- data/lib/contrast/agent/assess/policy/policy_node.rb +2 -2
- data/lib/contrast/agent/assess/policy/policy_scanner.rb +3 -3
- data/lib/contrast/agent/assess/policy/preshift.rb +15 -5
- data/lib/contrast/agent/assess/policy/propagation_method.rb +25 -22
- data/lib/contrast/agent/assess/policy/propagation_node.rb +2 -2
- data/lib/contrast/agent/assess/policy/propagator.rb +18 -18
- 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/match_data.rb +3 -2
- data/lib/contrast/agent/assess/policy/propagator/prepend.rb +5 -0
- data/lib/contrast/agent/assess/policy/propagator/split.rb +4 -4
- data/lib/contrast/agent/assess/policy/propagator/substitution.rb +5 -4
- data/lib/contrast/agent/assess/policy/rewriter_patch.rb +5 -5
- data/lib/contrast/agent/assess/policy/source_method.rb +5 -14
- data/lib/contrast/agent/assess/policy/source_validation/cross_site_validator.rb +1 -1
- data/lib/contrast/agent/assess/policy/source_validation/source_validation.rb +1 -1
- data/lib/contrast/agent/assess/policy/trigger/xpath.rb +1 -1
- data/lib/contrast/agent/assess/policy/trigger_method.rb +5 -5
- data/lib/contrast/agent/assess/policy/trigger_node.rb +3 -3
- data/lib/contrast/agent/assess/policy/trigger_validation/trigger_validation.rb +2 -2
- data/lib/contrast/agent/assess/properties.rb +13 -5
- data/lib/contrast/agent/assess/property/evented.rb +2 -2
- data/lib/contrast/agent/assess/property/tagged.rb +4 -4
- data/lib/contrast/agent/assess/rule.rb +2 -2
- data/lib/contrast/agent/assess/rule/base.rb +3 -4
- data/lib/contrast/agent/assess/rule/provider.rb +3 -3
- data/lib/contrast/agent/assess/rule/provider/hardcoded_password.rb +1 -1
- data/lib/contrast/agent/assess/rule/provider/hardcoded_value_rule.rb +2 -2
- data/lib/contrast/agent/at_exit_hook.rb +1 -1
- data/lib/contrast/agent/class_reopener.rb +7 -6
- data/lib/contrast/agent/deadzone/policy/deadzone_node.rb +1 -1
- data/lib/contrast/agent/deadzone/policy/policy.rb +2 -2
- data/lib/contrast/agent/disable_reaction.rb +1 -1
- data/lib/contrast/agent/exclusion_matcher.rb +1 -1
- data/lib/contrast/agent/inventory/policy/datastores.rb +2 -2
- data/lib/contrast/agent/inventory/policy/policy.rb +3 -3
- data/lib/contrast/agent/inventory/policy/trigger_node.rb +1 -1
- data/lib/contrast/agent/middleware.rb +33 -32
- data/lib/contrast/agent/patching/policy/after_load_patch.rb +4 -4
- data/lib/contrast/agent/patching/policy/after_load_patcher.rb +6 -5
- data/lib/contrast/agent/patching/policy/module_policy.rb +1 -1
- data/lib/contrast/agent/patching/policy/patch.rb +15 -15
- data/lib/contrast/agent/patching/policy/patcher.rb +30 -22
- data/lib/contrast/agent/patching/policy/policy.rb +6 -6
- data/lib/contrast/agent/patching/policy/policy_node.rb +1 -1
- data/lib/contrast/agent/patching/policy/trigger_node.rb +2 -2
- data/lib/contrast/agent/protect/policy/applies_command_injection_rule.rb +3 -3
- data/lib/contrast/agent/protect/policy/applies_deserialization_rule.rb +2 -2
- data/lib/contrast/agent/protect/policy/applies_no_sqli_rule.rb +2 -2
- data/lib/contrast/agent/protect/policy/applies_path_traversal_rule.rb +3 -3
- data/lib/contrast/agent/protect/policy/applies_sqli_rule.rb +2 -2
- data/lib/contrast/agent/protect/policy/applies_xxe_rule.rb +3 -3
- data/lib/contrast/agent/protect/policy/policy.rb +8 -8
- data/lib/contrast/agent/protect/policy/rule_applicator.rb +1 -1
- data/lib/contrast/agent/protect/policy/trigger_node.rb +1 -1
- data/lib/contrast/agent/protect/rule.rb +18 -18
- data/lib/contrast/agent/protect/rule/base.rb +4 -3
- data/lib/contrast/agent/protect/rule/base_service.rb +1 -1
- data/lib/contrast/agent/protect/rule/cmd_injection.rb +5 -5
- data/lib/contrast/agent/protect/rule/deserialization.rb +1 -1
- data/lib/contrast/agent/protect/rule/http_method_tampering.rb +1 -1
- data/lib/contrast/agent/protect/rule/no_sqli.rb +1 -1
- data/lib/contrast/agent/protect/rule/path_traversal.rb +4 -5
- data/lib/contrast/agent/protect/rule/sqli.rb +2 -2
- data/lib/contrast/agent/protect/rule/unsafe_file_upload.rb +1 -1
- data/lib/contrast/agent/protect/rule/xss.rb +1 -1
- data/lib/contrast/agent/protect/rule/xxe.rb +3 -5
- data/lib/contrast/agent/protect/rule/xxe/entity_wrapper.rb +2 -2
- data/lib/contrast/agent/railtie.rb +1 -1
- data/lib/contrast/agent/reaction_processor.rb +2 -2
- data/lib/contrast/agent/request.rb +11 -9
- data/lib/contrast/agent/request_context.rb +10 -6
- data/lib/contrast/agent/response.rb +6 -6
- data/lib/contrast/agent/rewriter.rb +5 -6
- data/lib/contrast/agent/service_heartbeat.rb +2 -2
- data/lib/contrast/agent/static_analysis.rb +3 -3
- data/lib/contrast/agent/thread.rb +1 -1
- data/lib/contrast/agent/thread_watcher.rb +2 -2
- data/lib/contrast/agent/tracepoint_hook.rb +1 -1
- data/lib/contrast/agent/version.rb +1 -1
- data/lib/contrast/api.rb +4 -4
- data/lib/contrast/api/communication.rb +9 -9
- data/lib/contrast/api/communication/messaging_queue.rb +2 -2
- data/lib/contrast/api/communication/response_processor.rb +1 -1
- data/lib/contrast/api/communication/socket_client.rb +5 -5
- data/lib/contrast/api/communication/speedracer.rb +1 -1
- data/lib/contrast/api/communication/tcp_socket.rb +1 -1
- data/lib/contrast/api/communication/unix_socket.rb +1 -1
- data/lib/contrast/api/decorators.rb +14 -14
- data/lib/contrast/api/decorators/address.rb +7 -6
- data/lib/contrast/api/decorators/application_settings.rb +3 -2
- data/lib/contrast/api/decorators/application_update.rb +5 -4
- data/lib/contrast/api/decorators/http_request.rb +13 -12
- data/lib/contrast/api/decorators/input_analysis.rb +3 -2
- data/lib/contrast/api/decorators/message.rb +3 -2
- data/lib/contrast/api/decorators/rasp_rule_sample.rb +2 -1
- data/lib/contrast/api/decorators/route_coverage.rb +3 -2
- data/lib/contrast/api/decorators/server_features.rb +3 -2
- data/lib/contrast/api/decorators/trace_event.rb +3 -2
- data/lib/contrast/api/decorators/trace_event_object.rb +6 -5
- data/lib/contrast/api/decorators/trace_event_signature.rb +5 -4
- data/lib/contrast/api/decorators/trace_taint_range.rb +4 -3
- data/lib/contrast/api/decorators/user_input.rb +4 -4
- data/lib/contrast/common_agent_configuration.rb +2 -2
- data/lib/contrast/components/agent.rb +2 -2
- data/lib/contrast/components/app_context.rb +1 -1
- data/lib/contrast/components/config.rb +4 -4
- data/lib/contrast/components/contrast_service.rb +1 -1
- data/lib/contrast/components/interface.rb +15 -15
- data/lib/contrast/components/logger.rb +1 -1
- data/lib/contrast/components/scope.rb +3 -3
- data/lib/contrast/config.rb +18 -18
- data/lib/contrast/config/base_configuration.rb +2 -2
- data/lib/contrast/config/protect_rule_configuration.rb +1 -1
- data/lib/contrast/configuration.rb +5 -5
- data/lib/contrast/extension/assess.rb +22 -21
- data/lib/contrast/extension/assess/array.rb +4 -4
- data/lib/contrast/extension/assess/assess_extension.rb +27 -29
- data/lib/contrast/extension/assess/eval_trigger.rb +3 -3
- data/lib/contrast/extension/assess/exec_trigger.rb +1 -1
- data/lib/contrast/extension/assess/fiber.rb +3 -3
- data/lib/contrast/extension/assess/hash.rb +5 -3
- data/lib/contrast/extension/assess/kernel.rb +7 -6
- data/lib/contrast/extension/assess/marshal.rb +62 -0
- data/lib/contrast/extension/assess/regexp.rb +3 -3
- data/lib/contrast/extension/assess/string.rb +5 -5
- data/lib/contrast/extension/inventory.rb +4 -4
- data/lib/contrast/extension/kernel.rb +1 -1
- data/lib/contrast/extension/module.rb +1 -1
- data/lib/contrast/extension/protect.rb +3 -3
- data/lib/contrast/extension/protect/kernel.rb +2 -2
- data/lib/contrast/extension/protect/psych.rb +2 -2
- data/lib/contrast/framework/manager.rb +7 -8
- data/lib/contrast/framework/rack/patch/session_cookie.rb +1 -1
- data/lib/contrast/framework/rack/patch/support.rb +1 -1
- data/lib/contrast/framework/rack/support.rb +2 -2
- data/lib/contrast/framework/rails/patch/assess_configuration.rb +2 -2
- data/lib/contrast/framework/rails/patch/rails_application_configuration.rb +1 -1
- data/lib/contrast/framework/rails/patch/support.rb +3 -3
- data/lib/contrast/framework/rails/rewrite/action_controller_railties_helper_inherited.rb +2 -2
- data/lib/contrast/framework/rails/rewrite/active_record_named.rb +2 -2
- data/lib/contrast/framework/rails/rewrite/active_record_time_zone_inherited.rb +2 -2
- data/lib/contrast/framework/rails/support.rb +62 -14
- data/lib/contrast/framework/sinatra/patch/base.rb +1 -1
- data/lib/contrast/framework/sinatra/patch/support.rb +1 -1
- data/lib/contrast/framework/sinatra/support.rb +2 -2
- data/lib/contrast/funchook/funchook.rb +1 -1
- data/lib/contrast/logger/application.rb +2 -2
- data/lib/contrast/logger/format.rb +22 -9
- data/lib/contrast/logger/log.rb +10 -8
- data/lib/contrast/logger/request.rb +30 -0
- data/lib/contrast/tasks/config.rb +1 -1
- data/lib/contrast/tasks/service.rb +2 -2
- data/lib/contrast/utils/assess/sampling_util.rb +2 -2
- data/lib/contrast/utils/assess/tracking_util.rb +1 -1
- data/lib/contrast/utils/boolean_util.rb +1 -1
- data/lib/contrast/utils/class_util.rb +2 -2
- data/lib/contrast/utils/freeze_util.rb +1 -1
- data/lib/contrast/utils/gemfile_reader.rb +5 -5
- data/lib/contrast/utils/hash_digest.rb +2 -1
- data/lib/contrast/utils/heap_dump_util.rb +2 -2
- data/lib/contrast/utils/invalid_configuration_util.rb +1 -1
- data/lib/contrast/utils/inventory_util.rb +4 -4
- data/lib/contrast/utils/io_util.rb +1 -1
- data/lib/contrast/utils/os.rb +1 -1
- data/lib/contrast/utils/ruby_ast_rewriter.rb +1 -1
- data/lib/contrast/utils/sha256_builder.rb +2 -2
- data/lib/contrast/utils/stack_trace_utils.rb +2 -2
- data/lib/contrast/utils/string_utils.rb +1 -1
- data/ruby-agent.gemspec +5 -5
- data/service_executables/VERSION +1 -1
- data/service_executables/linux/contrast-service +0 -0
- data/service_executables/mac/contrast-service +0 -0
- metadata +22 -19
- data/lib/contrast/agent/assess/insulator.rb +0 -49
- data/lib/contrast/agent/require_state.rb +0 -61
data/lib/contrast/logger/log.rb
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
require 'logger'
|
5
|
+
require 'ougai'
|
6
|
+
require 'singleton'
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
require 'contrast/components/interface'
|
9
|
+
require 'contrast/extension/module'
|
10
|
+
require 'contrast/logger/application'
|
11
|
+
require 'contrast/logger/format'
|
12
|
+
require 'contrast/logger/request'
|
13
|
+
require 'contrast/logger/time'
|
13
14
|
|
14
15
|
module Contrast
|
15
16
|
module Logger
|
@@ -98,6 +99,7 @@ module Contrast
|
|
98
99
|
|
99
100
|
def add_contrast_loggers logger
|
100
101
|
logger.extend(Contrast::Logger::Application)
|
102
|
+
logger.extend(Contrast::Logger::Request)
|
101
103
|
logger.extend(Contrast::Logger::Time)
|
102
104
|
end
|
103
105
|
|
@@ -0,0 +1,30 @@
|
|
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
|
+
require 'contrast/components/interface'
|
5
|
+
require 'contrast/utils/timer'
|
6
|
+
|
7
|
+
module Contrast
|
8
|
+
module Logger
|
9
|
+
# Our decorator for the Ougai logger allowing for the logging of the
|
10
|
+
# request lifecycle, used to provide context during troubleshooting.
|
11
|
+
module Request
|
12
|
+
include Contrast::Components::Interface
|
13
|
+
access_component :config
|
14
|
+
|
15
|
+
# Utility method to log the start of a request
|
16
|
+
def request_start
|
17
|
+
debug('Beginning request analysis')
|
18
|
+
end
|
19
|
+
|
20
|
+
# Utility method to log the end of a request, including the time it took
|
21
|
+
# for that request to be processed.
|
22
|
+
def request_end
|
23
|
+
context = Contrast::Agent::REQUEST_TRACKER.current
|
24
|
+
elapsed_time = context ? (Contrast::Utils::Timer.now_ms - context.timer.start_ms) : -1
|
25
|
+
debug('Ending request analysis',
|
26
|
+
elapsed_time_ms: elapsed_time)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
4
|
+
require 'yaml'
|
5
5
|
|
6
6
|
module Contrast
|
7
7
|
# A Rake task to generate a contrast_security.yaml file with some basic settings
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
require 'contrast/components/interface'
|
5
|
+
require 'contrast/utils/os'
|
6
6
|
|
7
7
|
module Contrast
|
8
8
|
# A Rake task designed to allow control of the Contrast Service as a stand
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
require 'singleton'
|
5
|
+
require 'contrast/components/interface'
|
6
6
|
|
7
7
|
module Contrast
|
8
8
|
module Utils
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
4
|
+
require 'contrast/components/interface'
|
5
5
|
|
6
6
|
module Contrast
|
7
7
|
module Utils
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
4
|
+
require 'contrast/utils/object_share'
|
5
5
|
|
6
6
|
module Contrast
|
7
7
|
module Utils
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
require 'contrast/extension/module'
|
5
|
+
require 'contrast/utils/object_share'
|
6
6
|
|
7
7
|
module Contrast
|
8
8
|
module Utils
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
4
|
+
require 'contrast/utils/duck_utils'
|
5
5
|
|
6
6
|
module Contrast
|
7
7
|
module Utils
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
require 'set'
|
5
|
+
require 'contrast/utils/sha256_builder'
|
6
|
+
require 'contrast/utils/string_utils'
|
7
|
+
require 'contrast/components/interface'
|
8
|
+
require 'contrast/api'
|
9
9
|
|
10
10
|
module Contrast
|
11
11
|
module Utils
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
4
|
+
require 'digest'
|
5
5
|
|
6
6
|
module Contrast
|
7
7
|
module Utils
|
@@ -131,6 +131,7 @@ module Contrast
|
|
131
131
|
end
|
132
132
|
|
133
133
|
def initialize
|
134
|
+
super
|
134
135
|
@crc32 = 0
|
135
136
|
end
|
136
137
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
require 'objspace'
|
5
|
+
require 'contrast/components/interface'
|
6
6
|
|
7
7
|
module Contrast
|
8
8
|
module Utils
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
4
|
+
require 'contrast/components/interface'
|
5
5
|
|
6
6
|
module Contrast
|
7
7
|
module Utils
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
require 'contrast/utils/timer'
|
5
|
+
require 'contrast/utils/object_share'
|
6
|
+
require 'contrast/utils/gemfile_reader'
|
7
|
+
require 'contrast/components/interface'
|
8
8
|
|
9
9
|
module Contrast
|
10
10
|
module Utils
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
4
|
+
require 'contrast/components/interface'
|
5
5
|
|
6
6
|
module Contrast
|
7
7
|
module Utils
|
data/lib/contrast/utils/os.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
4
|
+
require 'contrast/components/interface'
|
5
5
|
|
6
6
|
module Contrast
|
7
7
|
module Utils
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
require 'singleton'
|
5
|
+
require 'contrast/utils/object_share'
|
6
6
|
|
7
7
|
module Contrast
|
8
8
|
module Utils
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
require 'contrast/utils/object_share'
|
5
|
+
require 'contrast/api'
|
6
6
|
|
7
7
|
module Contrast
|
8
8
|
module Utils
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
4
|
+
require 'contrast/components/interface'
|
5
5
|
|
6
6
|
module Contrast
|
7
7
|
module Utils
|
data/ruby-agent.gemspec
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
require_relative './lib/contrast/agent/version'
|
5
|
-
require 'bundler'
|
4
|
+
require_relative './lib/contrast/agent/version'
|
5
|
+
require 'bundler'
|
6
6
|
# https://github.com/grpc/grpc/issues/21514#issuecomment-581417788
|
7
7
|
module BundlerHack
|
8
8
|
def __materialize__
|
@@ -50,9 +50,9 @@ def self.add_dev_dependencies spec
|
|
50
50
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
51
51
|
spec.add_development_dependency 'rspec-benchmark'
|
52
52
|
spec.add_development_dependency 'rspec_junit_formatter', '0.3.0'
|
53
|
-
spec.add_development_dependency 'rubocop', '0.
|
54
|
-
spec.add_development_dependency 'rubocop-performance', '1.
|
55
|
-
spec.add_development_dependency 'rubocop-rspec', '1.
|
53
|
+
spec.add_development_dependency 'rubocop', '0.89.1'
|
54
|
+
spec.add_development_dependency 'rubocop-performance', '1.7.1'
|
55
|
+
spec.add_development_dependency 'rubocop-rspec', '1.42.0'
|
56
56
|
spec.add_development_dependency 'simplecov', '~> 0.18'
|
57
57
|
spec.add_development_dependency 'sinatra', '>= 2'
|
58
58
|
spec.add_development_dependency 'sqlite3', '1.3.9'
|
data/service_executables/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.11.1
|
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.14.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-
|
15
|
+
date: 2020-08-20 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: amazing_print
|
@@ -258,42 +258,42 @@ dependencies:
|
|
258
258
|
requirements:
|
259
259
|
- - '='
|
260
260
|
- !ruby/object:Gem::Version
|
261
|
-
version: 0.
|
261
|
+
version: 0.89.1
|
262
262
|
type: :development
|
263
263
|
prerelease: false
|
264
264
|
version_requirements: !ruby/object:Gem::Requirement
|
265
265
|
requirements:
|
266
266
|
- - '='
|
267
267
|
- !ruby/object:Gem::Version
|
268
|
-
version: 0.
|
268
|
+
version: 0.89.1
|
269
269
|
- !ruby/object:Gem::Dependency
|
270
270
|
name: rubocop-performance
|
271
271
|
requirement: !ruby/object:Gem::Requirement
|
272
272
|
requirements:
|
273
273
|
- - '='
|
274
274
|
- !ruby/object:Gem::Version
|
275
|
-
version: 1.
|
275
|
+
version: 1.7.1
|
276
276
|
type: :development
|
277
277
|
prerelease: false
|
278
278
|
version_requirements: !ruby/object:Gem::Requirement
|
279
279
|
requirements:
|
280
280
|
- - '='
|
281
281
|
- !ruby/object:Gem::Version
|
282
|
-
version: 1.
|
282
|
+
version: 1.7.1
|
283
283
|
- !ruby/object:Gem::Dependency
|
284
284
|
name: rubocop-rspec
|
285
285
|
requirement: !ruby/object:Gem::Requirement
|
286
286
|
requirements:
|
287
287
|
- - '='
|
288
288
|
- !ruby/object:Gem::Version
|
289
|
-
version: 1.
|
289
|
+
version: 1.42.0
|
290
290
|
type: :development
|
291
291
|
prerelease: false
|
292
292
|
version_requirements: !ruby/object:Gem::Requirement
|
293
293
|
requirements:
|
294
294
|
- - '='
|
295
295
|
- !ruby/object:Gem::Version
|
296
|
-
version: 1.
|
296
|
+
version: 1.42.0
|
297
297
|
- !ruby/object:Gem::Dependency
|
298
298
|
name: simplecov
|
299
299
|
requirement: !ruby/object:Gem::Requirement
|
@@ -462,20 +462,20 @@ executables:
|
|
462
462
|
- contrast_service
|
463
463
|
extensions:
|
464
464
|
- ext/cs__common/extconf.rb
|
465
|
-
- ext/
|
465
|
+
- ext/cs__assess_string/extconf.rb
|
466
466
|
- ext/cs__assess_active_record_named/extconf.rb
|
467
|
-
- ext/
|
467
|
+
- ext/cs__assess_hash/extconf.rb
|
468
|
+
- ext/cs__assess_yield_track/extconf.rb
|
469
|
+
- ext/cs__assess_basic_object/extconf.rb
|
468
470
|
- ext/cs__assess_module/extconf.rb
|
471
|
+
- ext/cs__assess_regexp/extconf.rb
|
469
472
|
- ext/cs__protect_kernel/extconf.rb
|
470
|
-
- ext/
|
471
|
-
- ext/cs__assess_fiber_track/extconf.rb
|
473
|
+
- ext/cs__assess_string_interpolation26/extconf.rb
|
472
474
|
- ext/cs__assess_kernel/extconf.rb
|
473
|
-
- ext/
|
474
|
-
- ext/
|
475
|
-
- ext/cs__assess_array/extconf.rb
|
475
|
+
- ext/cs__assess_marshal_module/extconf.rb
|
476
|
+
- ext/cs__assess_fiber_track/extconf.rb
|
476
477
|
- ext/cs__contrast_patch/extconf.rb
|
477
|
-
- ext/
|
478
|
-
- ext/cs__assess_regexp/extconf.rb
|
478
|
+
- ext/cs__assess_array/extconf.rb
|
479
479
|
extra_rdoc_files: []
|
480
480
|
files:
|
481
481
|
- ".clang-format"
|
@@ -674,7 +674,9 @@ files:
|
|
674
674
|
- lib/contrast/agent/assess/contrast_event.rb
|
675
675
|
- lib/contrast/agent/assess/events/event_factory.rb
|
676
676
|
- lib/contrast/agent/assess/events/source_event.rb
|
677
|
-
- lib/contrast/agent/assess/
|
677
|
+
- lib/contrast/agent/assess/finalizers/finalize.rb
|
678
|
+
- lib/contrast/agent/assess/finalizers/freeze.rb
|
679
|
+
- lib/contrast/agent/assess/finalizers/hash.rb
|
678
680
|
- lib/contrast/agent/assess/policy/dynamic_source_factory.rb
|
679
681
|
- lib/contrast/agent/assess/policy/patcher.rb
|
680
682
|
- lib/contrast/agent/assess/policy/policy.rb
|
@@ -779,7 +781,6 @@ files:
|
|
779
781
|
- lib/contrast/agent/request.rb
|
780
782
|
- lib/contrast/agent/request_context.rb
|
781
783
|
- lib/contrast/agent/request_handler.rb
|
782
|
-
- lib/contrast/agent/require_state.rb
|
783
784
|
- lib/contrast/agent/response.rb
|
784
785
|
- lib/contrast/agent/rewriter.rb
|
785
786
|
- lib/contrast/agent/rule_set.rb
|
@@ -864,6 +865,7 @@ files:
|
|
864
865
|
- lib/contrast/extension/assess/fiber.rb
|
865
866
|
- lib/contrast/extension/assess/hash.rb
|
866
867
|
- lib/contrast/extension/assess/kernel.rb
|
868
|
+
- lib/contrast/extension/assess/marshal.rb
|
867
869
|
- lib/contrast/extension/assess/regexp.rb
|
868
870
|
- lib/contrast/extension/assess/string.rb
|
869
871
|
- lib/contrast/extension/delegator.rb
|
@@ -896,6 +898,7 @@ files:
|
|
896
898
|
- lib/contrast/logger/application.rb
|
897
899
|
- lib/contrast/logger/format.rb
|
898
900
|
- lib/contrast/logger/log.rb
|
901
|
+
- lib/contrast/logger/request.rb
|
899
902
|
- lib/contrast/logger/time.rb
|
900
903
|
- lib/contrast/security_exception.rb
|
901
904
|
- lib/contrast/tasks/config.rb
|
@@ -1,49 +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
|
-
cs__scoped_require 'contrast/utils/prevent_serialization'
|
5
|
-
cs__scoped_require 'contrast/agent/assess/properties'
|
6
|
-
|
7
|
-
module Contrast
|
8
|
-
module Agent
|
9
|
-
module Assess
|
10
|
-
# This is just a wrapper around Properties so that if they are on a frozen
|
11
|
-
# object, they are left mutable for us.
|
12
|
-
class Insulator
|
13
|
-
# Return a new delegator with a properties method, used to track
|
14
|
-
# properties in a manner that won't be serialized.
|
15
|
-
#
|
16
|
-
# @return [SimpleDelegator<Object>]
|
17
|
-
def self.generate
|
18
|
-
delegator = SimpleDelegator.new(nil)
|
19
|
-
delegator.extend(Contrast::Utils::PreventPsychSerialization)
|
20
|
-
delegator
|
21
|
-
end
|
22
|
-
|
23
|
-
# Return the frozen properties delegator, which is a
|
24
|
-
#
|
25
|
-
# @return [SimpleDelegator<Object>]
|
26
|
-
def self.generate_frozen
|
27
|
-
@_generate_frozen ||= begin
|
28
|
-
delegator = SimpleDelegator.new(nil)
|
29
|
-
delegator.extend(Contrast::Utils::PreventPsychSerialization)
|
30
|
-
delegator
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
# Our patch of the SimpleDelegator class, allowing us to leverage its
|
39
|
-
# marshal_dump and marshal_load methods to hide our properties on an object so
|
40
|
-
# that they will not be dumped or loaded.
|
41
|
-
# We do this to prevent polluting data that may run on applications that are no
|
42
|
-
# longer instrumented with Contrast
|
43
|
-
class SimpleDelegator
|
44
|
-
# rubocop:disable Naming/MemoizedInstanceVariableName
|
45
|
-
def properties
|
46
|
-
@delegate_properties ||= Contrast::Agent::Assess::Properties.new
|
47
|
-
end
|
48
|
-
# rubocop:enable Naming/MemoizedInstanceVariableName
|
49
|
-
end
|