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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 259b4944d7b5a3db3fc1b29575c871fae0519662db44c54b3558db9910f26d4a
4
- data.tar.gz: 9a6ba2a54a94551c8aee3f0e14ba03cdf969048b250825126b0af88e867ced5b
3
+ metadata.gz: e2fcb2f6f87a3f5fe3f89091437cad264aa10b8a8e0440ab6568e172674fc9a7
4
+ data.tar.gz: 1713ee535af2200d1c8b9b0512456c2a96544942e552fbe487a77690d66ac262
5
5
  SHA512:
6
- metadata.gz: 9915b54980a670e2c0888f290c9946a67abdbe884241aaeb087b0898710a0f36bb2c3be7ac9569e0c57881e29b07794dcc026cbf6bbf10965be26da14b3a04ba
7
- data.tar.gz: 6c86c916bead230540c6bb2921c7427a1e07a89f09cc8365a02131514386b351b2fce30a6d8886ab984ca1528140f1fe0d40fa2b838ed86ab7d0060ae63aee0b
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 } },
@@ -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."
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Wafris
4
- VERSION = "1.1.9"
4
+ VERSION = "1.1.11"
5
5
  end
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.9
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: 2023-12-17 00:00:00.000000000 Z
12
+ date: 2024-05-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: connection_pool