diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index aa6530abd6f12..be74b017c4571 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -50,6 +50,7 @@ test/plugin_functional/plugins/app_link_test @elastic/kibana-core x-pack/test/usage_collection/plugins/application_usage_test @elastic/kibana-core x-pack/plugins/observability_solution/assets_data_access @elastic/obs-knowledge-team x-pack/test/security_api_integration/plugins/audit_log @elastic/kibana-security +packages/kbn-avc-banner @elastic/security-defend-workflows packages/kbn-axe-config @elastic/kibana-qa packages/kbn-babel-preset @elastic/kibana-operations packages/kbn-babel-register @elastic/kibana-operations diff --git a/.i18nrc.json b/.i18nrc.json index bab7cdc68d81d..59e33320eeea1 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -7,6 +7,7 @@ "alertingTypes": "packages/kbn-alerting-types", "apmOss": "src/plugins/apm_oss", "autocomplete": "packages/kbn-securitysolution-autocomplete/src", + "avcBanner": "packages/kbn-avc-banner/src", "bfetch": "src/plugins/bfetch", "bfetchError": "packages/kbn-bfetch-error", "cases": ["packages/kbn-cases-components"], diff --git a/package.json b/package.json index 8a60fbbe8da8c..273fcefd0db3a 100644 --- a/package.json +++ b/package.json @@ -180,6 +180,7 @@ "@kbn/application-usage-test-plugin": "link:x-pack/test/usage_collection/plugins/application_usage_test", "@kbn/assets-data-access-plugin": "link:x-pack/plugins/observability_solution/assets_data_access", "@kbn/audit-log-plugin": "link:x-pack/test/security_api_integration/plugins/audit_log", + "@kbn/avc-banner": "link:packages/kbn-avc-banner", "@kbn/banners-plugin": "link:x-pack/plugins/banners", "@kbn/bfetch-error": "link:packages/kbn-bfetch-error", "@kbn/bfetch-explorer-plugin": "link:examples/bfetch_explorer", diff --git a/packages/kbn-avc-banner/README.md b/packages/kbn-avc-banner/README.md new file mode 100644 index 0000000000000..3a5ea8c089a4a --- /dev/null +++ b/packages/kbn-avc-banner/README.md @@ -0,0 +1,3 @@ +# @kbn/avc-banner + +`@kbn/avc-banner` is the callout component to showcase the AVC 2024 results Elastic Security recently received for our native Endpoint and encourage users to install Elastic Defend/Endpoint. This package should be delted at EOY 2024. \ No newline at end of file diff --git a/packages/kbn-avc-banner/index.ts b/packages/kbn-avc-banner/index.ts new file mode 100644 index 0000000000000..de0577ee3ed83 --- /dev/null +++ b/packages/kbn-avc-banner/index.ts @@ -0,0 +1,9 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export * from './src'; diff --git a/packages/kbn-avc-banner/jest.config.js b/packages/kbn-avc-banner/jest.config.js new file mode 100644 index 0000000000000..8886c66ec80e7 --- /dev/null +++ b/packages/kbn-avc-banner/jest.config.js @@ -0,0 +1,13 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../..', + roots: ['/packages/kbn-avc-banner'], +}; diff --git a/packages/kbn-avc-banner/kibana.jsonc b/packages/kbn-avc-banner/kibana.jsonc new file mode 100644 index 0000000000000..51269b1b2e76b --- /dev/null +++ b/packages/kbn-avc-banner/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-browser", + "id": "@kbn/avc-banner", + "owner": "@elastic/security-defend-workflows" +} diff --git a/packages/kbn-avc-banner/package.json b/packages/kbn-avc-banner/package.json new file mode 100644 index 0000000000000..f01617945592d --- /dev/null +++ b/packages/kbn-avc-banner/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/avc-banner", + "private": true, + "version": "1.0.0", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/kbn-avc-banner/src/avc_banner_background.svg b/packages/kbn-avc-banner/src/avc_banner_background.svg new file mode 100644 index 0000000000000..57b0f91a419e9 --- /dev/null +++ b/packages/kbn-avc-banner/src/avc_banner_background.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/kbn-avc-banner/src/custom.d.ts b/packages/kbn-avc-banner/src/custom.d.ts new file mode 100644 index 0000000000000..9169166fe7af9 --- /dev/null +++ b/packages/kbn-avc-banner/src/custom.d.ts @@ -0,0 +1,13 @@ +/* + * 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 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +declare module '*.svg' { + const content: string; + // eslint-disable-next-line import/no-default-export + export default content; +} diff --git a/x-pack/plugins/security_solution/public/common/components/avc_banner/avc_results_banner_2024.tsx b/packages/kbn-avc-banner/src/index.tsx similarity index 73% rename from x-pack/plugins/security_solution/public/common/components/avc_banner/avc_results_banner_2024.tsx rename to packages/kbn-avc-banner/src/index.tsx index 0c73af1ef4861..54ded0bfdd49d 100644 --- a/x-pack/plugins/security_solution/public/common/components/avc_banner/avc_results_banner_2024.tsx +++ b/packages/kbn-avc-banner/src/index.tsx @@ -1,8 +1,9 @@ /* * 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. + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. */ import React from 'react'; @@ -10,13 +11,13 @@ import { css } from '@emotion/css'; import { i18n } from '@kbn/i18n'; import { EuiButton, EuiCallOut, EuiSpacer, useEuiTheme } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import { useKibana } from '../../lib/kibana'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; import avcBannerBackground from './avc_banner_background.svg'; export const AVCResultsBanner2024: React.FC<{ onDismiss: () => void }> = ({ onDismiss }) => { const { docLinks } = useKibana().services; const { euiTheme } = useEuiTheme(); - const bannerTitle = i18n.translate('xpack.securitySolution.common.avcResultsBanner.title', { + const bannerTitle = i18n.translate('avcBanner.title', { defaultMessage: '100% protection with zero false positives.', }); @@ -38,20 +39,18 @@ export const AVCResultsBanner2024: React.FC<{ onDismiss: () => void }> = ({ onDi data-test-subj="avcResultsBanner" > - + ); diff --git a/packages/kbn-avc-banner/tsconfig.json b/packages/kbn-avc-banner/tsconfig.json new file mode 100644 index 0000000000000..b75e84d57cf72 --- /dev/null +++ b/packages/kbn-avc-banner/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/kibana-react-plugin", + ] +} diff --git a/tsconfig.base.json b/tsconfig.base.json index bbd855176c35a..d34fd26a23723 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -94,6 +94,8 @@ "@kbn/assets-data-access-plugin/*": ["x-pack/plugins/observability_solution/assets_data_access/*"], "@kbn/audit-log-plugin": ["x-pack/test/security_api_integration/plugins/audit_log"], "@kbn/audit-log-plugin/*": ["x-pack/test/security_api_integration/plugins/audit_log/*"], + "@kbn/avc-banner": ["packages/kbn-avc-banner"], + "@kbn/avc-banner/*": ["packages/kbn-avc-banner/*"], "@kbn/axe-config": ["packages/kbn-axe-config"], "@kbn/axe-config/*": ["packages/kbn-axe-config/*"], "@kbn/babel-preset": ["packages/kbn-babel-preset"], diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/avc_banner/avc_banner_background.svg b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/avc_banner/avc_banner_background.svg deleted file mode 100644 index cd37f26c95f7b..0000000000000 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/avc_banner/avc_banner_background.svg +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/avc_banner/avc_results_banner_2024.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/avc_banner/avc_results_banner_2024.tsx deleted file mode 100644 index 63a3f68254c6c..0000000000000 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/avc_banner/avc_results_banner_2024.tsx +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 from 'react'; -import { css } from '@emotion/css'; -import { i18n } from '@kbn/i18n'; -import { EuiButton, EuiCallOut, EuiSpacer, useEuiTheme } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { useKibana } from '@kbn/kibana-react-plugin/public'; - -import avcBannerBackground from './avc_banner_background.svg'; - -export const AVCResultsBanner2024: React.FC<{ onDismiss: () => void }> = ({ onDismiss }) => { - const { docLinks } = useKibana().services; - const { euiTheme } = useEuiTheme(); - const bannerTitle = i18n.translate( - 'xpack.fleet.integrations.epm.elasticDefend.avcResultsBanner.title', - { - defaultMessage: '100% protection with zero false positives.', - } - ); - - const calloutStyles = css({ - paddingLeft: `${euiTheme.size.xl}`, - backgroundImage: `url(${avcBannerBackground})`, - backgroundRepeat: 'no-repeat', - backgroundPositionX: 'right', - backgroundPositionY: 'bottom', - }); - - return ( - - - - - - - - ); -}; diff --git a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/overview.tsx b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/overview.tsx index f9c2d80d3336e..2859b0ff7d8ae 100644 --- a/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/overview.tsx +++ b/x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/overview/overview.tsx @@ -22,6 +22,8 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { AVCResultsBanner2024 } from '@kbn/avc-banner'; + import { isIntegrationPolicyTemplate, isPackagePrerelease, @@ -40,8 +42,6 @@ import { SideBarColumn } from '../../../components/side_bar_column'; import type { FleetStartServices } from '../../../../../../../plugin'; -import { AVCResultsBanner2024 } from './avc_banner/avc_results_banner_2024'; - import { Screenshots } from './screenshots'; import { Readme } from './readme'; import { Details } from './details'; diff --git a/x-pack/plugins/fleet/tsconfig.json b/x-pack/plugins/fleet/tsconfig.json index 755f891e434ab..62ee9dce52994 100644 --- a/x-pack/plugins/fleet/tsconfig.json +++ b/x-pack/plugins/fleet/tsconfig.json @@ -112,5 +112,6 @@ "@kbn/integration-assistant-plugin", "@kbn/core-security-server-mocks", "@kbn/server-http-tools", + "@kbn/avc-banner", ] } diff --git a/x-pack/plugins/security_solution/public/common/components/avc_banner/avc_banner_background.svg b/x-pack/plugins/security_solution/public/common/components/avc_banner/avc_banner_background.svg deleted file mode 100644 index cd37f26c95f7b..0000000000000 --- a/x-pack/plugins/security_solution/public/common/components/avc_banner/avc_banner_background.svg +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/onboarding.tsx b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/onboarding.tsx index c19f03f63461d..571d4e59a89e6 100644 --- a/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/onboarding.tsx +++ b/x-pack/plugins/security_solution/public/common/components/landing_page/onboarding/onboarding.tsx @@ -6,6 +6,7 @@ */ import React, { useCallback, useMemo, useState } from 'react'; +import { AVCResultsBanner2024 } from '@kbn/avc-banner'; import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { TogglePanel } from './toggle_panel'; @@ -24,7 +25,6 @@ import type { StepId } from './types'; import { useOnboardingStyles } from './styles/onboarding.styles'; import { useKibana } from '../../../lib/kibana'; import type { OnboardingHubStepLinkClickedParams } from '../../../lib/telemetry/events/onboarding/types'; -import { AVCResultsBanner2024 } from '../../avc_banner/avc_results_banner_2024'; interface OnboardingProps { indicesExist?: boolean; diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json index 001a6e1b72d4b..ba89ca2864d74 100644 --- a/x-pack/plugins/security_solution/tsconfig.json +++ b/x-pack/plugins/security_solution/tsconfig.json @@ -207,5 +207,6 @@ "@kbn/core-i18n-browser", "@kbn/core-theme-browser", "@kbn/integration-assistant-plugin", + "@kbn/avc-banner", ] } diff --git a/yarn.lock b/yarn.lock index beacb66f76287..8ac472b61baf8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3438,6 +3438,10 @@ version "0.0.0" uid "" +"@kbn/avc-banner@link:packages/kbn-avc-banner": + version "0.0.0" + uid "" + "@kbn/axe-config@link:packages/kbn-axe-config": version "0.0.0" uid ""