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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

aiwaf_rust-0.1.9-cp38-abi3-win_amd64.whl (702.6 kB view details)

Uploaded CPython 3.8+Windows x86-64

aiwaf_rust-0.1.9-cp38-abi3-musllinux_1_2_x86_64.whl (1.2 MB view details)

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

aiwaf_rust-0.1.9-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.1.9-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (991.5 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

aiwaf_rust-0.1.9-cp38-abi3-macosx_11_0_arm64.whl (869.2 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

aiwaf_rust-0.1.9-cp38-abi3-macosx_10_12_x86_64.whl (923.2 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: aiwaf_rust-0.1.9-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.9-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3f6ce334e5aaaf643c1838375e7af499e559c543e71906061ca44c619f38e89b
MD5 a07dc3f1cd400d48661b7ff3e005d148
BLAKE2b-256 53cc8b6c1c0819eb8aec6cba6be6cfc390016797ce668a74a46c960b11c456e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiwaf_rust-0.1.9-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.9-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for aiwaf_rust-0.1.9-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 df8b36f1979961ade22d1414248dba6e3c9a62a83bf0971534ba091b72603b53
MD5 b116c2c27671790d933821b7dff77251
BLAKE2b-256 83eb64df158fcf8ad1cb3fed240d2e27637652cba4c4e66786425021efd0a6e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiwaf_rust-0.1.9-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.1.9-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for aiwaf_rust-0.1.9-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 845b0c210a2407f53b29784d3a3ae74362ce6f6f1420bcfad134b98cc0dda222
MD5 85e3f67caa2c87888a365436c4f1fbcf
BLAKE2b-256 52fa2c633f8698029500f9bf253df86c332e3a2d31177d90b0725791d89d2627

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiwaf_rust-0.1.9-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.1.9-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for aiwaf_rust-0.1.9-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d92b0bacc29a47f30a59ae434593cbd358252fe9e5bc12ef6c4753ec990dc309
MD5 0b269057d3c7cd4348e63ce145c35f38
BLAKE2b-256 24dce08d1baec3d4973b15b393555f8fc4c51147a88571a32c55c366c9c75c5b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for aiwaf_rust-0.1.9-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5862e2f3b1ffb9137cbae61dcfe627811f6d07ead852c802114e6e8a848f0aa9
MD5 2ff14cb55a54b56a8729cdb995f89b69
BLAKE2b-256 1d65a2156d5554eabc8740d42f9de54c0684e9c427b936835ea22d8e385dcb68

See more details on using hashes here.

Provenance

The following attestation bundles were made for aiwaf_rust-0.1.9-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.1.9-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for aiwaf_rust-0.1.9-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 448306eeb370b230fd6964d5f4664af286c472d24b271eb4a08f23506baec0ac
MD5 16862476f89dbb717d9c738a3d2d3cb0
BLAKE2b-256 fb87bd32ea9b09e23fad4adf61765f164edfa7c9e3972ced9777d427aeb93c91

See more details on using hashes here.

Provenance

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