Skip to main content

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 abi3 so a single wheel works on Python 3.8+ (including 3.12+).
  • The WASM package is published as aiwaf-wasm on npm.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiwaf_rust-0.2.0.tar.gz (26.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

aiwaf_rust-0.2.0-cp38-abi3-win_amd64.whl (722.8 kB view details)

Uploaded CPython 3.8+Windows x86-64

aiwaf_rust-0.2.0-cp38-abi3-musllinux_1_2_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ x86-64

aiwaf_rust-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

aiwaf_rust-0.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

aiwaf_rust-0.2.0-cp38-abi3-macosx_11_0_arm64.whl (886.3 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

aiwaf_rust-0.2.0-cp38-abi3-macosx_10_12_x86_64.whl (933.6 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file aiwaf_rust-0.2.0.tar.gz.

File metadata

  • Download URL: aiwaf_rust-0.2.0.tar.gz
  • Upload date:
  • Size: 26.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aiwaf_rust-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0117fef5e927f331631e1ecc77a2dfc7de441560a5d5fccf520a87a09a978eba
MD5 74c94454f7fa1b6ea515b29f661d3149
BLAKE2b-256 0898db5493ccbf4144b5ba614b75c0b76989260a311e76def3fef9c04cecf575

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiwaf_rust-0.2.0.tar.gz:

Publisher: publish.yml on aiwaf-project/aiwaf-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiwaf_rust-0.2.0-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: aiwaf_rust-0.2.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 722.8 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

Hashes for aiwaf_rust-0.2.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c067f374b979722e379dc9ec87b7ed70cf406cb857fa8947f3a94d3bf6707e72
MD5 85b7d541392651a63343c347d0b709b8
BLAKE2b-256 cae0ff7c09ee6d237b94c94682a4f44d52e9ee77a4389c82eed24c88da4d5054

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiwaf_rust-0.2.0-cp38-abi3-win_amd64.whl:

Publisher: publish.yml on aiwaf-project/aiwaf-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiwaf_rust-0.2.0-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for aiwaf_rust-0.2.0-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5a10c7c2943a6d5292866f75eede49fd2b877e9055308aa76e4e95d114aff2ba
MD5 c61014cd5356eb2b7261dfc864312962
BLAKE2b-256 9b7d85b63fb24283793a39f5f5246a68dfcb88944b60cbb48a49c7628196d5d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiwaf_rust-0.2.0-cp38-abi3-musllinux_1_2_x86_64.whl:

Publisher: publish.yml on aiwaf-project/aiwaf-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiwaf_rust-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for aiwaf_rust-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 226bbfe54306c1c43ec5da7dbe8337b38bf5a34c2462edb48b65365fad842b94
MD5 6e0e775e6642003d6ce842b0feeafd84
BLAKE2b-256 37af5ee01fae8cedc330afc79ee132523fe09e94fa76d92870ba9e8f47963d01

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiwaf_rust-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on aiwaf-project/aiwaf-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiwaf_rust-0.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for aiwaf_rust-0.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ad47b928dd8621fa6f51d21e4ba64365efadc12cf42c74502f48d09114eb11c4
MD5 f032c471d0c869716e0a5c83763b41dd
BLAKE2b-256 62756ca72cd11ac3830952c647f42ae736181a5dcdd414a36a71342630dcf42b

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiwaf_rust-0.2.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on aiwaf-project/aiwaf-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiwaf_rust-0.2.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for aiwaf_rust-0.2.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 21e0d750c0a05bfbf7d1450845db05cfc9de974900b73c836c08925e206905d3
MD5 bf8f45dfd6b181820a974b69acb1bd01
BLAKE2b-256 cbcd8b7516b9ef4d547fa3ea784244b32a8f9efa38340c215d78e1a14f7859b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiwaf_rust-0.2.0-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yml on aiwaf-project/aiwaf-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aiwaf_rust-0.2.0-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for aiwaf_rust-0.2.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a4457319bbd2f0c571c084701f77216f8ee43df1ce705cbe85b5bbecfe3c832b
MD5 acf22b0ef95626e5496d56fb631e99c3
BLAKE2b-256 db45be8ed2e9688c964b15cb3d42162a740b4e0f8bc971a5203ea809a27313f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiwaf_rust-0.2.0-cp38-abi3-macosx_10_12_x86_64.whl:

Publisher: publish.yml on aiwaf-project/aiwaf-rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page