SANNIF is a premium, Apple-inspired network intrusion detection and threat intelligence dashboard powered by a production-trained XGBoost model. It features a clean, minimal, and highly functional interface designed for cybersecurity analysts and SOC (Security Operations Center) demonstrations.
- Apple Human Interface Design: High-contrast, light-themed premium cards, layout grid, subtle borders, and smooth slide-up fade-in transitions.
- Robust Schema Validation: Automatically extracts expected features from the loaded model metadata and verifies uploaded CSV headers to prevent runtime crashes.
- System Health Monitor: Sidebar-mounted live check reporting model deserialization, encoder loading, engine mode, and required features verification state.
- Detailed Threat Analytics: Interactive Plotly diagrams representing threat classification shares, category frequencies, confidence distribution histograms, and top flagged vectors.
- Auto-Archiving Report Engine: Exports predictions and automatically archives unified records (inputs + outputs) on the server in the
reports/folder with timestamped filenames. - SOC Diagnostics Console: Diagnostic tab capturing environment parameters (memory footprint, library versions, model features matrix, backend execution latency) for rapid debugging.
- Demonstration Mode Fallback: If the production XGBoost DLL is blocked by Windows AppLocker/WDAC policies, SANNIF automatically activates a simulated inference engine to keep the full UI functional.
PBL SANNIF/
│
├── .streamlit/
│ └── config.toml # Streamlit light theme config
│
├── models/
│ ├── xgboost_model.json # Production XGBoost model (JSON format)
│ ├── attack_encoder.pkl # Serialized LabelEncoder
│ └── encoded_dataset.csv # UNSW-NB15 encoded dataset
│
├── reports/ # Auto-saved prediction reports (created on startup)
│
├── app.py # Main Streamlit interface and page router
├── model_loader.py # Model deserialization and predict_attacks function
├── requirements.txt # Production dependencies
└── README.md # Documentation
Ensure you have Python 3.9+ installed on your system.
Initialize your virtual environment and install the required libraries:
# Create a virtual environment
python -m venv .venv
# Activate the virtual environment
# Windows:
.venv\Scripts\activate
# macOS/Linux:
source .venv/bin/activate
# Install requirements
pip install -r requirements.txtBefore running the application, place your pre-trained model and label encoder files inside the models/ directory:
models/xgboost_model.json— Trained XGBoost classifier (JSON format, loaded viamodel.load_model())models/attack_encoder.pkl— Label encoder mapping integer predictions to attack category strings
Start the Streamlit application:
streamlit run app.pyOpen http://localhost:8501 in your browser.
- Underlying Classifier: XGBoost Baseline
- Accuracy: 82.01%
- Benchmark Dataset: UNSW-NB15
- Features Analyzed: 34 features (e.g.
dur,proto,service,state,spkts,dpkts, etc.) - Output Classes: 10 (9 Intrusions: Generic, Exploits, Fuzzers, DoS, Reconnaissance, Analysis, Backdoor, Shellcode, Worms + 1 Normal category)
If the System Health panel shows a red indicator:
- Navigate to the Diagnostics page.
- Verify the exact path error shown in the console logs.
- If the engine mode shows Simulated Fallback (amber indicator), the XGBoost DLL is blocked by Windows security policies — the app remains fully functional using simulated inference.
| Page | Purpose |
|---|---|
| 🏠 Dashboard | Live KPI cards, model profile, detection metrics |
| 📂 Upload Dataset | CSV drag-and-drop with schema validation |
| 🔍 Detection Results | Run XGBoost inference, view paginated threat logs |
| 📊 Analytics | Plotly pie/bar/histogram charts |
| ⬇ Export Report | Download CSV, view server archives |
| 🩺 Diagnostics | System environment, backend status, feature list |
| ℹ About | Project description, model specifications |
Click The Line Below to experience our app https://rithishkumarsannif.streamlit.app/