-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Osquery] Fix support for disabled security (#110547)
- Loading branch information
1 parent
907a340
commit 4416a31
Showing
24 changed files
with
280 additions
and
115 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React, { useCallback, useMemo } from 'react'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { EuiButton } from '@elastic/eui'; | ||
|
||
import { KibanaPageTemplate } from '../../../../../src/plugins/kibana_react/public'; | ||
import { INTEGRATIONS_PLUGIN_ID } from '../../../fleet/common'; | ||
import { pagePathGetters } from '../../../fleet/public'; | ||
import { isModifiedEvent, isLeftClickEvent, useKibana } from '../common/lib/kibana'; | ||
import { OsqueryIcon } from './osquery_icon'; | ||
import { useBreadcrumbs } from '../common/hooks/use_breadcrumbs'; | ||
import { OSQUERY_INTEGRATION_NAME } from '../../common'; | ||
|
||
const OsqueryAppEmptyStateComponent = () => { | ||
useBreadcrumbs('base'); | ||
|
||
const { | ||
application: { getUrlForApp, navigateToApp }, | ||
} = useKibana().services; | ||
|
||
const integrationHref = useMemo(() => { | ||
return getUrlForApp(INTEGRATIONS_PLUGIN_ID, { | ||
path: pagePathGetters.integration_details_overview({ | ||
pkgkey: OSQUERY_INTEGRATION_NAME, | ||
})[1], | ||
}); | ||
}, [getUrlForApp]); | ||
|
||
const integrationClick = useCallback( | ||
(event) => { | ||
if (!isModifiedEvent(event) && isLeftClickEvent(event)) { | ||
event.preventDefault(); | ||
return navigateToApp(INTEGRATIONS_PLUGIN_ID, { | ||
path: pagePathGetters.integration_details_overview({ | ||
pkgkey: OSQUERY_INTEGRATION_NAME, | ||
})[1], | ||
}); | ||
} | ||
}, | ||
[navigateToApp] | ||
); | ||
|
||
const pageHeader = useMemo( | ||
() => ({ | ||
iconType: OsqueryIcon, | ||
pageTitle: ( | ||
<FormattedMessage | ||
id="xpack.osquery.emptyState.pageTitle" | ||
defaultMessage="Add Osquery Manager" | ||
/> | ||
), | ||
description: ( | ||
<FormattedMessage | ||
id="xpack.osquery.emptyState.pageDescription" | ||
defaultMessage="Add this integration to run and schedule queries for Elastic Agent." | ||
/> | ||
), | ||
rightSideItems: [ | ||
// eslint-disable-next-line @elastic/eui/href-or-on-click | ||
<EuiButton | ||
key="button" | ||
fill | ||
href={integrationHref} | ||
onClick={integrationClick} | ||
iconType="plusInCircleFilled" | ||
> | ||
<FormattedMessage | ||
id="xpack.osquery.emptyState.addOsqueryManagerButton" | ||
defaultMessage="Add Osquery Manager" | ||
/> | ||
</EuiButton>, | ||
], | ||
}), | ||
[integrationClick, integrationHref] | ||
); | ||
|
||
return <KibanaPageTemplate isEmptyState={true} pageHeader={pageHeader} />; | ||
}; | ||
|
||
export const OsqueryAppEmptyState = React.memo(OsqueryAppEmptyStateComponent); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
*/ | ||
|
||
export const SAVED_QUERIES_ID = 'savedQueryList'; | ||
export const SAVED_QUERY_ID = 'savedQuery'; |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.