aiwaf 0.1.9.2.5__py3-none-any.whl → 0.1.9.2.6__py3-none-any.whl

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.

Potentially problematic release.


This version of aiwaf might be problematic. Click here for more details.

aiwaf/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  default_app_config = "aiwaf.apps.AiwafConfig"
2
2
 
3
- __version__ = "0.1.9.2.5"
3
+ __version__ = "0.1.9.2.6"
4
4
 
5
5
  # Note: Middleware classes are available from aiwaf.middleware
6
6
  # Import them only when needed to avoid circular imports during Django app loading
aiwaf/middleware.py CHANGED
@@ -587,13 +587,9 @@ class AIAnomalyMiddleware(MiddlewareMixin):
587
587
  data = [d for d in data if now - d[0] < self.WINDOW]
588
588
  cache.set(key, data, timeout=self.WINDOW)
589
589
 
590
- data.append((now, request.path, response.status_code, resp_time))
591
- data = [d for d in data if now - d[0] < self.WINDOW]
592
- cache.set(key, data, timeout=self.WINDOW)
593
-
594
- # Only learn keywords from error responses and non-existent paths
595
- # This prevents learning legitimate keywords from successful requests
596
- if (response.status_code >= 400 and not known_path and not is_exempt_path(request.path)):
590
+ # Only learn keywords from 404 responses (not found) on non-existent paths
591
+ # This prevents learning from 403 (blocked IPs accessing legitimate paths) or other error codes
592
+ if (response.status_code == 404 and not known_path and not is_exempt_path(request.path)):
597
593
  keyword_store = get_keyword_store()
598
594
  # Get legitimate keywords to avoid learning them
599
595
  from .trainer import get_legitimate_keywords
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiwaf
3
- Version: 0.1.9.2.5
3
+ Version: 0.1.9.2.6
4
4
  Summary: AI-powered Web Application Firewall
5
5
  Home-page: https://github.com/aayushgauba/aiwaf
6
6
  Author: Aayush Gauba
@@ -1,8 +1,8 @@
1
- aiwaf/__init__.py,sha256=0cr5WYpPFupra8Xms3_swtRbJDdZ3pYEjAnRaRSguIA,220
1
+ aiwaf/__init__.py,sha256=vgc-dT-AtR3_k84Wpmujg4ZRwl6EuU7IR2_KW2B0tBU,220
2
2
  aiwaf/apps.py,sha256=nCez-Ptlv2kaEk5HenA8b1pATz1VfhrHP1344gwcY1A,142
3
3
  aiwaf/blacklist_manager.py,sha256=LYCeKFB-7e_C6Bg2WeFJWFIIQlrfRMPuGp30ivrnhQY,1196
4
4
  aiwaf/decorators.py,sha256=IUKOdM_gdroffImRZep1g1wT6gNqD10zGwcp28hsJCs,825
5
- aiwaf/middleware.py,sha256=KW982p1eZ3hJYiR0lidomImkB5_J9uhfgCLzsMt53MI,32048
5
+ aiwaf/middleware.py,sha256=cpxOI6W45A6qRa9Ulk1StqCTSJjCoBx387FegZB0iMA,31889
6
6
  aiwaf/middleware_logger.py,sha256=LWZVDAnjh6CGESirA8eMbhGgJKB7lVDGRQqVroH95Lo,4742
7
7
  aiwaf/models.py,sha256=vQxgY19BDVMjoO903UNrTZC1pNoLltMU6wbyWPoAEns,2719
8
8
  aiwaf/storage.py,sha256=5ImrZMRn3u7HNsPH0fDjWhDrD2tgG2IHVnOXtLz0fk4,10253
@@ -29,8 +29,8 @@ aiwaf/management/commands/test_exemption_fix.py,sha256=ngyGaHUCmQQ6y--6j4q1viZJt
29
29
  aiwaf/resources/model.pkl,sha256=5t6h9BX8yoh2xct85MXOO60jdlWyg1APskUOW0jZE1Y,1288265
30
30
  aiwaf/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  aiwaf/templatetags/aiwaf_tags.py,sha256=XXfb7Tl4DjU3Sc40GbqdaqOEtKTUKELBEk58u83wBNw,357
32
- aiwaf-0.1.9.2.5.dist-info/licenses/LICENSE,sha256=Ir8PX4dxgAcdB0wqNPIkw84fzIIRKE75NoUil9RX0QU,1069
33
- aiwaf-0.1.9.2.5.dist-info/METADATA,sha256=YCEXlU9C4qclQ4VB_Tz5Wbn1eGk3DzREmyl83JaZuik,26824
34
- aiwaf-0.1.9.2.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
- aiwaf-0.1.9.2.5.dist-info/top_level.txt,sha256=kU6EyjobT6UPCxuWpI_BvcHDG0I2tMgKaPlWzVxe2xI,6
36
- aiwaf-0.1.9.2.5.dist-info/RECORD,,
32
+ aiwaf-0.1.9.2.6.dist-info/licenses/LICENSE,sha256=Ir8PX4dxgAcdB0wqNPIkw84fzIIRKE75NoUil9RX0QU,1069
33
+ aiwaf-0.1.9.2.6.dist-info/METADATA,sha256=iaCG43PeSHGu16Jawzelh5Qi0PoGysvi_BYfWFIcvbA,26824
34
+ aiwaf-0.1.9.2.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
+ aiwaf-0.1.9.2.6.dist-info/top_level.txt,sha256=kU6EyjobT6UPCxuWpI_BvcHDG0I2tMgKaPlWzVxe2xI,6
36
+ aiwaf-0.1.9.2.6.dist-info/RECORD,,