Network Inspection Platform
TCP port scanner that checks which network ports are open on a target host. Built with Python asyncio for concurrent scanning, FastAPI for the REST API, and deployed on Render. Includes input validation, rate limiting, and security controls to prevent abuse.
Technical Implementation
Backend Architecture
- Async Concurrency: Uses asyncio with semaphore-based rate limiting to prevent resource exhaustion
- Security: SSRF protection blocks localhost and private IP ranges, enforces max port range limits
- Validation: Input sanitization, DNS resolution safety, timeout enforcement
- Observability: Structured JSON logging with request timing and error tracking
- Clean Code: Type hints, docstrings, proper error classes, no global state
Key Features
- TCP connect scan with latency measurement
- Configurable concurrency limits via environment variables
- Proper HTTP status codes and CORS headers
- Production-ready error handling and logging
- Clean separation of concerns (validation, scanning, response formatting)