contrast-agent 5.2.0 → 6.1.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 +7 -0
- data/ext/cs__assess_basic_object/cs__assess_basic_object.c +19 -5
- data/ext/cs__assess_fiber_track/cs__assess_fiber_track.c +1 -1
- data/ext/cs__assess_hash/cs__assess_hash.c +3 -4
- data/ext/cs__assess_kernel/cs__assess_kernel.c +1 -2
- data/ext/cs__assess_marshal_module/cs__assess_marshal_module.c +26 -12
- data/ext/cs__assess_module/cs__assess_module.c +1 -1
- data/ext/cs__assess_regexp/cs__assess_regexp.c +15 -2
- data/ext/cs__assess_regexp/cs__assess_regexp.h +2 -0
- data/ext/cs__assess_string/cs__assess_string.c +21 -1
- data/ext/cs__assess_test/cs__assess_test.h +9 -0
- data/ext/cs__assess_test/cs__assess_tests.c +22 -0
- data/ext/cs__assess_test/extconf.rb +5 -0
- data/ext/cs__common/cs__common.c +113 -11
- data/ext/cs__common/cs__common.h +29 -5
- data/ext/cs__contrast_patch/cs__contrast_patch.c +55 -44
- data/ext/cs__os_information/cs__os_information.c +13 -10
- data/ext/cs__scope/cs__scope.c +146 -97
- data/ext/cs__tests/cs__tests.c +12 -0
- data/ext/cs__tests/cs__tests.h +3 -0
- data/ext/cs__tests/extconf.rb +5 -0
- data/lib/contrast/agent/assess/contrast_object.rb +16 -16
- data/lib/contrast/agent/assess/events/source_event.rb +17 -19
- data/lib/contrast/agent/assess/finalizers/hash.rb +2 -0
- data/lib/contrast/agent/assess/policy/policy_node.rb +50 -27
- data/lib/contrast/agent/assess/policy/policy_node_utils.rb +51 -0
- data/lib/contrast/agent/assess/policy/policy_scanner.rb +2 -16
- data/lib/contrast/agent/assess/policy/preshift.rb +8 -2
- data/lib/contrast/agent/assess/policy/propagation_method.rb +47 -13
- data/lib/contrast/agent/assess/policy/propagator/buffer.rb +118 -0
- data/lib/contrast/agent/assess/policy/propagator/keep.rb +19 -4
- data/lib/contrast/agent/assess/policy/propagator/remove.rb +18 -2
- data/lib/contrast/agent/assess/policy/propagator/splat.rb +17 -3
- data/lib/contrast/agent/assess/policy/propagator/split.rb +15 -19
- data/lib/contrast/agent/assess/policy/propagator/substitution.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/substitution_utils.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator/trim.rb +1 -1
- data/lib/contrast/agent/assess/policy/propagator.rb +1 -0
- data/lib/contrast/agent/assess/policy/source_method.rb +7 -7
- data/lib/contrast/agent/assess/policy/trigger_method.rb +4 -10
- data/lib/contrast/agent/assess/property/tagged.rb +1 -1
- data/lib/contrast/agent/assess/rule/provider/hardcoded_value_rule.rb +7 -2
- data/lib/contrast/agent/assess/rule/response/auto_complete_rule.rb +1 -1
- data/lib/contrast/agent/assess/rule/response/base_rule.rb +11 -3
- data/lib/contrast/agent/assess/rule/response/body_rule.rb +3 -3
- data/lib/contrast/agent/assess/rule/response/cache_control_header_rule.rb +60 -36
- data/lib/contrast/agent/assess/rule/response/framework/rails_support.rb +3 -3
- data/lib/contrast/agent/assess/rule/response/parameters_pollution_rule.rb +1 -1
- data/lib/contrast/agent/assess/rule/response/x_xss_protection_header_rule.rb +1 -2
- data/lib/contrast/agent/at_exit_hook.rb +1 -1
- data/lib/contrast/agent/deadzone/policy/deadzone_node.rb +0 -7
- data/lib/contrast/agent/deadzone/policy/policy.rb +0 -6
- data/lib/contrast/agent/exclusion_matcher.rb +3 -3
- data/lib/contrast/agent/inventory/database_config.rb +10 -3
- data/lib/contrast/agent/middleware.rb +5 -3
- data/lib/contrast/agent/patching/policy/after_load_patch.rb +0 -2
- data/lib/contrast/agent/patching/policy/patch.rb +13 -12
- data/lib/contrast/agent/patching/policy/patcher.rb +4 -4
- data/lib/contrast/agent/patching/policy/policy_node.rb +15 -2
- data/lib/contrast/agent/protect/exploitable_collection.rb +38 -0
- data/lib/contrast/agent/protect/input_analyzer/input_analyzer.rb +66 -9
- data/lib/contrast/agent/protect/policy/applies_no_sqli_rule.rb +2 -1
- data/lib/contrast/agent/protect/policy/applies_path_traversal_rule.rb +2 -2
- data/lib/contrast/agent/protect/rule/base.rb +37 -5
- data/lib/contrast/agent/protect/rule/base_service.rb +3 -1
- data/lib/contrast/agent/protect/rule/cmd_injection.rb +13 -0
- data/lib/contrast/agent/protect/rule/cmdi/cmdi_input_classification.rb +83 -0
- data/lib/contrast/agent/protect/rule/cmdi/cmdi_worth_watching.rb +64 -0
- data/lib/contrast/agent/protect/rule/http_method_tampering/http_method_tampering_input_classification.rb +96 -0
- data/lib/contrast/agent/protect/rule/http_method_tampering.rb +8 -0
- data/lib/contrast/agent/protect/rule/no_sqli/no_sqli_input_classification.rb +231 -0
- data/lib/contrast/agent/protect/rule/no_sqli.rb +27 -0
- data/lib/contrast/agent/protect/rule/sqli/sqli_input_classification.rb +18 -54
- data/lib/contrast/agent/protect/rule/sqli/sqli_worth_watching.rb +1 -4
- data/lib/contrast/agent/protect/rule/unsafe_file_upload/unsafe_file_upload_input_classification.rb +82 -0
- data/lib/contrast/agent/protect/rule/unsafe_file_upload/unsafe_file_upload_matcher.rb +45 -0
- data/lib/contrast/agent/protect/rule/unsafe_file_upload.rb +42 -0
- data/lib/contrast/agent/reporting/attack_result/attack_result.rb +63 -0
- data/lib/contrast/agent/reporting/attack_result/rasp_rule_sample.rb +52 -0
- data/lib/contrast/agent/reporting/attack_result/response_type.rb +29 -0
- data/lib/contrast/agent/reporting/attack_result/user_input.rb +87 -0
- data/lib/contrast/agent/reporting/masker/masker.rb +243 -0
- data/lib/contrast/agent/reporting/masker/masker_utils.rb +62 -0
- data/lib/contrast/agent/reporting/report.rb +2 -0
- data/lib/contrast/agent/reporting/reporter.rb +29 -22
- data/lib/contrast/agent/reporting/reporter_heartbeat.rb +49 -0
- data/lib/contrast/agent/reporting/reporting_events/agent_startup.rb +34 -0
- data/lib/contrast/agent/reporting/reporting_events/application_activity.rb +53 -0
- data/lib/contrast/agent/reporting/reporting_events/application_defend_activity.rb +48 -0
- data/lib/contrast/agent/reporting/reporting_events/application_defend_attack_activity.rb +64 -0
- data/lib/contrast/agent/reporting/reporting_events/application_defend_attack_sample.rb +70 -0
- data/lib/contrast/agent/reporting/reporting_events/application_defend_attack_sample_activity.rb +57 -0
- data/lib/contrast/agent/reporting/reporting_events/application_defend_attacker_activity.rb +56 -0
- data/lib/contrast/agent/reporting/reporting_events/application_inventory.rb +12 -4
- data/lib/contrast/agent/reporting/reporting_events/application_inventory_activity.rb +58 -0
- data/lib/contrast/agent/reporting/reporting_events/application_reporting_event.rb +27 -0
- data/lib/contrast/agent/reporting/reporting_events/application_startup.rb +50 -0
- data/lib/contrast/agent/reporting/reporting_events/application_startup_instrumentation.rb +27 -0
- data/lib/contrast/agent/reporting/reporting_events/application_update.rb +7 -12
- data/lib/contrast/agent/reporting/reporting_events/finding.rb +10 -4
- data/lib/contrast/agent/reporting/reporting_events/finding_event.rb +2 -4
- data/lib/contrast/agent/reporting/reporting_events/finding_event_object.rb +3 -3
- data/lib/contrast/agent/reporting/reporting_events/library_usage_observation.rb +5 -5
- data/lib/contrast/agent/reporting/reporting_events/observed_library_usage.rb +6 -2
- data/lib/contrast/agent/reporting/reporting_events/observed_route.rb +16 -12
- data/lib/contrast/agent/reporting/reporting_events/poll.rb +6 -2
- data/lib/contrast/agent/reporting/reporting_events/preflight.rb +10 -8
- data/lib/contrast/agent/reporting/reporting_events/preflight_message.rb +8 -11
- data/lib/contrast/agent/reporting/reporting_events/reporting_event.rb +2 -1
- data/lib/contrast/agent/reporting/reporting_events/route_coverage.rb +8 -6
- data/lib/contrast/agent/reporting/reporting_events/server_activity.rb +12 -20
- data/lib/contrast/agent/reporting/reporting_events/server_reporting_event.rb +27 -0
- data/lib/contrast/agent/reporting/reporting_utilities/audit.rb +17 -27
- data/lib/contrast/agent/reporting/reporting_utilities/build_preflight.rb +38 -0
- data/lib/contrast/agent/reporting/reporting_utilities/dtm_message.rb +8 -0
- data/lib/contrast/agent/reporting/reporting_utilities/endpoints.rb +6 -0
- data/lib/contrast/agent/reporting/reporting_utilities/reporter_client.rb +23 -7
- data/lib/contrast/agent/reporting/reporting_utilities/reporter_client_utils.rb +64 -76
- data/lib/contrast/agent/reporting/reporting_utilities/reporting_storage.rb +1 -1
- data/lib/contrast/agent/reporting/reporting_utilities/response.rb +17 -7
- data/lib/contrast/agent/reporting/reporting_utilities/response_extractor.rb +100 -0
- data/lib/contrast/agent/reporting/reporting_utilities/response_handler.rb +75 -13
- data/lib/contrast/agent/reporting/reporting_utilities/response_handler_mode.rb +63 -0
- data/lib/contrast/agent/reporting/reporting_utilities/response_handler_utils.rb +154 -113
- data/lib/contrast/agent/reporting/settings/application_settings.rb +9 -0
- data/lib/contrast/agent/reporting/settings/assess_server_feature.rb +5 -33
- data/lib/contrast/agent/reporting/settings/protect.rb +1 -1
- data/lib/contrast/agent/reporting/settings/protect_server_feature.rb +2 -2
- data/lib/contrast/agent/reporting/settings/sampling.rb +36 -0
- data/lib/contrast/agent/reporting/settings/sensitive_data_masking.rb +110 -0
- data/lib/contrast/agent/reporting/settings/sensitive_data_masking_rule.rb +58 -0
- data/lib/contrast/agent/request.rb +3 -3
- data/lib/contrast/agent/request_context.rb +1 -1
- data/lib/contrast/agent/request_context_extend.rb +2 -2
- data/lib/contrast/agent/request_handler.rb +7 -3
- data/lib/contrast/agent/response.rb +2 -0
- data/lib/contrast/agent/service_heartbeat.rb +6 -48
- data/lib/contrast/agent/static_analysis.rb +1 -1
- data/lib/contrast/agent/telemetry/base.rb +151 -0
- data/lib/contrast/agent/telemetry/events/event.rb +35 -0
- data/lib/contrast/agent/telemetry/events/exceptions/telemetry_exception_base.rb +59 -0
- data/lib/contrast/agent/telemetry/events/exceptions/telemetry_exception_event.rb +44 -0
- data/lib/contrast/agent/telemetry/events/exceptions/telemetry_exception_message.rb +115 -0
- data/lib/contrast/agent/telemetry/events/exceptions/telemetry_exception_message_exception.rb +83 -0
- data/lib/contrast/agent/telemetry/events/exceptions/telemetry_exception_stack_frame.rb +64 -0
- data/lib/contrast/agent/telemetry/events/exceptions/telemetry_exceptions.rb +20 -0
- data/lib/contrast/agent/telemetry/events/exceptions/telemetry_exceptions_report.rb +32 -0
- data/lib/contrast/agent/telemetry/events/metric_event.rb +28 -0
- data/lib/contrast/agent/telemetry/events/startup_metrics_event.rb +123 -0
- data/lib/contrast/agent/thread_watcher.rb +52 -68
- data/lib/contrast/agent/version.rb +1 -1
- data/lib/contrast/agent/worker_thread.rb +8 -0
- data/lib/contrast/agent.rb +4 -3
- data/lib/contrast/api/communication/messaging_queue.rb +28 -11
- data/lib/contrast/api/communication/response_processor.rb +7 -10
- data/lib/contrast/api/communication/speedracer.rb +1 -1
- data/lib/contrast/api/decorators/activity.rb +33 -0
- data/lib/contrast/api/decorators/address.rb +1 -1
- data/lib/contrast/api/decorators/http_request.rb +1 -1
- data/lib/contrast/api/decorators/response_type.rb +30 -0
- data/lib/contrast/api/decorators.rb +1 -0
- data/lib/contrast/components/app_context.rb +0 -4
- data/lib/contrast/components/assess.rb +14 -0
- data/lib/contrast/components/config.rb +13 -22
- data/lib/contrast/components/contrast_service.rb +9 -0
- data/lib/contrast/components/protect.rb +2 -2
- data/lib/contrast/components/sampling.rb +7 -11
- data/lib/contrast/components/settings.rb +116 -8
- data/lib/contrast/config/agent_configuration.rb +34 -41
- data/lib/contrast/config/api_configuration.rb +16 -75
- data/lib/contrast/config/api_proxy_configuration.rb +9 -48
- data/lib/contrast/config/application_configuration.rb +24 -95
- data/lib/contrast/config/assess_configuration.rb +21 -76
- data/lib/contrast/config/assess_rules_configuration.rb +13 -38
- data/lib/contrast/config/base_configuration.rb +11 -76
- data/lib/contrast/config/certification_configuration.rb +15 -68
- data/lib/contrast/config/exception_configuration.rb +15 -59
- data/lib/contrast/config/heap_dump_configuration.rb +19 -73
- data/lib/contrast/config/inventory_configuration.rb +11 -55
- data/lib/contrast/config/logger_configuration.rb +8 -41
- data/lib/contrast/config/protect_configuration.rb +23 -10
- data/lib/contrast/config/protect_rule_configuration.rb +23 -37
- data/lib/contrast/config/protect_rules_configuration.rb +39 -43
- data/lib/contrast/config/request_audit_configuration.rb +16 -55
- data/lib/contrast/config/root_configuration.rb +70 -13
- data/lib/contrast/config/ruby_configuration.rb +14 -47
- data/lib/contrast/config/sampling_configuration.rb +12 -65
- data/lib/contrast/config/server_configuration.rb +13 -45
- data/lib/contrast/config/service_configuration.rb +36 -17
- data/lib/contrast/configuration.rb +21 -13
- data/lib/contrast/extension/assess/string.rb +20 -1
- data/lib/contrast/extension/module.rb +0 -1
- data/lib/contrast/framework/manager.rb +2 -2
- data/lib/contrast/framework/rails/patch/support.rb +13 -45
- data/lib/contrast/logger/aliased_logging.rb +87 -0
- data/lib/contrast/logger/application.rb +1 -5
- data/lib/contrast/logger/cef_log.rb +1 -1
- data/lib/contrast/tasks/config.rb +100 -4
- data/lib/contrast/utils/assess/object_store.rb +36 -0
- data/lib/contrast/utils/assess/propagation_method_utils.rb +6 -0
- data/lib/contrast/utils/class_util.rb +5 -18
- data/lib/contrast/utils/input_classification.rb +73 -0
- data/lib/contrast/utils/invalid_configuration_util.rb +1 -1
- data/lib/contrast/utils/log_utils.rb +3 -1
- data/lib/contrast/utils/middleware_utils.rb +10 -9
- data/lib/contrast/utils/net_http_base.rb +1 -1
- data/lib/contrast/utils/object_share.rb +2 -1
- data/lib/contrast/utils/os.rb +0 -5
- data/lib/contrast/utils/patching/policy/patch_utils.rb +4 -5
- data/lib/contrast/utils/response_utils.rb +18 -33
- data/lib/contrast/utils/telemetry.rb +20 -2
- data/lib/contrast/utils/telemetry_client.rb +23 -11
- data/lib/contrast/utils/telemetry_hash.rb +41 -0
- data/lib/contrast/utils/telemetry_identifier.rb +16 -1
- data/lib/contrast.rb +9 -0
- data/resources/assess/policy.json +98 -0
- data/resources/deadzone/policy.json +0 -86
- data/ruby-agent.gemspec +10 -9
- data/service_executables/VERSION +1 -1
- data/service_executables/linux/contrast-service +0 -0
- data/service_executables/mac/contrast-service +0 -0
- metadata +98 -30
- data/lib/contrast/agent/metric_telemetry_event.rb +0 -26
- data/lib/contrast/agent/startup_metrics_telemetry_event.rb +0 -121
- data/lib/contrast/agent/telemetry.rb +0 -137
- data/lib/contrast/agent/telemetry_event.rb +0 -33
- data/lib/contrast/utils/exclude_key.rb +0 -20
@@ -3,9 +3,10 @@
|
|
3
3
|
|
4
4
|
module Contrast
|
5
5
|
module Config
|
6
|
-
# Common Configuration settings. Those in this section pertain to the
|
7
|
-
|
8
|
-
|
6
|
+
# Common Configuration settings. Those in this section pertain to the specific settings that apply to Ruby
|
7
|
+
class RubyConfiguration
|
8
|
+
include Contrast::Config::BaseConfiguration
|
9
|
+
|
9
10
|
DISABLED_RAKE_TASK_LIST = %w[
|
10
11
|
about assets:clean assets:clobber assets:environment
|
11
12
|
assets:precompile assets:precompile:all db:create db:drop db:fixtures:load db:migrate
|
@@ -23,16 +24,16 @@ module Contrast
|
|
23
24
|
:track_frozen_sources, :non_request_tracking, :uninstrument_namespace
|
24
25
|
|
25
26
|
def initialize hsh = {}
|
26
|
-
|
27
|
-
|
28
|
-
@
|
29
|
-
@
|
30
|
-
@
|
31
|
-
@
|
32
|
-
@
|
33
|
-
@
|
34
|
-
@
|
35
|
-
|
27
|
+
return unless hsh
|
28
|
+
|
29
|
+
@disabled_agent_rake_tasks = hsh[:disabled_agent_rake_tasks]
|
30
|
+
@exceptions = Contrast::Config::ExceptionConfiguration.new(hsh[:exceptions])
|
31
|
+
@interpolate = hsh[:interpolate]
|
32
|
+
@propagate_yield = hsh[:propagate_yield]
|
33
|
+
@require_scan = hsh[:require_scan]
|
34
|
+
@track_frozen_sources = hsh[:track_frozen_sources]
|
35
|
+
@non_request_tracking = hsh[:non_request_tracking]
|
36
|
+
@uninstrument_namespace = hsh[:uninstrument_namespace]
|
36
37
|
end
|
37
38
|
|
38
39
|
# These commands being detected will result the agent disabling instrumentation, generally any command
|
@@ -82,40 +83,6 @@ module Contrast
|
|
82
83
|
def uninstrument_namespace
|
83
84
|
@uninstrument_namespace.nil? ? DEFAULT_UNINSTRUMENTED_NAMESPACES : @uninstrument_namespace
|
84
85
|
end
|
85
|
-
|
86
|
-
# TODO: RUBY-1493 MOVE TO BASE CONFIG
|
87
|
-
|
88
|
-
def []= key, value
|
89
|
-
instance_variable_set("@#{ key }".to_sym, value)
|
90
|
-
@configuration_map[key] = value
|
91
|
-
end
|
92
|
-
|
93
|
-
def [] key
|
94
|
-
send(key.to_sym)
|
95
|
-
end
|
96
|
-
|
97
|
-
# Traverse the given entity to build out the configuration graph.
|
98
|
-
#
|
99
|
-
# The values will be either a hash, indicating internal nodes to
|
100
|
-
# traverse, or a value to set or the EMPTY_VALUE symbol, indicating a
|
101
|
-
# leaf node.
|
102
|
-
#
|
103
|
-
# The spec_key are the Contrast defined keys based on the instance variables of
|
104
|
-
# a given configuration.
|
105
|
-
def traverse_config values, spec_key
|
106
|
-
internal_nodes = values.cs__respond_to?(:has_key?)
|
107
|
-
val = internal_nodes ? value_from_key_config(spec_key, values) : nil
|
108
|
-
val == EMPTY_VALUE ? nil : val
|
109
|
-
end
|
110
|
-
|
111
|
-
def build_configuration_map
|
112
|
-
instance_variables.each do |key|
|
113
|
-
str_key = key.to_s.tr('@', '')
|
114
|
-
next if str_key == 'configuration_map'
|
115
|
-
|
116
|
-
@configuration_map[str_key] = send(str_key.to_sym)
|
117
|
-
end
|
118
|
-
end
|
119
86
|
end
|
120
87
|
end
|
121
88
|
end
|
@@ -3,9 +3,10 @@
|
|
3
3
|
|
4
4
|
module Contrast
|
5
5
|
module Config
|
6
|
-
# Common Configuration settings. Those in this section pertain to the
|
7
|
-
|
8
|
-
|
6
|
+
# Common Configuration settings. Those in this section pertain to the sampling functionality of the Agent.
|
7
|
+
class SamplingConfiguration
|
8
|
+
include Contrast::Config::BaseConfiguration
|
9
|
+
|
9
10
|
# @return [Integer, nil]
|
10
11
|
attr_reader :baseline
|
11
12
|
# @return [Integer, nil]
|
@@ -16,72 +17,18 @@ module Contrast
|
|
16
17
|
attr_reader :window_ms
|
17
18
|
|
18
19
|
def initialize hsh = {}
|
19
|
-
|
20
|
-
|
21
|
-
@
|
22
|
-
@
|
23
|
-
@
|
24
|
-
@
|
25
|
-
|
20
|
+
return unless hsh
|
21
|
+
|
22
|
+
@enable = hsh[:enable]
|
23
|
+
@baseline = hsh[:baseline]
|
24
|
+
@request_frequency = hsh[:request_frequency]
|
25
|
+
@response_frequency = hsh[:response_frequency]
|
26
|
+
@window_ms = hsh[:window_ms]
|
26
27
|
end
|
27
28
|
|
28
29
|
# @return [Boolean, false]
|
29
30
|
def enable
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
def enable= value
|
34
|
-
self['enable'] = value
|
35
|
-
end
|
36
|
-
|
37
|
-
def baseline= value
|
38
|
-
self['baseline'] = value
|
39
|
-
end
|
40
|
-
|
41
|
-
def request_frequency= value
|
42
|
-
self['request_frequency'] = value
|
43
|
-
end
|
44
|
-
|
45
|
-
def response_frequency= value
|
46
|
-
self['response_frequency'] = value
|
47
|
-
end
|
48
|
-
|
49
|
-
def window_ms= value
|
50
|
-
self['window_ms'] = value
|
51
|
-
end
|
52
|
-
|
53
|
-
# TODO: RUBY-1493 MOVE TO BASE CONFIG
|
54
|
-
|
55
|
-
def []= key, value
|
56
|
-
instance_variable_set("@#{ key }".to_sym, value)
|
57
|
-
@configuration_map[key] = value
|
58
|
-
end
|
59
|
-
|
60
|
-
def [] key
|
61
|
-
send(key.to_sym)
|
62
|
-
end
|
63
|
-
|
64
|
-
# Traverse the given entity to build out the configuration graph.
|
65
|
-
#
|
66
|
-
# The values will be either a hash, indicating internal nodes to
|
67
|
-
# traverse, or a value to set or the EMPTY_VALUE symbol, indicating a
|
68
|
-
# leaf node.
|
69
|
-
#
|
70
|
-
# The spec_key are the Contrast defined keys based on the instance variables of
|
71
|
-
# a given configuration.
|
72
|
-
def traverse_config values, spec_key
|
73
|
-
internal_nodes = values.cs__respond_to?(:has_key?)
|
74
|
-
val = internal_nodes ? value_from_key_config(spec_key, values) : nil
|
75
|
-
val == EMPTY_VALUE ? nil : val
|
76
|
-
end
|
77
|
-
|
78
|
-
def build_configuration_map
|
79
|
-
instance_variables.each do |key|
|
80
|
-
str_key = key.to_s.tr('@', '')
|
81
|
-
next if str_key == 'configuration_map'
|
82
|
-
|
83
|
-
@configuration_map[str_key] = send(str_key.to_sym)
|
84
|
-
end
|
31
|
+
!!@enable
|
85
32
|
end
|
86
33
|
end
|
87
34
|
end
|
@@ -3,9 +3,11 @@
|
|
3
3
|
|
4
4
|
module Contrast
|
5
5
|
module Config
|
6
|
-
# Common Configuration settings. Those in this section pertain to the
|
7
|
-
#
|
8
|
-
class ServerConfiguration
|
6
|
+
# Common Configuration settings. Those in this section pertain to the server identification functionality of the
|
7
|
+
# Agent.
|
8
|
+
class ServerConfiguration
|
9
|
+
include Contrast::Config::BaseConfiguration
|
10
|
+
|
9
11
|
# @return [String, nil]
|
10
12
|
attr_accessor :name
|
11
13
|
# @return [String, nil]
|
@@ -20,48 +22,14 @@ module Contrast
|
|
20
22
|
attr_accessor :version
|
21
23
|
|
22
24
|
def initialize hsh = {}
|
23
|
-
|
24
|
-
|
25
|
-
@
|
26
|
-
@
|
27
|
-
@
|
28
|
-
@
|
29
|
-
@
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
# TODO: RUBY-1493 MOVE TO BASE CONFIG
|
34
|
-
|
35
|
-
def []= key, value
|
36
|
-
instance_variable_set("@#{ key }".to_sym, value)
|
37
|
-
@configuration_map[key] = value
|
38
|
-
end
|
39
|
-
|
40
|
-
def [] key
|
41
|
-
send(key.to_sym)
|
42
|
-
end
|
43
|
-
|
44
|
-
# Traverse the given entity to build out the configuration graph.
|
45
|
-
#
|
46
|
-
# The values will be either a hash, indicating internal nodes to
|
47
|
-
# traverse, or a value to set or the EMPTY_VALUE symbol, indicating a
|
48
|
-
# leaf node.
|
49
|
-
#
|
50
|
-
# The spec_key are the Contrast defined keys based on the instance variables of
|
51
|
-
# a given configuration.
|
52
|
-
def traverse_config values, spec_key
|
53
|
-
internal_nodes = values.cs__respond_to?(:has_key?)
|
54
|
-
val = internal_nodes ? value_from_key_config(spec_key, values) : nil
|
55
|
-
val == EMPTY_VALUE ? nil : val
|
56
|
-
end
|
57
|
-
|
58
|
-
def build_configuration_map
|
59
|
-
instance_variables.each do |key|
|
60
|
-
str_key = key.to_s.tr('@', '')
|
61
|
-
next if str_key == 'configuration_map'
|
62
|
-
|
63
|
-
@configuration_map[str_key] = send(str_key.to_sym)
|
64
|
-
end
|
25
|
+
return unless hsh
|
26
|
+
|
27
|
+
@path = hsh[:path]
|
28
|
+
@name = hsh[:name]
|
29
|
+
@type = hsh[:type]
|
30
|
+
@tags = hsh[:tags]
|
31
|
+
@environment = hsh[:environment]
|
32
|
+
@version = hsh[:version]
|
65
33
|
end
|
66
34
|
end
|
67
35
|
end
|
@@ -5,25 +5,44 @@ require 'contrast/config/logger_configuration'
|
|
5
5
|
|
6
6
|
module Contrast
|
7
7
|
module Config
|
8
|
-
# Common Configuration settings. Those in this section pertain to the
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
#
|
13
|
-
|
8
|
+
# Common Configuration settings. Those in this section pertain to the communication between the Agent & the Service
|
9
|
+
class ServiceConfiguration
|
10
|
+
include Contrast::Config::BaseConfiguration
|
11
|
+
|
12
|
+
# We don't set these b/c we've been asked to handle the default values of these settings differently, logging
|
13
|
+
# when we have to use them.
|
14
|
+
DEFAULT_HOST = '127.0.0.1' # rubocop:disable Style/IpAddresses
|
14
15
|
DEFAULT_PORT = '30555'
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
17
|
+
attr_writer :logger, :bypass
|
18
|
+
# @return [String, nil]
|
19
|
+
attr_accessor :socket
|
20
|
+
# @return [String, nil]
|
21
|
+
attr_accessor :port
|
22
|
+
# @return [String, nil]
|
23
|
+
attr_accessor :host
|
24
|
+
# @return [Boolean, nil]
|
25
|
+
attr_accessor :enable
|
26
|
+
|
27
|
+
def initialize hsh = {}
|
28
|
+
return unless hsh
|
29
|
+
|
30
|
+
@enable = hsh[:enable]
|
31
|
+
@host = hsh[:host]
|
32
|
+
@port = hsh[:port]
|
33
|
+
@socket = hsh[:socket]
|
34
|
+
@logger = Contrast::Config::LoggerConfiguration.new(hsh[:logger])
|
35
|
+
@bypass = hsh[:bypass]
|
36
|
+
end
|
37
|
+
|
38
|
+
# @return [Contrast::Config::LoggerConfiguration]
|
39
|
+
def logger
|
40
|
+
@logger ||= Contrast::Config::LoggerConfiguration.new
|
41
|
+
end
|
42
|
+
|
43
|
+
# @return [Boolean, false]
|
44
|
+
def bypass
|
45
|
+
@bypass.nil? ? false : @bypass
|
27
46
|
end
|
28
47
|
end
|
29
48
|
end
|
@@ -7,7 +7,6 @@ require 'fileutils'
|
|
7
7
|
require 'contrast/config'
|
8
8
|
require 'contrast/utils/object_share'
|
9
9
|
require 'contrast/components/scope'
|
10
|
-
require 'contrast/utils/exclude_key'
|
11
10
|
|
12
11
|
module Contrast
|
13
12
|
# This is how we read in the local settings for the Agent, both ENV/ CMD line
|
@@ -27,15 +26,17 @@ module Contrast
|
|
27
26
|
MILLISECOND_MARKER = '_ms'
|
28
27
|
CONVERSION = { 'agent.service.enable' => 'agent.start_bundled_service' }.cs__freeze
|
29
28
|
CONFIG_BASE_PATHS = ['', 'config/', '/etc/contrast/ruby/', '/etc/contrast/', '/etc/'].cs__freeze
|
29
|
+
KEYS_TO_REDACT = %i[api_key url service_key user_name].cs__freeze
|
30
|
+
REDACTED = '**REDACTED**'
|
30
31
|
|
31
32
|
def initialize cli_options = nil, default_name = DEFAULT_YAML_PATH
|
32
33
|
@default_name = default_name
|
33
34
|
|
34
35
|
# Load config_kv from file
|
35
|
-
config_kv =
|
36
|
+
config_kv = deep_symbolize_all_keys(load_config)
|
36
37
|
|
37
38
|
# Overlay CLI options - they take precedence over config file
|
38
|
-
cli_options =
|
39
|
+
cli_options = deep_symbolize_all_keys(cli_options)
|
39
40
|
config_kv = deep_merge(cli_options, config_kv) if cli_options
|
40
41
|
|
41
42
|
# Some in-flight rewrites to maintain backwards compatibility
|
@@ -105,7 +106,7 @@ module Contrast
|
|
105
106
|
def update_prop_keys config
|
106
107
|
CONVERSION.each_pair do |old_method, new_method|
|
107
108
|
# See if the old value was set and needs to be translated
|
108
|
-
deprecated_keys = old_method.split('.')
|
109
|
+
deprecated_keys = old_method.split('.').map(&:to_sym)
|
109
110
|
old_value = config
|
110
111
|
deprecated_keys.each do |key|
|
111
112
|
old_value = old_value[key]
|
@@ -114,7 +115,7 @@ module Contrast
|
|
114
115
|
next if old_value.nil? # have to account for literal false
|
115
116
|
|
116
117
|
log_deprecated_property(old_method, new_method)
|
117
|
-
new_keys = new_method.split('.')
|
118
|
+
new_keys = new_method.split('.').map(&:to_sym)
|
118
119
|
# We changed the seconds values into ms values. Multiply them accordingly
|
119
120
|
old_value = old_value.to_i * 1000 if new_method.end_with?(MILLISECOND_MARKER)
|
120
121
|
new_value = config
|
@@ -147,12 +148,12 @@ module Contrast
|
|
147
148
|
end
|
148
149
|
end
|
149
150
|
|
150
|
-
def
|
151
|
+
def deep_symbolize_all_keys hash
|
151
152
|
return if hash.nil?
|
152
153
|
|
153
154
|
new_hash = {}
|
154
155
|
hash.each do |key, value|
|
155
|
-
new_hash[key.
|
156
|
+
new_hash[key.to_sym] = value.is_a?(Hash) ? deep_symbolize_all_keys(value) : value
|
156
157
|
end
|
157
158
|
new_hash
|
158
159
|
end
|
@@ -219,11 +220,9 @@ module Contrast
|
|
219
220
|
when Contrast::Config::BaseConfiguration
|
220
221
|
# to_hash returns @configuration_map
|
221
222
|
convert.to_hash.each_key do |key|
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
# clean_key = key.to_s.tr('-', '_')
|
226
|
-
hash[key] = convert_to_hash(convert.send(key.to_sym), {})
|
223
|
+
# change '-' to '_' for ProtectRulesConfiguration
|
224
|
+
hash[key] = convert_to_hash(convert.send(key.tr('-', '_').to_sym), {})
|
225
|
+
hash[key] = REDACTED if redactable?(key)
|
227
226
|
end
|
228
227
|
hash
|
229
228
|
else
|
@@ -235,7 +234,7 @@ module Contrast
|
|
235
234
|
idx = 0
|
236
235
|
end_idx = new_keys.length - 1
|
237
236
|
while idx < new_keys.length
|
238
|
-
new_key = new_keys[idx]
|
237
|
+
new_key = new_keys[idx].to_sym
|
239
238
|
if idx == end_idx
|
240
239
|
new_value[new_key] = old_value if new_value[new_key].nil?
|
241
240
|
else
|
@@ -246,5 +245,14 @@ module Contrast
|
|
246
245
|
idx += 1
|
247
246
|
end
|
248
247
|
end
|
248
|
+
|
249
|
+
# Check if keys with sensitive data needs to be
|
250
|
+
# redacted.
|
251
|
+
#
|
252
|
+
# @param key [Symbol] key to check
|
253
|
+
# @return[Boolean] true | false
|
254
|
+
def redactable? key
|
255
|
+
KEYS_TO_REDACT.include?(key.to_sym)
|
256
|
+
end
|
249
257
|
end
|
250
258
|
end
|
@@ -13,7 +13,7 @@ module Contrast
|
|
13
13
|
# methods which are too complex to fit into one of the standard
|
14
14
|
# Contrast::Agent::Assess::Policy::Propagator molds without cluttering up the
|
15
15
|
# String Class or exposing our methods there.
|
16
|
-
class StringPropagator
|
16
|
+
class StringPropagator
|
17
17
|
extend Contrast::Components::Logger::InstanceMethods
|
18
18
|
extend Contrast::Components::Scope::InstanceMethods
|
19
19
|
|
@@ -43,6 +43,7 @@ module Contrast
|
|
43
43
|
offset = 0
|
44
44
|
inputs.each do |input|
|
45
45
|
properties.copy_from(input, result, offset)
|
46
|
+
add_dynamic_sources_info input, result
|
46
47
|
offset += input.length
|
47
48
|
parent_event = Contrast::Agent::Assess::Tracker.properties(input)&.event
|
48
49
|
parent_events << parent_event if parent_event
|
@@ -58,6 +59,24 @@ module Contrast
|
|
58
59
|
rescue StandardError => e
|
59
60
|
logger.error('Unable to track interpolation', e)
|
60
61
|
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
# When there is a string interpolation on input coming from tainted database,
|
66
|
+
# the Contrast::Agent::Assess::Properties::Updated.copy_from method won't copy
|
67
|
+
# the dynamic source properties needed in the build findings from TS to display
|
68
|
+
# the column and Table information as database source information.
|
69
|
+
#
|
70
|
+
# @param source [Object] the source object with the required properties.
|
71
|
+
# @param target [Object] the result form the interpolation and the object
|
72
|
+
# that needs to keep the source properties, in order to be reporter on
|
73
|
+
# trigger event.
|
74
|
+
# @return updated_properties [Hash<DynamicSourceInfo>, nil]
|
75
|
+
def add_dynamic_sources_info source, target
|
76
|
+
return unless (dynamic_props = Contrast::Agent::Assess::Tracker.properties(source)&.properties)
|
77
|
+
|
78
|
+
Contrast::Agent::Assess::Tracker.properties(target)&.add_properties(dynamic_props)
|
79
|
+
end
|
61
80
|
end
|
62
81
|
end
|
63
82
|
end
|
@@ -125,7 +125,7 @@ module Contrast
|
|
125
125
|
# @return [Contrast::Api::Dtm::RouteCoverage] the current route as a Dtm.
|
126
126
|
def get_route_dtm request
|
127
127
|
@_frameworks.lazy.map { |framework_support| framework_support.current_route(request) }.
|
128
|
-
reject(&:nil?).first
|
128
|
+
reject(&:nil?).first # rubocop:disable Style/CollectionCompact
|
129
129
|
end
|
130
130
|
|
131
131
|
# Iterate through current frameworks and return the current request's route. This will be the first non-nil
|
@@ -135,7 +135,7 @@ module Contrast
|
|
135
135
|
# @return [Contrast::Agent::Reporting::RouteCoverage] the current route as a Dtm.
|
136
136
|
def get_route_information request
|
137
137
|
@_frameworks.lazy.map { |framework_support| framework_support.current_route_coverage(request) }.
|
138
|
-
reject(&:nil?).first
|
138
|
+
reject(&:nil?).first # rubocop:disable Style/CollectionCompact
|
139
139
|
end
|
140
140
|
|
141
141
|
# Sometimes the framework we want to instrument is loaded after our agent code. To catch that case, we'll detect
|
@@ -25,51 +25,19 @@ module Contrast
|
|
25
25
|
|
26
26
|
# (See BaseSupport#after_load_patches)
|
27
27
|
def after_load_patches
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
patches.merge(special_after_load_patches) if RUBY_VERSION < '2.6.0'
|
42
|
-
patches
|
43
|
-
end
|
44
|
-
|
45
|
-
def special_after_load_patches
|
46
|
-
[
|
47
|
-
# TODO: RUBY-714 remove w/ EOL of 2.5
|
48
|
-
#
|
49
|
-
# @deprecated Everything past here is used for Rewriting and can
|
50
|
-
# be removed once we no longer support 2.5.
|
51
|
-
Contrast::Agent::Patching::Policy::AfterLoadPatch.new(
|
52
|
-
'ActionController::Railties::Helper::ClassMethods',
|
53
|
-
'contrast/framework/rails/rewrite/action_controller_railties_helper_inherited',
|
54
|
-
method_to_instrument: :inherited,
|
55
|
-
instrumenting_module:
|
56
|
-
'Contrast::Framework::Rails::Rewrite::ActionControllerRailtiesHelperInherited'),
|
57
|
-
Contrast::Agent::Patching::Policy::AfterLoadPatch.new(
|
58
|
-
'ActiveRecord::AttributeMethods::Read::ClassMethods',
|
59
|
-
'contrast/framework/rails/rewrite/active_record_attribute_methods_read',
|
60
|
-
instrumenting_module:
|
61
|
-
'Contrast::Framework::Rails::Rewrite::ActiveRecordAttributeMethodsRead'),
|
62
|
-
Contrast::Agent::Patching::Policy::AfterLoadPatch.new(
|
63
|
-
'ActiveRecord::Scoping::Named::ClassMethods',
|
64
|
-
'contrast/framework/rails/rewrite/active_record_named',
|
65
|
-
instrumenting_module: 'Contrast::Framework::Rails::Rewrite::ActiveRecordNamed'),
|
66
|
-
Contrast::Agent::Patching::Policy::AfterLoadPatch.new(
|
67
|
-
'ActiveRecord::AttributeMethods::TimeZoneConversion::ClassMethods',
|
68
|
-
'contrast/framework/rails/rewrite/active_record_time_zone_inherited',
|
69
|
-
method_to_instrument: :inherited,
|
70
|
-
instrumenting_module:
|
71
|
-
'Contrast::Framework::Rails::Rewrite::ActiveRecordTimeZoneInherited')
|
72
|
-
]
|
28
|
+
Set.new([
|
29
|
+
Contrast::Agent::Patching::Policy::AfterLoadPatch.new(
|
30
|
+
'ActionController::Live::Buffer',
|
31
|
+
'contrast/framework/rails/patch/action_controller_live_buffer',
|
32
|
+
instrumenting_module:
|
33
|
+
'Contrast::Framework::Rails::Patch::ActionControllerLiveBuffer'),
|
34
|
+
Contrast::Agent::Patching::Policy::AfterLoadPatch.new(
|
35
|
+
'Rails::Application::Configuration',
|
36
|
+
'contrast/framework/rails/patch/rails_application_configuration',
|
37
|
+
method_to_instrument: :session_store,
|
38
|
+
instrumenting_module:
|
39
|
+
'Contrast::Framework::Rails::Patch::RailsApplicationConfiguration')
|
40
|
+
])
|
73
41
|
end
|
74
42
|
end
|
75
43
|
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'contrast/agent/telemetry/events/exceptions/telemetry_exceptions'
|
5
|
+
|
6
|
+
module Contrast
|
7
|
+
module Logger
|
8
|
+
# Our decorator for the Ougai logger allowing for the catching, creating and saving Telemetry exceptions
|
9
|
+
module AliasedLogging
|
10
|
+
ALIASED_WARN = 'warn'.cs__freeze
|
11
|
+
ALIASED_ERROR = 'error'.cs__freeze
|
12
|
+
ALIASED_FATAL = 'fatal'.cs__freeze
|
13
|
+
|
14
|
+
# @param message [String] The message to log. Use default_message if not specified.
|
15
|
+
# @param exception [Exception] The exception or the error
|
16
|
+
# @param data [Object] Any structured data
|
17
|
+
def warn message = nil, exception = nil, data = nil, &block
|
18
|
+
# build Telemetry Exclusion
|
19
|
+
build_exclusion(ALIASED_WARN, message, exception, data)
|
20
|
+
super(message, exception, data, &block)
|
21
|
+
end
|
22
|
+
|
23
|
+
# @param message [String] The message to log. Use default_message if not specified.
|
24
|
+
# @param exception [Exception] The exception or the error
|
25
|
+
# @param data [Object] Any structured data
|
26
|
+
def error message = nil, exception = nil, data = nil, &block
|
27
|
+
# build Telemetry Exclusion
|
28
|
+
build_exclusion(ALIASED_ERROR, message, exception, data)
|
29
|
+
super(message, exception, data, &block)
|
30
|
+
end
|
31
|
+
|
32
|
+
# @param message [String] The message to log. Use default_message if not specified.
|
33
|
+
# @param exception [Exception] The exception or the error
|
34
|
+
# @param data [Object] Any structured data
|
35
|
+
def fatal message = nil, exception = nil, data = nil, &block
|
36
|
+
# build Telemetry Exclusion
|
37
|
+
build_exclusion(ALIASED_FATAL, message, exception, data)
|
38
|
+
super(message, exception, data, &block)
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def build_exclusion type, message = nil, exception = nil, data = nil
|
44
|
+
start = caller_locations&.find_index { |stack| stack.to_s.include?(type) }
|
45
|
+
stack_trace = start ? caller_locations(start + 1, 20) : caller_locations(20, 20)
|
46
|
+
stack_frame_type = stack_trace[1].path.delete_prefix(Dir.pwd)
|
47
|
+
message_exception_type = exception ? exception.cs__class.to_s : stack_frame_type.split('/').last
|
48
|
+
stack_frame_function = stack_trace[1].label
|
49
|
+
key = "#{ stack_frame_type }|#{ stack_frame_function }|#{ message }"
|
50
|
+
if TELEMETRY_EXCEPTIONS[key]
|
51
|
+
TELEMETRY_EXCEPTIONS.increment key
|
52
|
+
return
|
53
|
+
end
|
54
|
+
|
55
|
+
event_message = create_message(stack_frame_function, stack_frame_type, message_exception_type, data, exception,
|
56
|
+
message)
|
57
|
+
TELEMETRY_EXCEPTIONS[key] = event_message
|
58
|
+
rescue StandardError => e
|
59
|
+
debug('Unable to report exception to telemetry', e)
|
60
|
+
end
|
61
|
+
|
62
|
+
def create_message stack_frame_function, stack_frame_type, message_exception_type, data, exception, message
|
63
|
+
message_for_exception = if exception
|
64
|
+
exception.cs__respond_to?(:message) ? exception.message : exception
|
65
|
+
else
|
66
|
+
message
|
67
|
+
end
|
68
|
+
module_name = exception ? exception.cs__class.to_s.split('::').first : nil
|
69
|
+
stack_frame = Contrast::Agent::Telemetry::TelemetryException::StackFrame.build stack_frame_function,
|
70
|
+
stack_frame_type,
|
71
|
+
module_name
|
72
|
+
message_exception = Contrast::Agent::Telemetry::TelemetryException::MessageException.build(
|
73
|
+
message_exception_type,
|
74
|
+
message_for_exception,
|
75
|
+
module_name,
|
76
|
+
stack_frame)
|
77
|
+
tags = if data
|
78
|
+
data
|
79
|
+
else
|
80
|
+
exception.cs__is_a?(Hash) ? exception : {}
|
81
|
+
end
|
82
|
+
message = Contrast::Agent::Telemetry::TelemetryException::Message.build tags, [message_exception]
|
83
|
+
Contrast::Agent::Telemetry::TelemetryException::Event.new message
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -1,8 +1,6 @@
|
|
1
1
|
# Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
require 'contrast/utils/exclude_key'
|
5
|
-
|
6
4
|
module Contrast
|
7
5
|
module Logger
|
8
6
|
# Our decorator for the Ougai logger allowing for the logging of the
|
@@ -19,7 +17,7 @@ module Contrast
|
|
19
17
|
env_key = env_key.to_s
|
20
18
|
next unless ENV_KEYS.include?(env_key) ||
|
21
19
|
(env_key.start_with?(Contrast::Components::Config::CONTRAST_ENV_MARKER) &&
|
22
|
-
!env_key.start_with?(Contrast::Components::Config::CONTRAST_ENV_MARKER
|
20
|
+
!env_key.start_with?("#{ Contrast::Components::Config::CONTRAST_ENV_MARKER }API"))
|
23
21
|
|
24
22
|
info('Environment settings', key: env_key, value: env_value)
|
25
23
|
end
|
@@ -31,8 +29,6 @@ module Contrast
|
|
31
29
|
loggable = ::Contrast::CONFIG.loggable
|
32
30
|
info('Current configuration', configuration: loggable)
|
33
31
|
env_keys = ENV.keys.select do |env_key|
|
34
|
-
next if Contrast::Utils::ExcludeKey.excludable? env_key.to_s
|
35
|
-
|
36
32
|
env_key&.to_s&.start_with?(Contrast::Components::Config::CONTRAST_ENV_MARKER)
|
37
33
|
end
|
38
34
|
env_items = env_keys.map { |env_key| Contrast::Utils::EnvConfigurationItem.new(env_key, nil) }
|
@@ -142,7 +142,7 @@ module Contrast
|
|
142
142
|
"as suspicious using #{ rule_id } - #{ input_value }"
|
143
143
|
log [suspicious_attack_with, rule_id, outcome], ::Logger::WARN
|
144
144
|
elsif input_value.present?
|
145
|
-
suspicious_attack_without =
|
145
|
+
suspicious_attack_without = "Suspicious activity indicates a potential attack using #{ rule_id }"
|
146
146
|
log [suspicious_attack_without, rule_id, outcome], ::Logger::WARN
|
147
147
|
end
|
148
148
|
end
|