Skip to content

lhiebert01/genai-network-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔒 GenAI Multi-Model Network Analyzer 🔒

A clean, interactive web application that allows users to analyze network security logs and compare responses from different AI models (Google's Gemini and OpenAI's GPT) side by side. This project helps security professionals quickly understand network security events and get expert recommendations.

✨ Features

  • 🤖 Real-time interaction with multiple AI models
  • 🔄 Easy switching between Gemini and OpenAI models
  • 🛡️ Network security log analysis with detailed explanations
  • 🔍 Detection of common attack patterns (SYN floods, port scans, brute force, etc.)
  • 📊 Proper formatting of structured data (tables, lists)
  • 💾 Save chat history functionality
  • 📱 Responsive design for mobile and desktop
  • 🎨 Clean, modern user interface

🌟 Live Demo

[Link to your deployed app will go here]

⚙️ Prerequisites

  • Python 3.12.9 or higher
  • Google AI API key
  • OpenAI API key

📥 Installation

  1. Clone the repository:
git clone https://github.com/yourusername/genai-network-analyzer.git
cd genai-network-analyzer
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: .\venv\Scripts\activate
  1. Install required packages:
pip install -r requirements.txt
  1. Set up environment variables:
    • Copy .env.template to .env
    • Add your API keys:
      GOOGLE_API_KEY=your_gemini_api_key
      OPENAI_API_KEY=your_openai_api_key
      

🚀 Running Locally

  1. Start the application:
python app.py
  1. Open your browser and navigate to:
http://localhost:8000

📊 Network Security Log Analysis

The application is designed to analyze various types of network security logs, including:

  • SYN Flood Attacks: Detects TCP SYN packet floods that can cause denial of service
  • Port Scanning: Identifies reconnaissance activities scanning for open ports
  • Brute Force Attacks: Detects password guessing attempts on services like SSH
  • Data Exfiltration: Identifies unauthorized data transfers via DNS and other protocols

📁 Project Structure

genai-network-analyzer/
├── app.py                 # Main FastAPI application
├── static/
│   ├── style.css         # CSS styles
│   └── main.js           # JavaScript functionality
├── templates/
│   └── index.html        # HTML template
├── logging_config.py      # Logging configuration
├── .env                  # Environment variables (not in repo)
├── .env.template         # Template for environment variables
├── requirements.txt      # Python dependencies
└── README.md            # Project documentation

🌐 API Endpoints

  • GET /: Main chat interface
  • POST /chat/gemini: Endpoint for Gemini model interactions
  • POST /chat/openai: Endpoint for OpenAI model interactions
  • GET /models/gemini: Get available Gemini models
  • GET /models/openai: Get available OpenAI models
  • GET /examples: Get example network security logs

☁️ Deployment

This application can be deployed to various platforms:

  • Render: Using the included render.yaml configuration
  • Heroku: With appropriate Procfile setup
  • Any cloud platform that supports Python applications

👥 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Google AI for Gemini Pro API
  • OpenAI for GPT API
  • FastAPI framework
  • Community contributors

📞 Contact

Developed by Lindsay Hiebert