sqreen 1.18.0 → 1.18.1

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: a588437667070c3e175082755b4f63a1bcc2a1c1f599142fc56ac2348d05a1bf
4
- data.tar.gz: 1dd5d9a28a0d4285c807587d1a0740342561950c85c4fc84e273ced99b90a6c7
3
+ metadata.gz: 8a60b6d82dda8a468ead32c8bf1f450f633cd3093ef9bc5d4de7aecbd29625c1
4
+ data.tar.gz: 1bf856cf8bb9a3fc1e363cfbf119459d4656500db3641e367bd40d62fe6b3176
5
5
  SHA512:
6
- metadata.gz: 4e2d876f635ceadf46df13484f50ec6dfd418ebece431916330d2319be79f6a0f38c27a73f2a4261809af30fc3d32e6024a68c415b372ad7214b245f2e2443f6
7
- data.tar.gz: 38a0ee125e1ded9a6bbddd440f30a3011b7c36051ac7393f5cd8294a128952fd9f7a93735b20496394e77a042a14c95199817fad6598625d5583030f8c50aace
6
+ metadata.gz: e2f3528dbe5a32798c94c77f60f249b4271502d4be504e2ddaa1137a4af4878c9a59bb9455b4693adfcdde1818dc3d5875fbb218ab12c07e4766df082f5f75ab
7
+ data.tar.gz: bd587c43bfed1c1a68c2acaeeab7c78927bb329ed569c5bd4e92af1a0a36c3eb1a002e01273a2505d7c5e30b7df66a0ae4f197ac9a8c472e7c3c1a1e8ac27788
@@ -1,3 +1,9 @@
1
+ ## 1.18.1
2
+
3
+ * Improve handling of scoped IPv6 addresses
4
+ * Remove spurious warning on Rails 6
5
+ * Add missing WAF constant check
6
+
1
7
  ## 1.18.0
2
8
 
3
9
  * Support In-App WAF
@@ -169,7 +169,7 @@ module Sqreen
169
169
  end
170
170
 
171
171
  def matching_actions(client_ip)
172
- parsed_ip = IPAddr.new(client_ip)
172
+ parsed_ip = IPAddr.new(client_ip.gsub(/%[^%\/]+/, ''))
173
173
  trie = parsed_ip.family == Socket::AF_INET6 ? @trie_v6 : @trie_v4
174
174
  return [] unless trie
175
175
  found = trie.search_matching(parsed_ip.to_i, parsed_ip.family)
@@ -15,6 +15,8 @@ module Sqreen
15
15
  end
16
16
 
17
17
  def inspect_middlewares
18
+ return unless ::Rails.application.middleware.respond_to?(:map)
19
+
18
20
  Sqreen.log.debug { "Middlewares: " << ::Rails.application.middleware.map(&:inspect).inspect }
19
21
  end
20
22
 
@@ -13,7 +13,7 @@ module Sqreen
13
13
  klass = case
14
14
  when defined?(::Rails) && defined?(::Rails::VERSION)
15
15
  case Rails::VERSION::MAJOR.to_i
16
- when 4, 5
16
+ when 4, 5, 6
17
17
  require 'sqreen/frameworks/rails'
18
18
  Sqreen::Frameworks::RailsFramework
19
19
  when 3
@@ -22,13 +22,17 @@ module Sqreen
22
22
  @libsqreen
23
23
  end
24
24
 
25
+ def self.waf?
26
+ Sqreen::Dependency.const_exist?('LibSqreen::WAF')
27
+ end
28
+
25
29
  attr_reader :binding_accessors, :budget, :waf_rule_name
26
30
 
27
31
  def initialize(*args)
28
32
  super(*args)
29
33
  @overtimeable = false
30
34
 
31
- unless WAFCB.libsqreen?
35
+ unless WAFCB.libsqreen? && WAFCB.waf?
32
36
  Sqreen.log.warn('libsqreen gem not found')
33
37
  return
34
38
  end
@@ -57,10 +61,7 @@ module Sqreen
57
61
  end
58
62
 
59
63
  def pre(instance, args, _budget)
60
- unless WAFCB.libsqreen?
61
- Sqreen.log.warn('libsqreen not required')
62
- return
63
- end
64
+ return unless WAFCB.libsqreen? && WAFCB.waf?
64
65
 
65
66
  request = framework.request
66
67
  return if !waf_rule_name || !request
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
2
  # Please refer to our terms for more information: https://www.sqreen.io/terms.html
3
3
  module Sqreen
4
- VERSION = '1.18.0'.freeze
4
+ VERSION = '1.18.1'.freeze
5
5
  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.0
4
+ version: 1.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sqreen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-15 00:00:00.000000000 Z
11
+ date: 2019-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sq_mini_racer