From e8d2e207155667524c1ad90d4d64f36579184ae0 Mon Sep 17 00:00:00 2001 From: hojmark <1203136+hojmark@users.noreply.github.com> Date: Mon, 20 Jul 2026 22:34:05 +0200 Subject: [PATCH 01/14] chore: update renovate.json settings --- renovate.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/renovate.json b/renovate.json index aa2bce41..61a24bdb 100644 --- a/renovate.json +++ b/renovate.json @@ -1,15 +1,19 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:best-practices"], "timezone": "Europe/Berlin", "addLabels": [ "dependencies" ], - "minimumReleaseAge": "14 days", + "minimumReleaseAge": "7 days", "internalChecksFilter": "strict", - "prCreation": "not-pending", "dependencyDashboard": true, "prConcurrentLimit": 5, "prHourlyLimit": 0, + "vulnerabilityAlerts": { + "labels": ["security"], + "minimumReleaseAge": "1 day" + }, "automerge": false, "dockerfile": { //"pinDigests": true From f5890a573941ee3d22566d711f83e5bb39b8eb55 Mon Sep 17 00:00:00 2001 From: hojmark <1203136+hojmark@users.noreply.github.com> Date: Mon, 20 Jul 2026 22:50:05 +0200 Subject: [PATCH 02/14] revert-ish windows mac address parsing --- src/Scanning/Arp/WindowsArpTableProvider.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Scanning/Arp/WindowsArpTableProvider.cs b/src/Scanning/Arp/WindowsArpTableProvider.cs index 067f7593..f0e1b435 100644 --- a/src/Scanning/Arp/WindowsArpTableProvider.cs +++ b/src/Scanning/Arp/WindowsArpTableProvider.cs @@ -41,14 +41,13 @@ protected override ArpTable ReadSystemArpCache() { internal static ArpTable ParseArpOutput( TextReader reader ) { var map = new Dictionary(); - reader.ReadLine(); // Skip empty line - reader.ReadLine(); // Skip interface - reader.ReadLine(); // Skip header - while ( reader.ReadLine() is { } line ) { var parts = line.Split( (char[]?) null, StringSplitOptions.RemoveEmptyEntries ); - if ( parts[0].Count( c => c == '.' ) != 3 ) { // Should look like an IPv4 address + if ( + parts[0].Count( c => c == '.' ) != 3 && // Dots in an IPv4 address + parts[1].Count( c => c == '-' ) != 5 // Hyphens in a Windows MAC. E.g., 00-11-22-33-44-55 + ) { Console.Error.WriteLine( $"Skipping invalid ARP entry: {line}" ); continue; } From ad050bfd89af3443ec6c3af784a287c8b657d531 Mon Sep 17 00:00:00 2001 From: hojmark <1203136+hojmark@users.noreply.github.com> Date: Mon, 20 Jul 2026 22:53:48 +0200 Subject: [PATCH 03/14] f --- src/Scanning/Arp/WindowsArpTableProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Scanning/Arp/WindowsArpTableProvider.cs b/src/Scanning/Arp/WindowsArpTableProvider.cs index f0e1b435..4d4665e1 100644 --- a/src/Scanning/Arp/WindowsArpTableProvider.cs +++ b/src/Scanning/Arp/WindowsArpTableProvider.cs @@ -46,7 +46,7 @@ internal static ArpTable ParseArpOutput( TextReader reader ) { if ( parts[0].Count( c => c == '.' ) != 3 && // Dots in an IPv4 address - parts[1].Count( c => c == '-' ) != 5 // Hyphens in a Windows MAC. E.g., 00-11-22-33-44-55 + parts[1].Count( c => c == '-' ) != 5 // Hyphens in a Windows-reported MAC. E.g., 00-11-22-33-44-55 ) { Console.Error.WriteLine( $"Skipping invalid ARP entry: {line}" ); continue; From 4cdcabb80518642ee6abc6293f06e52ebd8e3483 Mon Sep 17 00:00:00 2001 From: hojmark <1203136+hojmark@users.noreply.github.com> Date: Mon, 20 Jul 2026 22:54:14 +0200 Subject: [PATCH 04/14] revert-ish linux mac address parsing --- src/Scanning/Arp/LinuxArpTableProvider.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Scanning/Arp/LinuxArpTableProvider.cs b/src/Scanning/Arp/LinuxArpTableProvider.cs index 7ed3697c..41c535a1 100644 --- a/src/Scanning/Arp/LinuxArpTableProvider.cs +++ b/src/Scanning/Arp/LinuxArpTableProvider.cs @@ -37,6 +37,15 @@ internal static ArpTable ParseArpOutput( TextReader reader ) { while ( reader.ReadLine() is { } line ) { var parts = line.Split( (char[]?) null, StringSplitOptions.RemoveEmptyEntries ); + + if ( + parts[0].Count( c => c == '.' ) != 3 && // Dots in an IPv4 address + parts[1].Count( c => c == ':' ) != 5 // Hyphens in a Linux-reported MAC. E.g., 00:11:22:33:44:55 + ) { + Console.Error.WriteLine( $"Skipping invalid ARP entry: {line}" ); + continue; + } + var ip = IPAddress.Parse( parts[0] ); var mac = new MacAddress( parts[3] ); map[ip] = mac; From 449714d00346a1d5a5fcf03bc0347d469868c5bc Mon Sep 17 00:00:00 2001 From: hojmark <1203136+hojmark@users.noreply.github.com> Date: Mon, 20 Jul 2026 22:55:13 +0200 Subject: [PATCH 05/14] delete stale comment --- src/Scanning/Arp/LinuxArpTableProvider.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Scanning/Arp/LinuxArpTableProvider.cs b/src/Scanning/Arp/LinuxArpTableProvider.cs index 41c535a1..e7b82252 100644 --- a/src/Scanning/Arp/LinuxArpTableProvider.cs +++ b/src/Scanning/Arp/LinuxArpTableProvider.cs @@ -1,4 +1,3 @@ -using System.Diagnostics; using System.Net; using System.Runtime.Versioning; using Drift.Domain.Device.Addresses; @@ -6,7 +5,6 @@ namespace Drift.Scanning.Arp; internal class LinuxArpTableProvider : ArpTableProviderBase { - // TODO read from /proc/net/arp instead of spawning processes [SupportedOSPlatform( "linux" )] protected override ArpTable ReadSystemArpCache() { const string procArpPath = "/proc/net/arp"; From 6a846e7246793fd77826f638a05698532c0e671b Mon Sep 17 00:00:00 2001 From: hojmark <1203136+hojmark@users.noreply.github.com> Date: Mon, 20 Jul 2026 22:55:54 +0200 Subject: [PATCH 06/14] extract constant --- src/Scanning/Arp/LinuxArpTableProvider.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Scanning/Arp/LinuxArpTableProvider.cs b/src/Scanning/Arp/LinuxArpTableProvider.cs index e7b82252..967df79a 100644 --- a/src/Scanning/Arp/LinuxArpTableProvider.cs +++ b/src/Scanning/Arp/LinuxArpTableProvider.cs @@ -5,15 +5,15 @@ namespace Drift.Scanning.Arp; internal class LinuxArpTableProvider : ArpTableProviderBase { + private const string ProcArpPath = "/proc/net/arp"; + [SupportedOSPlatform( "linux" )] protected override ArpTable ReadSystemArpCache() { - const string procArpPath = "/proc/net/arp"; - - if ( !File.Exists( procArpPath ) ) { - throw new FileNotFoundException( $"Path not found: {procArpPath}" ); + if ( !File.Exists( ProcArpPath ) ) { + throw new FileNotFoundException( $"Path not found: {ProcArpPath}" ); } - using var streamReader = new StreamReader( procArpPath ); + using var streamReader = new StreamReader( ProcArpPath ); return ParseArpOutput( streamReader ); } From 6d7dc19ac39b6871119194d195f21003380c75ad Mon Sep 17 00:00:00 2001 From: hojmark <1203136+hojmark@users.noreply.github.com> Date: Mon, 20 Jul 2026 22:56:09 +0200 Subject: [PATCH 07/14] f --- src/Scanning/Arp/LinuxArpTableProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Scanning/Arp/LinuxArpTableProvider.cs b/src/Scanning/Arp/LinuxArpTableProvider.cs index 967df79a..ab1479ae 100644 --- a/src/Scanning/Arp/LinuxArpTableProvider.cs +++ b/src/Scanning/Arp/LinuxArpTableProvider.cs @@ -19,7 +19,7 @@ protected override ArpTable ReadSystemArpCache() { } /// - /// Parses the output of /proc/net/arp into an . + /// Parses the contents of /proc/net/arp into an . /// /// /// Format: From f10c50d4cba6f72a616c0f9796201b7e0dd2f928 Mon Sep 17 00:00:00 2001 From: hojmark <1203136+hojmark@users.noreply.github.com> Date: Mon, 20 Jul 2026 22:56:27 +0200 Subject: [PATCH 08/14] f --- src/Scanning/Arp/LinuxArpTableProvider.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Scanning/Arp/LinuxArpTableProvider.cs b/src/Scanning/Arp/LinuxArpTableProvider.cs index ab1479ae..ba6ab7f3 100644 --- a/src/Scanning/Arp/LinuxArpTableProvider.cs +++ b/src/Scanning/Arp/LinuxArpTableProvider.cs @@ -31,8 +31,6 @@ protected override ArpTable ReadSystemArpCache() { internal static ArpTable ParseArpOutput( TextReader reader ) { var map = new Dictionary(); - reader.ReadLine(); // Skip header - while ( reader.ReadLine() is { } line ) { var parts = line.Split( (char[]?) null, StringSplitOptions.RemoveEmptyEntries ); From 0476f173a55ede3961d42b155f139911b50ecdea Mon Sep 17 00:00:00 2001 From: hojmark <1203136+hojmark@users.noreply.github.com> Date: Mon, 20 Jul 2026 22:56:46 +0200 Subject: [PATCH 09/14] f --- src/Scanning/Arp/LinuxArpTableProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Scanning/Arp/LinuxArpTableProvider.cs b/src/Scanning/Arp/LinuxArpTableProvider.cs index ba6ab7f3..e35cc732 100644 --- a/src/Scanning/Arp/LinuxArpTableProvider.cs +++ b/src/Scanning/Arp/LinuxArpTableProvider.cs @@ -36,7 +36,7 @@ internal static ArpTable ParseArpOutput( TextReader reader ) { if ( parts[0].Count( c => c == '.' ) != 3 && // Dots in an IPv4 address - parts[1].Count( c => c == ':' ) != 5 // Hyphens in a Linux-reported MAC. E.g., 00:11:22:33:44:55 + parts[1].Count( c => c == ':' ) != 5 // Semicolons in a Linux-reported MAC. E.g., 00:11:22:33:44:55 ) { Console.Error.WriteLine( $"Skipping invalid ARP entry: {line}" ); continue; From 11759906948c71d385f2c6691130963f6575ecef Mon Sep 17 00:00:00 2001 From: hojmark <1203136+hojmark@users.noreply.github.com> Date: Mon, 20 Jul 2026 22:57:11 +0200 Subject: [PATCH 10/14] workflow concurrency --- .github/workflows/ci.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index dcebc3c1..65a02899 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,6 +19,10 @@ on: - 'detailed' - 'diagnostic' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test-linux: name: 🐧 Test From 3c77b107b48d439a5c677fa236ba80dea647b09a Mon Sep 17 00:00:00 2001 From: hojmark <1203136+hojmark@users.noreply.github.com> Date: Mon, 20 Jul 2026 23:04:56 +0200 Subject: [PATCH 11/14] dotnet version from global.json --- .github/actions/setup-runner/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-runner/action.yml b/.github/actions/setup-runner/action.yml index b95a16c3..9664e02b 100644 --- a/.github/actions/setup-runner/action.yml +++ b/.github/actions/setup-runner/action.yml @@ -14,7 +14,7 @@ runs: - name: Set up .NET uses: actions/setup-dotnet@v5 with: - dotnet-version: ${{ env.DOTNET_VERSION }} + global-json-file: global.json - name: Restore .NET tools shell: bash From 1ee1e447383ea65cabef465d85a578e4df5bc22b Mon Sep 17 00:00:00 2001 From: hojmark <1203136+hojmark@users.noreply.github.com> Date: Mon, 20 Jul 2026 23:05:00 +0200 Subject: [PATCH 12/14] fix --- src/Scanning/Arp/LinuxArpTableProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Scanning/Arp/LinuxArpTableProvider.cs b/src/Scanning/Arp/LinuxArpTableProvider.cs index e35cc732..907affd8 100644 --- a/src/Scanning/Arp/LinuxArpTableProvider.cs +++ b/src/Scanning/Arp/LinuxArpTableProvider.cs @@ -36,7 +36,7 @@ internal static ArpTable ParseArpOutput( TextReader reader ) { if ( parts[0].Count( c => c == '.' ) != 3 && // Dots in an IPv4 address - parts[1].Count( c => c == ':' ) != 5 // Semicolons in a Linux-reported MAC. E.g., 00:11:22:33:44:55 + parts[3].Count( c => c == ':' ) != 5 // Semicolons in a Linux-reported MAC. E.g., 00:11:22:33:44:55 ) { Console.Error.WriteLine( $"Skipping invalid ARP entry: {line}" ); continue; From 21f61911c35e000e3ab18c3d4b5ce2827185b023 Mon Sep 17 00:00:00 2001 From: hojmark <1203136+hojmark@users.noreply.github.com> Date: Mon, 20 Jul 2026 23:12:47 +0200 Subject: [PATCH 13/14] windows fix --- src/Scanning/Arp/WindowsArpTableProvider.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Scanning/Arp/WindowsArpTableProvider.cs b/src/Scanning/Arp/WindowsArpTableProvider.cs index 4d4665e1..6c5bf201 100644 --- a/src/Scanning/Arp/WindowsArpTableProvider.cs +++ b/src/Scanning/Arp/WindowsArpTableProvider.cs @@ -42,6 +42,10 @@ internal static ArpTable ParseArpOutput( TextReader reader ) { var map = new Dictionary(); while ( reader.ReadLine() is { } line ) { + if ( string.IsNullOrWhiteSpace( line ) ) { + continue; + } + var parts = line.Split( (char[]?) null, StringSplitOptions.RemoveEmptyEntries ); if ( From 7df3668dcfc7e69c549088379cf692df3da1def5 Mon Sep 17 00:00:00 2001 From: hojmark <1203136+hojmark@users.noreply.github.com> Date: Mon, 20 Jul 2026 23:17:25 +0200 Subject: [PATCH 14/14] remove unnecessary env var --- .github/actions/setup-runner/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/setup-runner/action.yml b/.github/actions/setup-runner/action.yml index 9664e02b..aeb927f8 100644 --- a/.github/actions/setup-runner/action.yml +++ b/.github/actions/setup-runner/action.yml @@ -6,7 +6,6 @@ runs: - name: Set environment variables shell: bash run: | - echo "DOTNET_VERSION=10.x" >> $GITHUB_ENV echo "DOTNET_NOLOGO=false" >> $GITHUB_ENV echo "DOTNET_CLI_TELEMETRY_OPTOUT=true" >> $GITHUB_ENV echo "NUKE_TELEMETRY_OPTOUT=true" >> $GITHUB_ENV