Skip to content

Commit c7c96dc

Browse files
[9.1] [Cloud Security] fix vulnerablity flyout resource table displayed package fields (#226340) (#226407)
# Backport This will backport the following commits from `main` to `9.1`: - [[Cloud Security] fix vulnerablity flyout resource table displayed package fields (#226340)](#226340) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Alex Prozorov","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-07-03T12:20:17Z","message":"[Cloud Security] fix vulnerablity flyout resource table displayed package fields (#226340)\n\n## Summary\n\nThis PR fix the following\n[issue](https://github.com/elastic/kibana/issues/226325).\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\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- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"3d394b5bb7d80c347e44a407f6afb845b5037a84","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Cloud Security","backport:version","v9.1.0","v9.2.0"],"title":"[Cloud Security] fix vulnerablity flyout resource table displayed package fields","number":226340,"url":"https://github.com/elastic/kibana/pull/226340","mergeCommit":{"message":"[Cloud Security] fix vulnerablity flyout resource table displayed package fields (#226340)\n\n## Summary\n\nThis PR fix the following\n[issue](https://github.com/elastic/kibana/issues/226325).\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\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- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"3d394b5bb7d80c347e44a407f6afb845b5037a84"}},"sourceBranch":"main","suggestedTargetBranches":["9.1"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/226340","number":226340,"mergeCommit":{"message":"[Cloud Security] fix vulnerablity flyout resource table displayed package fields (#226340)\n\n## Summary\n\nThis PR fix the following\n[issue](https://github.com/elastic/kibana/issues/226325).\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\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- [x] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"3d394b5bb7d80c347e44a407f6afb845b5037a84"}}]}] BACKPORT--> Co-authored-by: Alex Prozorov <[email protected]>
1 parent 19eb51e commit c7c96dc

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/test_subjects.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ export const VULNERABILITY_OVERVIEW_TAB_ID_MORE_BTN = 'vulnerability-overview-ta
3030
export const VULNERABILITY_OVERVIEW_TAB_ID_LESS_BTN = 'vulnerability-overview-tab-id-more-less';
3131
export const VULNERABILITY_OVERVIEW_PUBLISHED_DATE = 'vulnerability-overview-tab-published-date';
3232
export const VULNERABILITY_EMPTY_VALUE = 'vulnerability-empty-value';
33+
export const VULNERABILITY_RESOURCE_TABLE = 'vulnerability-resource-table';

x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_finding_flyout.test.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
VULNERABILITY_HEADER_REFERENCE_LINK,
2020
VULNERABILITY_OVERVIEW_TAB_ID_LESS_BTN,
2121
VULNERABILITY_OVERVIEW_TAB_ID_MORE_BTN,
22+
VULNERABILITY_RESOURCE_TABLE,
2223
VULNERABILITY_SCORES_FLYOUT,
2324
} from '../test_subjects';
2425
import { EMPTY_VALUE } from '../../configurations/findings_flyout/findings_flyout';
@@ -181,6 +182,28 @@ describe('<VulnerabilityFindingFlyout/>', () => {
181182
getAllByText(mockVulnerabilityHit.package.fixed_version as string);
182183
});
183184

185+
it('shows resource information in a table with correct fields', () => {
186+
const { getByTestId } = render(
187+
<TestProvider>
188+
<VulnerabilityOverviewTab vulnerabilityRecord={mockVulnerabilityHit} />
189+
</TestProvider>
190+
);
191+
192+
const resourceTable = getByTestId(VULNERABILITY_RESOURCE_TABLE);
193+
expect(resourceTable).toBeInTheDocument();
194+
195+
// Check that all resource fields are displayed in the table
196+
const tableContent = resourceTable.textContent;
197+
expect(tableContent).toContain('ID');
198+
expect(tableContent).toContain(mockVulnerabilityHit.resource?.id);
199+
expect(tableContent).toContain('Name');
200+
expect(tableContent).toContain(mockVulnerabilityHit.resource?.name);
201+
expect(tableContent).toContain('Package');
202+
expect(tableContent).toContain(mockVulnerabilityHit.package.name);
203+
expect(tableContent).toContain('Version');
204+
expect(tableContent).toContain(mockVulnerabilityHit.package.version);
205+
});
206+
184207
it('Overview Tab with Qualys vulnerability renders multiple CVEs', async () => {
185208
const cvesToAppend = [
186209
'CVE-2022-11111',

x-pack/solutions/security/plugins/cloud_security_posture/public/pages/vulnerabilities/vulnerabilities_finding_flyout/vulnerability_overview_tab.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import { VulnerabilityDetectionRuleCounter } from './vulnerability_detection_rul
4848
import { CopyButton } from '../../../components/copy_button';
4949
import { columns, convertObjectToArray } from '../../configurations/findings_flyout/overview_tab';
5050
import { VulnerabilityIdContent } from './vulnerability_id_content';
51+
import { VULNERABILITY_RESOURCE_TABLE } from '../test_subjects';
5152

5253
const cvssVendors: Record<string, Vendor> = {
5354
nvd: 'NVD',
@@ -294,12 +295,13 @@ const getResourceList = (vulnerabilityData: CspVulnerabilityFinding) => [
294295
<EuiPanel>
295296
<EuiPanel hasBorder>
296297
<EuiBasicTable
298+
data-test-subj={VULNERABILITY_RESOURCE_TABLE}
297299
items={
298300
convertObjectToArray({
299301
ID: vulnerabilityData?.resource?.id,
300302
Name: vulnerabilityData?.resource?.name,
301303
Package: vulnerabilityData?.package?.name,
302-
Version: vulnerabilityData?.package?.fixed_version,
304+
Version: vulnerabilityData?.package?.version,
303305
}) || []
304306
}
305307
rowHeader="Field"

0 commit comments

Comments
 (0)