Skip to main content

A security library for Tornado to control IPs, log requests, and detect penetration attempts. Powered by guard-core.

Reason this release was yanked:

Leaked token, .env file, and other non-distributable modules/files

Project description

tornadoapi-guard


tornadoapi-guard is a security library for Tornado that provides middleware to control IPs, log requests, detect penetration attempts and more. It integrates seamlessly with Tornado to offer robust protection against various security threats. Powered by guard-core.

License CI CodeQL last-commit

Python Tornado Redis


Part of the Guard Security Ecosystem:

Framework Package Language
FastAPI fastapi-guard Python
Flask flaskapi-guard Python
Django djapi-guard Python
Tornado tornadoapi-guard (this) Python
Express/NestJS/Fastify/Hono guard-core-ts TypeScript

Features

  • IP Whitelisting and Blacklisting: Control access based on IP addresses.
  • User Agent Filtering: Block requests from specific user agents.
  • Rate Limiting: Limit the number of requests from a single IP.
  • Automatic IP Banning: Automatically ban IPs after a certain number of suspicious requests.
  • Penetration Attempt Detection: Detect and log potential penetration attempts.
  • HTTP Security Headers: Comprehensive security headers management (CSP, HSTS, X-Frame-Options, etc.)
  • Custom Logging: Log security events to a custom file.
  • Cloud Provider IP Blocking: Block requests from cloud provider IPs (AWS, GCP, Azure).
  • IP Geolocation: Use a service like IPInfo.io API to determine the country of an IP address.
  • Distributed State Management: (Optional) Redis integration for shared security state across instances
  • Flexible Storage: Redis-enabled distributed storage or in-memory storage for single instance deployments

Installation

To install tornadoapi-guard, use pip:

pip install tornadoapi-guard

Status

Work in progress. The adapter layer is being built to bring guard-core's full security pipeline to Tornado applications.


Development

# Install dependencies
make install-dev

# Run tests locally
make local-test

# Run linters
make lint

# Fix formatting
make fix

# Run all checks
make check-all

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Author

Renzo Franceschini - rennf93@users.noreply.github.com .


Acknowledgements

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

tornadoapi_guard-0.0.1.tar.gz (236.4 kB view details)

Uploaded Source

Built Distribution

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

tornadoapi_guard-0.0.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file tornadoapi_guard-0.0.1.tar.gz.

File metadata

  • Download URL: tornadoapi_guard-0.0.1.tar.gz
  • Upload date:
  • Size: 236.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for tornadoapi_guard-0.0.1.tar.gz
Algorithm Hash digest
SHA256 cd5fb75b3c92736ca43388ce7dd5481dd23ac4a8904691070fd46512d4b66205
MD5 2acb381aab84f50cb9695caec9b909d0
BLAKE2b-256 eacbbb9abb5e4b960638e6627de855a8f42b57bb86ad7f1d44706de885ec8ff6

See more details on using hashes here.

File details

Details for the file tornadoapi_guard-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tornadoapi_guard-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd5a94a402fcda7abb68932db403d99ad1de55de8933c85c3b86fe10f0dbc9f5
MD5 365b1979fec4fe6c98ea596b9f712c15
BLAKE2b-256 04ccc176ecb9d5bdc97350fcbf57b024f4fd5d59b73cf6816d2321bfa9d2ee92

See more details on using hashes here.

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