wafris 0.3.5 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/lua/dist/wafris_core.lua +5 -3
- data/lib/wafris/configuration.rb +4 -1
- 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: a6403b9b2f805fb237789d238e0eaffd0fef7b488f8a105ee402eda335a30de0
|
4
|
+
data.tar.gz: 76aec9129b297c975ce26f0c9992d5296ff9ff643543154e58192b7a3df49bed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc5eddfd5163e22f711fec29cd3be30b32be39846a1536fdafab77b7c85ba48be7f9af026cf91a6d0d233beabd3e965541dd681b19e818fa3272b583693302c5
|
7
|
+
data.tar.gz: 95e21d8938ec9cd481fafd0bda406f31e5305b5dce24cef3e681a8436cce5535fa8b51f51c339cf2b1a15ebde2fa4fade9968caaf33afbc72a2ef70f2b6b4dd5
|
@@ -71,7 +71,7 @@ local max_requests = 100000
|
|
71
71
|
local max_requests_per_ip = 10000
|
72
72
|
|
73
73
|
local client_ip = ARGV[1]
|
74
|
-
local
|
74
|
+
local client_ip_to_decimal = ARGV[2]
|
75
75
|
local unix_time_milliseconds = ARGV[3]
|
76
76
|
local unix_time = ARGV[3] / 1000
|
77
77
|
local proxy_ip = ARGV[4]
|
@@ -98,10 +98,12 @@ increment_timebucket_for("host:", current_timebucket, host)
|
|
98
98
|
|
99
99
|
-- BLOCKING LOGIC
|
100
100
|
-- Safelist Range Check
|
101
|
-
|
101
|
+
-- TODO: ZRANGEBYSCORE is deprecated in Redis 6.2+. Replace with ZRANGE
|
102
|
+
if next(redis.call("ZRANGEBYSCORE", "allowed_ranges", client_ip_to_decimal, "+inf", "LIMIT", 0, 1)) then
|
102
103
|
return "Allowed"
|
103
104
|
-- Blocklist Range Check
|
104
|
-
elseif next(redis.call("ZRANGEBYSCORE", "blocked_ranges",
|
105
|
+
elseif next(redis.call("ZRANGEBYSCORE", "blocked_ranges", client_ip_to_decimal, "+inf", "LIMIT", 0, 1)) then
|
106
|
+
increment_timebucket_for("wafris:blocked:", current_timebucket, client_ip)
|
105
107
|
return "Blocked"
|
106
108
|
-- No Matches
|
107
109
|
else
|
data/lib/wafris/configuration.rb
CHANGED
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.
|
4
|
+
version: 0.5.0
|
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-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: connection_pool
|