How wellafl3x/infotecs_ti_automation works
Project Type and Purpose
• This is an automated PCAP-processing pipeline that glues together Zeek (traffic analysis), RITA (threat intelligence reporting), MongoDB (storage), and NGINX (report serving).
• It’s driven by a single orchestrator shell script (this_script.sh), with a helper Python component (main.py) to generate whitelists from the AdGuard JSON.
File Structure Analysis
• Top-level orchestrator:
• this_script.sh – installs components, sets up directories, and runs the monitor loop
• vars – environment variables controlling paths and feature toggles
• Processing scripts:
• main.py – whitelist generator from AdGuard JSON → outputs domains.txt and results.txt
• helper_scripts/clear.sh – cleanup utility
• Config templates (in templates/):
• rita/ (RITA config)
• smb/ (Samba share config)
• web/ (HTML/CSS + NGINX + RITA conf)
• whitelists/ (domain/IP lists)
• External dependencies & binaries:
• golang/go1.20.2.linux-amd64.tar.gz – Go toolchain for building RITA
• requirements.txt – any Python dependencies
Key Architecture from README
• Setup phase: installs Zeek, RITA, MongoDB, NGINX → creates directories (PCAPS, REPORTS, temp dirs) → applies templated configs → starts services
• Runtime phase: uses inotify to watch PCAPS/ → on new file:
a) Zeek analysis → writes logs to /tmp
b) RITA analysis (filters via whitelists generated by main.py) → stores in MongoDB → renders web reports
c) NGINX serves those reports on port 80
• Optional SMB share for PCAP/REPORTS via Samba
Main Components
• Operator (root shell)
• Orchestrator (this_script.sh + vars)
• Configuration Templates
• File System: input (PCAPS/), temp (/tmp/zeek/, /tmp/rita/), output (REPORTS/)
• Watcher (inotify service)
• Zeek engine
• Whitelist generator (main.py + AdGuard JSON external)
• RITA engine + MongoDB
• NGINX web server
• Optional Samba service
Interactions & Data Flow
• Operator → runs this_script.sh → installs & configures services
• inotify → triggers Zeek on new PCAP
• Zeek logs → passed to RITA
• main.py (periodic or on-demand) → fetches AdGuard JSON → outputs whitelists → RITA applies filters
• RITA → writes results to MongoDB and generates HTML reports
• NGINX → serves HTML/CSS/JS reports
• Samba (optional) → exposes PCAPS/REPORTS shares
Architectural Patterns and Principles
• Pipeline pattern: discrete processing stages (collect → analyze → report)
• Event-driven: inotify triggers analysis automatically
• Modular templates: decoupled configs for each service
• Single orchestrator entry point for reproducible deployment