How proffaro/kshark works
KShark is a hybrid eBPF security platform: a Go agent collects kernel telemetry, a Python engine evaluates behavioral rules and ML detections, and results are persisted and exposed through an API and desktop GUI. The graph follows that workflow and includes the GUI’s event-analysis layer. Several agent, probe, and GUI implementation files were not sampled; their connections are shown only where the README or source index supports them.
Main entry points: realtime_engine.py Realtime ingestion · main.py System orchestrator · main.go Go eBPF agent · main_window.py KShark desktop
Components 23
Kernel collection
- Go eBPF agent
agent/cmd/agent/main.go - eBPF probes
bpf/probes - Agent WebSocket
agent/server/websocket.go
Detection and storage
- Realtime ingestion
ml_engine/inference/realtime_engine.py - Feature extraction
ml_engine/preprocessing/feature_extractor.py - Process lineage
ml_engine/preprocessing/process_graph.py - Behavioral rules
ml_engine/rules/behavioral_engine.py - Falco rules
ml_engine/rules/falco_engine.py - ML detector
ml_engine/models/detector.py - Alert dispatch
ml_engine/detection/alert_dispatcher.py - DuckDB and SQLite
ml_engine/storage/db_manager.py - Storage models
ml_engine/storage/models.py
API and operations
- System orchestrator
main.py - REST API
ml_engine/api/server.py - API routes
ml_engine/api/routes.py
Desktop analysis
- KShark desktop
kshark/main_window.py - Event table model
kshark/models/event_table_model.py - Display filters
kshark/core/filter_engine.py - Event coloring
kshark/core/coloring_engine.py - Syscall lookup
kshark/core/syscall_table.py - Theme settings
kshark/core/theme.py
Other components
- Security operator
- Linux kernel
Connections 25
- Security operator → System orchestrator: starts system
main.py - System orchestrator → Go eBPF agent: starts agent
main.py - Go eBPF agent → eBPF probes: loads probes
- Linux kernel → eBPF probes: emits telemetry
- Go eBPF agent → Agent WebSocket: streams events
- Agent WebSocket → Realtime ingestion: sends telemetry
- System orchestrator → Realtime ingestion: starts engine
main.py - Realtime ingestion → Feature extraction: extracts features
ml_engine/inference/realtime_engine.py - Realtime ingestion → Process lineage: updates lineage
ml_engine/inference/realtime_engine.py - Realtime ingestion → Behavioral rules: evaluates events
ml_engine/inference/realtime_engine.py - Behavioral rules → Falco rules: evaluates rules
ml_engine/rules/behavioral_engine.py - Realtime ingestion → ML detector: scores features
ml_engine/inference/realtime_engine.py - Realtime ingestion → Alert dispatch: dispatches alerts
ml_engine/inference/realtime_engine.py - Realtime ingestion → DuckDB and SQLite: persists events
ml_engine/inference/realtime_engine.py - DuckDB and SQLite → Storage models: uses models
ml_engine/storage/db_manager.py - System orchestrator → REST API: starts API
main.py - REST API → API routes: mounts routes
ml_engine/api/server.py - API routes → DuckDB and SQLite: queries storage
ml_engine/api/routes.py - Security operator → KShark desktop: opens desktop
- KShark desktop → Event table model: presents events
kshark/main_window.py - Event table model → Event coloring: colors rows
kshark/models/event_table_model.py - Event coloring → Display filters: matches rules
kshark/core/coloring_engine.py - Display filters → Syscall lookup: resolves names
kshark/core/filter_engine.py - Event coloring → Theme settings: reads theme
kshark/core/coloring_engine.py - KShark desktop → Theme settings: sets appearance
kshark/main_window.py