Skip to content
draco

draco

Pypi • November 28, 2026

Firewall, anti-copy pace, country filter, review requests and CrowdSec for Python web apps (ASGI: FastAPI, Starlette; WSGI: Flask, Django). No dependencies.

pip install draco-insomnis==0.1.43

The Draco Insomnis firewall for Python web apps, with no dependencies . It uses the same signatures and limits as the WordPress, PrestaShop, Drupal, Joomla, Moodle, Laravel, Magento, server and JavaScript editions, and runs the same shared test cases ( tests/vectors ), so every edition gives the same answer to the same request.

Draco checks requests in this order:

Blocked addresses can still read the site. They cannot post anything or open sensitive pages (login, sign-up and admin).

Countries , by default only for sensitive requests. Behind Cloudflare the country comes from Cloudflare; without it, from the monthly country list (see below).

Firewall signatures : SQL injection, path traversal, code injection, XSS in the URL, known scanners and probes for files like .env or .git , in the path, the query and the posted form or JSON (also when URL-encoded twice). In log mode it only keeps evidence; in block mode it answers 403 with a page that never says which rule matched. Five attacks in 10 minutes block the address for 7 days.

In log mode it only keeps evidence; in block mode it answers 403 with a page that never says which rule matched.

Five attacks in 10 minutes block the address for 7 days.

Anti-copy pace : pages a minute per address (default 120) and per /24 or /64 network (600), 429 over the limit. Only HTML pages count. Google, Bing, Apple and Yandex may go faster once the reverse DNS proves who they are.

The visitor's address is the connection's own unless you choose proxy="xff" or proxy="cf" , and even then the header is only believed from a trusted proxy (local and private networks by default, trusted_proxies when you list them, Cloudflare's ranges for cf ). If Draco itself fails, the request goes through.

The engine runs in a worker thread, so the event loop never waits on it (it may ask the DNS to prove a engine). Forms and JSON bodies up to 64 KB are read once and handed to your app unchanged.

Countries without Cloudflare

The same list as the other editions: DB-IP "IP to Country Lite" (CC BY 4.0), built monthly by this project. It is downloaded on start when missing or older than 35 days, then checked once a day, and only replaces the old file when the published SHA-256 matches. The lookup is local.

"This is a mistake": review requests

The 403 page carries a short form, signed for the address and the moment it was shown, with the rule sealed, a trap field and 3 requests a day per address (50 per site). The visitor always gets the same "Request sent" page. Draco never writes to the person who asks. Let someone through with gate.blocks.remove(ip) or by adding the address to admin_ips .

Bans from your own CrowdSec (key from cscli bouncers add draco ) join the block list, synced in a background thread at most once a minute. Ranges wider than /16 or /32 and admin_ips are never imported; blocks you set yourself are never lifted by it. The other way, crowdsec_line(event) writes evidence lines for the parser and scenario in server/crowdsec .

The default MemoryStore serves one process. With several workers or servers, give every one the same store : any object with bump(key, ttl) -> int , get(key) , set(key, value, ttl) (ttl 0 = for good) and delete(key) . With Redis that is INCR + EXPIRE NX , GET , SET EX and DEL . The keys are the same as in the JavaScript edition, so a Node and a Python app can one block list.

Release files for draco-insomnis 0.1.43

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation .

Source distribution (sdist)

Built distribution (wheel)

Total release size: 77.5 kB

Release files / draco_insomnis-0.1.43.tar.gz

Provenance describes where a file came from. On PyPI, provenance is shared via attestations , which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Release files / draco_insomnis-0.1.43-py3-none-any.whl

Provenance describes where a file came from. On PyPI, provenance is shared via attestations , which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Security for draco-insomnis 0.1.43

Provenance describes where a file came from. On PyPI, provenance is shared via attestations , which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Both files in this release have been uploaded with provenance metadata.

Attestation for draco_insomnis-0.1.43.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Attestation for draco_insomnis-0.1.43-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

Nov 28, 2026 2 release files Full provenance

Nov 27, 2026 2 release files Full provenance

Nov 27, 2026 2 release files Full provenance

Nov 26, 2026 2 release files Full provenance

Nov 25, 2026 2 release files Full provenance

Nov 25, 2026 2 release files Full provenance

Nov 24, 2026 2 release files Full provenance

Nov 21, 2026 2 release files Full provenance

Nov 17, 2026 2 release files Full provenance

Nov 16, 2026 2 release files Full provenance

Nov 15, 2026 2 release files Full provenance

Nov 15, 2026 2 release files Full provenance

Nov 15, 2026 2 release files Full provenance