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+.
  • 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.1.3.tar.gz (32.0 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.1.3-cp38-abi3-win_amd64.whl (702.6 kB view details)

Uploaded CPython 3.8+Windows x86-64

aiwaf_rust-0.1.3-cp38-abi3-manylinux_2_34_x86_64.whl (1.0 MB view details)

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

aiwaf_rust-0.1.3-cp38-abi3-macosx_11_0_arm64.whl (869.1 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: aiwaf_rust-0.1.3.tar.gz
  • Upload date:
  • Size: 32.0 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.1.3.tar.gz
Algorithm Hash digest
SHA256 e47976c71edd28bfd6e3972f5dfb5c6afa08cd1f226ccd828c4bfba540211ba2
MD5 ed8c0639c58a06e6a787e79d91870163
BLAKE2b-256 72e20de75264f3f40b2ed3e1913096449537e2c2192916eea784bef821a7ae1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiwaf_rust-0.1.3.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.1.3-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: aiwaf_rust-0.1.3-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

Hashes for aiwaf_rust-0.1.3-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5d6ebabe95e52edd07b1e72cd70a99bb828581c9b4ff353dd913c9e1d162f1f5
MD5 843dc3f3be3c90f0825da1ea3390218a
BLAKE2b-256 af3b0f2771a3b824fbd34b0f7286bca6e36c4bc3d3c3b3598b79767f00771e88

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiwaf_rust-0.1.3-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.1.3-cp38-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for aiwaf_rust-0.1.3-cp38-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7515f8c31debac0a019271ace7fc5c52151b706c005d250670f972e23951d88a
MD5 ed7f34e22c528413ee8acfd7ef681e32
BLAKE2b-256 6e9500f11a74d86de6e63f4d8cd574b482f6028ea638d8e1b7a65fb2219d86c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiwaf_rust-0.1.3-cp38-abi3-manylinux_2_34_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.1.3-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for aiwaf_rust-0.1.3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4b639cade3f82221bf9ed511b73fefa73e8f189a7c19537514e979c6d46d3292
MD5 99cfd48edd491a6dc85a2381e624751c
BLAKE2b-256 295534bc8c1f6c267d5cbca1d4c90a595e1ecb1e3e74d592a2161f97aece9c7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiwaf_rust-0.1.3-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.

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