kubo/plugin/plugins/telemetry
Hector Sanjuan 049256c22f
fix(telemetry): improve vm/container detection (#10944)
* telemetry: use systemd-detect-virt for container/vm detection

Current VM detection is not very accurate and systemd-detect-virt does exactly
what's needed under a miriad of virtualization platforms.

The downside is that we are running a system command which is uglier and might
perhaps flip anti-viruses or something.

* telemetry: improve vm/container detection with pure go

replace systemd-detect-virt with file-based detection to avoid:
- security risks from executing external binaries
- unnecessary repeated detection (now cached with sync.Once)
- missing detection on non-systemd systems

removes false positives:
- cpu hypervisor flag (indicates capability, not guest status)
- generic dmi strings that match physical hardware
- overlay filesystem check (used by immutable distros)

Co-authored-by: Andrew Gillis <11790789+gammazero@users.noreply.github.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2025-09-08 20:38:47 +02:00
..
telemetry_test.go feat: telemetry plugin (#10866) 2025-08-18 20:46:05 +02:00
telemetry_uuid feat: telemetry plugin (#10866) 2025-08-18 20:46:05 +02:00
telemetry.go fix(telemetry): improve vm/container detection (#10944) 2025-09-08 20:38:47 +02:00