How gaurav-chatribin/threat-reputation-checker works
Project Overview and Purpose
• That this is a backend web application built using Flask. The main goal is to offer a unified interface for checking the reputation of IP addresses and domain names via multiple threat intelligence APIs (VirusTotal, AbuseIPDB, Criminal IP, and Whoislookup).
• The README explains its purpose, features, and user interactions. It’s a single-page web interface where users can enter input, triggering API calls to gather threat intelligence data.
Analyzing the File Structure
• Top-Level Files:
• app.py: The main Flask application file; this is the entry point.
• LICENSE, README.md, requirements.txt: These are standard metadata and dependency files.
• module Directory:
• Contains individual Python modules (abuseipdb.py, criminal_ip.py, virustotal.py, whoislookup.py). These encapsulate the functionality to interact with the respective APIs.
• This reflects a modular design pattern where external service interactions are separated for maintainability.
• templates and static Directories:
• templates: Contains index.html, which is used to render the user interface.
• static: Contains style.css for front-end styling.
a. Main Components:
• Web Server / Application Layer: The Flask application in app.py acts as the main controller that receives requests from users.
• API Modules: Represented by individual modules (abuseipdb, criminal_ip, virustotal, whoislookup) which handle external service calls.
• Presentation Layer: Templates (index.html) and static files (style.css) that generate the UI.
• External Services: The third-party APIs provided by VirusTotal, AbuseIPDB, Criminal IP, and Whoislookup that are queried for threat information.
b. Relationships and Interactions:
• User Interaction: The user enters an IP or domain in the browser (UI).
• Request Flow: The browser sends the request to the Flask app (HTTP request).
• Controller Action: app.py receives the request, validates input, and determines which module to invoke based on the input type.
• Module Communication: app.py calls relevant functions from the modules in the module folder, which then issue API calls to external services.
• Data Handling: The responses from these APIs are aggregated, processed, and then rendered back on the index.html template.
c. Architectural Patterns and Principles:
• Modular Design: Each external API is encapsulated in its own module for clean separation of concerns.
• MVC-Like Pattern: Although simple, there’s an evident separation between the view (templates, static), the controller (app.py), and the model/logic (modules handling API calls).
• Single-Page Interface: The UI is simple and dynamic, providing feedback on a single page.
d. Relevant Technologies and Frameworks:
• Python & Flask: For the backend web functionality.
• Requests library: Used within the modules to communicate with the external APIs.
• HTML/CSS: For the frontend via Jinja2 templates served by Flask.
• External APIs: VirusTotal, AbuseIPDB, Criminal IP, and Whoislookup.
Instructing the Principal Software Engineer
• Components to include:
• Client / Frontend: Represented by the browser, index.html, and static files.
• Backend Server: The Flask application process running app.py.
• Modules: Separate blocks for abuseipdb.py, criminal_ip.py, virustotal.py, and whoislookup.py.
• External APIs: Represent each external threat intelligence API as distinct services.
• From Client → Flask Application: user request initiation.
• From Flask Application → Each API Module: representing function calls and data aggregation.
• From Modules → External Services: outgoing API calls.