From e0b01a5abdeb3bd5969de2919f341bc97b55a656 Mon Sep 17 00:00:00 2001 From: Jakob Beckmann Date: Wed, 2 Oct 2024 07:34:23 +0200 Subject: [PATCH 1/3] feat: introduce osquery_flag to agent --- modules/kolide-launcher/default.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/modules/kolide-launcher/default.nix b/modules/kolide-launcher/default.nix index 40dbff4..3639df0 100644 --- a/modules/kolide-launcher/default.nix +++ b/modules/kolide-launcher/default.nix @@ -87,6 +87,14 @@ in ''; }; + osQueryFlags = mkOption { + type = types.listOf types.str; + default = []; + description = '' + OsQuery flagsto pass via the agent. + ''; + }; + localdevPath = mkOption { type = types.nullOr types.path; default = null; @@ -124,10 +132,11 @@ in "--autoupdate_interval ${cfg.autoupdateInterval}" "--autoupdater_initial_delay ${cfg.autoupdaterInitialDelay}" ] - ++ optional cfg.insecureTransport "--insecure_transport" - ++ optional cfg.insecureTLS "--insecure" - ++ optional (!builtins.isNull cfg.localdevPath) "--localdev_path ${cfg.localdevPath}" - ); + ++ optional cfg.insecureTransport "--insecure_transport" + ++ optional cfg.insecureTLS "--insecure" + ++ optional (!builtins.isNull cfg.localdevPath) "--localdev_path ${cfg.localdevPath}" + ++ map (x: "--osquery_flag ${x}") cfg.osQueryFlags + ); Restart = "on-failure"; RestartSec = 3; }; From 3a3e6ff03bb48036df3886bf524f295a19cb3df8 Mon Sep 17 00:00:00 2001 From: Jakob Beckmann Date: Wed, 2 Oct 2024 17:07:59 +0200 Subject: [PATCH 2/3] fix: remove typo in osQueryFlag option description --- modules/kolide-launcher/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/kolide-launcher/default.nix b/modules/kolide-launcher/default.nix index 3639df0..00b1142 100644 --- a/modules/kolide-launcher/default.nix +++ b/modules/kolide-launcher/default.nix @@ -91,7 +91,7 @@ in type = types.listOf types.str; default = []; description = '' - OsQuery flagsto pass via the agent. + OsQuery flags to pass via the agent. ''; }; From 287f96ebed19199fe09a622f50dd5c6b2ea4353b Mon Sep 17 00:00:00 2001 From: Jakob Beckmann Date: Wed, 2 Oct 2024 17:14:02 +0200 Subject: [PATCH 3/3] fix: add suggestions on description and option name for osqueryFlag Helped-by: Rebecca Mahany-Horton --- modules/kolide-launcher/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/kolide-launcher/default.nix b/modules/kolide-launcher/default.nix index 00b1142..75bf97a 100644 --- a/modules/kolide-launcher/default.nix +++ b/modules/kolide-launcher/default.nix @@ -87,11 +87,11 @@ in ''; }; - osQueryFlags = mkOption { + osqueryFlags = mkOption { type = types.listOf types.str; default = []; description = '' - OsQuery flags to pass via the agent. + Flags to pass to osquery (possibly overriding Launcher defaults). ''; }; @@ -135,7 +135,7 @@ in ++ optional cfg.insecureTransport "--insecure_transport" ++ optional cfg.insecureTLS "--insecure" ++ optional (!builtins.isNull cfg.localdevPath) "--localdev_path ${cfg.localdevPath}" - ++ map (x: "--osquery_flag ${x}") cfg.osQueryFlags + ++ map (x: "--osquery_flag ${x}") cfg.osqueryFlags ); Restart = "on-failure"; RestartSec = 3;