CodebaseAi commited on
Commit
452e476
Β·
1 Parent(s): f52cb69

Added readme

Browse files
Files changed (1) hide show
  1. Readme.md +43 -0
Readme.md ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: AI NIDS Backend
3
+ emoji: πŸ›‘οΈ
4
+ colorFrom: blue
5
+ colorTo: indigo
6
+ sdk: docker
7
+ app_port: 7860
8
+ pinned: false
9
+ ---
10
+
11
+ # πŸ›‘οΈ Adaptive AI Network Intrusion Detection System (NIDS)
12
+
13
+ This repository contains the backend API and machine learning logic for the AI-NIDS project. It is deployed as a Dockerized container on Hugging Face Spaces.
14
+
15
+ ## πŸš€ Key Features
16
+ - **Real-time Detection**: Flask-SocketIO with `eventlet` for high-concurrency traffic monitoring.
17
+ - **Dynamic ML Selection**: Automatically downloads and switches between `BCC` and `CICIDS` models from the Hugging Face Hub.
18
+ - **Cloud Guard**: Intelligent environment detection to disable raw socket sniffing when running in cloud environments (Hugging Face/Render).
19
+ - **Threat Analysis**: Integrated with Groq AI for deep packet inspection and human-readable threat summaries.
20
+
21
+ ## πŸ› οΈ Tech Stack
22
+ - **Framework**: Flask & Flask-SocketIO
23
+ - **Server**: Eventlet / Gunicorn
24
+ - **Machine Learning**: Scikit-learn, LightGBM, Joblib
25
+ - **Deployment**: Docker
26
+
27
+ ## πŸ”’ Environment Variables (Required)
28
+ To run this Space, you must configure the following **Secrets** in your Space Settings:
29
+ - `GROQ_API_KEY`: API key for AI threat analysis.
30
+ - `MAIL_USERNAME`: Gmail address for sending security alerts.
31
+ - `MAIL_PASSWORD`: Google App Password (16-character code).
32
+ - `HF_TOKEN`: (Optional) Required only if your model repository is private.
33
+
34
+ ## πŸ“‚ Project Structure
35
+ ```text
36
+ .
37
+ β”œβ”€β”€ app.py # Main entry point (Port 7860)
38
+ β”œβ”€β”€ Dockerfile # Container configuration
39
+ β”œβ”€β”€ requirements.txt # Optimized dependencies
40
+ β”œβ”€β”€ README.md # This file (HF Config)
41
+ β”œβ”€β”€ utils/ # Model selector and helpers
42
+ β”œβ”€β”€ routes/ # API Blueprint definitions
43
+ └── capture/ # Packet processing logic