Skip to content

ogtamimi/linscope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ”­ LINSCOPE

Real-time behavioral observability platform for Linux

See what's happening inside your Linux system as a living security graph

License Platform Status Python React Performance FPS


✨ What is linscope?

linscope transforms Linux kernel activity into a live visual behavioral system.

Instead of drowning in logs, you see:

  • πŸ”΄ Live process graphs β€” who spawned what, when, and why
  • 🌐 Network flow maps β€” real-time connection visualization
  • ⚑ Behavioral anomaly detection β€” not signature-based
  • 🎬 Attack replay β€” reconstruct incidents step by step
  • πŸ€– AI-powered analysis β€” local LLM for incident explanation

Built for SOC analysts, pentesters, and security researchers.

πŸ—οΈ Architecture

eBPF Collector  β†’  FastAPI Backend  β†’  WebSocket  β†’  React Frontend
      ↓                 ↓                 ↓                ↓
Kernel Event      Real-time          Live Graph      Visualization
   Stream         Processing           Updates
      ↓
Detection Engine  β†’  Replay Engine  β†’ AI Assistant

πŸ“¦ Install from Debian package

If you have the packaged installer linscope_v1_amd64.deb, install it with:

sudo dpkg -i linscope_v1_amd64.deb
sudo apt-get install -f

After the package installs, run the application using the installed binary or service. For example:

linscope

If the command is not available, follow the regular source-based startup instructions in the Quick Start section below.


πŸš€ Quick Start

Prerequisites

  • Linux (Ubuntu 22.04+, Mint 21+)
  • Python 3.10+
  • Node.js 18+
  • Root access for the collector
  • eBPF dependencies: bpfcc-tools, python3-bpfcc, linux-headers-$(uname -r), bpftrace
  • Optional: local Ollama for AI analysis

Install required packages

cd linscope
sudo apt update
sudo apt install -y bpfcc-tools python3-bpfcc linux-headers-$(uname -r) bpftrace
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

npm install is independent of the Python virtual environment.

cd linscope/frontend
npm install

Optional: install Ollama for local AI

If you want the AI Analyst and incident analysis features to work locally, install Ollama and start its local server.

# Follow Ollama install instructions from https://ollama.com/docs/installation
curl -fsSL https://ollama.com/install.sh | sudo bash

Then start the Ollama API server:

ollama serve --port 11434

By default, linscope will use http://localhost:11434 for Ollama. You can override this with OLLAMA_URL=http://localhost:11434 in your environment.

Optional: VirusTotal integration

If you want VirusTotal IOC lookups, run:

bash setup-virustotal.sh

Then set your VIRUSTOTAL_API_KEY in .env.example or a local .env file.

Running linscope

Terminal 1 β€” Backend

cd linscope/backend
python3 -m uvicorn main:app --reload --port 8000

Terminal 2 β€” Collector

cd linscope/collector
sudo PYTHONPATH=/usr/lib/python3/dist-packages python3 main.py

Terminal 3 β€” Frontend

cd linscope/frontend
npm run dev

Open http://localhost:3000 πŸ”­


🎯 Features

Feature Status Description
Process Monitoring βœ… eBPF process exec/fork/exit events
Network Monitoring βœ… NetworkMonitorV2 with /proc/net/tcp fallback
File Syscall Monitoring βœ… Experimental open/unlink tracking
Live Graph βœ… Real-time behavioral graph rendering
Timeline View βœ… Zoom, search, PID filter
Replay Engine βœ… Speed control and seek
Detection Engine βœ… Rule-based MITRE-style detection
Alerts Panel βœ… Real-time alert streaming
AI Analyst βœ… Local Ollama + Groq support
Virtual Scrolling βœ… O(1) DOM rendering

πŸ“Š Performance (v1.0.0)

Metric Before After Improvement
Max Events/sec 500 2000+ 4x
FPS 15-20 45-100 3x
Memory usage 250-300MB 45-100MB 3x
DOM nodes 1000+ 50-150 10x

πŸ”Œ API Endpoints

Method Endpoint Description
GET / Health check
POST /api/events/batch Ingest event batches from collector
GET /api/events Fetch stored events
GET /api/alerts Fetch alert history
POST /api/alerts/feedback Submit alert feedback
POST /api/ai/chat AI chat streaming
POST /api/ai/analyze-incident Incident analysis
WebSocket /ws Real-time event stream
WebSocket /ws/alerts Alert stream

πŸ“ Project Structure

linscope/
|
β”œβ”€β”€ README.md                     # Project overview, installation, usage, and features
β”œβ”€β”€ LICENSE                       # Apache 2.0 license file
β”œβ”€β”€ .gitignore                    # Files/folders ignored by Git
β”œβ”€β”€ .env.example                  # Example environment variables for local config
β”œβ”€β”€ setup-virustotal.sh           # Helper script to configure VirusTotal integration  
β”œβ”€β”€ requirements.txt   
|
β”œβ”€β”€ backend/                      # FastAPI backend and AI integration
|   |
β”‚   β”œβ”€β”€ main.py                        # Backend application entrypoint
β”‚   β”œβ”€β”€ detection_engine.py            # Detection rules and alert generation
β”‚   β”œβ”€β”€ ai_service.py                  # Ollama/Groq AI service integration
β”‚   β”œβ”€β”€ virustotal.py                  # VirusTotal IOC lookup router
β”‚   β”œβ”€β”€ backend.log                    # Backend runtime log file
β”‚   β”œβ”€β”€ linscope.db                    # Local SQLite event store
β”‚   β”œβ”€β”€ api/                           # Backend API package
β”‚   β”‚   └── __init__.py                # API package initializer
|   |
|   |
β”‚   └── src/                           # Backend utilities and shared helpers
β”‚       └── __init__.py 
|   
|
|
β”œβ”€β”€ collector/                    # eBPF collector and event emitter
|   |
β”‚   β”œβ”€β”€ main.py                        # Collector entrypoint, starts process/network monitors
β”‚   β”œβ”€β”€ mock_collector.py              # Synthetic event generator for testing
β”‚   β”œβ”€β”€ __pycache__/                   # Compiled Python bytecode cache
|   |
|   |
β”‚   └── src/
β”‚       β”œβ”€β”€ event_emitter.py            # Sends event batches to backend
β”‚       β”œβ”€β”€ network_monitor_v2.py       # Network monitor with fallback logic
β”‚       β”œβ”€β”€ process_monitor.py          # Process tracking via eBPF
β”‚       └── file_monitor.py             # Experimental file syscall tracking
|   
|
β”œβ”€β”€ frontend/                     # React frontend app
|   |
β”‚   β”œβ”€β”€ package.json                   # Frontend npm package manifest
β”‚   β”œβ”€β”€ package-lock.json              # Locked frontend dependency versions
β”‚   β”œβ”€β”€ tsconfig.json                  # TypeScript compiler config
β”‚   β”œβ”€β”€ vite.config.ts                 # Frontend build and dev server config
β”‚   β”œβ”€β”€ index.html                     # Browser app shell
β”‚   β”œβ”€β”€ metadata.json                  # App metadata and settings
β”‚   β”œβ”€β”€ README.md                      # Frontend-specific README
β”‚   β”œβ”€β”€ .gitignore                     # Frontend ignored files
β”‚   β”œβ”€β”€ dist/                          # Built frontend assets
β”‚   β”œβ”€β”€ frontend.log                   # Frontend runtime log file
β”‚   β”œβ”€β”€ icons/                         # UI icon assets
β”‚   β”œβ”€β”€ node_modules/                  # Installed npm packages
|   |
β”‚   └── src/
β”‚       β”œβ”€β”€ App.tsx                       # Main React app component
β”‚       β”œβ”€β”€ main.tsx                      # React entrypoint rendering App
β”‚       β”œβ”€β”€ index.css                     # Global frontend styles
β”‚       β”œβ”€β”€ types.ts                      # Shared TypeScript types
β”‚       β”œβ”€β”€ vite-env.d.ts                 # Vite environment type defs
β”‚       β”œβ”€β”€ lib/                          # Utility modules and helpers
β”‚       β”‚   └── utils.ts
|       |
|       |
β”‚       β”œβ”€β”€ workers/                      # Web Workers for performance offload
β”‚       β”‚   └── anomalyDetection.ts
|       |
|       |
β”‚       β”œβ”€β”€ components/                   # UI components and panels
β”‚       β”‚   β”œβ”€β”€ AIChat.tsx
β”‚       β”‚   β”œβ”€β”€ AlertsPanel.tsx
β”‚       β”‚   β”œβ”€β”€ AppLayout.tsx
β”‚       β”‚   β”œβ”€β”€ LiveGraph.tsx
β”‚       β”‚   β”œβ”€β”€ ReplayView.tsx
β”‚       β”‚   β”œβ”€β”€ RightPanel.tsx
β”‚       β”‚   β”œβ”€β”€ SettingsPanel.tsx
β”‚       β”‚   β”œβ”€β”€ Sidebar.tsx
β”‚       β”‚   β”œβ”€β”€ TimelineView.tsx
β”‚       β”‚   └── VirtualEventFeed.tsx
|       |
β”‚       └── hooks/                       # React hooks for state and data
β”‚           β”œβ”€β”€ useAlerts.ts
β”‚           β”œβ”€β”€ usePanelState.ts
β”‚           β”œβ”€β”€ useVirusTotal.ts
β”‚           └── useWebSocketAdaptive.ts
| 
β”œβ”€β”€ docs/                         # Documentation and contribution guides
└── venv/                         # Python virtual environment

πŸ–ΌοΈ Screenshots

Linscope screenshot 1 Linscope screenshot 2
Linscope screenshot 3 Linscope screenshot 4

🌐 Notes

  • collector/main.py requires root and uses PYTHONPATH=/usr/lib/python3/dist-packages for compatibility.
  • The AI features work best with a running local Ollama server.
  • Use .env.example to configure optional API keys for Ollama, Groq, Gemini, and VirusTotal.

🀝 Contributing

Contributions welcome! See docs/CONTRIBUTING.md.

πŸ“ License

Apache 2.0 – see LICENSE.

πŸ™ Acknowledgments

  • eBPF & BCC communities
  • FastAPI & React ecosystems
Built with ❀️ for the blue team

About

Real-time behavioral observability platform for Linux - visualize processes, syscalls, and network flows as a living security graph.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors