sqreen 1.18.4-java → 1.18.5-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/sqreen/rules/waf_cb.rb +6 -6
- 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: eb507312dca29a9446f8bce75d8b150c709e453efc0d09757f2637cb0b486771
|
4
|
+
data.tar.gz: 3138b8a6a57d9330e97767161003f9861409b1e30deaa140828456684a25d096
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1afa452809625ca8739de597abd0b714e5dc27682f365bc24e3a67c0319288321e13875f2b9a623ece2798e377ff7852938208bf7144c2f43726c731cc9b08bb
|
7
|
+
data.tar.gz: 4204ba1c27317034ff4ab051831bd36e3ab174dce731113242ca4fe2e405b2aedcf083e0dccd702302e09da4fc1277d5319c8195073ee5635c019b145638a842
|
data/CHANGELOG.md
CHANGED
data/lib/sqreen/rules/waf_cb.rb
CHANGED
@@ -13,7 +13,7 @@ require 'sqreen/dependency/libsqreen'
|
|
13
13
|
module Sqreen
|
14
14
|
module Rules
|
15
15
|
class WAFCB < RuleCB
|
16
|
-
BUDGET_MAX =
|
16
|
+
BUDGET_MAX = 5
|
17
17
|
|
18
18
|
def self.libsqreen?
|
19
19
|
Sqreen::Dependency::LibSqreen.required?
|
@@ -52,7 +52,7 @@ module Sqreen
|
|
52
52
|
@binding_accessors = @data['values'].fetch('binding_accessors', []).each_with_object({}) do |e, h|
|
53
53
|
h[e] = BindingAccessor.new(e)
|
54
54
|
end
|
55
|
-
@budget = @data['values'].fetch('
|
55
|
+
@budget = @data['values'].fetch('budget_in_ms', BUDGET_MAX) * 1000
|
56
56
|
|
57
57
|
ObjectSpace.define_finalizer(self, WAFCB.finalizer(@waf_rule_name.dup))
|
58
58
|
end
|
@@ -70,8 +70,8 @@ module Sqreen
|
|
70
70
|
h[e] = capper.call(b.resolve(*env))
|
71
71
|
end
|
72
72
|
waf_args = Sqreen::EncodingSanitizer.sanitize(waf_args)
|
73
|
-
|
74
|
-
action, data = ::LibSqreen::WAF.run(waf_rule_name, waf_args,
|
73
|
+
waf_budget = [self.budget, budget * 1_000_000].compact.min.to_i
|
74
|
+
action, data = ::LibSqreen::WAF.run(waf_rule_name, waf_args, waf_budget)
|
75
75
|
|
76
76
|
case action
|
77
77
|
when :monitor
|
@@ -103,13 +103,13 @@ module Sqreen
|
|
103
103
|
lambda do |object_id|
|
104
104
|
return unless WAFCB.libsqreen?
|
105
105
|
|
106
|
-
::LibSqreen::WAF.delete(waf_rule_name
|
106
|
+
::LibSqreen::WAF.delete(waf_rule_name)
|
107
107
|
Sqreen.log.debug("WAF rule #{rule_name} deleted, from #<#{name}:0x#{object_id.to_s(16).rjust(16, '0')}>")
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
111
|
def record_exception(exception, infos = {}, at = Time.now.utc)
|
112
|
-
infos.merge!(exception_to_infos(exception))
|
112
|
+
infos.merge!(exception_to_infos(exception)) if exception.is_a?(Sqreen::WAFError)
|
113
113
|
super(exception, infos, at)
|
114
114
|
end
|
115
115
|
|
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.5
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Sqreen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|