From c65d596099243a2f19b907c3097bec725346ab97 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Thu, 4 Dec 2025 13:40:31 +0100 Subject: [PATCH] Add sudo for nftables query command Update nftables port collector to use sudo when querying ruleset. Requires corresponding sudoers configuration in NixOS. - Change nft command to use sudo - Update version to v0.1.248 --- agent/Cargo.toml | 2 +- agent/src/collectors/systemd.rs | 2 +- dashboard/Cargo.toml | 2 +- shared/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/agent/Cargo.toml b/agent/Cargo.toml index 19759f7..bb570b4 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-agent" -version = "0.1.247" +version = "0.1.248" edition = "2021" [dependencies] diff --git a/agent/src/collectors/systemd.rs b/agent/src/collectors/systemd.rs index d23c62a..cb51252 100644 --- a/agent/src/collectors/systemd.rs +++ b/agent/src/collectors/systemd.rs @@ -915,7 +915,7 @@ impl SystemdCollector { /// Returns: (tcp_ports_string, udp_ports_string) fn get_nftables_open_ports(&self) -> (String, String) { let output = Command::new("timeout") - .args(&["3", "nft", "list", "ruleset"]) + .args(&["3", "sudo", "nft", "list", "ruleset"]) .output(); let output = match output { diff --git a/dashboard/Cargo.toml b/dashboard/Cargo.toml index 4234559..30e67f1 100644 --- a/dashboard/Cargo.toml +++ b/dashboard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard" -version = "0.1.247" +version = "0.1.248" edition = "2021" [dependencies] diff --git a/shared/Cargo.toml b/shared/Cargo.toml index 8a602eb..7748d6f 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-shared" -version = "0.1.247" +version = "0.1.248" edition = "2021" [dependencies]