wafris 0.3.4 → 0.4.0
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 +6 -6
- 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: e843055b9966018647b5c475eeeaedbb70a433fd9fa2328503c873833142dbdb
|
4
|
+
data.tar.gz: 12b6bf55a65413151ddd224c8ce39465c2801fdcc15842cbf8730bc20ebe486f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b499bd7a1421dad5c91e421d804f2ac7af96f329649ad1ba2e0d383790e7bc2e01fbb29e369486e5adb37a96c4c7f998513dbeefcce0b2edc6692555945ff20
|
7
|
+
data.tar.gz: 89f5161f97c7eb3e14bce624d5c9cc76cc00e91e710f64ae466bfe91e28d47ec147a85ff29dc9b4a2a7d539664b86a7a14d079e2f659f39b49d89f5e321d2a6b
|
@@ -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]
|
@@ -89,20 +89,20 @@ add_to_HLL_request_count(current_timebucket, request_id)
|
|
89
89
|
-- LEADERBOARD DATA COLLECTION
|
90
90
|
-- TODO: breaking change will to switch to client_ip: prefix
|
91
91
|
increment_timebucket_for(nil, current_timebucket, client_ip)
|
92
|
-
if proxy_ip ~= nil then
|
93
|
-
increment_timebucket_for(
|
92
|
+
if proxy_ip ~= nil and proxy_ip ~= "" then
|
93
|
+
increment_timebucket_for("proxy_ip:", current_timebucket, proxy_ip)
|
94
94
|
end
|
95
|
-
increment_timebucket_for("proxy_ip:", current_timebucket, proxy_ip)
|
96
95
|
increment_timebucket_for("user_agent:", current_timebucket, user_agent)
|
97
96
|
increment_timebucket_for("request_path:", current_timebucket, request_path)
|
98
97
|
increment_timebucket_for("host:", current_timebucket, host)
|
99
98
|
|
100
99
|
-- BLOCKING LOGIC
|
101
100
|
-- Safelist Range Check
|
102
|
-
if next(redis.call("ZRANGEBYSCORE", "allowed_ranges",
|
101
|
+
if next(redis.call("ZRANGEBYSCORE", "allowed_ranges", client_ip_to_decimal, "+inf", "LIMIT", 0, 1)) then
|
103
102
|
return "Allowed"
|
104
103
|
-- Blocklist Range Check
|
105
|
-
elseif next(redis.call("ZRANGEBYSCORE", "blocked_ranges",
|
104
|
+
elseif next(redis.call("ZRANGEBYSCORE", "blocked_ranges", client_ip_to_decimal, "+inf", "LIMIT", 0, 1)) then
|
105
|
+
increment_timebucket_for("wafris:blocked:", current_timebucket, client_ip)
|
106
106
|
return "Blocked"
|
107
107
|
-- No Matches
|
108
108
|
else
|
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.4.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
|