aiwaf 0.1.8.1__tar.gz → 0.1.8.3__tar.gz

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.

Files changed (28) hide show
  1. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/PKG-INFO +2 -1
  2. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/README.md +1 -0
  3. aiwaf-0.1.8.3/aiwaf/templatetags/aiwaf_tags.py +13 -0
  4. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf/trainer.py +4 -1
  5. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf.egg-info/PKG-INFO +2 -1
  6. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/pyproject.toml +1 -1
  7. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/setup.py +1 -1
  8. aiwaf-0.1.8.1/aiwaf/templatetags/aiwaf_tags.py +0 -14
  9. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/LICENSE +0 -0
  10. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf/__init__.py +0 -0
  11. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf/apps.py +0 -0
  12. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf/blacklist_manager.py +0 -0
  13. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf/management/__init__.py +0 -0
  14. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf/management/commands/__init__.py +0 -0
  15. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf/management/commands/add_ipexemption.py +0 -0
  16. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf/management/commands/aiwaf_reset.py +0 -0
  17. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf/management/commands/detect_and_train.py +0 -0
  18. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf/middleware.py +0 -0
  19. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf/models.py +0 -0
  20. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf/resources/model.pkl +0 -0
  21. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf/storage.py +0 -0
  22. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf/templatetags/__init__.py +0 -0
  23. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf/utils.py +0 -0
  24. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf.egg-info/SOURCES.txt +0 -0
  25. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf.egg-info/dependency_links.txt +0 -0
  26. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf.egg-info/requires.txt +0 -0
  27. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/aiwaf.egg-info/top_level.txt +0 -0
  28. {aiwaf-0.1.8.1 → aiwaf-0.1.8.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiwaf
3
- Version: 0.1.8.1
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
@@ -143,6 +143,7 @@ AIWAF_ACCESS_LOG = "/var/log/nginx/access.log"
143
143
  ```python
144
144
  AIWAF_MODEL_PATH = BASE_DIR / "aiwaf" / "resources" / "model.pkl"
145
145
  AIWAF_MIN_FORM_TIME = 1.0 # minimum seconds between GET and POST
146
+ AIWAF_AI_CONTAMINATION = 0.05 # AI anomaly detection sensitivity (5%)
146
147
  AIWAF_RATE_WINDOW = 10 # seconds
147
148
  AIWAF_RATE_MAX = 20 # max requests per window
148
149
  AIWAF_RATE_FLOOD = 10 # flood threshold
@@ -0,0 +1,13 @@
1
+ from django import template
2
+ from django.utils.html import format_html
3
+ from django.conf import settings
4
+
5
+ register = template.Library()
6
+
7
+ @register.simple_tag
8
+ def honeypot_field(field_name=None):
9
+ """
10
+ Legacy honeypot field - no longer needed with timing-based honeypot.
11
+ Returns empty string to maintain backward compatibility.
12
+ """
13
+ return ""
@@ -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.1
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "aiwaf"
3
- version = "0.1.8.1"
3
+ version = "0.1.8.3"
4
4
  description = "AI-powered Web Application Firewall"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.8"
@@ -9,7 +9,7 @@ long_description = (HERE / "README.md").read_text(encoding="utf-8")
9
9
 
10
10
  setup(
11
11
  name="aiwaf",
12
- version="0.1.8.1",
12
+ version="0.1.8.3",
13
13
  description="AI‑driven, self‑learning Web Application Firewall for Django",
14
14
  long_description=long_description,
15
15
  long_description_content_type="text/markdown",
@@ -1,14 +0,0 @@
1
- from django import template
2
- from django.utils.html import format_html
3
- from django.conf import settings
4
-
5
- register = template.Library()
6
-
7
- @register.simple_tag
8
- def honeypot_field(field_name=None):
9
-
10
- name = field_name or getattr(settings, "AIWAF_HONEYPOT_FIELD", "hp_field")
11
- return format_html(
12
- '<input type="text" name="{}" hidden autocomplete="off" tabindex="-1" />',
13
- name
14
- )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes