mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Osquery] Fix Osquery plugin initialization (#99591)
This commit is contained in:
parent
dfe8637c52
commit
ec66797c7c
3 changed files with 27 additions and 13 deletions
|
@ -38,6 +38,14 @@ export function toggleOsqueryPlugin(
|
||||||
http: CoreStart['http'],
|
http: CoreStart['http'],
|
||||||
registerExtension?: StartPlugins['fleet']['registerExtension']
|
registerExtension?: StartPlugins['fleet']['registerExtension']
|
||||||
) {
|
) {
|
||||||
|
if (http.anonymousPaths.isAnonymous(window.location.pathname)) {
|
||||||
|
updater$.next(() => ({
|
||||||
|
status: AppStatus.inaccessible,
|
||||||
|
navLinkStatus: AppNavLinkStatus.hidden,
|
||||||
|
}));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
http
|
http
|
||||||
.fetch<GetPackagesResponse>(epmRouteService.getListPath(), { query: { experimental: true } })
|
.fetch<GetPackagesResponse>(epmRouteService.getListPath(), { query: { experimental: true } })
|
||||||
.then(({ response }) => {
|
.then(({ response }) => {
|
||||||
|
@ -134,22 +142,23 @@ export class OsqueryPlugin implements Plugin<OsqueryPluginSetup, OsqueryPluginSt
|
||||||
|
|
||||||
if (config.enabled) {
|
if (config.enabled) {
|
||||||
toggleOsqueryPlugin(this.appUpdater$, core.http, registerExtension);
|
toggleOsqueryPlugin(this.appUpdater$, core.http, registerExtension);
|
||||||
|
|
||||||
|
registerExtension({
|
||||||
|
package: OSQUERY_INTEGRATION_NAME,
|
||||||
|
view: 'package-policy-create',
|
||||||
|
component: LazyOsqueryManagedPolicyCreateImportExtension,
|
||||||
|
});
|
||||||
|
|
||||||
|
registerExtension({
|
||||||
|
package: OSQUERY_INTEGRATION_NAME,
|
||||||
|
view: 'package-policy-edit',
|
||||||
|
component: LazyOsqueryManagedPolicyEditExtension,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
registerExtension({
|
|
||||||
package: OSQUERY_INTEGRATION_NAME,
|
|
||||||
view: 'package-policy-create',
|
|
||||||
component: LazyOsqueryManagedPolicyCreateImportExtension,
|
|
||||||
});
|
|
||||||
|
|
||||||
registerExtension({
|
|
||||||
package: OSQUERY_INTEGRATION_NAME,
|
|
||||||
view: 'package-policy-edit',
|
|
||||||
component: LazyOsqueryManagedPolicyEditExtension,
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
this.appUpdater$.next(() => ({
|
this.appUpdater$.next(() => ({
|
||||||
status: AppStatus.inaccessible,
|
status: AppStatus.inaccessible,
|
||||||
|
navLinkStatus: AppNavLinkStatus.hidden,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -151,6 +151,11 @@ const ScheduledQueryGroupFormComponent: React.FC<ScheduledQueryGroupFormProps> =
|
||||||
// @ts-expect-error update types
|
// @ts-expect-error update types
|
||||||
draft.inputs[0].streams.forEach((stream) => {
|
draft.inputs[0].streams.forEach((stream) => {
|
||||||
delete stream.compiled_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;
|
return draft;
|
||||||
});
|
});
|
||||||
|
|
|
@ -43,7 +43,7 @@ export const buildResultsQuery = ({
|
||||||
aggs: {
|
aggs: {
|
||||||
count_by_agent_id: {
|
count_by_agent_id: {
|
||||||
terms: {
|
terms: {
|
||||||
field: 'agent.id',
|
field: 'elastic_agent.id',
|
||||||
size: 10000,
|
size: 10000,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue