sqreen 1.18.3 → 1.18.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/sqreen.rb +2 -0
- data/lib/sqreen/instrumentation.rb +8 -8
- data/lib/sqreen/rules/waf_cb.rb +2 -1
- data/lib/sqreen/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c45fb1ef0cc0144c31a590a99efd24dc36224425e3eaa03702d7f04337437c80
|
4
|
+
data.tar.gz: 6d0c44ddafa3547a74ffdbd1123d9f17d33a54699203baa7f4cbec91a3fd5bc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6104a3ec75fce7d9e4bfc5c75a106f536dcaa103c7350560713aae37820baead05d81f037d56133a5913620004f46611addf61bfe76a4868ac9407ba5b5d56f
|
7
|
+
data.tar.gz: f11adaa346fe2296289483c7d958a9ab7f67aebd01a22c8848f77fbb0d79dec2f9088f346d30a712472b2d4e783ea3cc7da66cb4944341419434bb4ef363ca99
|
data/CHANGELOG.md
CHANGED
data/lib/sqreen.rb
CHANGED
@@ -237,7 +237,7 @@ module Sqreen
|
|
237
237
|
key = [method]
|
238
238
|
args.each { |e| key.push(e.object_id) }
|
239
239
|
if key && @sqreen_multi_instr && @sqreen_multi_instr[instance.object_id].member?(key)
|
240
|
-
return instance.
|
240
|
+
return instance.__send__(original_method, *args, &block)
|
241
241
|
end
|
242
242
|
@sqreen_multi_instr ||= Hash.new { |h, k| h[k] = Set.new } # TODO: this should probably be a thread local
|
243
243
|
@sqreen_multi_instr[instance.object_id].add(key)
|
@@ -273,7 +273,7 @@ module Sqreen
|
|
273
273
|
skip_call = true
|
274
274
|
end
|
275
275
|
# If we are already overbudget let's not work at all
|
276
|
-
return
|
276
|
+
return __send__(original_meth, *args, &block) if skip_call
|
277
277
|
Instrumentation.guard_multi_call(self, meth, original_meth, args, block) do
|
278
278
|
precbs, postcbs, failcbs = Instrumentation.callbacks.get(klass_name, meth)
|
279
279
|
Thread.current[:sqreen_in_use] = true
|
@@ -328,7 +328,7 @@ module Sqreen
|
|
328
328
|
Thread.current[:sqreen_in_use] = false
|
329
329
|
return result if skip
|
330
330
|
begin
|
331
|
-
result =
|
331
|
+
result = __send__(original_meth, *args, &block)
|
332
332
|
rescue StandardError => e
|
333
333
|
Thread.current[:sqreen_in_use] = true
|
334
334
|
budget = Sqreen.performance_budget && framework && framework.remaining_perf_budget
|
@@ -401,7 +401,7 @@ module Sqreen
|
|
401
401
|
Sqreen::PerformanceNotifications::BinnedMetrics.start_request if has_notifications
|
402
402
|
|
403
403
|
begin
|
404
|
-
|
404
|
+
__send__(original_meth, *args, &block)
|
405
405
|
ensure
|
406
406
|
if has_notifications
|
407
407
|
Sqreen::PerformanceNotifications.instrument('next_req_notifs', PRE_CB) do
|
@@ -437,7 +437,7 @@ module Sqreen
|
|
437
437
|
end
|
438
438
|
|
439
439
|
alias_method original, new_method
|
440
|
-
|
440
|
+
__send__(method_kind, original)
|
441
441
|
private saved_meth_name
|
442
442
|
end
|
443
443
|
end
|
@@ -456,7 +456,7 @@ module Sqreen
|
|
456
456
|
method_kind = :private
|
457
457
|
end
|
458
458
|
alias_method meth, saved_meth_name
|
459
|
-
|
459
|
+
__send__(method_kind, meth)
|
460
460
|
|
461
461
|
remove_method saved_meth_name
|
462
462
|
end
|
@@ -503,7 +503,7 @@ module Sqreen
|
|
503
503
|
alias_method meth, new_method
|
504
504
|
private saved_meth_name
|
505
505
|
private new_method
|
506
|
-
|
506
|
+
__send__(method_kind, meth)
|
507
507
|
end
|
508
508
|
saved_meth_name
|
509
509
|
end
|
@@ -522,7 +522,7 @@ module Sqreen
|
|
522
522
|
method_kind = :private
|
523
523
|
end
|
524
524
|
alias_method meth.to_sym, saved_meth_name.to_sym
|
525
|
-
|
525
|
+
__send__(method_kind, meth.to_sym)
|
526
526
|
end
|
527
527
|
end
|
528
528
|
|
data/lib/sqreen/rules/waf_cb.rb
CHANGED
@@ -57,7 +57,7 @@ module Sqreen
|
|
57
57
|
ObjectSpace.define_finalizer(self, WAFCB.finalizer(@waf_rule_name.dup))
|
58
58
|
end
|
59
59
|
|
60
|
-
def pre(instance, args,
|
60
|
+
def pre(instance, args, budget)
|
61
61
|
return unless WAFCB.libsqreen? && WAFCB.waf?
|
62
62
|
|
63
63
|
request = framework.request
|
@@ -70,6 +70,7 @@ module Sqreen
|
|
70
70
|
h[e] = capper.call(b.resolve(*env))
|
71
71
|
end
|
72
72
|
waf_args = Sqreen::EncodingSanitizer.sanitize(waf_args)
|
73
|
+
budget = [self.budget, budget].compact.min
|
73
74
|
action, data = ::LibSqreen::WAF.run(waf_rule_name, waf_args, budget)
|
74
75
|
|
75
76
|
case action
|
data/lib/sqreen/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sqreen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.18.
|
4
|
+
version: 1.18.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sqreen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sq_mini_racer
|