How gilillo32/rise works
Project Type and Purpose
• The project is an online service map focused on identifying and alerting about cybersecurity vulnerabilities in companies located in the Basque Country.
• It is a full-stack web application that integrates a Node.js/Express backend with a set of frontend views (using EJS templates) and static public assets (CSS, JavaScript, images). In addition, it includes a specialized scanning service (under the “nuclei” directory) implemented in Python that manages vulnerability scanning, process orchestration, and result handling.
• The README confirms the service is used to detect, diagnose, and provide early warnings of cybersecurity issues.
Analysis of the File Structure
• Top-level directories and files indicate a symbiotic architecture:
• "controllers", "models", "routes", "server.js": Core Node.js backend components.
• "views" and "public": Frontend presentation layers. "views" contain EJS templates and partials; "public" holds CSS, JavaScript, images, and static JSON data.
• "nuclei": Contains Python scripts and shell scripts for scanning operations, configuration files, and a shared volume for scan results. This component appears to run separately (and may be orchestrated via Docker or invoked as a daemon) to perform vulnerability assessments.
• "dataset": Provides sample JSON data (companies.json) and a Python script for CSV-to-JSON conversion.
• Configuration and deployment artifacts like Dockerfile, docker-compose.yml, nginx.conf, and a mongo-init.sh file indicate containerized deployment (with Docker) and integration with MongoDB.
• Additional files such as package.json/package-lock.json and requirements.txt show the dual dependency management (npm and pip) for the Node and Python parts respectively.
Insights from the README
• The README details setup instructions using Docker Compose, environment variable configuration, and service initialization. It also provides usage instructions for creating users and setting up scans.
• It explains how to launch scanned analysis tasks (using nuclei) and how to enable a scan service daemon.
• Specific environment variables listed hint at a dependency on external services (e.g., Telegram for notifications) and database configurations (MongoDB).
a. Main Components:
• Frontend:
– User Interface represented by EJS views and static assets (HTML, CSS, JS).
– Public folder for styling and client-side logic.
• Backend:
– Node.js server (server.js) orchestrating requests via controllers and routes.
– Business logic in controllers and data models in models folder (e.g., company.js, user.js).
– API endpoints and RESTful services for client interactions.
• Vulnerability Scanning Service:
– Dedicated scanning module (nuclei) built with Python scripts.
– Scripts for launching scans (launch_scan.py, process_scan_results.py) and management (telegram_bot_manager.py).
– Shared volume for storing scan results and configuration (rise-config.yml, targets.txt).
– Shell scripts (run_scan_process.sh, setup_rise_service.sh) to run and manage the scanning daemons.
• Database:
– MongoDB for storing user, company, and potentially scan or configuration data (initialized via mongo-init.sh).
• Reverse Proxy / Load Balancer:
– NGINX (nginx.conf) acting as a reverse proxy or static file server.
• Deployment Infrastructure:
– Dockerfile and docker-compose.yml managing containerized deployments of the application and possibly separate containers for the scanning service, the backend API, and the database.
b. Relationships and Interactions:
• The Frontend sends HTTP requests (via forms or AJAX calls) which are received by the Node.js backend.
• The backend, using controllers and routes, processes these requests, interacts with the MongoDB, and renders EJS views with dynamic data.
• The backend may also trigger or communicate with the scanning service to initiate vulnerability scans.
• The scanning service (the nuclei component) periodically or on demand reads configuration, scans specified targets, and writes results into a shared volume.
• Notifications (e.g., via Telegram) or further actions may be triggered by scanning outcomes.
• NGINX routes and load balances incoming traffic to the appropriate backend services.
• Environment variables are used across containers to connect these services securely.
c. Architectural Patterns/Design Principles:
• Separation of Concerns: Frontend, backend API, and scanning services are clearly separated.
• Containerization: Use of Docker and Docker Compose for deployment encapsulation.
• Modularity: The scanning service in the "nuclei" folder is distinct and can be managed or scaled independently.
• Integration: The system integrates multiple technologies (Node.js, Python, MongoDB, NGINX) into one cohesive service.
d. Relevant Technologies/Frameworks:
• Node.js and Express for the backend.
• EJS for server-side templating.
• MongoDB as the database.
• Python and related libraries (per requirements.txt) for scanning tasks.
• Docker and Docker Compose for container orchestration.
• NGINX for reverse proxying and possibly static content delivery.
• Telegram API integration for scan notifications.