[Osquery] Display scheduled actions in Osquery live queries view#253297
Draft
tomsonpl wants to merge 3 commits intoelastic:mainfrom
Draft
[Osquery] Display scheduled actions in Osquery live queries view#253297tomsonpl wants to merge 3 commits intoelastic:mainfrom
tomsonpl wants to merge 3 commits intoelastic:mainfrom
Conversation
…ry tracking Enable scheduled osquery packs and saved queries to appear in the Live Queries History page by creating tracking action documents in the space-aware osquery actions index.
# Conflicts: # x-pack/platform/plugins/shared/osquery/server/routes/pack/create_pack_route.ts # x-pack/platform/plugins/shared/osquery/server/routes/pack/update_pack_route.ts
Contributor
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Scheduled osquery packs and saved queries currently only produce result documents — no action or response documents are created. This makes them invisible in the Live Queries History page. This PR bridges that gap by:
action_id(UUIDv4) andstart_dateon pack create/update, persisted in the pack SO queries array and injected into the agent policy config for osquerybeat to correlate responses.logs-osquery_manager.actions-{spaceId}withinput_type: 'osquery_scheduled', enabling scheduled packs to appear in history alongside live queriesschedule_id(from SO id) andstart_date(fromcreated_at) in pack and saved query API responses — no new stored SO fields, no model version bump requiredaction_idreceive one on next updateosquery_scheduledactions, with a "Scheduled" badge and hidden re-run buttonHow it works
Key design decisions
.fleet-actions. Scheduled queries already run via policy config — Fleet actions would cause duplicate execution.logs-osquery_manager.actions-{spaceId}matching pack space isolationuser_idon scheduled action documents — these are system-driven recurring executionsUI
Test plan
.logs-osquery_manager.actions-{spaceId}action_idandstart_datein agent policy config via Fleet APIaction_id→ verify backfill creates action_ids and action document