contrast-agent 4.9.1 → 4.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +0 -1
- data/.rspec_parallel +6 -0
- data/ext/cs__assess_module/cs__assess_module.c +48 -0
- data/ext/cs__assess_module/cs__assess_module.h +7 -0
- data/ext/cs__common/cs__common.c +24 -7
- data/ext/cs__common/cs__common.h +12 -2
- data/ext/cs__contrast_patch/cs__contrast_patch.c +48 -12
- data/ext/cs__contrast_patch/cs__contrast_patch.h +5 -4
- data/ext/cs__os_information/cs__os_information.c +31 -0
- data/ext/cs__os_information/cs__os_information.h +7 -0
- data/ext/{cs__protect_kernel → cs__os_information}/extconf.rb +0 -0
- data/lib/contrast/agent/assess/contrast_event.rb +1 -2
- data/lib/contrast/agent/assess/contrast_object.rb +1 -4
- data/lib/contrast/agent/assess/finalizers/hash.rb +0 -1
- data/lib/contrast/agent/assess/policy/dynamic_source_factory.rb +2 -0
- data/lib/contrast/agent/assess/policy/patcher.rb +0 -1
- data/lib/contrast/agent/assess/policy/policy_scanner.rb +0 -2
- data/lib/contrast/agent/assess/policy/preshift.rb +29 -12
- data/lib/contrast/agent/assess/policy/propagation_method.rb +71 -142
- data/lib/contrast/agent/assess/policy/propagation_node.rb +4 -4
- data/lib/contrast/agent/assess/policy/propagator/database_write.rb +2 -2
- data/lib/contrast/agent/assess/policy/propagator/match_data.rb +31 -11
- data/lib/contrast/agent/assess/policy/propagator/remove.rb +4 -9
- data/lib/contrast/agent/assess/policy/propagator/split.rb +3 -2
- data/lib/contrast/agent/assess/policy/propagator/substitution.rb +1 -0
- data/lib/contrast/agent/assess/policy/rewriter_patch.rb +0 -1
- data/lib/contrast/agent/assess/policy/source_method.rb +15 -88
- data/lib/contrast/agent/assess/policy/trigger/xpath.rb +0 -1
- data/lib/contrast/agent/assess/policy/trigger_method.rb +45 -172
- data/lib/contrast/agent/assess/policy/trigger_node.rb +52 -19
- data/lib/contrast/agent/assess/property/evented.rb +2 -1
- data/lib/contrast/agent/assess/property/tagged.rb +15 -132
- data/lib/contrast/agent/assess/rule/provider/hardcoded_value_rule.rb +0 -1
- data/lib/contrast/agent/deadzone/policy/policy.rb +6 -0
- data/lib/contrast/agent/disable_reaction.rb +1 -1
- data/lib/contrast/agent/exclusion_matcher.rb +0 -4
- data/lib/contrast/agent/inventory/database_config.rb +117 -0
- data/lib/contrast/agent/inventory/dependency_usage_analysis.rb +7 -5
- data/lib/contrast/agent/inventory/policy/datastores.rb +2 -2
- data/lib/contrast/agent/metric_telemetry_event.rb +26 -0
- data/lib/contrast/agent/middleware.rb +23 -0
- data/lib/contrast/agent/patching/policy/after_load_patch.rb +3 -0
- data/lib/contrast/agent/patching/policy/after_load_patcher.rb +17 -12
- data/lib/contrast/agent/patching/policy/method_policy.rb +54 -9
- data/lib/contrast/agent/patching/policy/module_policy.rb +2 -4
- data/lib/contrast/agent/patching/policy/patch.rb +42 -238
- data/lib/contrast/agent/patching/policy/patch_status.rb +3 -7
- data/lib/contrast/agent/patching/policy/patcher.rb +10 -49
- data/lib/contrast/agent/protect/policy/applies_no_sqli_rule.rb +1 -1
- data/lib/contrast/agent/protect/rule/no_sqli.rb +7 -53
- data/lib/contrast/agent/protect/rule/sql_sample_builder.rb +137 -0
- data/lib/contrast/agent/protect/rule/sqli.rb +7 -70
- data/lib/contrast/agent/reaction_processor.rb +1 -1
- data/lib/contrast/agent/request.rb +9 -4
- data/lib/contrast/agent/request_context.rb +51 -33
- data/lib/contrast/agent/request_handler.rb +7 -3
- data/lib/contrast/agent/rule_set.rb +2 -4
- data/lib/contrast/agent/scope.rb +32 -20
- data/lib/contrast/agent/startup_metrics_telemetry_event.rb +71 -0
- data/lib/contrast/agent/static_analysis.rb +5 -3
- data/lib/contrast/agent/telemetry.rb +129 -0
- data/lib/contrast/agent/telemetry_event.rb +34 -0
- data/lib/contrast/agent/thread_watcher.rb +43 -14
- data/lib/contrast/agent/tracepoint_hook.rb +16 -3
- data/lib/contrast/agent/version.rb +1 -1
- data/lib/contrast/agent.rb +6 -1
- data/lib/contrast/api/communication/messaging_queue.rb +12 -6
- data/lib/contrast/api/communication/service_lifecycle.rb +4 -1
- data/lib/contrast/api/communication/socket_client.rb +4 -4
- data/lib/contrast/api/decorators/agent_startup.rb +4 -4
- data/lib/contrast/api/decorators/application_startup.rb +6 -5
- data/lib/contrast/api/decorators/route_coverage.rb +24 -1
- data/lib/contrast/components/agent.rb +5 -2
- data/lib/contrast/components/api.rb +34 -0
- data/lib/contrast/components/app_context.rb +24 -0
- data/lib/contrast/components/assess.rb +13 -3
- data/lib/contrast/components/base.rb +2 -2
- data/lib/contrast/components/config.rb +91 -11
- data/lib/contrast/components/contrast_service.rb +10 -2
- data/lib/contrast/components/logger.rb +13 -8
- data/lib/contrast/components/scope.rb +9 -28
- data/lib/contrast/config/api_configuration.rb +22 -0
- data/lib/contrast/config/assess_configuration.rb +1 -0
- data/lib/contrast/config/base_configuration.rb +14 -6
- data/lib/contrast/config/env_variables.rb +25 -0
- data/lib/contrast/config/root_configuration.rb +1 -0
- data/lib/contrast/config/service_configuration.rb +2 -1
- data/lib/contrast/config.rb +1 -0
- data/lib/contrast/configuration.rb +22 -15
- data/lib/contrast/extension/assess/array.rb +1 -11
- data/lib/contrast/extension/assess/eval_trigger.rb +0 -20
- data/lib/contrast/extension/assess/fiber.rb +0 -11
- data/lib/contrast/extension/assess/hash.rb +0 -10
- data/lib/contrast/extension/assess/kernel.rb +1 -10
- data/lib/contrast/extension/assess/marshal.rb +3 -11
- data/lib/contrast/extension/assess/regexp.rb +0 -11
- data/lib/contrast/extension/assess/string.rb +1 -26
- data/lib/contrast/extension/extension.rb +61 -0
- data/lib/contrast/framework/grape/support.rb +174 -0
- data/lib/contrast/framework/manager.rb +56 -18
- data/lib/contrast/framework/rack/support.rb +1 -1
- data/lib/contrast/framework/rails/patch/action_controller_live_buffer.rb +9 -6
- data/lib/contrast/framework/rails/patch/assess_configuration.rb +0 -1
- data/lib/contrast/framework/rails/patch/support.rb +35 -30
- data/lib/contrast/framework/rails/railtie.rb +1 -1
- data/lib/contrast/framework/rails/rewrite/active_record_named.rb +1 -0
- data/lib/contrast/framework/rails/support.rb +60 -13
- data/lib/contrast/framework/sinatra/support.rb +1 -1
- data/lib/contrast/logger/application.rb +4 -0
- data/lib/contrast/logger/log.rb +89 -15
- data/lib/contrast/utils/assess/propagation_method_utils.rb +129 -0
- data/lib/contrast/utils/assess/property/tagged_utils.rb +142 -0
- data/lib/contrast/utils/assess/source_method_utils.rb +83 -0
- data/lib/contrast/utils/assess/trigger_method_utils.rb +138 -0
- data/lib/contrast/utils/class_util.rb +58 -44
- data/lib/contrast/utils/exclude_key.rb +20 -0
- data/lib/contrast/utils/io_util.rb +43 -35
- data/lib/contrast/utils/lru_cache.rb +45 -0
- data/lib/contrast/utils/metrics_hash.rb +59 -0
- data/lib/contrast/utils/os.rb +23 -0
- data/lib/contrast/utils/patching/policy/patch_utils.rb +232 -0
- data/lib/contrast/utils/patching/policy/patcher_utils.rb +54 -0
- data/lib/contrast/utils/requests_client.rb +150 -0
- data/lib/contrast/utils/ruby_ast_rewriter.rb +16 -13
- data/lib/contrast/utils/tag_util.rb +2 -1
- data/lib/contrast/utils/telemetry.rb +78 -0
- data/lib/contrast/utils/telemetry_identifier.rb +137 -0
- data/lib/contrast.rb +19 -1
- data/resources/assess/policy.json +208 -7
- data/resources/deadzone/policy.json +91 -0
- data/ruby-agent.gemspec +12 -2
- data/service_executables/VERSION +1 -1
- data/service_executables/linux/contrast-service +0 -0
- data/service_executables/mac/contrast-service +0 -0
- metadata +102 -18
- data/ext/cs__protect_kernel/cs__protect_kernel.c +0 -47
- data/ext/cs__protect_kernel/cs__protect_kernel.h +0 -12
- data/lib/contrast/extension/protect/kernel.rb +0 -39
- data/lib/contrast/utils/inventory_util.rb +0 -113
@@ -0,0 +1,137 @@
|
|
1
|
+
# Copyright (c) 2021 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'
|
5
|
+
require 'contrast/utils/os'
|
6
|
+
require 'socket'
|
7
|
+
|
8
|
+
module Contrast
|
9
|
+
module Utils
|
10
|
+
# Tools for supporting the Telemetry feature
|
11
|
+
module Telemetry
|
12
|
+
# Gets info about the instrumented application required to build unique identifiers,
|
13
|
+
# used in the agent's Telemetry.
|
14
|
+
module Identifier
|
15
|
+
MAC_REGEX = /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/.cs__freeze
|
16
|
+
LINUX_OS_REG = /hwaddr=.*?(([A-F0-9]{2}:){5}[A-F0-9]{2})/im.cs__freeze
|
17
|
+
MAC_OS_PRIMARY = 'en0'.cs__freeze
|
18
|
+
LINUX_PRIMARY = 'enp'.cs__freeze
|
19
|
+
|
20
|
+
# Sinatra and Grape both use similar approach to identify the app_name.
|
21
|
+
# Rails has a different way of doing it, but to unify this we'll use this one.
|
22
|
+
# If app_name is changed/renamed during production it would still get the
|
23
|
+
# new folder's name.
|
24
|
+
#
|
25
|
+
# @ return [String] name of the application from the current working directory
|
26
|
+
def self.app_name
|
27
|
+
@_app_name ||= File.basename(Dir.pwd)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns the MAC address of the primary network interface, depending on the used OS.
|
31
|
+
# If the primary is unknown it finds the first available network interface and gets it's
|
32
|
+
# MAC address instead.
|
33
|
+
#
|
34
|
+
# @return [String, nil] MAC address of the primary network interface or
|
35
|
+
# the first available one, or nil if nothing found
|
36
|
+
def self.mac
|
37
|
+
@_mac = find_mac MAC_OS_PRIMARY if Contrast::Utils::OS.mac? && @_mac.nil?
|
38
|
+
@_mac = find_mac LINUX_PRIMARY if Contrast::Utils::OS.linux? && @_mac.nil?
|
39
|
+
# or find any available
|
40
|
+
@_mac = find_mac if @_mac.nil?
|
41
|
+
@_mac
|
42
|
+
end
|
43
|
+
|
44
|
+
class << self
|
45
|
+
private
|
46
|
+
|
47
|
+
# Finds the primary MAC address of all listed network adapters.
|
48
|
+
# If primary is not set or unknown, use the first MAC address found
|
49
|
+
# from the listed adapters.
|
50
|
+
#
|
51
|
+
# @param primary [nil, String] optional param if set look only for primary
|
52
|
+
# network adapter's name
|
53
|
+
# @return [String, nil] MAC address of the first listed network adapter or
|
54
|
+
# nil if not found
|
55
|
+
def find_mac primary = nil
|
56
|
+
result = nil
|
57
|
+
idx = 0
|
58
|
+
return if interfaces.empty?
|
59
|
+
|
60
|
+
while idx < interfaces.length
|
61
|
+
addr = interfaces[idx].addr
|
62
|
+
name = interfaces[idx].name # rubocop:disable Security/Module/Name
|
63
|
+
# retrieving MAC address from primary network interface or first available
|
64
|
+
mac = retrieve_mac name, addr, primary
|
65
|
+
idx += 1
|
66
|
+
next unless mac
|
67
|
+
|
68
|
+
result = mac if mac && (mac.match? MAC_REGEX)
|
69
|
+
break if result && !primary
|
70
|
+
end
|
71
|
+
result
|
72
|
+
end
|
73
|
+
|
74
|
+
# Retrieves MAC address for primary or any network interface.
|
75
|
+
# This is OS dependent search.
|
76
|
+
#
|
77
|
+
# @param name [Sting] interface name of ifaddr
|
78
|
+
# @param addr [String] address info
|
79
|
+
# example: #<Addrinfo: LINK[en0 aa:bb:cc:00:11:22]>
|
80
|
+
# @param primary [nil, String] optional param if set look only for primary
|
81
|
+
# network adapter's name
|
82
|
+
# @return mac [nil, String] MAC address of primary network interface,
|
83
|
+
# any network interface, or nil if no interface is found.
|
84
|
+
def retrieve_mac name, addr, primary
|
85
|
+
mac = nil
|
86
|
+
# Mac OS allow us to use getnameinfo(sockaddr [, flags]) => [hostname, servicename]
|
87
|
+
#
|
88
|
+
# returned address:
|
89
|
+
# <Socket::Ifaddr en0 UP,BROADCAST,RUNNING,NOTRAILERS,SIMPLEX,MULTICAST LINK[en0 aa:bb:cc:00:11:22]>
|
90
|
+
if Contrast::Utils::OS.mac?
|
91
|
+
mac = addr.getnameinfo[0] unless primary
|
92
|
+
mac = addr.getnameinfo[0] if primary && name.include?(primary)
|
93
|
+
end
|
94
|
+
# In Linux using Socket::addr#getnameinfo results in ai_family not supported exception.
|
95
|
+
# In this case we are relying on match filtering of addresses.
|
96
|
+
#
|
97
|
+
# returned address:
|
98
|
+
# #<Socket::Ifaddr eth0 UP,BROADCAST,RUNNING,MULTICAST,0x10000
|
99
|
+
# PACKET[protocol=0 eth0 hatype=1 HOST hwaddr=aa:bb:cc:00:11:22]>
|
100
|
+
if primary && Contrast::Utils::OS.linux?
|
101
|
+
mac = Regexp.last_match(1) if addr.inspect =~ LINUX_OS_REG && name.include?(primary)
|
102
|
+
elsif primary.nil? && Contrast::Utils::OS.linux?
|
103
|
+
mac = Regexp.last_match(1) if addr.inspect =~ LINUX_OS_REG
|
104
|
+
end
|
105
|
+
mac
|
106
|
+
end
|
107
|
+
|
108
|
+
# Returns array of network interfaces.
|
109
|
+
# This is OS dependent search.
|
110
|
+
#
|
111
|
+
# @return interfaces [Array] Returns an array of interface addresses.
|
112
|
+
# Socket::Ifaddr - represents a result of getifaddrs().
|
113
|
+
def interfaces
|
114
|
+
@_interfaces = []
|
115
|
+
arr = Socket.getifaddrs
|
116
|
+
idx = 0
|
117
|
+
check_family = 0
|
118
|
+
while idx < arr.length
|
119
|
+
# We need only network adapters MACs. Checking for pfamily of every socket address:
|
120
|
+
# 18 for Mac OS and 17 for Linux.
|
121
|
+
# family should be an address family such as: :INET, :INET6, :UNIX, etc.
|
122
|
+
check_family = 18 if Contrast::Utils::OS.mac?
|
123
|
+
check_family = 17 if Contrast::Utils::OS.linux?
|
124
|
+
if arr[idx].addr.pfamily != check_family
|
125
|
+
idx += 1
|
126
|
+
next
|
127
|
+
end
|
128
|
+
@_interfaces << arr[idx]
|
129
|
+
idx += 1
|
130
|
+
end
|
131
|
+
@_interfaces
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
data/lib/contrast.rb
CHANGED
@@ -23,7 +23,7 @@ end
|
|
23
23
|
|
24
24
|
if RUBY_VERSION >= '3.0.0'
|
25
25
|
# This fixes Ruby 3.0 issues with Module#(some instance method) patching by preventing the prepending of
|
26
|
-
# a JSON helper on protobuf load. String.instance_method(:+) is one of the most
|
26
|
+
# a JSON helper on protobuf load. String.instance_method(:+) is one of the most noticeable.
|
27
27
|
# TODO: RUBY-1132 Remove this once Ruby 3 is fixed.
|
28
28
|
# See bug here: https://bugs.ruby-lang.org/issues/17725
|
29
29
|
class Class
|
@@ -35,6 +35,7 @@ if RUBY_VERSION >= '3.0.0'
|
|
35
35
|
end
|
36
36
|
|
37
37
|
require 'contrast/components/agent'
|
38
|
+
require 'contrast/components/api'
|
38
39
|
require 'contrast/components/app_context'
|
39
40
|
require 'contrast/components/assess'
|
40
41
|
require 'contrast/components/config'
|
@@ -47,6 +48,7 @@ require 'contrast/components/scope'
|
|
47
48
|
require 'contrast/components/settings'
|
48
49
|
|
49
50
|
module Contrast
|
51
|
+
API = Contrast::Components::Api::Interface.new
|
50
52
|
SCOPE = Contrast::Components::Scope::Interface.new
|
51
53
|
CONFIG = Contrast::Components::Config::Interface.new
|
52
54
|
SETTINGS = Contrast::Components::Settings::Interface.new
|
@@ -76,3 +78,19 @@ if RUBY_VERSION >= '3.0.0'
|
|
76
78
|
Class.alias_method(:prepend, :cs__orig_prepend)
|
77
79
|
Class.remove_method(:cs__orig_prepend)
|
78
80
|
end
|
81
|
+
|
82
|
+
if RUBY_VERSION < '3.0.0'
|
83
|
+
# Better handles ancestors for older ruby versions.
|
84
|
+
# This is called from C, tread lightly.
|
85
|
+
class Module
|
86
|
+
@_included_in = []
|
87
|
+
# Returns array with modules including this instance
|
88
|
+
def included_in
|
89
|
+
@_included_in ||= [] unless cs__frozen?
|
90
|
+
end
|
91
|
+
|
92
|
+
def self.included_in
|
93
|
+
@_included_in ||= [] unless cs__frozen?
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -33,6 +33,23 @@
|
|
33
33
|
"target": "R",
|
34
34
|
"type": "BODY",
|
35
35
|
"tags":["NO_NEWLINES", "CROSS_SITE"]
|
36
|
+
}, {
|
37
|
+
"class_name":"ActionDispatch::Request",
|
38
|
+
"instance_method": true,
|
39
|
+
"method_visibility": "public",
|
40
|
+
"method_name": "body",
|
41
|
+
"source": "P0",
|
42
|
+
"target": "R",
|
43
|
+
"type": "BODY",
|
44
|
+
"tags":["NO_NEWLINES", "CROSS_SITE"]
|
45
|
+
}, {
|
46
|
+
"class_name":"ActionDispatch::Cookies::CookieJar",
|
47
|
+
"instance_method": true,
|
48
|
+
"method_visibility": "public",
|
49
|
+
"method_name": "[]",
|
50
|
+
"target": "R",
|
51
|
+
"type": "COOKIE",
|
52
|
+
"tags":["NO_NEWLINES", "CROSS_SITE"]
|
36
53
|
}, {
|
37
54
|
"class_name":"Rack::Request::Helpers",
|
38
55
|
"instance_method": true,
|
@@ -129,10 +146,45 @@
|
|
129
146
|
"target":"R",
|
130
147
|
"type":"PARAMETER",
|
131
148
|
"tags":["CROSS_SITE"]
|
149
|
+
}, {
|
150
|
+
"class_name":"Grape::Env",
|
151
|
+
"instance_method": true,
|
152
|
+
"method_visibility": "public",
|
153
|
+
"method_name":"[]",
|
154
|
+
"source": "P0",
|
155
|
+
"target":"R",
|
156
|
+
"type":"HEADER",
|
157
|
+
"tags":["CROSS_SITE"]
|
158
|
+
}, {
|
159
|
+
"class_name":"Grape::Request",
|
160
|
+
"instance_method": true,
|
161
|
+
"method_visibility": "public",
|
162
|
+
"method_name":"headers",
|
163
|
+
"source": "P0",
|
164
|
+
"target":"R",
|
165
|
+
"type":"HEADER",
|
166
|
+
"tags":["NO_NEWLINES", "CROSS_SITE"]
|
167
|
+
}, {
|
168
|
+
"class_name":"Grape::Request",
|
169
|
+
"instance_method": true,
|
170
|
+
"method_visibility": "public",
|
171
|
+
"method_name":"body",
|
172
|
+
"target":"R",
|
173
|
+
"type":"BODY",
|
174
|
+
"tags":["CROSS_SITE"]
|
175
|
+
}, {
|
176
|
+
"class_name":"Grape::Validations::Base",
|
177
|
+
"instance_method": true,
|
178
|
+
"method_visibility": "public",
|
179
|
+
"method_name":"validate!",
|
180
|
+
"source": "P0",
|
181
|
+
"target":"R",
|
182
|
+
"type":"PARAMETER",
|
183
|
+
"tags":["CROSS_SITE"]
|
132
184
|
}
|
133
185
|
],
|
134
186
|
"propagators":[
|
135
|
-
|
187
|
+
{
|
136
188
|
"class_name":"String",
|
137
189
|
"instance_method": true,
|
138
190
|
"method_visibility": "public",
|
@@ -140,7 +192,7 @@
|
|
140
192
|
"source":"O",
|
141
193
|
"target":"R",
|
142
194
|
"action":"KEEP"
|
143
|
-
},
|
195
|
+
}, {
|
144
196
|
"class_name": "String",
|
145
197
|
"instance_method": true,
|
146
198
|
"method_visibility": "public",
|
@@ -148,8 +200,15 @@
|
|
148
200
|
"source": "O",
|
149
201
|
"target": "R",
|
150
202
|
"action": "KEEP"
|
151
|
-
},
|
152
|
-
|
203
|
+
}, {
|
204
|
+
"class_name": "String",
|
205
|
+
"instance_method": true,
|
206
|
+
"method_visibility": "public",
|
207
|
+
"method_name": "force_encoding",
|
208
|
+
"source": "O",
|
209
|
+
"target": "R",
|
210
|
+
"action": "SPLAT"
|
211
|
+
}, {
|
153
212
|
"class_name": "String",
|
154
213
|
"instance_method": true,
|
155
214
|
"method_visibility": "public",
|
@@ -157,8 +216,7 @@
|
|
157
216
|
"source": "O",
|
158
217
|
"target": "R",
|
159
218
|
"action": "KEEP"
|
160
|
-
},
|
161
|
-
{
|
219
|
+
}, {
|
162
220
|
"class_name": "String",
|
163
221
|
"instance_method": true,
|
164
222
|
"method_visibility": "public",
|
@@ -166,7 +224,7 @@
|
|
166
224
|
"source": "O,P0",
|
167
225
|
"target": "R",
|
168
226
|
"action": "SPLIT"
|
169
|
-
},{
|
227
|
+
}, {
|
170
228
|
"class_name": "String",
|
171
229
|
"instance_method": true,
|
172
230
|
"method_visibility": "public",
|
@@ -722,6 +780,24 @@
|
|
722
780
|
"patch_method": "select_tagger",
|
723
781
|
"source": "O",
|
724
782
|
"target": "R"
|
783
|
+
},{
|
784
|
+
"class_name":"CGI::Util",
|
785
|
+
"method_name":"unescape",
|
786
|
+
"instance_method": true,
|
787
|
+
"method_visibility": "public",
|
788
|
+
"source":"P0",
|
789
|
+
"target":"R",
|
790
|
+
"action":"SPLAT",
|
791
|
+
"tags":[],
|
792
|
+
"untags":[]
|
793
|
+
}, {
|
794
|
+
"class_name":"StringIO",
|
795
|
+
"instance_method": true,
|
796
|
+
"method_visibility": "public",
|
797
|
+
"method_name": "read",
|
798
|
+
"source": "O",
|
799
|
+
"target": "R",
|
800
|
+
"action": "SPLAT"
|
725
801
|
}, {
|
726
802
|
"class_name":"CGI::Util",
|
727
803
|
"method_name":"escapeHTML",
|
@@ -742,6 +818,16 @@
|
|
742
818
|
"action":"SPLAT",
|
743
819
|
"tags":["HTML_ENCODED"],
|
744
820
|
"untags":["HTML_DECODED"]
|
821
|
+
}, {
|
822
|
+
"class_name":"Rack::Utils",
|
823
|
+
"method_name":"escape_html",
|
824
|
+
"instance_method": false,
|
825
|
+
"method_visibility": "public",
|
826
|
+
"source":"P0",
|
827
|
+
"target":"R",
|
828
|
+
"action":"SPLAT",
|
829
|
+
"tags":["HTML_ENCODED"],
|
830
|
+
"untags":["HTML_DECODED"]
|
745
831
|
}, {
|
746
832
|
"class_name":"CGI::Util",
|
747
833
|
"method_name":"h",
|
@@ -1287,6 +1373,18 @@
|
|
1287
1373
|
"instance_method": true,
|
1288
1374
|
"method_visibility": "public",
|
1289
1375
|
"source":"P0"
|
1376
|
+
}, {
|
1377
|
+
"class_name":"Rack::Response",
|
1378
|
+
"method_name":"body=",
|
1379
|
+
"instance_method": true,
|
1380
|
+
"method_visibility": "public",
|
1381
|
+
"source":"P0"
|
1382
|
+
}, {
|
1383
|
+
"class_name":"Rack::Response",
|
1384
|
+
"method_name":"write",
|
1385
|
+
"instance_method": true,
|
1386
|
+
"method_visibility": "public",
|
1387
|
+
"source":"P0"
|
1290
1388
|
}, {
|
1291
1389
|
"class_name":"Sinatra::Helpers",
|
1292
1390
|
"method_name":"body",
|
@@ -1347,12 +1445,108 @@
|
|
1347
1445
|
"method_visibility": "public",
|
1348
1446
|
"method_name":"async_exec",
|
1349
1447
|
"source":"P0"
|
1448
|
+
}, {
|
1449
|
+
"class_name":"ActiveRecord::Relation::Calculations",
|
1450
|
+
"instance_method": true,
|
1451
|
+
"method_visibility": "public",
|
1452
|
+
"method_name":"calculate",
|
1453
|
+
"source":"P0"
|
1454
|
+
}, {
|
1455
|
+
"class_name":"ActiveRecord::FinderMethods",
|
1456
|
+
"instance_method": true,
|
1457
|
+
"method_visibility": "public",
|
1458
|
+
"method_name":"exists?",
|
1459
|
+
"source":"P0"
|
1460
|
+
}, {
|
1461
|
+
"class_name":"ActiveRecord::FinderMethods",
|
1462
|
+
"instance_method": true,
|
1463
|
+
"method_visibility": "public",
|
1464
|
+
"method_name":"find_by",
|
1465
|
+
"source":"P0"
|
1350
1466
|
}, {
|
1351
1467
|
"class_name":"ActiveRecord::Querying",
|
1352
1468
|
"instance_method": false,
|
1353
1469
|
"method_visibility": "public",
|
1354
1470
|
"method_name":"select",
|
1355
1471
|
"source":"P0"
|
1472
|
+
}, {
|
1473
|
+
"class_name":"ActiveRecord::QueryMethods",
|
1474
|
+
"instance_method": true,
|
1475
|
+
"method_visibility": "public",
|
1476
|
+
"method_name":"from",
|
1477
|
+
"source":"P0"
|
1478
|
+
}, {
|
1479
|
+
"class_name":"ActiveRecord::QueryMethods",
|
1480
|
+
"instance_method": true,
|
1481
|
+
"method_visibility": "public",
|
1482
|
+
"method_name":"group",
|
1483
|
+
"source":"P0"
|
1484
|
+
}, {
|
1485
|
+
"class_name":"ActiveRecord::QueryMethods",
|
1486
|
+
"instance_method": true,
|
1487
|
+
"method_visibility": "public",
|
1488
|
+
"method_name":"having",
|
1489
|
+
"source":"P0"
|
1490
|
+
}, {
|
1491
|
+
"class_name":"ActiveRecord::QueryMethods",
|
1492
|
+
"instance_method": true,
|
1493
|
+
"method_visibility": "public",
|
1494
|
+
"method_name":"joins",
|
1495
|
+
"source":"P0"
|
1496
|
+
}, {
|
1497
|
+
"class_name":"ActiveRecord::QueryMethods",
|
1498
|
+
"instance_method": true,
|
1499
|
+
"method_visibility": "public",
|
1500
|
+
"method_name":"lock",
|
1501
|
+
"source":"P0"
|
1502
|
+
}, {
|
1503
|
+
"class_name":"ActiveRecord::QueryMethods",
|
1504
|
+
"instance_method": true,
|
1505
|
+
"method_visibility": "public",
|
1506
|
+
"method_name":"select",
|
1507
|
+
"source":"P0"
|
1508
|
+
}, {
|
1509
|
+
"class_name":"ActiveRecord::QueryMethods",
|
1510
|
+
"instance_method": true,
|
1511
|
+
"method_visibility": "public",
|
1512
|
+
"method_name":"reselect",
|
1513
|
+
"source":"P0"
|
1514
|
+
}, {
|
1515
|
+
"class_name":"ActiveRecord::QueryMethods",
|
1516
|
+
"instance_method": true,
|
1517
|
+
"method_visibility": "public",
|
1518
|
+
"method_name":"where",
|
1519
|
+
"source":"P0"
|
1520
|
+
}, {
|
1521
|
+
"class_name":"ActiveRecord::QueryMethods",
|
1522
|
+
"instance_method": true,
|
1523
|
+
"method_visibility": "public",
|
1524
|
+
"method_name":"rewhere",
|
1525
|
+
"source":"P0"
|
1526
|
+
}, {
|
1527
|
+
"class_name":"ActiveRecord::QueryMethods::WhereChain",
|
1528
|
+
"instance_method": true,
|
1529
|
+
"method_visibility": "public",
|
1530
|
+
"method_name":"not",
|
1531
|
+
"source":"P0"
|
1532
|
+
}, {
|
1533
|
+
"class_name":"ActiveRecord::Relation",
|
1534
|
+
"instance_method": true,
|
1535
|
+
"method_visibility": "public",
|
1536
|
+
"method_name":"delete_by",
|
1537
|
+
"source":"P0"
|
1538
|
+
}, {
|
1539
|
+
"class_name":"ActiveRecord::Relation",
|
1540
|
+
"instance_method": true,
|
1541
|
+
"method_visibility": "public",
|
1542
|
+
"method_name":"destroy_by",
|
1543
|
+
"source":"P0"
|
1544
|
+
}, {
|
1545
|
+
"class_name":"ActiveRecord::Relation",
|
1546
|
+
"instance_method": true,
|
1547
|
+
"method_visibility": "public",
|
1548
|
+
"method_name":"update_all",
|
1549
|
+
"source":"P0"
|
1356
1550
|
}
|
1357
1551
|
]
|
1358
1552
|
}, {
|
@@ -1685,6 +1879,13 @@
|
|
1685
1879
|
"method_visibility": "public",
|
1686
1880
|
"method_name": "redirect_to",
|
1687
1881
|
"source": "P0"
|
1882
|
+
},
|
1883
|
+
{
|
1884
|
+
"class_name": "Grape::DSL::InsideRoute",
|
1885
|
+
"instance_method": true,
|
1886
|
+
"method_visibility": "public",
|
1887
|
+
"method_name": "redirect",
|
1888
|
+
"source": "P0"
|
1688
1889
|
}
|
1689
1890
|
]
|
1690
1891
|
}, {
|
@@ -1,6 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"deadzones":[
|
3
3
|
{
|
4
|
+
"class_name":"Rspec::Core::Example",
|
5
|
+
"instance_method":true,
|
6
|
+
"method_visibility": "private",
|
7
|
+
"method_name":"finish"
|
8
|
+
},{
|
4
9
|
"class_name":"Rack::Request::Helpers",
|
5
10
|
"instance_method":true,
|
6
11
|
"method_visibility": "public",
|
@@ -195,6 +200,92 @@
|
|
195
200
|
"method_visibility": "public",
|
196
201
|
"method_name":"exists?",
|
197
202
|
"code": "https://github.com/rails/rails/blob/v6.0.3.4/actionpack/lib/action_dispatch/request/session.rb#L201"
|
203
|
+
},{
|
204
|
+
"class_name": "RSpec::Matchers::BuiltIn::BaseMatcher"
|
205
|
+
},{
|
206
|
+
"class_name": "RSpec::Matchers::BuiltIn::BeAKindOf"
|
207
|
+
},{
|
208
|
+
"class_name": "RSpec::Matchers::BuiltIn::BeAnInstanceOf"
|
209
|
+
},{
|
210
|
+
"class_name": "RSpec::Matchers::BuiltIn::BeBetween"
|
211
|
+
},{
|
212
|
+
"class_name": "RSpec::Matchers::BuiltIn::Be"
|
213
|
+
},{
|
214
|
+
"class_name": "RSpec::Matchers::BuiltIn::BeComparedTo"
|
215
|
+
},{
|
216
|
+
"class_name": "RSpec::Matchers::BuiltIn::BeFalsey"
|
217
|
+
},{
|
218
|
+
"class_name": "RSpec::Matchers::BuiltIn::BeHelpers"
|
219
|
+
},{
|
220
|
+
"class_name": "RSpec::Matchers::BuiltIn::BeNil"
|
221
|
+
},{
|
222
|
+
"class_name": "RSpec::Matchers::BuiltIn::BePredicate"
|
223
|
+
},{
|
224
|
+
"class_name": "RSpec::Matchers::BuiltIn::BeTruthy"
|
225
|
+
},{
|
226
|
+
"class_name": "RSpec::Matchers::BuiltIn::BeWithin"
|
227
|
+
},{
|
228
|
+
"class_name": "RSpec::Matchers::BuiltIn::Change"
|
229
|
+
},{
|
230
|
+
"class_name": "RSpec::Matchers::BuiltIn::ChangeRelatively"
|
231
|
+
},{
|
232
|
+
"class_name": "RSpec::Matchers::BuiltIn::SpecificValuesChange"
|
233
|
+
},{
|
234
|
+
"class_name": "RSpec::Matchers::BuiltIn::Compound"
|
235
|
+
},{
|
236
|
+
"class_name": "RSpec::Matchers::BuiltIn::Compound::And"
|
237
|
+
}, {
|
238
|
+
"class_name": "RSpec::Matchers::BuiltIn::Compound::Or"
|
239
|
+
},{
|
240
|
+
"class_name": "RSpec::Matchers::BuiltIn::ContainExactly"
|
241
|
+
},{
|
242
|
+
"class_name": "RSpec::Matchers::BuiltIn::Cover"
|
243
|
+
},{
|
244
|
+
"class_name": "RSpec::Matchers::BuiltIn::EndWith"
|
245
|
+
},{
|
246
|
+
"class_name": "RSpec::Matchers::BuiltIn::Eq"
|
247
|
+
},{
|
248
|
+
"class_name": "RSpec::Matchers::BuiltIn::Eql"
|
249
|
+
},{
|
250
|
+
"class_name": "RSpec::Matchers::BuiltIn::Equal"
|
251
|
+
},{
|
252
|
+
"class_name": "RSpec::Matchers::BuiltIn::Exist"
|
253
|
+
},{
|
254
|
+
"class_name": "RSpec::Matchers::BuiltIn::Has"
|
255
|
+
},{
|
256
|
+
"class_name": "RSpec::Matchers::BuiltIn::HaveAttributes"
|
257
|
+
},{
|
258
|
+
"class_name": "RSpec::Matchers::BuiltIn::All"
|
259
|
+
},{
|
260
|
+
"class_name": "RSpec::Matchers::BuiltIn::Match"
|
261
|
+
},{
|
262
|
+
"class_name": "RSpec::Matchers::BuiltIn::NegativeOperatorMatcher"
|
263
|
+
},{
|
264
|
+
"class_name": "RSpec::Matchers::BuiltIn::OperatorMatcher"
|
265
|
+
},{
|
266
|
+
"class_name": "RSpec::Matchers::BuiltIn::Output"
|
267
|
+
},{
|
268
|
+
"class_name": "RSpec::Matchers::BuiltIn::PositiveOperatorMatcher"
|
269
|
+
},{
|
270
|
+
"class_name": "RSpec::Matchers::BuiltIn::RaiseError"
|
271
|
+
},{
|
272
|
+
"class_name": "RSpec::Matchers::BuiltIn::RespondTo"
|
273
|
+
},{
|
274
|
+
"class_name": "RSpec::Matchers::BuiltIn::Satisfy"
|
275
|
+
},{
|
276
|
+
"class_name": "RSpec::Matchers::BuiltIn::StartWith"
|
277
|
+
},{
|
278
|
+
"class_name": "RSpec::Matchers::BuiltIn::ThrowSymbol"
|
279
|
+
},{
|
280
|
+
"class_name": "RSpec::Matchers::BuiltIn::YieldControl"
|
281
|
+
},{
|
282
|
+
"class_name": "RSpec::Matchers::BuiltIn::YieldSuccessiveArgs"
|
283
|
+
},{
|
284
|
+
"class_name": "RSpec::Matchers::BuiltIn::YieldWithArgs"
|
285
|
+
},{
|
286
|
+
"class_name": "RSpec::Matchers::BuiltIn::YieldWithNoArgs"
|
287
|
+
},{
|
288
|
+
"class_name": "SimpleCov"
|
198
289
|
}
|
199
290
|
]
|
200
291
|
}
|
data/ruby-agent.gemspec
CHANGED
@@ -24,6 +24,7 @@ def self.add_dev_dependencies spec
|
|
24
24
|
add_debuggers(spec)
|
25
25
|
add_linters(spec) # if RUBY_VERSION >= '2.6.0' # TODO: RUBY-714 remove guard w/ EOL of 2.5
|
26
26
|
add_specs(spec)
|
27
|
+
add_custom_dependencies(spec)
|
27
28
|
end
|
28
29
|
|
29
30
|
# Dependencies used to build the agent during development.
|
@@ -33,14 +34,21 @@ def self.add_builders spec
|
|
33
34
|
spec.add_development_dependency 'rake-compiler', '~> 0'
|
34
35
|
end
|
35
36
|
|
37
|
+
# Dependencies that are required during testing in actual application
|
38
|
+
def self.add_custom_dependencies spec
|
39
|
+
spec.add_development_dependency 'zlib'
|
40
|
+
end
|
41
|
+
|
36
42
|
# Dependencies used for local debugging during development.
|
37
43
|
def self.add_debuggers spec
|
38
44
|
spec.add_development_dependency 'pry'
|
45
|
+
spec.add_development_dependency 'pry-byebug', '>= 3.9'
|
39
46
|
spec.add_development_dependency 'ruby-debug-ide'
|
40
47
|
end
|
41
48
|
|
42
49
|
# Dependencies used for framework testing.
|
43
50
|
def self.add_frameworks spec
|
51
|
+
spec.add_development_dependency 'grape', '~> 1.5', '>= 1.5.2'
|
44
52
|
spec.add_development_dependency 'rack-protection', '>= 2'
|
45
53
|
spec.add_development_dependency 'rails', '6.0.3.5'
|
46
54
|
spec.add_development_dependency 'sinatra', '>= 2'
|
@@ -66,12 +74,13 @@ def self.add_specs spec
|
|
66
74
|
spec.add_development_dependency 'factory_bot'
|
67
75
|
spec.add_development_dependency 'fake_ftp'
|
68
76
|
spec.add_development_dependency 'openssl'
|
77
|
+
spec.add_development_dependency 'parallel_tests'
|
69
78
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
70
79
|
spec.add_development_dependency 'rspec-benchmark'
|
71
80
|
spec.add_development_dependency 'rspec_junit_formatter', '0.3.0'
|
72
81
|
spec.add_development_dependency 'rspec-rails', '5.0'
|
73
|
-
spec.add_development_dependency 'warning'
|
74
82
|
spec.add_development_dependency 'tzinfo-data' # Alpine rspec-rails requirement.
|
83
|
+
spec.add_development_dependency 'warning'
|
75
84
|
end
|
76
85
|
|
77
86
|
def self.add_coverage spec
|
@@ -141,7 +150,8 @@ def self.add_files spec
|
|
141
150
|
'shared_libraries/libfunchook.so',
|
142
151
|
'shared_libraries/funchook.h',
|
143
152
|
'funchook/src/libfunchook.dylib',
|
144
|
-
'funchook/src/libfunchook.so'
|
153
|
+
'funchook/src/libfunchook.so',
|
154
|
+
'.secrets.baseline')
|
145
155
|
end
|
146
156
|
end
|
147
157
|
|
data/service_executables/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.27.3
|
Binary file
|
Binary file
|