Skip to content

Commit

Permalink
[9.0] [Siem Migrations] Translated Rules Upsell Page (#212777) (#213253)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `9.0`:
- [[Siem Migrations] Translated Rules Upsell Page
(#212777)](#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=\"https://github.com/user-attachments/assets/d7484635-292d-4bf0-883b-c9fd93b72096\"/>|\n|Serverless|<video\nsrc=\"https://github.com/user-attachments/assets/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=\"https://github.com/user-attachments/assets/d7484635-292d-4bf0-883b-c9fd93b72096\"/>|\n|Serverless|<video\nsrc=\"https://github.com/user-attachments/assets/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":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"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=\"https://github.com/user-attachments/assets/d7484635-292d-4bf0-883b-c9fd93b72096\"/>|\n|Serverless|<video\nsrc=\"https://github.com/user-attachments/assets/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-->

Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
  • Loading branch information
kibanamachine and logeekal authored Mar 5, 2025
1 parent f62e695 commit 9bb526a
Show file tree
Hide file tree
Showing 15 changed files with 239 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
);
Original file line number Diff line number Diff line change
@@ -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();
});
});
Original file line number Diff line number Diff line change
@@ -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>
);
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -40,7 +41,7 @@ export const SiemMigrationStartUpsellSection = React.memo(function SiemMigration
color="warning"
fill
>
{'Manage License'}
{SIEM_MIGRATION_MANAGER_LICENSE_BTN}
</EuiButton>
</EuiFlexItem>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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',
})}
/>
);
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
EntityAnalyticsUpsellingPageLazy,
EntityAnalyticsUpsellingSectionLazy,
SiemMigrationsStartUpsellSectionLazy,
SiemMigrationsTranslatedRulesUpsellPageLazy,
} from './lazy_upselling';

interface UpsellingsConfig {
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => ({
Expand Down
Original file line number Diff line number Diff line change
@@ -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}
/>
);
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
EntityAnalyticsUpsellingSectionLazy,
OsqueryResponseActionsUpsellingSectionLazy,
SiemMigrationsStartUpsellSectionLazy,
SiemMigrationsTranslatedRulesUpsellPageLazy,
ThreatIntelligencePaywallLazy,
} from './lazy_upselling';
import * as i18n from './translations';
Expand Down Expand Up @@ -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) ?? '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
"@kbn/logging",
"@kbn/automatic-import-plugin",
"@kbn/cloud-security-posture-common",
"@kbn/dev-utils"
"@kbn/dev-utils",
]
}

0 comments on commit 9bb526a

Please sign in to comment.