Skip to content

Commit

Permalink
[8.x] [Cloud Security] add posture type for CSPM dashboard accounts l…
Browse files Browse the repository at this point in the history
…ink (#197633) (#197971)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Cloud Security] add posture type for CSPM dashboard accounts link
(#197633)](#197633)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Maxim
Kholod","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-28T11:18:48Z","message":"[Cloud
Security] add posture type for CSPM dashboard accounts link
(#197633)\n\n## Summary\r\n\r\n- fixes
https://github.com/elastic/security-team/issues/10914","sha":"b6de3b713dd4cd3996b40bce53c7f0f31b2bcf1f","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Cloud
Security","backport:prev-minor","v8.16.0","backport:version","v8.17.0"],"title":"[Cloud
Security] add posture type for CSPM dashboard accounts
link","number":197633,"url":"https://github.com/elastic/kibana/pull/197633","mergeCommit":{"message":"[Cloud
Security] add posture type for CSPM dashboard accounts link
(#197633)\n\n## Summary\r\n\r\n- fixes
https://github.com/elastic/security-team/issues/10914","sha":"b6de3b713dd4cd3996b40bce53c7f0f31b2bcf1f"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197633","number":197633,"mergeCommit":{"message":"[Cloud
Security] add posture type for CSPM dashboard accounts link
(#197633)\n\n## Summary\r\n\r\n- fixes
https://github.com/elastic/security-team/issues/10914","sha":"b6de3b713dd4cd3996b40bce53c7f0f31b2bcf1f"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Maxim Kholod <[email protected]>
  • Loading branch information
kibanamachine and maxcold authored Oct 28, 2024
1 parent c4f03ae commit 17c7e33
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 17c7e33

Please sign in to comment.