diff --git a/audit/internal/platform/sat.go b/audit/internal/platform/sat.go index 13773a3..986b7f5 100644 --- a/audit/internal/platform/sat.go +++ b/audit/internal/platform/sat.go @@ -12,6 +12,7 @@ import ( "os" "os/exec" "path/filepath" + "syscall" "sort" "strconv" "strings" @@ -531,6 +532,13 @@ func runSATCommandCtx(ctx context.Context, verboseLog, name string, cmd []string } c := exec.CommandContext(ctx, resolvedCmd[0], resolvedCmd[1:]...) + c.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} + c.Cancel = func() error { + if c.Process != nil { + _ = syscall.Kill(-c.Process.Pid, syscall.SIGKILL) + } + return nil + } if len(env) > 0 { c.Env = append(os.Environ(), env...) }