Skip to content

Commit

Permalink
Move osquery extension management into osquery instance (#1927)
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany authored Oct 30, 2024
1 parent 9ae6142 commit 9262ceb
Show file tree
Hide file tree
Showing 6 changed files with 253 additions and 246 deletions.
68 changes: 0 additions & 68 deletions cmd/launcher/extension.go

This file was deleted.

15 changes: 1 addition & 14 deletions cmd/launcher/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ import (
"github.com/kolide/launcher/pkg/service"
"github.com/kolide/launcher/pkg/traces"
"github.com/kolide/launcher/pkg/traces/exporter"
"github.com/osquery/osquery-go/plugin/config"
"github.com/osquery/osquery-go/plugin/distributed"
osquerylogger "github.com/osquery/osquery-go/plugin/logger"

"go.etcd.io/bbolt"
)
Expand Down Expand Up @@ -362,15 +359,10 @@ func runLauncher(ctx context.Context, cancel func(), multiSlogger, systemMultiSl
return fmt.Errorf("error initializing osquery instance history: %w", err)
}

// create the osquery extension
extension, err := createExtensionRuntime(ctx, k, client)
if err != nil {
return fmt.Errorf("create extension with runtime: %w", err)
}
runGroup.Add("osqueryExtension", extension.Execute, extension.Shutdown)
// create the runner that will launch osquery
osqueryRunner := osqueryruntime.New(
k,
client,
osqueryruntime.WithStdout(kolidelog.NewOsqueryLogAdapter(
k.Slogger().With(
"component", "osquery",
Expand All @@ -388,11 +380,6 @@ func runLauncher(ctx context.Context, cancel func(), multiSlogger, systemMultiSl
kolidelog.WithLevel(slog.LevelInfo),
)),
osqueryruntime.WithAugeasLensFunction(augeas.InstallLenses),
osqueryruntime.WithOsqueryExtensionPlugins(
config.NewPlugin(osqueryruntime.KolideSaasExtensionName, extension.GenerateConfigs),
distributed.NewPlugin(osqueryruntime.KolideSaasExtensionName, extension.GetQueries, extension.WriteResults),
osquerylogger.NewPlugin(osqueryruntime.KolideSaasExtensionName, extension.LogString),
),
)
runGroup.Add("osqueryRunner", osqueryRunner.Run, osqueryRunner.Interrupt)

Expand Down
Loading

0 comments on commit 9262ceb

Please sign in to comment.