Skip to main content

Python bindings for libmodsecurity (OWASP ModSecurity v3)

Project description

python-modsecurity

Python bindings for libmodsecurity.

Install

pip install libmodsecurity

with uv:

uv venv --python 3.13
uv add libmodsecurity

Usage

from libmodsecurity import ModSecurity, RulesSet

engine = ModSecurity()
engine.set_connector_information("my-app/1.0")

rules = RulesSet()
rules.load("""
SecRuleEngine On
SecRule REQUEST_URI "@contains /admin" \
    "id:1,phase:1,deny,status:403,log,msg:'blocked'"
""")

with engine.transaction(rules) as t:
    t.process_connection("127.0.0.1", 12345, "127.0.0.1", 80)
    t.process_uri("/admin", "GET", "1.1")
    t.add_request_header("Host", "example.com")
    t.process_request_headers()

    if it := t.intervention():
        print(f"blocked with {it.status}: {it.log}")

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

libmodsecurity-3.0.15.post1.tar.gz (24.5 kB view details)

Uploaded Source

Built Distributions

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

libmodsecurity-3.0.15.post1-cp313-cp313-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

libmodsecurity-3.0.15.post1-cp313-cp313-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

libmodsecurity-3.0.15.post1-cp312-cp312-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

libmodsecurity-3.0.15.post1-cp312-cp312-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

libmodsecurity-3.0.15.post1-cp311-cp311-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

libmodsecurity-3.0.15.post1-cp311-cp311-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

libmodsecurity-3.0.15.post1-cp310-cp310-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

libmodsecurity-3.0.15.post1-cp310-cp310-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

libmodsecurity-3.0.15.post1-cp39-cp39-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

libmodsecurity-3.0.15.post1-cp39-cp39-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file libmodsecurity-3.0.15.post1.tar.gz.

File metadata

  • Download URL: libmodsecurity-3.0.15.post1.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for libmodsecurity-3.0.15.post1.tar.gz
Algorithm Hash digest
SHA256 3e017bfc1bfd08d01b10d46b5cf786402157d8fd412b28ebc3b2c8f8cb38e439
MD5 b16cbf40dd8bd0febecd8184ad75ef8c
BLAKE2b-256 0469726d2da55c4216186a740dea477c671a3017625d5704a08cb5ff52b346b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for libmodsecurity-3.0.15.post1.tar.gz:

Publisher: wheels.yml on meirdev/python-modsecurity

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

File details

Details for the file libmodsecurity-3.0.15.post1-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for libmodsecurity-3.0.15.post1-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3a9cf43bee433966e9bb1f9120df29a327047af4f489813332eef7dbcabf3189
MD5 4658060d04c013446822d6aec6fb962c
BLAKE2b-256 d2c872925f781f08c2a3db5c81e0dee660c4a3b08b0bdcf3cdf9d962a0e1247b

See more details on using hashes here.

Provenance

The following attestation bundles were made for libmodsecurity-3.0.15.post1-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on meirdev/python-modsecurity

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

File details

Details for the file libmodsecurity-3.0.15.post1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libmodsecurity-3.0.15.post1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 45fd79e8fa8fda535fca829adb5bfb7a4d3b1442213995247f337f1598938032
MD5 4d6c3e40e388a820b20757682f34cf21
BLAKE2b-256 1090a8ccf21b1e909e13301e0a3c3a96ec6cc66261b62481ad30618133c0675b

See more details on using hashes here.

Provenance

The following attestation bundles were made for libmodsecurity-3.0.15.post1-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: wheels.yml on meirdev/python-modsecurity

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

File details

Details for the file libmodsecurity-3.0.15.post1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for libmodsecurity-3.0.15.post1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f9f76d74fdd8c9dd572d9c14fcbdc316bb6c0bb19579444724993eec0e822494
MD5 095c8c6b7daa2d8a9ffe253971ad6384
BLAKE2b-256 e5b1827fdbeeb4ecd495b8acbd44c21069319d12a7ec5e00f150df2649e83b21

See more details on using hashes here.

Provenance

The following attestation bundles were made for libmodsecurity-3.0.15.post1-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on meirdev/python-modsecurity

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

File details

Details for the file libmodsecurity-3.0.15.post1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libmodsecurity-3.0.15.post1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8255f8a19af7d69e9a6058052198b8258091af0d0a95cad3a3d8b4a665dc62bf
MD5 1dfd020f06eaa3db9408571278ca0375
BLAKE2b-256 eadbc95d410a6370f632fee3b1b9ae8f40bc8ad99ca16c551efcef96c918212d

See more details on using hashes here.

Provenance

The following attestation bundles were made for libmodsecurity-3.0.15.post1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: wheels.yml on meirdev/python-modsecurity

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

File details

Details for the file libmodsecurity-3.0.15.post1-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for libmodsecurity-3.0.15.post1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 499c344fa23b4be51c5b5b2b06f92156429996afbad6b72dd8b579cadd8b97e9
MD5 eb77a5bc9536806ee46d0d5ae7281e1c
BLAKE2b-256 a2011f0df2ada761580d4a6948f00f439ad4b6fff8421ec7daad3d855ae66f81

See more details on using hashes here.

Provenance

The following attestation bundles were made for libmodsecurity-3.0.15.post1-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on meirdev/python-modsecurity

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

File details

Details for the file libmodsecurity-3.0.15.post1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libmodsecurity-3.0.15.post1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 28b25ec5721adcc5312707bb7d6a10584aa175720662634b4444a7ee915fd91b
MD5 3bafe62843d12cf4e09b939daf05bf70
BLAKE2b-256 5517a23a575597c6e271251023d05f68b3167c791bbc84f86e3f021ce1b672aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for libmodsecurity-3.0.15.post1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: wheels.yml on meirdev/python-modsecurity

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

File details

Details for the file libmodsecurity-3.0.15.post1-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for libmodsecurity-3.0.15.post1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 531c5fe71542ebbfc95c317406695bb8ed7d2c119bf6c5005896f8574ba68de3
MD5 318b5144b5443eb8f5449f0d245020c6
BLAKE2b-256 e57b65f56e4b981ee811e262f7abc1fd12647a38e8a77a62fd107357315fe43b

See more details on using hashes here.

Provenance

The following attestation bundles were made for libmodsecurity-3.0.15.post1-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on meirdev/python-modsecurity

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

File details

Details for the file libmodsecurity-3.0.15.post1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libmodsecurity-3.0.15.post1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5a69fe3091613bd8a5c4f1eefeb803c5854f944e7774d559eb9ef65003fb475b
MD5 b297e55780a3f67e16989f61134683a3
BLAKE2b-256 41623dfa91d95c7460aec97822726ff2c0cda139d821bdf57f32d2aef09d646a

See more details on using hashes here.

Provenance

The following attestation bundles were made for libmodsecurity-3.0.15.post1-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: wheels.yml on meirdev/python-modsecurity

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

File details

Details for the file libmodsecurity-3.0.15.post1-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for libmodsecurity-3.0.15.post1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e510095fd16210bc9e7414a5e4d0606aac892799efc75e43a9f6fbb203175aee
MD5 f67eac6976fb3e556b1893618eebabc8
BLAKE2b-256 b4de3bd05586fce7c68bc593f5d7291e82e00b61b0e39a15359cc8e0147961f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for libmodsecurity-3.0.15.post1-cp39-cp39-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on meirdev/python-modsecurity

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

File details

Details for the file libmodsecurity-3.0.15.post1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for libmodsecurity-3.0.15.post1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f92143e136ad785f8f931a68e75272a7498e2959a79273a50a9a9cf72d0a87de
MD5 5c377ce19cdbf95cca0b652174eca2ab
BLAKE2b-256 9ff187665689d9cd6d9525162ceaf0ed3a1672c37563f13743c27c8ab21f1ab8

See more details on using hashes here.

Provenance

The following attestation bundles were made for libmodsecurity-3.0.15.post1-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: wheels.yml on meirdev/python-modsecurity

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