Welcome to AntiScrape-FastAPI-Defender, a secure FastAPI-based authentication service with robust defense mechanisms against web scraping and malicious activities. This project aims to provide developers with a framework to build authentication services that are resilient to common threats such as abusive requests, spam submissions, and malicious user agents.
- Rate Limiting: Protects against abuse by limiting the number of requests per IP address.
- Behavioral Analysis: Detects and blocks suspicious user agents, such as headless browsers and bots.
- Honeypot Detection: Identifies and blocks form submissions from honeypot fields to deter automated attacks.
- IP Health Check: Verifies the health of incoming IP addresses to block toxic, proxy, or spam traffic.
- Logging: Records suspicious activities for further analysis and monitoring.
To get started with AntiScrape-FastAPI-Defender, follow these steps:
-
Clone the Repository:
git clone https://github.com/geoseiden/AntiScrape-FastAPI-Defender.git
-
Install Dependencies:
cd AntiScrape-FastAPI-Defender pip install -r requirements.txt -
Run the Server:
python server.py
-
Interact with the API:
- Use
client.pyto trigger different scenarios for testing. - Explore the API endpoints (
/login) and observe the implemented security measures in action.
- Use
- Adjust rate limits, honeypot field names, and other settings in
server.pyto suit your requirements. - Optionally, integrate with other third-party IP health check services by modifying the
check_ip_healthfunction.
Contributions to AntiScrape-FastAPI-Defender are welcome! Here are some ways you can contribute:
- Report bugs or suggest features by opening an issue.
- Submit pull requests for bug fixes, improvements, or new features.
- Share your feedback and ideas to help enhance the project.
This project is licensed under the MIT License.
- FastAPI: The high-performance web framework used for building the API.
- user-agents: Python library for parsing user agent strings.
- aiohttp: Asynchronous HTTP client/server framework for Python.
- Antideo: External service used for IP health checks.