mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -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'],
|
||||
registerExtension?: StartPlugins['fleet']['registerExtension']
|
||||
) {
|
||||
if (http.anonymousPaths.isAnonymous(window.location.pathname)) {
|
||||
updater$.next(() => ({
|
||||
status: AppStatus.inaccessible,
|
||||
navLinkStatus: AppNavLinkStatus.hidden,
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
http
|
||||
.fetch<GetPackagesResponse>(epmRouteService.getListPath(), { query: { experimental: true } })
|
||||
.then(({ response }) => {
|
||||
|
@ -134,22 +142,23 @@ export class OsqueryPlugin implements Plugin<OsqueryPluginSetup, OsqueryPluginSt
|
|||
|
||||
if (config.enabled) {
|
||||
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 {
|
||||
this.appUpdater$.next(() => ({
|
||||
status: AppStatus.inaccessible,
|
||||
navLinkStatus: AppNavLinkStatus.hidden,
|
||||
}));
|
||||
}
|
||||
|
||||
|
|
|
@ -151,6 +151,11 @@ const ScheduledQueryGroupFormComponent: React.FC<ScheduledQueryGroupFormProps> =
|
|||
// @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;
|
||||
});
|
||||
|
|
|
@ -43,7 +43,7 @@ export const buildResultsQuery = ({
|
|||
aggs: {
|
||||
count_by_agent_id: {
|
||||
terms: {
|
||||
field: 'agent.id',
|
||||
field: 'elastic_agent.id',
|
||||
size: 10000,
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue