wafris 0.5.2 → 0.5.3
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 +10 -7
- 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: e59525f95ab8d7eb6699b54e29cf5898ccd705a801f2114d19c120ec7764655e
|
4
|
+
data.tar.gz: 6c9690caf94f9c521b4bffcaecae3fa15042fc3873f2460f25e02ad68b43f1c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31a0bd63d3dcdda330336cd07367ae29c58a864beeecefe6d893eb18dad9335d84c17c3f1391d509c376f4374d7491cdb9d7616edf4b2b10dee8b34c443ee037
|
7
|
+
data.tar.gz: 61e9d0164f1082ff2d3da4181c6ccf912b1223499f96cc6011ffce4d12c7328d4f275b81e64fa5967d0dc85a9a4b926fcb609a3ea089006f3d830ac5e308f470
|
@@ -96,18 +96,21 @@ increment_timebucket_for("user_agent:", current_timebucket, user_agent)
|
|
96
96
|
increment_timebucket_for("request_path:", current_timebucket, request_path)
|
97
97
|
increment_timebucket_for("host:", current_timebucket, host)
|
98
98
|
|
99
|
+
local foobar = redis.call("ZRANGEBYSCORE", "blocked_ranges", client_ip_to_decimal, client_ip_to_decimal, "LIMIT", 0, 1)
|
100
|
+
|
101
|
+
redis.breakpoint()
|
102
|
+
|
99
103
|
-- BLOCKING LOGIC
|
100
|
-
-- Safelist Range Check
|
101
104
|
-- TODO: ZRANGEBYSCORE is deprecated in Redis 6.2+. Replace with ZRANGE
|
102
|
-
if
|
103
|
-
return
|
104
|
-
--
|
105
|
-
|
106
|
-
|
105
|
+
if
|
106
|
+
-- ZRANGEBYSCORE will always return a lua table, even if empty
|
107
|
+
-- TODO: When we introduce ranges we'll have to do an exact check followed by a range starting with decimal ip to infinity.
|
108
|
+
-- If the first result returned is "END" that means it falls in the range
|
109
|
+
next(redis.call("ZRANGEBYSCORE", "blocked_ranges", client_ip_to_decimal, client_ip_to_decimal, "LIMIT", 0, 1)) ~= nil
|
107
110
|
then
|
108
111
|
increment_timebucket_for("wafris:blocked:", current_timebucket, client_ip)
|
109
112
|
return "Blocked"
|
110
113
|
-- No Matches
|
111
114
|
else
|
112
|
-
return "
|
115
|
+
return "Allowed"
|
113
116
|
end
|
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: 0.5.
|
4
|
+
version: 0.5.3
|
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: 2023-05-
|
12
|
+
date: 2023-05-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: connection_pool
|