Skip to content

Commit

Permalink
[Cloud Security] add posture type for CSPM dashboard accounts link (e…
Browse files Browse the repository at this point in the history
…lastic#197633)

## Summary

- fixes elastic/security-team#10914

(cherry picked from commit b6de3b7)
  • Loading branch information
maxcold committed Oct 28, 2024
1 parent 1d62ae5 commit 7bdd42a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ describe('AccountsEvaluatedWidget', () => {
expect(mockNavToFindings).toHaveBeenCalledWith(
{
'cloud.provider': 'aws',
'rule.benchmark.posture_type': 'cspm',
},
['cloud.account.name']
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import React from 'react';
import { EuiFlexGroup, EuiFlexItem, useEuiTheme } from '@elastic/eui';
import { css } from '@emotion/react';
import { useNavigateFindings } from '@kbn/cloud-security-posture/src/hooks/use_navigate_findings';
import { CSPM_POLICY_TEMPLATE } from '@kbn/cloud-security-posture-common';
import { CLOUD_PROVIDERS, getBenchmarkApplicableTo } from '../../common/utils/helpers';
import { CIS_AWS, CIS_GCP, CIS_AZURE, CIS_K8S, CIS_EKS } from '../../common/constants';
import { CISBenchmarkIcon } from './cis_benchmark_icon';
Expand Down Expand Up @@ -61,7 +62,10 @@ export const AccountsEvaluatedWidget = ({
const navToFindings = useNavigateFindings();

const navToFindingsByCloudProvider = (provider: string) => {
navToFindings({ 'cloud.provider': provider }, [FINDINGS_GROUPING_OPTIONS.CLOUD_ACCOUNT_NAME]);
navToFindings(
{ 'cloud.provider': provider, 'rule.benchmark.posture_type': CSPM_POLICY_TEMPLATE },
[FINDINGS_GROUPING_OPTIONS.CLOUD_ACCOUNT_NAME]
);
};

const navToFindingsByCisBenchmark = (cisBenchmark: string) => {
Expand Down

0 comments on commit 7bdd42a

Please sign in to comment.