The UI can't tell which process monitor method the daemon is actually using

Aperta
#1,701 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
66/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
linux, python
Ambito
api, backend

Direzione di ricerca

Start with proto/ui.proto and daemon/procmon/monitor/init.go to trace the statistics sent to the UI and where the active method is selected. The issue suggests adding the running method to Statistics; check how statistics are populated and sent, then verify the UI can distinguish the active method from the configured one, including after a reload.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

When the configured method (ebpf or audit) fails to start, the daemon falls back to proc, but nothing tells the UI. The UI only sees the configured method, so it can show "ebpf" while the daemon is really parsing /proc. That matters to users: /proc misses or misattributes short-lived processes (#1447), which is the main reason to choose ebpf.

What happens now (master a1353848, same code in v1.8.0)
  • monitor.Init() tries the configured method and, if it fails, falls back to /proc. It calls procmon.SetMonitorMethod(procmon.MethodProc) and logs Process monitor method /proc (daemon/procmon/monitor/init.go:131-133). The running method is then known only inside the daemon (procmon.GetMonitorMethod()).
  • What the UI gets is ClientConfig.Config, which is the config file read from disk (daemon/ui/notifications.go:36,60). So ProcMonitorMethod there is the configured value, not the running one. It also doesn't reflect the -process-monitor-method command-line flag (daemon/main.go:107).
  • On a config reload, reloadConfiguration() puts the last good method back into its in-memory copy when the new one fails (daemon/ui/config_utils.go:261), but that copy isn't what getClientConfig() sends.
  • Statistics (proto/ui.proto:79) has no field for it either.
Expected behaviour

The UI can show the method in use, and that it differs from the configured one when there was a fallback.

Possible change (open to whatever fits best)
  • a. Add string process_monitor_method to Statistics, filled from procmon.GetMonitorMethod(). It's sent on every ping, so the UI also sees a change after a reload. This is additive in protobuf: older UIs ignore it and older daemons send an empty string, which reads as "unknown".
  • b. Or add the field to ClientConfig. That's only sent at subscribe time, so it would also need an update after a reload changes the method.
  • c. Also send an Alert (type warning, what: e.g. PROC_MONITOR) when Init falls back, so the UI can explain why. Today the only warning comes from the command-line path ("Unable to set process monitor method via parameter", daemon/main.go:643-645).

(a) looks like the smallest useful change. I'm happy to send a PR for it if that's the preferred shape.

Context

We noticed this while building a status view for a desktop frontend: there was no honest way to say "eBPF is active" versus "configured eBPF, running /proc".

Lingua principale
Python
Stelle
14.3k
Fork
689
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di evilsocket/opensnitch

Tutte le issue di evilsocket/opensnitch

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.