From ad136a84c0257cae43318c9fbed14ff4bb023b7e Mon Sep 17 00:00:00 2001 From: Rebecca Mahany-Horton Date: Thu, 22 Feb 2024 12:20:49 -0500 Subject: [PATCH] Add env vars to Kolide processes in checkup (#1616) --- ee/debug/checkups/processes.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ee/debug/checkups/processes.go b/ee/debug/checkups/processes.go index df5ec94cc..ef1ea61be 100644 --- a/ee/debug/checkups/processes.go +++ b/ee/debug/checkups/processes.go @@ -56,6 +56,13 @@ func (c *Processes) Run(ctx context.Context, fullWriter io.Writer) error { exe, _ := p.Exe() if strings.Contains(strings.ToLower(exe), "kolide") { c.kolideCount += 1 + + // Grab ENV vars if available -- we ignore the error because we expect + // this function to return `ErrNotImplementedError` on darwin + if envVars, err := p.EnvironWithContext(ctx); err == nil { + pMap["env"] = strings.Join(envVars, " ") + } + c.data[fmt.Sprintf("%d", p.Pid)] = pMap if !c.kolideRunningAsRoot {