Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SecuritySolution] Update severity colors for Borealis theme #206276

Merged
merged 23 commits into from
Jan 25, 2025

Conversation

angorayc
Copy link
Contributor

@angorayc angorayc commented Jan 10, 2025

Summary

Apply severity colors for Borealis theme.
#204007 (comment)

Update: ⚠️ As the final decision for severity color is still pending, the temporary colors are the hard coded color hex:
#203387
TODO Borealis migration - move from hardcoded values to severity palette https://github.com/elastic/security-team/issues/11606

Color token Amsterdam Borealis
Critical euiThemeVars.euiColorDanger #E7664C
High euiThemeVars.euiColorVis9_behindText #DA8B45
Meduiml euiThemeVars.euiColorVis5_behindText #D6BF57
Low euiThemeVars.euiColorVis0 #54B399

Running Kibana with the Borealis theme

In order to run Kibana with Borealis, you'll need to do the following:

Set the following in kibana.dev.yml: uiSettings.experimental.themeSwitcherEnabled: true

Run Kibana with the following environment variable set:
KBN_OPTIMIZER_THEMES="borealislight,borealisdark,v8light,v8dark" yarn start

This will expose a toggle under Stack Management > Advanced Settings > Theme version, which you can use to toggle between Amsterdam and Borealis.

Image

Checklist

@angorayc angorayc requested review from a team as code owners January 10, 2025 13:04
@angorayc angorayc added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting v9.0.0 EUI Visual Refresh labels Jan 10, 2025
@angorayc angorayc changed the title [SecuritySolution] Update severity colors [SecuritySolution] Update severity colors for Borealis theme Jan 10, 2025
@angorayc angorayc mentioned this pull request Jan 10, 2025
@angorayc angorayc requested a review from mgadewoll January 10, 2025 13:32
Copy link
Contributor

@maxcold maxcold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cloud_securty_posture related changes lgtm

Copy link
Contributor

@nikitaindik nikitaindik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this PR, @angorayc! I was planning to make similar changes, but only for the Rule Management and Detection Engine teams. You’ve gone above and beyond by covering even more areas — great work!

I’ve reviewed the Rule Management-owned code and left a few comments for your consideration. When you have a moment, please take a look.

Additionally, I tested the Rule Management-owned pages and didn’t encounter any issues. Everything looks good! 👍

Please address my comments and I'll give this PR another look. 🙏

Copy link
Contributor

@nikitaindik nikitaindik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing my feedback, @angorayc! I've re-tested the Rule Management-owned pages, as well as the rule creation and editing forms, across both themes in both dark and light modes, and found no issues. This is good to go! 👍

nikitaindik added a commit that referenced this pull request Jan 14, 2025
…206122)

**Resolves: #204737**
**Related PR (fixes severity indicator colors): #206276**

## Summary
This PR introduces some of the necessary changes to support the Borealis
UI theme on Rule Management team-owned pages. You can find a list of
what needs to be done in this
[issue](#199715) description
under "Requested Code Changes".

## Changes in this PR
- Replaced deprecated `euiThemeVars` with `useEuiTheme`.
- Fixed incorrect "disabled" button color for the rule delete bulk
action.

## Changes that are needed, but are outside of this PR's scope
- Fix incorrect severity colors in Borealis. Will be resolved by this
Threat Hunting [PR](#206276).
<img width="93" alt="Scherm­afbeelding 2025-01-13 om 13 46 26"
src="https://github.com/user-attachments/assets/d35407d7-77f9-4d7d-a6b8-3dfe4f8a0e9e"
/>

- Fix rule execution status indicator appearing too dark in the Borealis
theme. This issue will be addressed in EUI, but there is no draft PR
yet, as discussions are still ongoing between the design team and EUI
folks to determine the best approach.
<img width="326" alt="borealis"
src="https://github.com/user-attachments/assets/3324448c-be13-4074-bfdc-c6837fb2bc6c"
/>

## Testing
You can find the theme switcher in "Stack Management" -> "Advanced
Settings". Then you can test if everything looks correct in:
- Amsterdam theme, light mode
- Amsterdam theme, dark mode
- Borealis theme, light mode
- Borealis theme, dark mode

Work started on: 08-01-2025
Copy link
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code LGTM overall and desk tested! Can you add a few unit tests (added comment to each file)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be worth writing some uni tests, even though this is basic, it is used in a few places. As least if someone makes a change by mistake, they will be reminded...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add some unit tests for this new getSeverityColor function?

@r4zr32d3k1l
Copy link

Would it be possible to hold off on updating the Borealis severity colors for now? They are expected to change soon.

@angorayc
Copy link
Contributor Author

Would it be possible to hold off on updating the Borealis severity colors for now? They are expected to change soon.

Yup, I'll wait for your decision. Please keep @PhilippeOberti @CAWilson94 in the loop when you have the update. Thanks!

@CAWilson94
Copy link
Contributor

@r4zr32d3k1l feature freeze is on the 29th, will new severity colors come into effect before then?

viduni94 pushed a commit to viduni94/kibana that referenced this pull request Jan 23, 2025
…lastic#206122)

**Resolves: elastic#204737**
**Related PR (fixes severity indicator colors): elastic#206276**

## Summary
This PR introduces some of the necessary changes to support the Borealis
UI theme on Rule Management team-owned pages. You can find a list of
what needs to be done in this
[issue](elastic#199715) description
under "Requested Code Changes".

## Changes in this PR
- Replaced deprecated `euiThemeVars` with `useEuiTheme`.
- Fixed incorrect "disabled" button color for the rule delete bulk
action.

## Changes that are needed, but are outside of this PR's scope
- Fix incorrect severity colors in Borealis. Will be resolved by this
Threat Hunting [PR](elastic#206276).
<img width="93" alt="Scherm­afbeelding 2025-01-13 om 13 46 26"
src="https://github.com/user-attachments/assets/d35407d7-77f9-4d7d-a6b8-3dfe4f8a0e9e"
/>

- Fix rule execution status indicator appearing too dark in the Borealis
theme. This issue will be addressed in EUI, but there is no draft PR
yet, as discussions are still ongoing between the design team and EUI
folks to determine the best approach.
<img width="326" alt="borealis"
src="https://github.com/user-attachments/assets/3324448c-be13-4074-bfdc-c6837fb2bc6c"
/>

## Testing
You can find the theme switcher in "Stack Management" -> "Advanced
Settings". Then you can test if everything looks correct in:
- Amsterdam theme, light mode
- Amsterdam theme, dark mode
- Borealis theme, light mode
- Borealis theme, dark mode

Work started on: 08-01-2025
@nikitaindik
Copy link
Contributor

Hey folks! 👋 Any updates on this? Are we going to use severity colors from Amsterdam in Borealis?

@angorayc
Copy link
Contributor Author

angorayc commented Jan 24, 2025

Hey folks! 👋 Any updates on this? Are we going to use severity colors from Amsterdam in Borealis?

Update: ⚠️ As the final decision for severity color is still pending, the temporary colors are the hard coded color hex:
#203387

Color token Amsterdam Borealis
Critical euiThemeVars.euiColorDanger #E7664C
High euiThemeVars.euiColorVis9_behindText #DA8B45
Meduiml euiThemeVars.euiColorVis5_behindText #D6BF57
Low euiThemeVars.euiColorVis0 #54B399

Relevant implementation:
Cloud Security: https://github.com/elastic/kibana/pull/205136/files#diff-bf3f045d305b5cdcd6ed8b42d1b94a051ec8f8b55270fbd85aed96f93adeb351R35
Entity analytics: https://github.com/elastic/kibana/pull/204007/files

@elasticmachine
Copy link
Contributor

elasticmachine commented Jan 24, 2025

⏳ Build in-progress, with failures

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #5 / Amsterdam: getSeverityColor returns color for given severity: critical
  • [job] [logs] Jest Tests #5 / Amsterdam: getSeverityColor returns color for given severity: critical
  • [job] [logs] Jest Tests #5 / Amsterdam: getSeverityColor returns color for given severity: high
  • [job] [logs] Jest Tests #5 / Amsterdam: getSeverityColor returns color for given severity: high
  • [job] [logs] Jest Tests #5 / Amsterdam: getSeverityColor returns color for given severity: low
  • [job] [logs] Jest Tests #5 / Amsterdam: getSeverityColor returns color for given severity: low
  • [job] [logs] Jest Tests #5 / Amsterdam: getSeverityColor returns color for given severity: medium
  • [job] [logs] Jest Tests #5 / Amsterdam: getSeverityColor returns color for given severity: medium
  • [job] [logs] Jest Tests #5 / getFlattenedLegendItems returns the expected legend items
  • [job] [logs] Jest Tests #5 / getFlattenedLegendItems returns the expected legend items
  • [job] [logs] Jest Tests #12 / getFormattedAlertStats should return alert stats
  • [job] [logs] Jest Tests #12 / getFormattedAlertStats should return alert stats
  • [job] [logs] Jest Tests #5 / layers getLayersMultiDimensional returns the default fillColor for layer 1 when the group from path is not found
  • [job] [logs] Jest Tests #5 / layers getLayersMultiDimensional returns the default fillColor for layer 1 when the group from path is not found
  • [job] [logs] Jest Tests #5 / layers getLayersMultiDimensional returns the expected shape fill color function for layer 1, which has a different implementation
  • [job] [logs] Jest Tests #5 / layers getLayersMultiDimensional returns the expected shape fill color function for layer 1, which has a different implementation
  • [job] [logs] Jest Tests #5 / layers getLayersOneDimension return the default fill color when dataName is not found in the maxRiskSubAggregations
  • [job] [logs] Jest Tests #5 / layers getLayersOneDimension return the default fill color when dataName is not found in the maxRiskSubAggregations
  • [job] [logs] Jest Tests #5 / layers getLayersOneDimension returns the expected shape fillColor function
  • [job] [logs] Jest Tests #5 / layers getLayersOneDimension returns the expected shape fillColor function
  • [job] [logs] Jest Tests #5 / legend getFirstGroupLegendItems returns the expected legend item
  • [job] [logs] Jest Tests #5 / legend getFirstGroupLegendItems returns the expected legend item
  • [job] [logs] Jest Tests #5 / legend getLegendItemFromFlattenedBucket returns the expected legend item
  • [job] [logs] Jest Tests #5 / legend getLegendItemFromFlattenedBucket returns the expected legend item
  • [job] [logs] Jest Tests #5 / legend getLegendItemFromRawBucket returns the expected color when showColor is true
  • [job] [logs] Jest Tests #5 / legend getLegendItemFromRawBucket returns the expected color when showColor is true

History

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 6610 6611 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 21.3MB 21.3MB +4.4KB

History

@angorayc angorayc merged commit 235d5eb into elastic:main Jan 25, 2025
8 checks passed
CAWilson94 added a commit that referenced this pull request Jan 27, 2025
## Summary

This PR covers required updates for EUI refresh:
[#11228](elastic/security-team#11228)
The updates should only cover Entity Owned components. 

### Severity Colors Blocked
Severity colors are on hold until the security severity color palette is
finalised. Once agreed, a shared hook will be updated across all of
security, replacing the current RISK_SEVERITY_COLOUR mapping. The
previous severity colors hook was reverted in preparation for this
change. Updates for EA will be tracked accordingly.

See https://elastic.slack.com/archives/C0851RDCWPP/p1736954935896329 for
more details

elastic/security-team#11516 
#206276

---

### Testing 

Running Kibana with the Borealis theme
In order to run Kibana with Borealis, you'll need to do the following:

1. Set the following in kibana.dev.yml:
u`iSettings.experimental.themeSwitcherEnabled: true`

2. Run Kibana with the following environment variable set:
`KBN_OPTIMIZER_THEMES="borealislight,borealisdark,v8light,v8dark" yarn
start`

3. This will expose a toggle under **Stack Management > Advanced
Settings > Theme version**, which you can use to toggle
between Amsterdam and Borealis.

---

More details about each section
#199715

#### Borealis Updates Light & Dark Theme 

### Screenshots 
Google Docs for easy read - same screenshots below

https://docs.google.com/document/d/1tKPoqCPbccX94cqgPyHKBdr9_K3kmqveQGkcGo_Q8k4/edit?usp=sharing

---
## Light Theme

### Entity Store 


![entityStore](https://github.com/user-attachments/assets/94c03a9a-f6d2-4cf7-836b-ae3b3c310cdb)


![EntityStoreStatus](https://github.com/user-attachments/assets/46d45ad4-73aa-4fb7-b2ab-0b6525016ef5)

### Risk Score


![RiskScore](https://github.com/user-attachments/assets/63f1eca3-46f5-4f21-9cef-7b3b6c0724fd)

### Dashboard and Flyout


![Dashboard2](https://github.com/user-attachments/assets/5901db26-81b9-46bc-a3f4-4de7770babbc)


![RiskLevels](https://github.com/user-attachments/assets/5273c891-232f-4c6f-892f-c1979c2f8c23)


![FlyoutRiskScore](https://github.com/user-attachments/assets/1f0ebd6d-82d5-4356-907a-89bc1a04f483)


![FlyoutAssetCriticalityColors](https://github.com/user-attachments/assets/cca34be8-f3f8-4a5b-8698-1227d80edcc0)

## Dark Theme

### Entity Store


![DarkEntityStore](https://github.com/user-attachments/assets/48a12285-e57c-4da1-9376-489b4d9d2853)


![DarkEntityStoreStatus](https://github.com/user-attachments/assets/9a48e492-c28a-4dd0-876d-e34dcfefe49d)

### Risk Score


![DarkRiskScore](https://github.com/user-attachments/assets/becab00e-996d-4485-94fa-bf9bee337aaa)

### Dashboard and Flyout


![DarkDashboard](https://github.com/user-attachments/assets/72522716-0c29-4935-ba0c-f9fcea8ff94a)


![DarkRiskScore](https://github.com/user-attachments/assets/83ae74c8-3e16-49c5-9c05-9b666e146b1b)


![DarkFlyoutRiskScore](https://github.com/user-attachments/assets/2d97c992-ca08-4f97-9338-e59805084a36)


![DarkFlyoutAssetCriticalityColors](https://github.com/user-attachments/assets/197a8990-282f-4b01-bab5-e0b2b1518217)

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Mark Hopkin <[email protected]>
JoseLuisGJ pushed a commit to JoseLuisGJ/kibana that referenced this pull request Jan 27, 2025
…#206276)

## Summary

Apply severity colors for Borealis theme.
elastic#204007 (comment)

Update: ⚠️ As the final decision for severity color is still pending,
the temporary colors are the hard coded color hex:
elastic#203387
`TODO` Borealis migration - move from hardcoded values to severity
palette elastic/security-team#11606

| Color token | Amsterdam|Borealis|
|-------------|------------|------------|
| Critical | euiThemeVars.euiColorDanger |```#E7664C```|
| High | euiThemeVars.euiColorVis9_behindText |```#DA8B45``` |
| Meduiml |euiThemeVars.euiColorVis5_behindText|```#D6BF57``` |
| Low | euiThemeVars.euiColorVis0| ```#54B399``` |

### Running Kibana with the Borealis theme
In order to run Kibana with Borealis, you'll need to do the following:

Set the following in kibana.dev.yml:
uiSettings.experimental.themeSwitcherEnabled: true

Run Kibana with the following environment variable set:
KBN_OPTIMIZER_THEMES="borealislight,borealisdark,v8light,v8dark" yarn
start

This will expose a toggle under Stack Management > Advanced Settings >
Theme version, which you can use to toggle between Amsterdam and
Borealis.



![Image](https://github.com/user-attachments/assets/78d64946-43fc-4400-bbb1-229d900b7f05)


### Checklist


- [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

---------

Co-authored-by: kibanamachine <[email protected]>
JoseLuisGJ pushed a commit to JoseLuisGJ/kibana that referenced this pull request Jan 27, 2025
## Summary

This PR covers required updates for EUI refresh:
[elastic#11228](elastic/security-team#11228)
The updates should only cover Entity Owned components. 

### Severity Colors Blocked
Severity colors are on hold until the security severity color palette is
finalised. Once agreed, a shared hook will be updated across all of
security, replacing the current RISK_SEVERITY_COLOUR mapping. The
previous severity colors hook was reverted in preparation for this
change. Updates for EA will be tracked accordingly.

See https://elastic.slack.com/archives/C0851RDCWPP/p1736954935896329 for
more details

elastic/security-team#11516 
elastic#206276

---

### Testing 

Running Kibana with the Borealis theme
In order to run Kibana with Borealis, you'll need to do the following:

1. Set the following in kibana.dev.yml:
u`iSettings.experimental.themeSwitcherEnabled: true`

2. Run Kibana with the following environment variable set:
`KBN_OPTIMIZER_THEMES="borealislight,borealisdark,v8light,v8dark" yarn
start`

3. This will expose a toggle under **Stack Management > Advanced
Settings > Theme version**, which you can use to toggle
between Amsterdam and Borealis.

---

More details about each section
elastic#199715

#### Borealis Updates Light & Dark Theme 

### Screenshots 
Google Docs for easy read - same screenshots below

https://docs.google.com/document/d/1tKPoqCPbccX94cqgPyHKBdr9_K3kmqveQGkcGo_Q8k4/edit?usp=sharing

---
## Light Theme

### Entity Store 


![entityStore](https://github.com/user-attachments/assets/94c03a9a-f6d2-4cf7-836b-ae3b3c310cdb)


![EntityStoreStatus](https://github.com/user-attachments/assets/46d45ad4-73aa-4fb7-b2ab-0b6525016ef5)

### Risk Score


![RiskScore](https://github.com/user-attachments/assets/63f1eca3-46f5-4f21-9cef-7b3b6c0724fd)

### Dashboard and Flyout


![Dashboard2](https://github.com/user-attachments/assets/5901db26-81b9-46bc-a3f4-4de7770babbc)


![RiskLevels](https://github.com/user-attachments/assets/5273c891-232f-4c6f-892f-c1979c2f8c23)


![FlyoutRiskScore](https://github.com/user-attachments/assets/1f0ebd6d-82d5-4356-907a-89bc1a04f483)


![FlyoutAssetCriticalityColors](https://github.com/user-attachments/assets/cca34be8-f3f8-4a5b-8698-1227d80edcc0)

## Dark Theme

### Entity Store


![DarkEntityStore](https://github.com/user-attachments/assets/48a12285-e57c-4da1-9376-489b4d9d2853)


![DarkEntityStoreStatus](https://github.com/user-attachments/assets/9a48e492-c28a-4dd0-876d-e34dcfefe49d)

### Risk Score


![DarkRiskScore](https://github.com/user-attachments/assets/becab00e-996d-4485-94fa-bf9bee337aaa)

### Dashboard and Flyout


![DarkDashboard](https://github.com/user-attachments/assets/72522716-0c29-4935-ba0c-f9fcea8ff94a)


![DarkRiskScore](https://github.com/user-attachments/assets/83ae74c8-3e16-49c5-9c05-9b666e146b1b)


![DarkFlyoutRiskScore](https://github.com/user-attachments/assets/2d97c992-ca08-4f97-9338-e59805084a36)


![DarkFlyoutAssetCriticalityColors](https://github.com/user-attachments/assets/197a8990-282f-4b01-bab5-e0b2b1518217)

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Mark Hopkin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting EUI Visual Refresh release_note:skip Skip the PR/issue when compiling release notes v9.0.0
Projects
None yet