Skip to main content

A powerful WAF Middleware for Flask with SQLi, XSS, and Logic protection

Project description

WAF Middleware for Flask

Đây là thư viện tường lửa ứng dụng Web (WAF) mạnh mẽ dành cho Flask, được xây dựng như một đồ án chuyên ngành.

Tính năng Chính

  • Chống Injection: Ngăn chặn SQL Injection, Command Injection.
  • Chống Web Attacks: XSS (Cross-Site Scripting), LFI (Local File Inclusion).
  • Phòng thủ Logic:
    • Honeypot: Bẫy hacker và tự động Ban IP.
    • GeoIP: Chặn truy cập từ các quốc gia không mong muốn.
    • Anti-CSRF: Bảo vệ người dùng khỏi giả mạo request.
  • Chống DDoS: Rate Limiting (Giới hạn tần suất truy cập).
  • Hệ thống Cảnh báo: Tích hợp Bot Telegram báo cáo thời gian thực.

Cài đặt

Bạn có thể cài đặt thư viện thông qua file .whl (đã đóng gói):

pip install waf_middleware-1.0.0-py3-none-any.whl
Hướng dẫn Sử dụng
Tích hợp WAF vào ứng dụng Flask của bạn chỉ với 2 dòng code:

Python

from flask import Flask
from waf_middleware import Firewall

app = Flask(__name__)

# Cấu hình Secret Key (Bắt buộc cho Session)
app.config['SECRET_KEY'] = 'your-secret-key'

# Khởi chạy WAF
# Lưu ý: Điền Token Telegram trong file cấu hình nếu muốn nhận cảnh báo
waf = Firewall(app)

@app.route('/')
def index():
    return "Web này đã được bảo vệ bởi WAF Middleware!"

if __name__ == "__main__":
    app.run(debug=True)
Yêu cầu hệ thống
Python 3.8+

Flask

SQLAlchemy

Requests

Tác giả: Nguyễn Hoài Thoại

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

waf_middleware_hoaithoai35-1.1.9.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

waf_middleware_hoaithoai35-1.1.9-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file waf_middleware_hoaithoai35-1.1.9.tar.gz.

File metadata

File hashes

Hashes for waf_middleware_hoaithoai35-1.1.9.tar.gz
Algorithm Hash digest
SHA256 cfc4065366be6253ee427099dc55727fcbea9cdadd0f3166a63056f7291be1ba
MD5 e707cf1b9bfe2da8e176d43e1fd1779c
BLAKE2b-256 c348f237bb1907c536285772b0f7ee2ecfa12c1270b9949cae50d1d6bbe082c7

See more details on using hashes here.

File details

Details for the file waf_middleware_hoaithoai35-1.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for waf_middleware_hoaithoai35-1.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 cf2e2d75ec4f1185ac85901d079f2036d29601a468559b8b624e864f23c4c647
MD5 add294579d081a55a2716ea79ec125fc
BLAKE2b-256 e0d2e3f9cd881a65481331d3255db136044f149cfa3dda95eef36c1627405222

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