wafris 1.1.6 → 1.1.7
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/wafris/configuration.rb +3 -1
- data/lib/wafris/middleware.rb +8 -1
- data/lib/wafris/version.rb +1 -1
- data/lib/wafris.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: 5214c54be014012a7e6c155f70530c5771834ae6fb471f50a55982bc8f7d2217
|
4
|
+
data.tar.gz: 5fd19e2a7431f05ea5cd1c0142643ab9bf5afee0c8c944d19cab2849158483e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b19c182029512007f2428b6cf0662cb4772306aff63f8fb9bf13f7b7210d651cad796895095dca60f6ac4cdfa22bdf0b444f2389c867a35f712d4c02417b6e2
|
7
|
+
data.tar.gz: 91f7afb62403e7ef3edc8260a5e50110af9da3ccdcdf0903cce39d5b22138649fda0a6d464665e1615e148cbd726906e269c942a5670516e1e61ed74e1bcabe0
|
data/lib/wafris/configuration.rb
CHANGED
@@ -7,10 +7,12 @@ module Wafris
|
|
7
7
|
attr_accessor :redis
|
8
8
|
attr_accessor :redis_pool_size
|
9
9
|
attr_accessor :maxmemory
|
10
|
+
attr_accessor :quiet_mode
|
10
11
|
|
11
12
|
def initialize
|
12
13
|
@redis_pool_size = 20
|
13
14
|
@maxmemory = 25
|
15
|
+
@quiet_mode = false
|
14
16
|
end
|
15
17
|
|
16
18
|
def connection_pool
|
@@ -25,7 +27,7 @@ module Wafris
|
|
25
27
|
'maxmemory', @maxmemory)
|
26
28
|
LogSuppressor.puts_log(
|
27
29
|
"[Wafris] firewall enabled. Connected to Redis on #{redis.connection[:host]}. Ready to process requests. Set rules at: https://wafris.org/hub"
|
28
|
-
)
|
30
|
+
) unless @quiet_mode
|
29
31
|
end
|
30
32
|
|
31
33
|
def core_sha
|
data/lib/wafris/middleware.rb
CHANGED
@@ -29,9 +29,16 @@ module Wafris
|
|
29
29
|
if Wafris.allow_request?(request)
|
30
30
|
@app.call(env)
|
31
31
|
else
|
32
|
-
|
32
|
+
LogSuppressor.puts_log(
|
33
|
+
"[Wafris] Blocked: #{request.ip} #{request.request_method} #{request.host} #{request.url}}"
|
34
|
+
)
|
33
35
|
[403, {}, ['Blocked']]
|
34
36
|
end
|
37
|
+
rescue Redis::TimeoutError
|
38
|
+
LogSuppressor.puts_log(
|
39
|
+
"[Wafris] Wafris timed out during processing. Request passed without rules check."
|
40
|
+
)
|
41
|
+
@app.call(env)
|
35
42
|
rescue StandardError => e
|
36
43
|
LogSuppressor.puts_log(
|
37
44
|
"[Wafris] Redis connection error: #{e.message}. Request passed without rules check."
|
data/lib/wafris/version.rb
CHANGED
data/lib/wafris.rb
CHANGED
@@ -21,7 +21,7 @@ module Wafris
|
|
21
21
|
yield(configuration)
|
22
22
|
LogSuppressor.puts_log(
|
23
23
|
"[Wafris] attempting firewall connection via Wafris.configure initializer."
|
24
|
-
)
|
24
|
+
) unless configuration.quiet_mode
|
25
25
|
configuration.create_settings
|
26
26
|
rescue Redis::CannotConnectError, ArgumentError
|
27
27
|
LogSuppressor.puts_log(
|
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.7
|
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
|
+
date: 2023-11-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: connection_pool
|