aiwaf 0.1.8.2__py3-none-any.whl → 0.1.8.3__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/trainer.py CHANGED
@@ -167,7 +167,10 @@ def train() -> None:
167
167
  df = pd.DataFrame(feature_dicts)
168
168
  feature_cols = [c for c in df.columns if c != "ip"]
169
169
  X = df[feature_cols].astype(float).values
170
- model = IsolationForest(contamination=0.01, random_state=42)
170
+ model = IsolationForest(
171
+ contamination=getattr(settings, "AIWAF_AI_CONTAMINATION", 0.05),
172
+ random_state=42
173
+ )
171
174
  model.fit(X)
172
175
 
173
176
  os.makedirs(os.path.dirname(MODEL_PATH), exist_ok=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiwaf
3
- Version: 0.1.8.2
3
+ Version: 0.1.8.3
4
4
  Summary: AI-powered Web Application Firewall
5
5
  Home-page: https://github.com/aayushgauba/aiwaf
6
6
  Author: Aayush Gauba
@@ -164,6 +164,7 @@ AIWAF_ACCESS_LOG = "/var/log/nginx/access.log"
164
164
  ```python
165
165
  AIWAF_MODEL_PATH = BASE_DIR / "aiwaf" / "resources" / "model.pkl"
166
166
  AIWAF_MIN_FORM_TIME = 1.0 # minimum seconds between GET and POST
167
+ AIWAF_AI_CONTAMINATION = 0.05 # AI anomaly detection sensitivity (5%)
167
168
  AIWAF_RATE_WINDOW = 10 # seconds
168
169
  AIWAF_RATE_MAX = 20 # max requests per window
169
170
  AIWAF_RATE_FLOOD = 10 # flood threshold
@@ -4,7 +4,7 @@ aiwaf/blacklist_manager.py,sha256=sM6uTH7zD6MOPGb0kzqV2aFut2vxKgft_UVeRJr7klw,39
4
4
  aiwaf/middleware.py,sha256=0tmOTErZBy524O6gtKKo4liWYiovAVMgxEk91L-ngZk,9246
5
5
  aiwaf/models.py,sha256=XaG1pd_oZu3y-fw66u4wblGlWcUY9gvsTNKGD0kQk7Y,1672
6
6
  aiwaf/storage.py,sha256=bxCILzzvA1-q6nwclRE8WrfoRhe25H4VrsQDf0hl_lY,1903
7
- aiwaf/trainer.py,sha256=Xs_AuA7RCa1oyo5-lJYlnRYUiaq-HY2KXAviAdiGnzU,6217
7
+ aiwaf/trainer.py,sha256=TTFpFzzBCI3RYDbLzBYN5QknRsYkKfNNzwOW5YP8s5w,6285
8
8
  aiwaf/utils.py,sha256=RkEUWhhHy6tOk7V0UYv3cN4xhOR_7aBy9bjhwuV2cdA,1436
9
9
  aiwaf/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  aiwaf/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -14,8 +14,8 @@ aiwaf/management/commands/detect_and_train.py,sha256=-o-LZ7QZ5GeJPCekryox1DGXKMm
14
14
  aiwaf/resources/model.pkl,sha256=5t6h9BX8yoh2xct85MXOO60jdlWyg1APskUOW0jZE1Y,1288265
15
15
  aiwaf/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  aiwaf/templatetags/aiwaf_tags.py,sha256=XXfb7Tl4DjU3Sc40GbqdaqOEtKTUKELBEk58u83wBNw,357
17
- aiwaf-0.1.8.2.dist-info/licenses/LICENSE,sha256=Ir8PX4dxgAcdB0wqNPIkw84fzIIRKE75NoUil9RX0QU,1069
18
- aiwaf-0.1.8.2.dist-info/METADATA,sha256=Q93RjqYRrVZ9PwQCHVF2LNgM5bvY1TZxnIgnbPV29-c,7178
19
- aiwaf-0.1.8.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
- aiwaf-0.1.8.2.dist-info/top_level.txt,sha256=kU6EyjobT6UPCxuWpI_BvcHDG0I2tMgKaPlWzVxe2xI,6
21
- aiwaf-0.1.8.2.dist-info/RECORD,,
17
+ aiwaf-0.1.8.3.dist-info/licenses/LICENSE,sha256=Ir8PX4dxgAcdB0wqNPIkw84fzIIRKE75NoUil9RX0QU,1069
18
+ aiwaf-0.1.8.3.dist-info/METADATA,sha256=pVPIKsB4D0MFaDKpxpox5SbbizHIJfxbez7srt3d8Xk,7256
19
+ aiwaf-0.1.8.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
+ aiwaf-0.1.8.3.dist-info/top_level.txt,sha256=kU6EyjobT6UPCxuWpI_BvcHDG0I2tMgKaPlWzVxe2xI,6
21
+ aiwaf-0.1.8.3.dist-info/RECORD,,