Skip to content

Commit

Permalink
[Cloud Security] remove nvd link generation logic from Kibana (#165330)
Browse files Browse the repository at this point in the history
## Summary

- fixes: elastic/security-team#7490

The NVD generation logic will be happening on the `cloudbeat` side after
elastic/cloudbeat#869 (comment) is done and
elastic/cloudbeat#1303 is merged, so we can
remove the logic from Kibana and use what's in `vulnerability.reference`

---------

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
maxcold and kibanamachine authored Sep 12, 2023
1 parent 11d88cd commit 01f4bc2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import { HttpSetup } from '@kbn/core/public';
import { i18n } from '@kbn/i18n';
import { getVulnerabilityReferenceUrl } from '../../../common/utils/get_vulnerability_reference_url';
import type { Vulnerability } from '../../../../common/schemas';
import {
LATEST_VULNERABILITIES_RETENTION_POLICY,
Expand Down Expand Up @@ -83,8 +82,6 @@ export const createDetectionRuleFromVulnerabilityFinding = async (
http: HttpSetup,
vulnerability: Vulnerability
) => {
const referenceUrl = getVulnerabilityReferenceUrl(vulnerability);

return await createDetectionRule({
http,
rule: {
Expand Down Expand Up @@ -144,7 +141,7 @@ export const createDetectionRuleFromVulnerabilityFinding = async (
},
index: [VULNERABILITIES_INDEX_PATTERN],
query: generateVulnerabilitiesRuleQuery(vulnerability),
references: referenceUrl ? [referenceUrl] : [],
references: vulnerability.reference ? [vulnerability.reference] : [],
name: getVulnerabilityRuleName(vulnerability),
description: vulnerability.description,
tags: generateVulnerabilitiesTags(vulnerability),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { euiThemeVars } from '@kbn/ui-theme';
import { css } from '@emotion/react';
import { HttpSetup } from '@kbn/core-http-browser';
import { TakeAction } from '../../../components/take_action';
import { getVulnerabilityReferenceUrl } from '../../../common/utils/get_vulnerability_reference_url';
import { truthy } from '../../../../common/utils/helpers';
import { CspInlineDescriptionList } from '../../../components/csp_inline_description_list';
import { VulnerabilityOverviewTab } from './vulnerability_overview_tab';
Expand Down Expand Up @@ -158,7 +157,7 @@ export const VulnerabilityFindingFlyout = ({
{ defaultMessage: 'Loading' }
);

const vulnerabilityReference = getVulnerabilityReferenceUrl(vulnerabilityRecord.vulnerability);
const vulnerabilityReference = vulnerability?.reference;

const createVulnerabilityRuleFn = async (http: HttpSetup) =>
await createDetectionRuleFromVulnerabilityFinding(http, vulnerabilityRecord.vulnerability);
Expand Down

0 comments on commit 01f4bc2

Please sign in to comment.