diff --git a/x-pack/plugins/osquery/public/plugin.ts b/x-pack/plugins/osquery/public/plugin.ts index c0a097cb3ba2..d1e7154fb0dc 100644 --- a/x-pack/plugins/osquery/public/plugin.ts +++ b/x-pack/plugins/osquery/public/plugin.ts @@ -38,6 +38,14 @@ export function toggleOsqueryPlugin( http: CoreStart['http'], registerExtension?: StartPlugins['fleet']['registerExtension'] ) { + if (http.anonymousPaths.isAnonymous(window.location.pathname)) { + updater$.next(() => ({ + status: AppStatus.inaccessible, + navLinkStatus: AppNavLinkStatus.hidden, + })); + return; + } + http .fetch(epmRouteService.getListPath(), { query: { experimental: true } }) .then(({ response }) => { @@ -134,22 +142,23 @@ export class OsqueryPlugin implements Plugin ({ status: AppStatus.inaccessible, + navLinkStatus: AppNavLinkStatus.hidden, })); } diff --git a/x-pack/plugins/osquery/public/scheduled_query_groups/form/index.tsx b/x-pack/plugins/osquery/public/scheduled_query_groups/form/index.tsx index 68652e13bed0..8924a61d181b 100644 --- a/x-pack/plugins/osquery/public/scheduled_query_groups/form/index.tsx +++ b/x-pack/plugins/osquery/public/scheduled_query_groups/form/index.tsx @@ -151,6 +151,11 @@ const ScheduledQueryGroupFormComponent: React.FC = // @ts-expect-error update types draft.inputs[0].streams.forEach((stream) => { delete stream.compiled_stream; + + // we don't want to send id as null when creating the policy + if (stream.id == null) { + delete stream.id; + } }); return draft; }); diff --git a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/results/query.all_results.dsl.ts b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/results/query.all_results.dsl.ts index 6ef00b0ea305..b560fd3c364e 100644 --- a/x-pack/plugins/osquery/server/search_strategy/osquery/factory/results/query.all_results.dsl.ts +++ b/x-pack/plugins/osquery/server/search_strategy/osquery/factory/results/query.all_results.dsl.ts @@ -43,7 +43,7 @@ export const buildResultsQuery = ({ aggs: { count_by_agent_id: { terms: { - field: 'agent.id', + field: 'elastic_agent.id', size: 10000, }, },