diff --git a/web/app/Sensor/Ifconfig.php b/web/app/Sensor/Ifconfig.php index 043e2d550539486142d6d35e5a3b7e2cf82360a2..f2506df5c88f0732bac3f64e526c060a8c49ce82 100644 --- a/web/app/Sensor/Ifconfig.php +++ b/web/app/Sensor/Ifconfig.php @@ -102,6 +102,8 @@ class Ifconfig extends AbstractSensor { */ public function parseIfconfig($string) { + $allowed_prefixes = ["en", "eth"]; + if ($string == null) { return []; } @@ -112,6 +114,10 @@ class Ifconfig extends AbstractSensor { foreach ($lines as $line) { $name = $this->pregMatchOne(self::IFNAME, $line); if ($name !== false) { + if (!\starts_with($name, $allowed_prefixes)) { + continue; + } + // Starting the section of a new interface $if = new NetworkInterface(); $interfaces[] = $if;