forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kibana-cloud-security-posture owned UX adjustment for borealis (elast…
…ic#205136) ## Summary This PR covers some of the changes required for the new Borealis theme: - elastic/security-team#11230 The detailed guide of migrating to Borealis can be found in this meta ticket: - elastic#199715 As the work is still in progress, here are the details of what is included in this PR: - the full migration is done for flows related to Cloud Security Posture. One requirement from EUI is not fulfilled, as we switched to hardcoded severity colors and hardcoded failed/passed misconfig finding colors. This is because the new severity color palette built by EUI team is not yet approved by Security Designers, see https://elastic.slack.com/archives/C0851RDCWPP/p1736954935896329 for more details - I made some straightforward changes to Cloud Defend and k8s dashboard plugins and added some todos, but these plugins are decommissioned in Serverless and from 9.0, so no thorough testing is required - In the Session View I made some straightforward changes according to the EUI guide and added TODOs where feedback from designers is required. Still waiting for the designer's feedback, but I think we can safely merge the changes present in this PR and it will bring Session View to a better state before 9.0 FF Amsterdam vs Borealis comparison screenshots for CSP and Session View: https://www.figma.com/design/XPKYLgZcoI61V3RUfHoHg9/Untitled?node-id=41-42&t=zLvulagbqCiXhrAo-0 ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [x] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
4a6891f
commit 35794a0
Showing
47 changed files
with
538 additions
and
469 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
x-pack/platform/packages/shared/kbn-cloud-security-posture/common/types/misconfigurations.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export type MisconfigurationEvaluationStatus = 'passed' | 'failed' | 'unknown'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ | |
}, | ||
"include": ["**/*.ts", "**/*.tsx"], | ||
"kbn_references": [ | ||
"@kbn/ui-theme", | ||
], | ||
"exclude": ["target/**/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
.../security/packages/kbn-cloud-security-posture/public/src/constants/component_constants.ts
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
.../security/packages/kbn-cloud-security-posture/public/src/hooks/use_get_cvs_score_color.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* 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 { useEuiTheme } from '@elastic/eui'; | ||
|
||
import { getCvsScoreColor as getCvsScoreColorUtil } from '../..'; | ||
|
||
export const useGetCvsScoreColor = () => { | ||
const { euiTheme } = useEuiTheme(); | ||
|
||
const getCvsScoreColor = (score: number) => { | ||
return getCvsScoreColorUtil(score, euiTheme); | ||
}; | ||
|
||
return { getCvsScoreColor }; | ||
}; |
19 changes: 19 additions & 0 deletions
19
...ity/packages/kbn-cloud-security-posture/public/src/hooks/use_get_severity_status_color.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* 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 { useEuiTheme } from '@elastic/eui'; | ||
import { VulnSeverity } from '@kbn/cloud-security-posture-common'; | ||
|
||
import { getSeverityStatusColor as getSeverityStatusColorUtil } from '../..'; | ||
|
||
export const useGetSeverityStatusColor = () => { | ||
const { euiTheme } = useEuiTheme(); | ||
const getSeverityStatusColor = (status: VulnSeverity) => { | ||
return getSeverityStatusColorUtil(status, euiTheme); | ||
}; | ||
return { getSeverityStatusColor }; | ||
}; |
77 changes: 77 additions & 0 deletions
77
.../security/packages/kbn-cloud-security-posture/public/src/utils/get_finding_colors.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* 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 { getCvsScoreColor, getSeverityStatusColor, SEVERITY_COLOR } from './get_finding_colors'; | ||
import { EuiThemeComputed } from '@elastic/eui'; | ||
|
||
const mockEuiThemeBorealis = { | ||
themeName: 'borialis', | ||
}; | ||
|
||
describe('getSeverityStatusColor', () => { | ||
it('should return the correct color for LOW severity', () => { | ||
expect(getSeverityStatusColor('LOW', mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
SEVERITY_COLOR.low | ||
); | ||
}); | ||
|
||
it('should return the correct color for MEDIUM severity', () => { | ||
expect(getSeverityStatusColor('MEDIUM', mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
SEVERITY_COLOR.medium | ||
); | ||
}); | ||
|
||
it('should return the correct color for HIGH severity', () => { | ||
expect(getSeverityStatusColor('HIGH', mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
SEVERITY_COLOR.high | ||
); | ||
}); | ||
|
||
it('should return the correct color for CRITICAL severity', () => { | ||
expect(getSeverityStatusColor('CRITICAL', mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
SEVERITY_COLOR.critical | ||
); | ||
}); | ||
|
||
it('should return the correct color for an unknown severity', () => { | ||
expect(getSeverityStatusColor('UNKNOWN', mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
SEVERITY_COLOR.unknown | ||
); | ||
}); | ||
}); | ||
|
||
describe('getCvsScoreColor', () => { | ||
it('returns correct color for low severity score', () => { | ||
expect(getCvsScoreColor(1.5, mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
SEVERITY_COLOR.low | ||
); | ||
}); | ||
|
||
it('returns correct color for medium severity score', () => { | ||
expect(getCvsScoreColor(5.5, mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
SEVERITY_COLOR.medium | ||
); | ||
}); | ||
|
||
it('returns correct color for high severity score', () => { | ||
expect(getCvsScoreColor(7.9, mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
SEVERITY_COLOR.high | ||
); | ||
}); | ||
|
||
it('returns correct color for critical severity score', () => { | ||
expect(getCvsScoreColor(10.0, mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
SEVERITY_COLOR.critical | ||
); | ||
}); | ||
|
||
it('returns correct color for low severity score for undefined value', () => { | ||
expect(getCvsScoreColor(-0.2, mockEuiThemeBorealis as EuiThemeComputed)).toBe( | ||
SEVERITY_COLOR.unknown | ||
); | ||
}); | ||
}); |
Oops, something went wrong.