wafris 1.1.9 → 1.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lua/dist/wafris_core.lua +5 -4
- data/lib/wafris/middleware.rb +9 -0
- data/lib/wafris/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: e2fcb2f6f87a3f5fe3f89091437cad264aa10b8a8e0440ab6568e172674fc9a7
|
4
|
+
data.tar.gz: 1713ee535af2200d1c8b9b0512456c2a96544942e552fbe487a77690d66ac262
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0312e05a8cf9687dd222263a75a3fcec4590bdd325b3d3f01d80ed211c6810b99bcaa9cfd1b682767f6cba9ba7f97240f7faf6d78d549a7cc03df4d9c40fad68
|
7
|
+
data.tar.gz: 5e897f2ea32786c2b82e39f2f5b9385bd862b255294f92e59f405a8327d16e96efeb6d38194ba0490b8b9020e22931dae06c7d28112e7bd71efc456b4841ccc8
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
|
3
3
|
local USE_TIMESTAMPS_AS_REQUEST_IDS = false
|
4
|
-
local EXPIRATION_IN_SECONDS = 86400
|
4
|
+
local EXPIRATION_IN_SECONDS = tonumber(redis.call("HGET", "waf-settings", "expiration-time")) or 86400
|
5
5
|
local EXPIRATION_OFFSET_IN_SECONDS = 3600
|
6
6
|
|
7
7
|
|
@@ -19,11 +19,11 @@ local function set_property_value_id_lookups(property_abbreviation, property_val
|
|
19
19
|
property_id = redis.call("INCR", property_abbreviation .. "-id-counter")
|
20
20
|
redis.call("SET", value_key, property_id)
|
21
21
|
redis.call("SET", property_abbreviation .. "I" .. property_id, property_value)
|
22
|
-
else
|
23
|
-
redis.call("EXPIRE", value_key, EXPIRATION_IN_SECONDS + EXPIRATION_OFFSET_IN_SECONDS)
|
24
|
-
redis.call("EXPIRE", property_abbreviation .. "I" .. property_id, EXPIRATION_IN_SECONDS + EXPIRATION_OFFSET_IN_SECONDS)
|
25
22
|
end
|
26
23
|
|
24
|
+
redis.call("EXPIRE", value_key, EXPIRATION_IN_SECONDS + EXPIRATION_OFFSET_IN_SECONDS)
|
25
|
+
redis.call("EXPIRE", property_abbreviation .. "I" .. property_id, EXPIRATION_IN_SECONDS + EXPIRATION_OFFSET_IN_SECONDS)
|
26
|
+
|
27
27
|
return property_id
|
28
28
|
end
|
29
29
|
|
@@ -153,6 +153,7 @@ local function check_blocks(request)
|
|
153
153
|
local rule_categories = {
|
154
154
|
{ category = "bi", func = ip_in_hash, args = { "rules-blocked-i", request.ip } },
|
155
155
|
{ category = "bc", func = ip_in_cidr_range, args = { "rules-blocked-cidrs-set", request.ip_decimal_lexical } },
|
156
|
+
{ category = "bs", func = ip_in_cidr_range, args = { "rules-blocked-cidrs-subscriptions-set", request.ip_decimal_lexical } },
|
156
157
|
{ category = "bu", func = match_by_pattern, args = { "u", request.user_agent } },
|
157
158
|
{ category = "bp", func = match_by_pattern, args = { "p", request.path } },
|
158
159
|
{ category = "ba", func = match_by_pattern, args = { "a", request.parameters } },
|
data/lib/wafris/middleware.rb
CHANGED
@@ -39,6 +39,15 @@ module Wafris
|
|
39
39
|
"[Wafris] Wafris timed out during processing. Request passed without rules check."
|
40
40
|
)
|
41
41
|
@app.call(env)
|
42
|
+
rescue NoMethodError => e
|
43
|
+
if e.message.include?("undefined method `connection_pool'")
|
44
|
+
LogSuppressor.puts_log(
|
45
|
+
"[Wafris] Wafris is not configured. Please check your configuration settings. Request passed without rules check. More info can be found at: https://github.com/Wafris/wafris-rb"
|
46
|
+
)
|
47
|
+
else
|
48
|
+
raise e
|
49
|
+
end
|
50
|
+
@app.call(env)
|
42
51
|
rescue StandardError => e
|
43
52
|
LogSuppressor.puts_log(
|
44
53
|
"[Wafris] Redis connection error: #{e.message}. Request passed without rules check."
|
data/lib/wafris/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wafris
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micahel Buckbee
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-05-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: connection_pool
|