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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/sqreen/actions.rb +1 -1
- data/lib/sqreen/dependency/rails.rb +2 -0
- data/lib/sqreen/frameworks.rb +1 -1
- data/lib/sqreen/rules_callbacks/waf.rb +6 -5
- 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: 8a60b6d82dda8a468ead32c8bf1f450f633cd3093ef9bc5d4de7aecbd29625c1
|
4
|
+
data.tar.gz: 1bf856cf8bb9a3fc1e363cfbf119459d4656500db3641e367bd40d62fe6b3176
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2f3528dbe5a32798c94c77f60f249b4271502d4be504e2ddaa1137a4af4878c9a59bb9455b4693adfcdde1818dc3d5875fbb218ab12c07e4766df082f5f75ab
|
7
|
+
data.tar.gz: bd587c43bfed1c1a68c2acaeeab7c78927bb329ed569c5bd4e92af1a0a36c3eb1a002e01273a2505d7c5e30b7df66a0ae4f197ac9a8c472e7c3c1a1e8ac27788
|
data/CHANGELOG.md
CHANGED
data/lib/sqreen/actions.rb
CHANGED
@@ -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)
|
data/lib/sqreen/frameworks.rb
CHANGED
@@ -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
|
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.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-
|
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
|