How devtalent2030/securiscan works
Project Type and Purpose
• This is a full-stack, containerized web security vulnerability scanner (“SecuriScan”) that crawls and tests websites against the OWASP Top 10.
• It consists of a React/TypeScript Next.js frontend, a Flask/Python backend API, modular security‐testing utilities (SQLi, XSS, CSRF, etc.), persistence (e.g. PostgreSQL), and container/orchestration for deployment (Docker Compose, AWS/Vercel).
File Structure
• Top level:
• backend/ – Flask app, app/ holds main app.py, route definitions and a utils/ folder for each vulnerability scanner module.
• securiscan-frontend/ – Next.js v13+ app directory, with app/ pages (dashboard routes per vulnerability), components/ reusable reports/UI, API service (api/scan.ts).
• docker-compose.yml – multi‐service orchestration.
• docs/ – architecture, API specs, setup guides.
• Patterns:
• Modular backend (one module per OWASP test)
• Component‐based frontend (per‐test dashboard routes & report components)
• Containerized microservices style (frontend + backend as separate services)
• Standard API‐driven separation (REST endpoints called by React Query in frontend).
README for Insights
• Tech stack: Flask, BeautifulSoup, Scapy, Nmap, CloudWatch, Next.js, Tailwind, Chart.js, React Query, Docker, AWS/Vercel, JWT, PostgreSQL, AWS Secrets Manager.
• Key features: automated crawling, AI‐driven payloads, real‐time dashboards, RBAC.
a. Main Components
• Frontend Service (Next.js)
• Backend API Service (Flask)
• Vulnerability Scanner Modules (utils: SQLi, XSS, CSRF, SSRF, etc.)
• Website Crawler (BeautifulSoup/Requests)
• External Tools (Nmap, Scapy)
• Persistence Layer (PostgreSQL)
• Authentication & Secret Store (JWT, AWS Secrets Manager)
• Logging & Monitoring (Python Logging → CloudWatch)
• Orchestration Layer (Docker Compose, AWS EC2 / Vercel)
b. Relationships & Data Flows
1. User → Next.js frontend UI (React Query triggers)
2. Frontend → REST API endpoints (/crawl, /check_sql, etc.) over HTTPS
3. API Service
– orchestrates crawler module → collects URLs
– dispatches each scanner module (SQLi, XSS, etc.)
– invokes external tools (Nmap/Scapy) for deeper analysis
– persists results in PostgreSQL
– writes logs/metrics to CloudWatch
4. API → returns structured JSON or PDF/HTML reports
5. Frontend → renders real-time dashboards (Chart.js) & report components
c. Architectural Patterns & Principles
• Separation of concerns: distinct UI, API, scanner modules
• Modular plugin-style scanning utilities
• Stateless API + persistent data store
• Containerized deployment for portability & scaling
• Use of CI/CD (Docker Compose + AWS/Vercel)
• Secure configuration: HTTPS, JWT, RBAC, Secrets Manager
d. Key Technologies
• Frontend: Next.js (React+TS), React Query, Tailwind CSS, Material UI, Chart.js
• Backend: Flask, BeautifulSoup, Requests, Scapy, Nmap, Python Logging
• Infrastructure: Docker, Docker Compose, AWS EC2/S3/Secrets Manager, Vercel, PostgreSQL