Rust-powered WAF heuristics exposed to Python via PyO3
Project description
aiwaf-rust
Fast WAF heuristics and anomaly scoring implemented in Rust and exposed to Python. Designed for lightweight request validation and isolation-forest style scoring.
Install
pip install aiwaf-rust
Quickstart
from aiwaf_rust import (
validate_headers,
validate_url,
validate_content,
validate_recent,
AiwafIsolationForest,
)
headers = {
"user-agent": "Mozilla/5.0",
"accept": "text/html,application/xhtml+xml",
"accept-language": "en-US,en;q=0.9",
"accept-encoding": "gzip, deflate",
"connection": "keep-alive",
}
print(validate_headers(headers))
print(validate_url("https://example.com/login"))
print(validate_content("username=admin&password=..."))
print(validate_recent([{ "path": "/", "status": 200 }]))
model = AiwafIsolationForest(100, 256, 0.5, 42)
model.fit([[0.1, 0.2, 0.3], [0.2, 0.1, 0.4]])
print(model.anomaly_score([0.3, 0.2, 0.1]))
Notes
- Built with PyO3 and
abi3so a single wheel works on Python 3.8+. - The WASM package is published as
aiwaf-wasmon npm.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiwaf_rust-0.1.4-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: aiwaf_rust-0.1.4-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 702.6 kB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
969cf7c9972b58cfac2f255a666b6219ed5e14dd29e9b3597cf838779fb7bd68
|
|
| MD5 |
a1e54afde8fceac65b5d08e954a74963
|
|
| BLAKE2b-256 |
cdf465788148de188e67cdb2fe9283f305f2cd2a4a4cd4b7350fd38a68e3ce16
|
Provenance
The following attestation bundles were made for aiwaf_rust-0.1.4-cp38-abi3-win_amd64.whl:
Publisher:
publish.yml on aiwaf-project/aiwaf-rust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiwaf_rust-0.1.4-cp38-abi3-win_amd64.whl -
Subject digest:
969cf7c9972b58cfac2f255a666b6219ed5e14dd29e9b3597cf838779fb7bd68 - Sigstore transparency entry: 1280483712
- Sigstore integration time:
-
Permalink:
aiwaf-project/aiwaf-rust@132421a936dbb866f3d65426c33994c23568fb92 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aiwaf-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@132421a936dbb866f3d65426c33994c23568fb92 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file aiwaf_rust-0.1.4-cp38-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: aiwaf_rust-0.1.4-cp38-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.8+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
377fb3471e0cedd3624784aa3436fc7eadce87b5042bafb3b837dbf6d50c5873
|
|
| MD5 |
54f2bf90ab431f1201e6af8b983ac6a3
|
|
| BLAKE2b-256 |
1d33b03187208c61f34ba2a890ba003ef26476b97200f51fabe721ae91eb18e1
|
Provenance
The following attestation bundles were made for aiwaf_rust-0.1.4-cp38-abi3-manylinux_2_34_x86_64.whl:
Publisher:
publish.yml on aiwaf-project/aiwaf-rust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiwaf_rust-0.1.4-cp38-abi3-manylinux_2_34_x86_64.whl -
Subject digest:
377fb3471e0cedd3624784aa3436fc7eadce87b5042bafb3b837dbf6d50c5873 - Sigstore transparency entry: 1280483711
- Sigstore integration time:
-
Permalink:
aiwaf-project/aiwaf-rust@132421a936dbb866f3d65426c33994c23568fb92 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aiwaf-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@132421a936dbb866f3d65426c33994c23568fb92 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file aiwaf_rust-0.1.4-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: aiwaf_rust-0.1.4-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 868.7 kB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6fac5f41f84224bf9092b9045a4bb4b2cda4f0393f323c2ec096c4fcf8a610a
|
|
| MD5 |
a2b2cd479cac8c5179f9b70aa11be043
|
|
| BLAKE2b-256 |
e0c842c7d5ba9f117379aba5724de0d8999c55624d2a38ab4cb4a0deef12a6b6
|
Provenance
The following attestation bundles were made for aiwaf_rust-0.1.4-cp38-abi3-macosx_11_0_arm64.whl:
Publisher:
publish.yml on aiwaf-project/aiwaf-rust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aiwaf_rust-0.1.4-cp38-abi3-macosx_11_0_arm64.whl -
Subject digest:
d6fac5f41f84224bf9092b9045a4bb4b2cda4f0393f323c2ec096c4fcf8a610a - Sigstore transparency entry: 1280483709
- Sigstore integration time:
-
Permalink:
aiwaf-project/aiwaf-rust@132421a936dbb866f3d65426c33994c23568fb92 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aiwaf-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@132421a936dbb866f3d65426c33994c23568fb92 -
Trigger Event:
workflow_dispatch
-
Statement type: