mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
## Summary Fixes https://github.com/elastic/security-team/issues/8934 Summarize your PR. If it involves visual changes include a screenshot or gif. This PR enables the Security AI assistant to be used globally - i.e. if you are outside of the security solution (e.g. Discover), the Security Assistant can still be opened. Changes: - A public module has been added to the elastic-assistant plugin (previously it was a server-side-only plugin). - The vast majority of the assistant (flyout and nav bar) has been moved into the new elastic-assistantpublic plugin. - Comment actions & message augmentations remain within the security-solution. - A new public plugin was created called elastic-assistant-shared state. This plugin is used to share state between the elastic-assistant public plugin and other plugins (e.g. security-solution). - For example, the security solution registers comment actions in the elastic-assistant-shared-state plugin. The elastic-assistant public plugin then reads the comment actions from elastic-assistant-shared-state and renders them in the assistant flyout.  ### Considerations: - Currently, the Security AI assistant is being displayed everywhere except the observability solution (see implementation [here](https://github.com/elastic/kibana/pull/223936/files#diff-5dd1ea91c2d5d242203cc58ee59ec283116e5e739ed82bae4e2cd78af322150c)). This is only for testing while the PR is in review. We plan to add a setting to the stack management that allows the user to configure where they would like the assistant to be shown. This will be changed before the PR is merged. ## How to test Feel free to use the cloud and serverless deployments created by the CI pipeline for testing. Credentials can be found on Buildkite. ### Verify that the Security AI assistant works as expected within the security solution Expected there to be no changes in how the security AI assistant works within the Security Solution. Please do some exploratory testing to make sure nothing has changed. Start the branch locally and go to http://localhost:5601/app/security/ Things to test: - Does the assistant open? - Can I send an alert to the assistant from the alerts page? - Does the assistant display code blocks correctly? - Does the assistant display ESQL correctly (can I view the ESQL in the timeline)? - Do assistant messages have the correct comment actions? Do the comment actions work? - Are conversations displayed correctly? - Do citations work? - Does the assistant work in serverless? Does the assistant work as expected in AI4SOC? - Do quick prompts work? - Can you select a system prompt for a new convo? - Can you send alerts to the Security AI assistant? - AI assistant in a space that has Security disabled. - Does attack discovery work? AI assistant open in Discover app: <img width="1841" alt="image" src="https://github.com/user-attachments/assets/0a13a100-d192-4fa4-b395-0951452e14c2" /> AI assistant in Security solution: <img width="1841" alt="image" src="https://github.com/user-attachments/assets/7ed38f37-79de-41a7-a80f-8b96147bfdf6" /> ### Verify the Security AI assistant works in Discover (or anywhere outside of the Security solution)? Head over to http://localhost:5601/app/discover. Note that some functionality is removed when using the AI assistant outside of security: - Only the "copy" comment action appears on messages. - Code block augmentations (i.e. the button that opens ESQL inside of the timeline) don't appear. Things to test: - Does the security AI assistant button appear in the nav bar? - Can you open the security AI assistant? - Are you able to send messages? - Are conversations appearing as expected? - Can you close the assistant? - Do citations work? - Can you switch to a different solution while the assistant is open? Security AI assistant open in AI4SOC Discover: <img width="1841" alt="image" src="https://github.com/user-attachments/assets/36537b9b-e945-459e-ac13-43e9444e92b7" /> ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [X] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [X] [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) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
9 lines
352 B
TypeScript
9 lines
352 B
TypeScript
/*
|
|
* 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.
|
|
*/
|
|
|
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
import '@testing-library/jest-dom';
|