Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't run the initial runner, regardless of launcher flags #1568

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/osquery/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func NewExtension(ctx context.Context, client service.KolideService, k types.Kna
slogger: k.Slogger().With("component", "initial_runner"),
identifier: identifier,
store: k.InitialResultsStore(),
enabled: opts.RunDifferentialQueriesImmediately,
enabled: false, // currently, we don't want to run the initial runner, even if the flag is set
}

return &Extension{
Expand Down
9 changes: 6 additions & 3 deletions pkg/osquery/initial-runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ type initialRunner struct {
}

func (i *initialRunner) Execute(configBlob string, writeFn func(ctx context.Context, l logger.LogType, results []string, reeenroll bool) error) error {
if !i.enabled {
i.slogger.Log(context.TODO(), slog.LevelDebug,
"initial runner not enabled",
)
return nil
}
var config OsqueryConfig
if err := json.Unmarshal([]byte(configBlob), &config); err != nil {
return fmt.Errorf("unmarshal osquery config blob: %w", err)
Expand All @@ -48,9 +54,6 @@ func (i *initialRunner) Execute(configBlob string, writeFn func(ctx context.Cont

var initialRunResults []OsqueryResultLog
for packName, pack := range config.Packs {
if !i.enabled { // only execute them when the plugin is enabled.
break
}
for query, queryContent := range pack.Queries {
queryName := fmt.Sprintf("pack:%s:%s", packName, query)
if _, ok := toRun[queryName]; !ok {
Expand Down
Loading