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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43b9ddb790f25ff47df2953ec789110bc2273fa02fe632b76c36066da880ad9a
4
- data.tar.gz: 05544de42de06ad978ea9dfe330b330a090eff0ae8661bdfa8509251cf57d9ce
3
+ metadata.gz: eb507312dca29a9446f8bce75d8b150c709e453efc0d09757f2637cb0b486771
4
+ data.tar.gz: 3138b8a6a57d9330e97767161003f9861409b1e30deaa140828456684a25d096
5
5
  SHA512:
6
- metadata.gz: e3ba0e41808617dddbfc03d2f8807fa8039ad1ad40ac6a8b815082986ac8ef39aae795e1867faa685625c5a048f36a44beb4e29092528f7cb28aa087bd3a8034
7
- data.tar.gz: b7f7b42ea91a2a9ece4e660485dac8aa65c4dfa635241f9e685b3ff855d21f68c091260814a9c7a14f3ecd9c6fe92f03824f084c718e8cb27691569537e5c011
6
+ metadata.gz: 1afa452809625ca8739de597abd0b714e5dc27682f365bc24e3a67c0319288321e13875f2b9a623ece2798e377ff7852938208bf7144c2f43726c731cc9b08bb
7
+ data.tar.gz: 4204ba1c27317034ff4ab051831bd36e3ab174dce731113242ca4fe2e405b2aedcf083e0dccd702302e09da4fc1277d5319c8195073ee5635c019b145638a842
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 1.18.5
2
+
3
+ * Fix type mismatch in WAF time budget handling
4
+ * Improve exception handling for non-WAF errors within WAF
5
+
1
6
  ## 1.18.4
2
7
 
3
8
  * Fix instrumentation conflict when a class defines a send method
@@ -13,7 +13,7 @@ require 'sqreen/dependency/libsqreen'
13
13
  module Sqreen
14
14
  module Rules
15
15
  class WAFCB < RuleCB
16
- BUDGET_MAX = 5000
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('budget', BUDGET_MAX)
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
- budget = [self.budget, budget].compact.min
74
- action, data = ::LibSqreen::WAF.run(waf_rule_name, waf_args, budget)
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, waf_args, budget)
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
 
@@ -2,5 +2,5 @@
2
2
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
3
3
 
4
4
  module Sqreen
5
- VERSION = '1.18.4'.freeze
5
+ VERSION = '1.18.5'.freeze
6
6
  end
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
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-10 00:00:00.000000000 Z
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