[8.18] [Siem Migrations] Translated Rules Upsell Page (#212777) (#213443)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Siem Migrations] Translated Rules Upsell Page
(#212777)](https://github.com/elastic/kibana/pull/212777)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Jatin
Kathuria","email":"jatin.kathuria@elastic.co"},"sourceCommit":{"committedDate":"2025-03-05T14:53:26Z","message":"[Siem
Migrations] Translated Rules Upsell Page (#212777)\n\n## Summary\n\nThis
PR adds the Upsell for `Translated Rules` Page as
per\n[design](https://www.figma.com/design/BD9GZZz6y8pfSbubAt5H2W/%5B8.18%5D-GenAI-Powered-SIEM-Migration%3A-Rule-translation?node-id=63-81202&p=f&t=oJug1zebtufPlNKM-0).\n\n\nBelow
is the Demo for the
same.\n\n|Instance|Demo|\n|---|---|\n|ESS|<video\nsrc=\"767d8409-a391-41b8-b4d1-1c838dffc363\"/>|\n\n\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n\n### Identify
risks\n\nDoes this PR introduce any risks? For example, consider risks
like hard\nto test bugs, performance regression, potential of data
loss.\n\nDescribe the risk, its severity, and mitigation for each
identified\nrisk. Invite stakeholders and evaluate how to proceed before
merging.\n\n- [ ] [See some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"197a281bf918ca021979dc1c948730fe99fd07de","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat
Hunting","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Siem
Migrations] Translated Rules Upsell
Page","number":212777,"url":"https://github.com/elastic/kibana/pull/212777","mergeCommit":{"message":"[Siem
Migrations] Translated Rules Upsell Page (#212777)\n\n## Summary\n\nThis
PR adds the Upsell for `Translated Rules` Page as
per\n[design](https://www.figma.com/design/BD9GZZz6y8pfSbubAt5H2W/%5B8.18%5D-GenAI-Powered-SIEM-Migration%3A-Rule-translation?node-id=63-81202&p=f&t=oJug1zebtufPlNKM-0).\n\n\nBelow
is the Demo for the
same.\n\n|Instance|Demo|\n|---|---|\n|ESS|<video\nsrc=\"767d8409-a391-41b8-b4d1-1c838dffc363\"/>|\n\n\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n\n### Identify
risks\n\nDoes this PR introduce any risks? For example, consider risks
like hard\nto test bugs, performance regression, potential of data
loss.\n\nDescribe the risk, its severity, and mitigation for each
identified\nrisk. Invite stakeholders and evaluate how to proceed before
merging.\n\n- [ ] [See some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"197a281bf918ca021979dc1c948730fe99fd07de"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/213253","number":213253,"state":"MERGED","mergeCommit":{"sha":"9bb526a47cab552091b7db8d9edddac7c1b2300f","message":"[9.0]
[Siem Migrations] Translated Rules Upsell Page (#212777) (#213253)\n\n#
Backport\n\nThis will backport the following commits from `main` to
`9.0`:\n- [[Siem Migrations] Translated Rules Upsell
Page\n(#212777)](https://github.com/elastic/kibana/pull/212777)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Jatin Kathuria
<jatin.kathuria@elastic.co>"}},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212777","number":212777,"mergeCommit":{"message":"[Siem
Migrations] Translated Rules Upsell Page (#212777)\n\n## Summary\n\nThis
PR adds the Upsell for `Translated Rules` Page as
per\n[design](https://www.figma.com/design/BD9GZZz6y8pfSbubAt5H2W/%5B8.18%5D-GenAI-Powered-SIEM-Migration%3A-Rule-translation?node-id=63-81202&p=f&t=oJug1zebtufPlNKM-0).\n\n\nBelow
is the Demo for the
same.\n\n|Instance|Demo|\n|---|---|\n|ESS|<video\nsrc=\"767d8409-a391-41b8-b4d1-1c838dffc363\"/>|\n\n\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n\n### Identify
risks\n\nDoes this PR introduce any risks? For example, consider risks
like hard\nto test bugs, performance regression, potential of data
loss.\n\nDescribe the risk, its severity, and mitigation for each
identified\nrisk. Invite stakeholders and evaluate how to proceed before
merging.\n\n- [ ] [See some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"197a281bf918ca021979dc1c948730fe99fd07de"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
This commit is contained in:
Jatin Kathuria 2025-03-11 13:11:30 +01:00 committed by GitHub
parent 0834cb6504
commit 85089b2030
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 241 additions and 3 deletions

View file

@ -79,3 +79,10 @@ export const PREBUILT_RULE_CUSTOMIZATION_DESCRIPTION = (
},
}
);
export const SIEM_MIGRATION_MANAGER_LICENSE_BTN = i18n.translate(
'securitySolutionPackages.upselling.siemMigrations.manageLicenseBtn',
{
defaultMessage: 'Manage license',
}
);

View file

@ -0,0 +1,50 @@
/*
* 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 { SiemMigrationsTranslatedRulesUpsellPage } from './siem_migrations_translated_rules';
import { render, screen } from '@testing-library/react';
describe('SiemMigrationsTranslatedRulesUpsellPage', () => {
it('should render the component with all sections correctly', () => {
render(
<SiemMigrationsTranslatedRulesUpsellPage
title="title"
upgradeMessage="upgradeMessage"
upgradeHref="https://upgrade.Href"
/>
);
expect(screen.getByTestId('siemMigrationTranslatedRulesUpsellButton')).toBeVisible();
expect(screen.getByTestId('siemMigrationTranslatedRulesUpsellTitle')).toBeVisible();
expect(screen.getByTestId('siemMigrationTranslatedRulesUpsellTitle')).toHaveTextContent(
'title'
);
expect(screen.getByTestId('siemMigrationTranslatedRulesUpsellUpgradeMessage')).toBeVisible();
expect(
screen.getByTestId('siemMigrationTranslatedRulesUpsellUpgradeMessage')
).toHaveTextContent('upgradeMessage');
expect(screen.getByTestId('siemMigrationTranslatedRulesUpsellButton')).toBeVisible();
expect(screen.getByTestId('siemMigrationTranslatedRulesUpsellButton')).toHaveAttribute(
'href',
'https://upgrade.Href'
);
});
it('should render the component without upgradeHref', () => {
render(
<SiemMigrationsTranslatedRulesUpsellPage title="title" upgradeMessage="upgradeMessage" />
);
expect(
screen.queryByTestId('siemMigrationTranslatedRulesUpsellButton')
).not.toBeInTheDocument();
});
});

View file

@ -0,0 +1,74 @@
/*
* 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 { EuiButton, EuiEmptyPrompt, EuiPageHeader, EuiFlexItem, EuiFlexGroup } from '@elastic/eui';
import React, { useMemo } from 'react';
import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template';
import { css } from '@emotion/react';
import { SIEM_MIGRATION_MANAGER_LICENSE_BTN } from '../messages';
import * as i18n from './translations';
export const SiemMigrationsTranslatedRulesUpsellPage = React.memo(
function SiemMigrationsTranslatedRulesUpsellPage({
title,
upgradeMessage,
upgradeHref,
}: {
title: React.ReactNode;
upgradeMessage: React.ReactNode;
upgradeHref?: string;
}) {
const CTAButton = useMemo(() => {
return (
<EuiButton
data-test-subj="siemMigrationTranslatedRulesUpsellButton"
href={upgradeHref}
color="primary"
iconType="gear"
>
{SIEM_MIGRATION_MANAGER_LICENSE_BTN}
</EuiButton>
);
}, [upgradeHref]);
return (
<KibanaPageTemplate contentBorder={false} grow={true} restrictWidth={false}>
<KibanaPageTemplate.Section color="plain" paddingSize="none">
<EuiPageHeader bottomBorder pageTitle={i18n.SIEM_MIGRATION_UPSELLING_PAGE_TITLE} />
<EuiFlexGroup
css={css`
/**
* Height of 210px applies to both ESS and Serverless.
* It is combination of height of Kibana Header + Action Bar and Page Header
*
*/
min-height: calc(100vh - 210px);
`}
justifyContent="center"
alignItems="center"
direction="column"
>
<EuiFlexItem>
<EuiEmptyPrompt
title={
<span data-test-subj="siemMigrationTranslatedRulesUpsellTitle">{title}</span>
}
actions={upgradeHref ? CTAButton : null}
iconType={'logoSecurity'}
body={
<span data-test-subj="siemMigrationTranslatedRulesUpsellUpgradeMessage">
{upgradeMessage}
</span>
}
/>
</EuiFlexItem>
</EuiFlexGroup>
</KibanaPageTemplate.Section>
</KibanaPageTemplate>
);
}
);

View file

@ -28,3 +28,10 @@ export const ENTITY_ANALYTICS_TITLE = i18n.translate(
defaultMessage: 'Entity Analytics',
}
);
export const SIEM_MIGRATION_UPSELLING_PAGE_TITLE = i18n.translate(
'securitySolutionPackages.siemMigration.pageTitle',
{
defaultMessage: 'Translate Rules',
}
);

View file

@ -7,6 +7,7 @@
import { EuiButton, EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiPanel, EuiText } from '@elastic/eui';
import React from 'react';
import { SIEM_MIGRATION_MANAGER_LICENSE_BTN } from '../messages';
export const SiemMigrationStartUpsellSection = React.memo(function SiemMigrationStartUpsellSection({
title,
@ -40,7 +41,7 @@ export const SiemMigrationStartUpsellSection = React.memo(function SiemMigration
color="warning"
fill
>
{'Manage License'}
{SIEM_MIGRATION_MANAGER_LICENSE_BTN}
</EuiButton>
</EuiFlexItem>
) : null}

View file

@ -27,6 +27,16 @@ export const SiemMigrationsStartUpsellSectionLazy = withSuspenseUpsell(
)
);
export const SiemMigrationsTranslatedRulesUpsellPageLazy = withSuspenseUpsell(
lazy(() =>
import('./pages/siem_migrations_translated_rules').then(
({ SiemMigrationsTranslatedRulesPage }) => ({
default: SiemMigrationsTranslatedRulesPage,
})
)
)
);
export const EntityAnalyticsUpsellingPageLazy = lazy(() =>
import('./pages/entity_analytics_upselling').then(({ EntityAnalyticsUpsellingPageESS }) => ({
default: EntityAnalyticsUpsellingPageESS,

View file

@ -0,0 +1,27 @@
/*
* 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 { SiemMigrationsTranslatedRulesUpsellPage as SiemMigrationsTranslatedRulesUpsellPageCommonn } from '@kbn/security-solution-upselling/pages/siem_migrations_translated_rules';
import { useKibana } from '../../common/services';
import * as i18n from '../translations';
export const SiemMigrationsTranslatedRulesPage = React.memo(
function SiemMigrationsTranslatedRulesPage() {
const { services } = useKibana();
return (
<SiemMigrationsTranslatedRulesUpsellPageCommonn
title={i18n.SIEM_MIGRATION_UPSELLING_TITLE('Enterprise')}
upgradeMessage={i18n.SIEM_MIGRATION_RULES_PAGE_UPGRADE_LICENSE_MESSAGE}
upgradeHref={services.application.getUrlForApp('management', {
path: 'stack/license_management',
})}
/>
);
}
);

View file

@ -10,7 +10,7 @@ import { SecurityPageName } from '@kbn/security-solution-plugin/common';
import { upsellingPages } from './register_upsellings';
describe('upsellingPages', () => {
it('registers the Attack discovery page with the expected minimum license for self managed', () => {
it('should register the Attack discovery page with the expected minimum license for self managed', () => {
const attackDiscoveryPage = upsellingPages.find(
({ pageName }) => pageName === SecurityPageName.attackDiscovery
);

View file

@ -32,6 +32,7 @@ import {
EntityAnalyticsUpsellingPageLazy,
EntityAnalyticsUpsellingSectionLazy,
SiemMigrationsStartUpsellSectionLazy,
SiemMigrationsTranslatedRulesUpsellPageLazy,
} from './lazy_upselling';
interface UpsellingsConfig {
@ -102,6 +103,12 @@ export const upsellingPages: UpsellingPages = [
minimumLicenseRequired: 'enterprise',
component: AttackDiscoveryUpsellingPageLazy,
},
{
pageName: SecurityPageName.siemMigrationsRules,
minimumLicenseRequired: 'enterprise',
component: SiemMigrationsTranslatedRulesUpsellPageLazy,
},
];
// Upsellings for sections, linked by arbitrary ids

View file

@ -29,3 +29,11 @@ export const SIEM_MIGRATION_UPGRADE_LICENSE_MESSAGE = i18n.translate(
defaultMessage: 'To use this feature, upgrade your Elastic subscription level.',
}
);
export const SIEM_MIGRATION_RULES_PAGE_UPGRADE_LICENSE_MESSAGE = i18n.translate(
'xpack.securitySolutionEss.upselling.siemMigrations.rulesPageUpgradeLicenseMessage',
{
defaultMessage:
'To use this feature, upgrade your Elastic subscription level. If you have created a migration previously, you will be able to access it after upgrade.',
}
);

View file

@ -49,6 +49,16 @@ export const SiemMigrationsStartUpsellSectionLazy = withSuspenseUpsell(
)
);
export const SiemMigrationsTranslatedRulesUpsellPageLazy = withSuspenseUpsell(
lazy(() =>
import('./pages/siem_migrations_translated_rules').then(
({ SiemMigrationsTranslatedRulesUpsellPage }) => ({
default: SiemMigrationsTranslatedRulesUpsellPage,
})
)
)
);
export const AttackDiscoveryUpsellingPageLazy = withSuspenseUpsell(
lazy(() =>
import('./pages/attack_discovery').then(({ AttackDiscoveryUpsellingPageServerless }) => ({

View file

@ -0,0 +1,21 @@
/*
* 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 { SiemMigrationsTranslatedRulesUpsellPage as SiemMigrationsTranslatedRulesUpsellPageCommon } from '@kbn/security-solution-upselling/pages/siem_migrations_translated_rules';
import * as i18n from '../translations';
export const SiemMigrationsTranslatedRulesUpsellPage = React.memo(
function SiemMigrationsTranslatedRulesUpsellPage() {
return (
<SiemMigrationsTranslatedRulesUpsellPageCommon
title={i18n.SIEM_MIGRATION_UPSELLING_TITLE('Complete')}
upgradeMessage={i18n.SIEM_MIGRATION_RULES_PAGE_UPGRADE_LICENSE_MESSAGE}
/>
);
}
);

View file

@ -42,3 +42,11 @@ export const SIEM_MIGRATION_UPGRADE_MESSAGE = i18n.translate(
'To use this feature, you need to upgrade your Elastic Cloud Serverless feature tier. Update your subscription or contact your administrator for assistance.',
}
);
export const SIEM_MIGRATION_RULES_PAGE_UPGRADE_LICENSE_MESSAGE = i18n.translate(
'xpack.securitySolutionServerless.upselling.siemMigrations.rulesPageUpgradeLicenseMessage',
{
defaultMessage:
'To use this feature, you need to upgrade your Elastic Cloud Serverless feature tier. Update your subscription or contact your administrator for assistance. If you have created a migration previously, you will be able to access it after upgrade.',
}
);

View file

@ -34,6 +34,7 @@ import {
EntityAnalyticsUpsellingSectionLazy,
OsqueryResponseActionsUpsellingSectionLazy,
SiemMigrationsStartUpsellSectionLazy,
SiemMigrationsTranslatedRulesUpsellPageLazy,
ThreatIntelligencePaywallLazy,
} from './lazy_upselling';
import * as i18n from './translations';
@ -86,6 +87,11 @@ export const upsellingPages: UpsellingPages = [
pli: ProductFeatureKey.attackDiscovery,
component: () => <AttackDiscoveryUpsellingPageLazy />,
},
{
pageName: SecurityPageName.siemMigrationsRules,
pli: ProductFeatureKey.siemMigrations,
component: () => <SiemMigrationsTranslatedRulesUpsellPageLazy />,
},
];
const entityAnalyticsProductType = getProductTypeByPLI(ProductFeatureKey.advancedInsights) ?? '';

View file

@ -11,7 +11,9 @@
"server/**/*.ts",
"../../../../../typings/**/*"
],
"exclude": ["target/**/*"],
"exclude": [
"target/**/*"
],
"kbn_references": [
"@kbn/core",
"@kbn/config-schema",