Commit graph

1444 commits

Author SHA1 Message Date
Sergi Romeu
8767adc622
[A11y][APM] Add aria-label to technical preview badge (#216483)
## Summary

Fixes https://github.com/elastic/kibana/issues/212093

This PR adds the `aria-label` prop so screen readers work with this
tooltip text.

![image](https://github.com/user-attachments/assets/8c3d345d-68be-42cb-ab6f-addafd0d7683)
2025-04-01 11:08:27 +02:00
Sergi Romeu
54ce010161
[A11y][APM] Add aria-label to fold traces button (#216485)
## Summary

Fixes #212228

This PR adds `aria-label` to the fold/unfold traces button.


![image](https://github.com/user-attachments/assets/7c14d3d1-c246-4b85-a80c-4fb51dd1f305)
2025-04-01 11:06:55 +02:00
Luke Gmys
65bb560539
[Security Solution] Rename use_data_view to use_data_view_spec (#216461)
## Summary

Just naming things, the goal is to highlight the fact the hook returns
the spec and not the DataView instance.
No testing is required as the change does not alter the logic.
2025-04-01 09:40:25 +01:00
Alex Prozorov
1b9bf801e4
[Cloud Security] handle grouping in multi value fields (#215913)
## Summary

Purpose of this PR is to handle grouping of multi-value fields which are
introduced by Qualys VDMR integrations.
This PR adds the capability to flatten grouping results of the following
fields - vulnerability.id, package.name, package.version and
package.fixed_version, which are all ECS fields.

It continues the changes of this
[PR](https://github.com/elastic/kibana/pull/213039).

### Checklist

**The following topics will be merged as part of another PR**
### Vulnerabilities data grid and Flyout
- [x] grouping by CVE should be handled properly in the UI.
- [x] multi value fields are flattened - each value is counted as
separate group key.
- [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] 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)


### Screenshots

Grouping before fix by multiple values

![image](https://github.com/user-attachments/assets/21756172-819c-4836-ba3a-79ae9ed6cbad)

Flatten by each value

![image](https://github.com/user-attachments/assets/d329d3f7-b499-4abb-8e40-6c8580be9202)
2025-04-01 11:26:46 +03:00
Vitalii Dmyterko
b3d750bc49
[Security Solution][Detection Engine] adds spaces telemetry for detection rules (#215393)
## Summary

 - addresses https://github.com/elastic/security-team/issues/12000
 - adds telemetry for rules in spaces: 
   - number of spaces, detection rules added
   - number of rules in each space

---------

Co-authored-by: Dan Dillinger <ddillinger@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-04-01 09:07:08 +01:00
Saikat Sarkar
7627c79065
[Playground] Remove Tech Preview badge from Playground (#216530)
## Summary
This PR removes the Tech Preview badge from the Playground

**Before**
![Screenshot 2025-03-31 at 11 52
00 AM](https://github.com/user-attachments/assets/29a68467-5d57-4cf1-a933-b49924de94fd)

**After**
![Screenshot 2025-03-31 at 11 52
26 AM](https://github.com/user-attachments/assets/8423d307-8b0f-4f74-bf9b-06752002af91)



### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] 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)
- [ ] 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.
- [ ] [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)
- [ ] ...
2025-03-31 16:38:48 -06:00
Rodney Norris
6b511b31e6
[Search][Playground] Query Mode Fixes (#216510)
## Summary

- Better handle null/undefined values query utility functions
- Fix scroll for larger query output editor
2025-03-31 16:55:45 -05:00
Michel Losier
bbaa054148
Format last activity value in fleet agent details view as datetime (#215531)
## Summary

Resolves: https://github.com/elastic/kibana/issues/192154

In the Fleet agent details view the last activity row shows the relative
time since the last report from an agent. This value is not as useful if
a user needs to debug why an agent is no longer reporting. Additionally,
the text content in the integration inputs are not selectable and
copyable.

* Changes the agent details last activity value to show the formatted
datetime. 
* The text for integration inputs in agent details is now selectable and
copyable.
2025-03-31 21:25:17 +01:00
Lola
35b7a4aa12
[Cloud Security] fix the alert severity order (#215813)
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.

Alert status Order was showing Low to High rather the showing the
highest status of severity to the lowest severity.
This PR removes the reverse and shows severity from Critical to Low. I
applied ranking order for critical to low to address the sort order

<img width="664" alt="image"
src="https://github.com/user-attachments/assets/2e0f4974-ea08-4bc4-ae1c-53b0c0f53561"
/>
<img width="408" alt="image"
src="https://github.com/user-attachments/assets/77db4442-53eb-44b5-a2d1-8dbbf1858dff"
/>

<img width="628" alt="image"
src="https://github.com/user-attachments/assets/947e8cc2-989b-4b9c-bffe-97ab2e15309d"
/>
2025-03-31 20:18:03 +01:00
Jacek Kolezynski
63575a8320
[Security Solution] Improve documentation for version and revision fields (#216074)
**Resolves: https://github.com/elastic/security-docs/issues/3545**

## Summary

I am fixing documentation for the version and revision fields.
I used this page as the base documentation:
https://docs.elastic.dev/security-solution/dev-docs/detections/rule-versions

The changes:
- by marking the RuleVersion as read-only I am making sure we are
properly documenting that this field is not to be used in the request.
It is only returned in the response.
- by introducing RuleRevision type and marking it as read-only, I am
doing the same for this field, saying that this field is not supposed to
be used in the request.
- I am not changing any code in the app, as the ticket says we shouldn't
do any breaking changes and the update of the version should not cause
400 error. Basically current behavior is kept: users can still update
the version to whatever value they want, including going backwards, and
the changes to revision field is completely ignored.
- I am adding a condensed description of these fields.

I wanted to introduce an internal link between these two fields, but I
couldn't make it work in Bump.sh (even though this should work, normal
Markdown links) so I abandoned this idea.

You can also use this [link](https://bump.sh/jkelas2/doc/kibana_wip2)
where I deployed the generated bundled doc.

Screenshots:

<img width="664" alt="image"
src="https://github.com/user-attachments/assets/34d82eb2-f7f0-4369-ad8e-2fd3c1f35447"
/>

<img width="660" alt="image"
src="https://github.com/user-attachments/assets/dc7772af-0185-4850-816e-60be003775d6"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-31 20:06:13 +02:00
Alberto Blázquez
3ee795780d
Implement "Group by" feature in Asset Inventory page (#212955)
## Summary

Closes https://github.com/elastic/kibana/issues/202092

Depends on:

- https://github.com/elastic/kibana/pull/213212
- https://github.com/elastic/kibana/pull/215963
- https://github.com/elastic/kibana/pull/216354

Add a "Group by" menu dropdown on the right side of the data grid to
render rows grouped recursively with a maximum of 3 group levels i.e.
entities grouped by type (1), category (2), risk(3). It supports
grouping by custom fields as in Findings.

Pagination state of each recursive group is kept locally, while the
top-level group's pagination is kept in the URL query-string. This is to
preserve consistency with the data-table's pagination state which is
also kept in the URL.

### Component hierarchy

<img width="1389" alt="Screenshot 2025-03-28 at 16 00 31"
src="https://github.com/user-attachments/assets/d4c30849-5d76-4589-867f-718847e11e8b"
/>

### Screenshots

<details><summary>TBD Menu Dropdown</summary>
</details> 

<details><summary>Group by none</summary>
<img width="1374" alt="Screenshot 2025-03-26 at 17 00 58"
src="https://github.com/user-attachments/assets/5b319f7b-d63a-4bce-bf24-15549cda254d"
/>
</details>

<details><summary>TBD Group by entity type</summary>
</details>

<details><summary>TBD Group by source</summary>
</details>

<details><summary>TBD Group by entity type, then source</summary>
</details>

<details><summary>TBD Group by source, then entity type</summary>
</details>

<details><summary>TBD Group by cloud account</summary>
</details>

<details><summary>Group by custom field (entity.id)</summary>
<img width="1348" alt="Screenshot 2025-03-26 at 17 02 45"
src="https://github.com/user-attachments/assets/46dc1f25-2bd4-4571-888d-5becf011b7c6"
/>
</details>

> [!IMPORTANT]
> We can't group by asset criticality at the moment because the field is
not present in the current dataset.

<details><summary>TBD Group by asset criticality</summary>
</details>

### Definition of done

- [x] Add a toggle to switch between **DataGrid** and **Group by View**
visualizations.
- [x] Implement the **Group by View** using the `@kbn/grouping` package
for consistency and reusability.
- [x] Provide a dropdown menu to select grouping fields, including:
(updated as per [this
epic](https://github.com/elastic/security-team/issues/10344))
- ~~**Asset type (asset.type)**~~ -> **Asset criticality
(asset.criticality)**
- ~~**Asset category (asset.category)**~~ -> **Entity type
(entity.category)**
- ~~**Risk (host.risk.calculated_level)**~~ -> **Cloud account
(cloud.account.id)**
  - ~~**Criticality (asset.criticality)**~~ -> **Source (entity.type)**
- **Custom field**: Allow users to input/select a custom field for
grouping.
- [x] Display the following information for each group row:
  - The grouped term value.
  - The count of assets in that group.
- A button to expand the group and view the assets in a filtered
**DataGrid**.
- [x] Ensure group expansion dynamically displays assets in a DataGrid
filtered by the selected grouping field.
- [x] **Pagination**: Display 10 groups per page by default, with
pagination controls to navigate between pages.
- [x] **Rows per page dropdown**: Allow users to adjust the number of
groups displayed per page (options: 10, 25, 50, 100).

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] 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.
- [ ] [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)

### Risks

No risk since code is still hidden behind the *Enable Asset Inventory*
advanced setting and the beta *Cloud Asset* integration must be
installed.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-31 17:25:36 +01:00
Sergi Romeu
a23c6d0662
[A11y][APM] Change tpm abbreviation to trace per minute for screen-readers (#216282)
## Summary

Fixes https://github.com/elastic/kibana/issues/194984

This PR uses the `EuiScreenReaderOnly` component to spell out trace per
minute instead of its abbreviation for screen readers

---------

Co-authored-by: jennypavlova <jennypavlova94@gmail.com>
2025-03-31 16:36:26 +01:00
Vitalii Dmyterko
f199b4ceff
[Security Solution][Detection Engine] adds missing ES|QL/New terms rule status telemetry (#214974)
## Summary

- partly addresses https://github.com/elastic/security-team/issues/12000
- adds missing ES|QL rule status telemetry
- adds missing New terms rule status telemetry

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-31 16:18:02 +01:00
Saikat Sarkar
0f4ce97f0e
[Onboarding] Redirect viewers to the discover page as the landing page (#216357)
## Summary
This PR updates the landing page for viewers, directing them to the
**discover** page instead of the **Index Management** page, as they do
not have permission to create or modify indices.


https://github.com/user-attachments/assets/e6fa0808-a54e-43b5-b825-278edd766271




### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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)
- [ ]
[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
- [ ] 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)
- [ ] 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.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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)
- [ ] ...
2025-03-31 16:16:21 +01:00
seanrathier
e86127ab49
[Cloud Security] Hide agentless traffic filtering callout in Serverless (#216239) 2025-03-31 11:04:28 -04:00
Vitalii Dmyterko
3247960336
[Security Solution][Detection Engine] fixes preview logged requests (#215177)
## Summary

During upgrade of ES client in
https://github.com/elastic/kibana/pull/208776, preview logged requests
started to show `index` property in request body.
This PR fixes issue
2025-03-31 14:24:49 +01:00
jennypavlova
cd8f18eed8
[APM][OTel] Service inventory icons should be visible if the agentName is returned (#216220)
Closes #214562 

## Summary

This PR fixes the issue with the service icons overridden by the merge
of the service stats

## Testing
As this is a bit tricky to test - it needs a bit of refreshing /
changing the time range, etc. to reproduce
The way to verify the fix is to check the service overview - every
service that has an icon there should have an icon in the service
inventory:


https://github.com/user-attachments/assets/e401554b-6a39-440b-a52b-a126e42eacd5
2025-03-31 14:07:17 +01:00
Luke Gmys
9679f29415
[Security Solution][Sourcerer] Replace Sourcerer with Discover Data View Picker (#210585)
# Unified Data View Picker: Phase 1 Implementation
Part of https://github.com/elastic/security-team/issues/11959

## What This PR Does
This PR represents the first step in our transition from the current
Sourcerer component to the new unified Data View Picker. Specifically,
this implementation:
- Creates a new Data View Picker component
- Implements feature flag protection for all changes
- Handles asynchronous effects through Redux listener middleware
- Establishes a new Redux store architecture to support ad hoc data
views infrastructure
- Utilizes ad hoc data views to handle legacy patterns from series 7
(replacing the previous upgrade data view flow)

See the readme for more info: 
```x-pack/solutions/security/plugins/security_solution/public/data_view_manager/readme.md```

## What This PR Does NOT Cover
- Does not affect screens other than Timelines
- Does not modify the existing Sourcerer component in any way
- Does not fully support all URL/local storage patterns

## Implementation Notes
We've made several accommodations to support both Sourcerer and the new Data View Picker simultaneously during this transition period, including:
- Some interfaces might look odd, especially the hooks that return the data view or patterns - this is intentional to support existing use cases
- There are feature flag-based conditional statements throughout the code that will be removed once the transition is complete

## Testing Instructions
1. Add the following feature flag to your configuration:
   ```
   xpack.securitySolution.enableExperimental: ['newDataViewPickerEnabled']
   ```
2. Navigate to the Timelines interface
3. Test interactions with the new Data View Picker

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-31 14:12:57 +02:00
Rodney Norris
b3054a913e
[Search][Playground] support for editing search query (#216041)
## Summary

This PR updates the Query Mode in playground to allow the user to
customize the query themselves. When the query is customized the GUI for
selecting fields is disabled. Changing the index setting will reset the
query to the elastic generated search query.

### Screenshots
<img width="1547" alt="image"
src="https://github.com/user-attachments/assets/24d94417-4e10-46dd-abaf-49c7196e17c0"
/>
`{query}` placeholder is required even when customized
<img width="1547" alt="image"
src="https://github.com/user-attachments/assets/8522ba4b-5027-49a6-a85d-19857e76e43b"
/>
"Run" action is disabled when query is not valid JSON
<img width="1547" alt="image"
src="https://github.com/user-attachments/assets/c741d755-4659-4dce-857f-4dfbb73b3035"
/>
Errors are displayed in Query Output
<img width="1547" alt="image"
src="https://github.com/user-attachments/assets/34a797c9-6de6-443a-b58c-5ea8f8c5bf79"
/>

Query field selection is disabled when query is customized


![image](https://github.com/user-attachments/assets/0fcda6c5-a820-4470-b554-9fc1d2ed7950)


### Feature Flag

** This work is behind the `searchPlayground:searchModeEnabled` feature
flag **
Enable feature with Dev Tools
```
POST kbn:/internal/kibana/settings/searchPlayground:searchModeEnabled
{"value": true}
```
OR
Enable feature in `kibana.dev.yml`
```yaml
uiSettings.overrides:
  'searchPlayground:searchModeEnabled': true
```


### Checklist

- [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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-29 14:49:37 +01:00
Philippe Oberti
5b7d5ab65e
[AI4DSOC] Alert summary KPI charts (#215585)
## Summary

This PR adds the KPI charts section to the alert summary page. The 3
charts are similar to the ones in the alerts page, but there are some
subtle differences, which lead to one of them being a separate
component, while the other 2 I was able to reuse the existing components
and just add a property to handle the different logic.

Here are the differences:
- in the AI for SOC we do not (currently) have cell actions, so a
property was added to the charts to be able to hide the cell actions
entirely
- the title of the right chart as well as the fact that it does not have
a dropdown to select the field to group the alerts by meant that a new
component (still using existing child components) was created

![Screenshot 2025-03-26 at 3 02
33 PM](https://github.com/user-attachments/assets/337b3ab4-29c3-40cd-8710-3f5c04898dd7)

The charts react to changes to the KQL bar:


https://github.com/user-attachments/assets/ed0e8f14-ba66-46ae-94df-6c8064c7a648

### Notes

Compared to the mocks (link at the end of the PR description), it was
decided to not add the icons to the left of the next for the middle and
right chart of the KPI section. These might be added in the future, but
there is some complexity related to fetching them (especially for the
alert by host) and more thoughts need to be had to make sure we're
handling all the possible cases.

## How to test

This needs to be ran in Serverless:
- `yarn es serverless --projectType security`
- `yarn serverless-security --no-base-path`

You also need to enable the AI for SOC tier, by adding the following to
your `serverless.security.dev.yaml` file:
```
xpack.securitySolutionServerless.productTypes:
  [
    { product_line: 'ai_soc', product_tier: 'search_ai_lake' },
  ]
```

And this to generate data: `yarn test:generate:serverless-dev`

Use one of these Serverless users:
- `platform_engineer`
- `endpoint_operations_analyst`
- `endpoint_policy_manager`
- `admin`
- `system_indices_superuser`

### Notes

You'll need to either have some AI for SOC integrations installed, or
more easily you can:
- change the `alert_summary.tsx` line `38` from `if
(installedPackages.length === 0) {` to `if (installedPackages.length >
0) {` to force the wrapper component to render
- update `42` of the same `alert_summary.tsx` file from `return <Wrapper
packages={installedPackages} />;` to `return <Wrapper
packages={availablePackages} />;` to be able to see some packages

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

Mocks:
https://www.figma.com/design/DYs7j4GQdAhg7aWTLI4R69/AI4DSOC?node-id=3284-70999&m=dev
Ticket: https://github.com/elastic/security-team/issues/11958
2025-03-28 17:39:14 -05:00
Davis McPhee
0bb73eec2c
[Discover] Initial tabs implementation (disabled in main) (#214861)
## Summary

This PR restructures Discover's state management to support tabs as
outlined in #215398, including the Redux store and
`RuntimeStateManager`. It also adds the initial tabs implementation to
the UI to start building on, but they're disabled by default with a
hardcoded flag. Tabs can be enabled by setting `TABS_ENABLED = true` in
`discover_main_route`, but they don't need to be thoroughly tested in
this PR since most of the functionality is incomplete.

There's also a flaw in the state management approach with `currentId`
since depending on it can cause state to leak across tabs when switching
tabs during async operations (e.g. data fetching). This shouldn't be an
issue while tabs are disabled, and there will be a followup PR #215620
to address it.


https://github.com/user-attachments/assets/ebbb9fa7-a3bc-4e82-9b5c-0d29cd0575f0

Part of #215398.

### Checklist

- [ ] 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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] 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)
- [ ] 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.
- [ ] [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)
2025-03-28 15:38:53 -03:00
Lene Gadewoll
2cd777d969
Upgrade EUI to v101.0.1 (#215698)
`100.0.0`  `101.0.1`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Package updates

### `@elastic/eui`
[`v101.0.1`](https://github.com/elastic/eui/releases/v101.0.1)

- Updated `EuiProvider` and `EuiThemeProvider` with a new
`highContrastMode` ([#8444](https://github.com/elastic/eui/pull/8444))
- This prop allows toggling a higher contrast visual style that
primarily affects borders and shadows
- On `EuiProvider`, if the `highContrastMode` prop is not passed, this
setting will inherit from the user's OS/system settings
- If the user is using a forced colors mode (e.g. Windows' high contrast
themes), this system setting will take precedence over any
`highContrastMode` or `colorMode` props passed
- Added `highContrastModeStyles` and `preventForcedColors` styling utils
([#8444](https://github.com/elastic/eui/pull/8444))
- Updated `EuiRangeTooltip` to be easier to see in dark mode
([#8444](https://github.com/elastic/eui/pull/8444))
- Updated some deprecated color token usages that have direct
substitutes ([#8444](https://github.com/elastic/eui/pull/8444))
  - `text` -> `textParagraph`
  - `title` -> `textHeading`
  - `subduedText` -> `textSubdued`
  - `disabledText` -> `textDisabled`
  - `accentText` -> `textAccent`
  - `dangerText` -> `textDanger`
  - `warningText` -> `textWarning`
- `useEuiShadow()` now accepts a second `options` argument
([#8234](https://github.com/elastic/eui/pull/8234))
- `useEuiShadowFlat()` now accepts an `options` object instead of only a
color ([#8234](https://github.com/elastic/eui/pull/8234))
- Updated `EuiPopover` and `EuiToolTip` to be easier to see in dark
mode. ([#8174](https://github.com/elastic/eui/pull/8174))

**Bug fixes**

- Fixed a visual bug where a transparent border would create visible
empty space (`LIGHT` mode only) for the components:
([#8427](https://github.com/elastic/eui/pull/8427))
  - `EuiPanel`
  - `EuiPopover`
  - `EuiToolTip`
  - `EuiToast`
  - `EuiTour`
  
  --- 
  
### `@elastic/eui-theme-common`
[`v0.1.0`](https://github.com/elastic/eui/releases/v0.1.0)

- Removed type `EuiShadowCustomColor`
([#8444](https://github.com/elastic/eui/pull/8444))
- Added types:  ([#8444](https://github.com/elastic/eui/pull/8444))
  - `EuiShadowOptions`
  - `EuiThemeHighContrastModeProp`
  - `EuiThemeHighContrastMode`
- Updated shadow utils to accepts a second `options` argument and return
borders in high contrast mode:
([#8444](https://github.com/elastic/eui/pull/8444))
  - `euiShadow`
  - `euiShadowXSmall`
  - `euiShadowSmall`
  - `euiShadowMedium`
  - `euiShadowLarge`
  - `euiSlightShadowHover`
  - `euiShadowFlat`
  
  ---
  
### `@elastic/eui-theme-borealis`
[`v0.1.0`](https://github.com/elastic/eui/releases/v0.1.0)

- Added new component level tokens:
([#8444](https://github.com/elastic/eui/pull/8444))
  - `buttonGroupBackgroundDisabledSelected`
  - `overlayMaskBackground`
  - `overlayMaskBackgroundHighContrast`
  - `skeletonBackgroundSkeletonMiddleHighContrast`
  

## Additional changes

The latest `@elastic/eui` package introduces high contrast mode support.
This PR sets all usages of `EuiProvider` to use
`highContrastMode={false}` to introduce it in disabled state (this
reflects the current functionality in Kibana). This is because the UI
for the high contrast mode functionality (and style adjustments) need to
first be implemented on Kibana side (by shared-ux).

## QA

Adding high contrast mode in disabled state should result in no visual
changes in Kibana. Please ensure your product view remain unchanged.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-28 19:29:23 +01:00
Michael Olorunnisola
e3db203470
[Security Solution][THI] - unskip tests (#213472)
## Summary

resolves https://github.com/elastic/kibana/issues/196851
resolves https://github.com/elastic/kibana/issues/195830
resolves https://github.com/elastic/kibana/issues/194510
2025-03-28 16:40:28 +01:00
Faisal Kanout
4bbfc85ebd
[OBX-UX-MGTM] Add stale alert insight (#215332)
## Summary

If fixes https://github.com/elastic/kibana/issues/213003 by adding a
stale alert insight to the alert details page

 ### The heuristics to show the stale alert callout are:
 1. The alert has been active for more than 5 days
<del> 2. The alert has no cases associated with it</d>
<del> 3. The rule is snoozed with no notifications</d>

### Callout stale alert - First Iteration Preview
<img width="1193" alt="Screenshot 2025-03-28 at 13 11 21"
src="https://github.com/user-attachments/assets/638e4926-483b-4728-8580-50ea8872a075"
/>






https://github.com/user-attachments/assets/55717eff-27e9-43a3-95c7-7d41b74f1ff8

---------
2025-03-28 16:26:19 +01:00
Marshall Main
0e63fce8aa
[Security Solution][Detection Engine] Remove CreateRuleOptions, pass options through security rule wrapper instead (#216039)
## Summary

Another small refactor follow up to
https://github.com/elastic/kibana/pull/212694. Overall, the goal here is
to increase consistency in how security rule executors receive common
parameters. `CreateRuleOptions` contained parameters that were passed in
to every security rule type and sometimes used in the `executor` -
bypassing the executor function's parameters. With this PR, params that
are used across multiple security rule type executors like `licensing`,
`experimentalFeatures`, `scheduleNotificationResponseActionsService`,
etc are all passed through the executor options from the shared security
rule type wrapper.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-28 10:52:44 -04:00
Cauê Marcondes
c6acecfc7d
[APM] Fix waterfall margin left position (#216229)
closes https://github.com/elastic/kibana/issues/179525

Before:
<img width="1348" alt="Screenshot 2025-03-27 at 16 50 34"
src="https://github.com/user-attachments/assets/4812c283-571b-48a6-be45-d352ff7e1e75"
/>

After:
<img width="1313" alt="Screenshot 2025-03-27 at 16 49 57"
src="https://github.com/user-attachments/assets/baa41183-6d97-4f46-98b4-012ef2b489f4"
/>
2025-03-28 15:24:36 +01:00
Georgiana-Andreea Onoleață
5a6c01ff82
[ResponseOps]consistent-type-imports linting rule for RO packages/plugins - PR3 (#212498)
- Enabled @typescript-eslint/consistent-type-imports eslint rule for
ResponseOps packages and plugins:
- this rule ensures that imports used only for type declarations are
consistently written using import type syntax
    
- fixed type imports in:
    - x-pack/platform/plugins/shared/event_log
    - x-pack/platform/plugins/shared/rule_registry
    - x-pack/platform/plugins/shared/task_manager
    - x-pack/solutions/observability/packages/kbn-alerts-grouping
    - src/platform/packages/shared/kbn-alerts-ui-shared
    - src/platform/packages/shared/kbn-alerting-types
    - src/platform/packages/shared/kbn-cases-components
    - src/platform/packages/shared/kbn-actions-types
    - src/platform/packages/shared/kbn-alerts-as-data-utils
    - src/platform/packages/shared/kbn-grouping
    - src/platform/packages/shared/kbn-rrule
    - src/platform/packages/shared/kbn-rule-data-utils
    - src/platform/packages/shared/kbn-triggers-actions-ui-types
    - x-pack/platform/packages/shared/kbn-alerting-comparators

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-28 08:56:46 -05:00
Mykola Harmash
c1ece02b9e
[Oblt Onboarding] Add white Apple logo for dark color scheme (#216275)
Closes https://github.com/elastic/kibana/issues/214088

This fixes the issue when Apple logo was not visible when Kibana uses
dark color scheme.

| Light | Dark |
| --- | --- |
| ![CleanShot 2025-03-28 at 11 48
15@2x](https://github.com/user-attachments/assets/92deab8c-bed6-4f39-b8c4-5f63c880101d)
| ![CleanShot 2025-03-28 at 11 48
01@2x](https://github.com/user-attachments/assets/92549fdc-a2fb-4453-8fa3-c234a4b0b1fd)
|
2025-03-28 14:41:11 +01:00
Abhishek Bhatia
ffb196f8e6
[Security Solution][Entity Analytics][Bug]Adding code to get spaceId dynamically (#216063)
## Summary

The Risk Summary in the Entity Flyout was displaying an incorrect risk
score due to the space name not being accounted for in the risk score
index query.

This update ensures that the namespace is properly considered while
querying the risk score, providing accurate results across different
spaces.

Screen recording : 



https://github.com/user-attachments/assets/91df526c-1c22-4d53-aa0c-d74abb54920a


Testing Steps : 
1. Navigate to Entity Risk Score page.
2. Add data in the `default` space
3. Check for Risk score in the Risk Summary for any of the entities in
the Entity Flyout.
4. The Risk score in the Entities table and the flyout should be same
5. Create a new space
6. Add data in the new space
7. Check for Risk score in the Risk Summary for any of the entities in
the Entity Flyout.
8. The Risk score in the Entities table and the flyout should be same



### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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] [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)
2025-03-28 12:29:27 +05:30
Philippe Oberti
27bc00997f
[AI4DSOC] Alert summary KQL bar (#215586)
## Summary

This PR adds the SiemSearchBar to the alert summary page. The search bar
is pretty basic: it hides the query menu and the filter buttons to the
left of the query input. Instead, the PR builds a new filter button.

That button lists all the sources available. Sources are basically
equivalent to integrations, or their corresponding rules. It is a
friendly UI name to abstract the concept or a rule.
In the AI for SOC effort, each integration is bundled with a single
rule. This means that deselecting a source from the Source filter button
is equivalent to adding a filter to the search bar to exclude all alerts
with the `kibana.alert.rule.name` property having the value of that
integration.

### Example:
 There are following 2 integrations installed:
```typescript
[
  {
    id: 'splunk',
    name: 'splunk',
    status: installationStatuses.Installed,
    title: 'Splunk',
    version: '',
  },
  {
    id: 'google_secops',
    name: 'google_secops',
    status: installationStatuses.Installed,
    title: 'Google SecOps',
    version: '',
  },
]
```

This means that - in theory - there are the following 2 rules installed
and running:
```typescript
[
  {
    related_integrations: [{ package: 'splunk' }],
    name: 'Splunk Rule',
  },
  {
    related_integrations: [{ package: 'google_secops' }],
    name: 'Google SecOps Rule',
  },
]
```

In this case, the `Sources` button would show 2 entries, as follow:
```typescript
[
  {
    checked: 'on',
    key: 'Splunk Rule',
    label: 'Splunk',
  },
  {
    checked: 'on',
    key: 'Google SecOps Rule',
    label: 'Splunk',
  },
]
```

By default, the `checked` property should be set to `on`. It would be
`off` if a filter for the corresponding `label` existed.


https://github.com/user-attachments/assets/059815d2-9181-4bf1-bd78-e0e5bfa7439d


https://github.com/user-attachments/assets/126606c7-b4e0-4d0b-82c1-b531c6490de3

## How to test

This needs to be ran in Serverless:
- `yarn es serverless --projectType security`
- `yarn serverless-security --no-base-path`

You also need to enable the AI for SOC tier, by adding the following to
your `serverless.security.dev.yaml` file:
```
xpack.securitySolutionServerless.productTypes:
  [
    { product_line: 'ai_soc', product_tier: 'search_ai_lake' },
  ]
```

And this to generate data: `yarn test:generate:serverless-dev`

Use one of these Serverless users:
- `platform_engineer`
- `endpoint_operations_analyst`
- `endpoint_policy_manager`
- `admin`
- `system_indices_superuser`

### Notes

You'll need to either have some AI for SOC integrations installed, or
more easily you can:
- change the `alert_summary.tsx` line `38` from `if
(installedPackages.length === 0) {` to `if (installedPackages.length >
0) {` to force the wrapper component to render
- update `42` of the same `alert_summary.tsx` file from `return <Wrapper
packages={installedPackages} />;` to `return <Wrapper
packages={availablePackages} />;` to be able to see some packages
- comment out line the if condition line `66` of `use_integrations.ts`
file to make sure that values are added even if there is no
`matchingRule`
- replace `const ruleName = changedOption.key;` with `const ruleName =
changedOption.label;` on line `78` of the
`integrations_filter_button.tsx` file

### Checklist

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

### Links 

Ticket https://github.com/elastic/security-team/issues/11956
Mocks
https://www.figma.com/design/DYs7j4GQdAhg7aWTLI4R69/AI4DSOC?node-id=3284-70999&m=dev

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-27 22:31:42 -05:00
Bailey Cash
40e95f00f1
[SLO]: Add filtering to SLO Management table, improve UX (#216040)
## Summary

Resolves #214258 

- Updates search bar to utilize UnifiedSearchBar
- Adds ability to filter SLOs by tags (OR operator)
- Makes improvements to version display

![Screenshot 2025-03-26 at 2 55
01 PM](https://github.com/user-attachments/assets/cf8c19e4-7a9f-4f2e-bd5d-b820b8f9bf23)
![Screenshot 2025-03-26 at 2 54
20 PM](https://github.com/user-attachments/assets/46e968ff-352a-4f4e-b762-a96c727c08f4)

---------

Co-authored-by: kdelemme <kdelemme@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-28 00:36:16 +02:00
Ievgen Sorokopud
177b4d57e6
[Attack Discovery][Scheduling] Define a data schema of Attack Discovery alert (#12169) (#215184)
## Summary

Here we define a data schema of Attack Discovery alert generated via the
Alerting Framework.

The set of attack discovery specific fields based on existing attack
discoveries described here
https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.gen.ts

All attack discovery specific fields will be stored inside the
`kibana.alert.attack_discovery` path.

<details>
  <summary>Alert document example</summary>

```json
{
        "_index": ".internal.alerts-security.attack.discovery.alerts-default-000001",
        "_id": "01b83369-e147-42d7-8def-87c5454ec7be",
        "_score": 1,
        "_source": {
          "kibana.alert.attack_discovery.users": [
            {
              "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0",
              "name": "elastic"
            }
          ],
          "kibana.alert.attack_discovery.title": "Coordinated multi-host attack",
          "kibana.alert.attack_discovery.details_markdown": """- The attack began with a successful authentication event on host {{ host.name 72b76e8e-9313-4405-8edc-c24eda59b781 }} by user {{ user.name d378d69d-9502-40a5-8d9a-d9b373980bdd }}. Shortly after, the process {{ process.name mimikatz.exe }} was executed from {{ process.executable C:\mimikatz.exe }}.
- On host {{ host.name bfb3fb5d-5a5f-4ac7-9d36-b081f2c4494e }}, a malware alert was triggered for the file {{ file.name fake_malware.exe }} located at {{ file.path C:/fake_malware.exe }}.
- On host {{ host.name 3b425cb3-7058-43f5-b2ad-de29f33eca20 }}, another malware alert was triggered for the process {{ process.name explorer.exe }}.
- Host {{ host.name 7ef6e3d7-7531-426f-96e1-8807d9e2fd12 }} exhibited suspicious behavior with the execution of {{ process.name explorer.exe }}.
- On host {{ host.name 0f7e4c9e-67f1-4edf-b55e-50900d1e59f5 }}, the process {{ process.name notepad.exe }} was executed, potentially indicating lateral movement.
- Host {{ host.name 54a71bb1-d213-478e-9da2-722218dcb2ed }} triggered a malware alert for {{ process.name notepad.exe }}.""",
          "kibana.alert.attack_discovery.entity_summary_markdown": "The insight involves hosts {{ host.name 72b76e8e-9313-4405-8edc-c24eda59b781 }}, {{ host.name 7ef6e3d7-7531-426f-96e1-8807d9e2fd12 }}, and user {{ user.name d378d69d-9502-40a5-8d9a-d9b373980bdd }}.",
          "kibana.alert.attack_discovery.summary_markdown": "An attack progression was observed starting with a successful authentication on {{ host.name 72b76e8e-9313-4405-8edc-c24eda59b781 }} by {{ user.name d378d69d-9502-40a5-8d9a-d9b373980bdd }}, followed by the execution of {{ process.name mimikatz.exe }}, malware activity, and potential lateral movement across multiple hosts including {{ host.name 7ef6e3d7-7531-426f-96e1-8807d9e2fd12 }} and {{ host.name 0f7e4c9e-67f1-4edf-b55e-50900d1e59f5 }}.",
          "kibana.alert.attack_discovery.mitre_attack_tactics": [
            "Initial Access",
            "Execution",
            "Persistence",
            "Lateral Movement",
            "Discovery"
          ],
          "kibana.alert.attack_discovery.alert_ids": [
            "9648d34f8b600a17b9fa8baedf425b7e190462ba3a8ef34b3f71d205e2b29a27",
            "c424c79e43387bb630f1facdb0939930b5b20aab5509c35e0e0f817d04575e0c",
            "e7b7c0ee70f003970f37bcab99646d6753abc185dd4d1219a8459e9ae74592ef",
            "d0bde4f1b0990d27b11dfd74e2af90e86700e735bc81eec8e91a9eed0534668e",
            "13a611195e49e91331aad08da7a2aa5556e890a1b96414f70b1b5f7cbfb275dc",
            "39176ec7b7ce34e2c244047769515243184dd7e8668d71c864439c2847061ed1"
          ],
          "kibana.alert.attack_discovery.replacements": {
            {
              "uuid": "d139f511-2e80-4554-a161-6dbd280fed08",
              "value": "0vswa2l7v8"
            },
            {
              "uuid": "99958549-db36-43eb-8379-bcc3d2ddd0cf",
              "value": "Host-n92pjmd9dv"
            },
            {
              "uuid": "e5c78e61-2252-4a53-87b9-221bb55e629a",
              "value": "rbx0fbssj4"
            },
            {
              "uuid": "192c0876-9616-4572-9ba2-1a8a86ddf4a9",
              "value": "Host-tiogh0c668"
            }
          },
          "kibana.alert.attack_discovery.api_config": {
            "connectorId": "gpt-4o",
            "actionTypeId": ".gen-ai"
          },
          "kibana.alert.attack_discovery.alerts_context_count": 100,
          "kibana.alert.rule.category": "Attack Discovery Schedule Rule",
          "kibana.alert.rule.consumer": "siem",
          "kibana.alert.rule.execution.uuid": "7c6f1e49-f2c8-447d-b0d3-47b705abfe94",
          "kibana.alert.rule.name": "Attack Discovery Schedule - 1",
          "kibana.alert.rule.parameters": {
            "alertsIndexPattern": ".alerts-security.alerts-default",
            "anonymizationFields": [
              {
                "id": "Hr2wXJUBOpH1ddTrm3JE",
                "timestamp": "2025-03-03T15:47:12.833Z",
                "field": "user.target.name",
                "allowed": true,
                "anonymized": true,
                "createdAt": "2025-03-03T15:47:12.833Z",
                "namespace": "default"
              }
            ],
            "apiConfig": {
              "connectorId": "gpt-4o",
              "actionTypeId": ".gen-ai"
            },
            "end": "now",
            "replacements": {},
            "size": 100,
            "start": "now-24h",
            "subAction": "invokeAI"
          },
          "kibana.alert.rule.producer": "assistant",
          "kibana.alert.rule.revision": 0,
          "kibana.alert.rule.rule_type_id": "assistant.attack_discovery_schedule",
          "kibana.alert.rule.tags": [
            "attack_discovery"
          ],
          "kibana.alert.rule.uuid": "465a296b-0231-493b-90b6-cc5444e7a9bf",
          "kibana.space_ids": [
            "default"
          ],
          "@timestamp": "2025-03-14T10:34:26.622Z",
          "event.action": "open",
          "event.kind": "signal",
          "kibana.alert.rule.execution.timestamp": "2025-03-14T10:34:26.622Z",
          "kibana.alert.action_group": "default",
          "kibana.alert.flapping": false,
          "kibana.alert.flapping_history": [
            true
          ],
          "kibana.alert.instance.id": "c0652e52-6feb-4b5c-95f5-483cad76608d",
          "kibana.alert.maintenance_window_ids": [],
          "kibana.alert.consecutive_matches": 1,
          "kibana.alert.pending_recovered_count": 0,
          "kibana.alert.status": "active",
          "kibana.alert.uuid": "01b83369-e147-42d7-8def-87c5454ec7be",
          "kibana.alert.severity_improving": false,
          "kibana.alert.workflow_status": "open",
          "kibana.alert.duration.us": 0,
          "kibana.alert.start": "2025-03-14T10:34:26.622Z",
          "kibana.alert.time_range": {
            "gte": "2025-03-14T10:34:26.622Z"
          },
          "kibana.version": "9.1.0",
          "tags": [
            "attack_discovery"
          ]
        }
      }
```

</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-27 22:54:02 +01:00
Marshall Main
f7ef9602a5
[Security Solution][Detection Engine] Remove unused types and functions (#216104)
## Summary

Remove dead code.
2025-03-27 15:26:35 -04:00
Elena Shostak
7a41906d88
[Authz] Mandatory Security Config (#215180)
## Summary

This PR makes `security` a required field for route registration. To
incorporate the new required filed, changes has been made:

1. **Test file updates**. A lot of the updates made in this PR were made
in tests.
2. **Versioned route security configuration**. For the versioned route
`security` config has been lifted up to the top-level definition:

    Before
    ```ts
    router.versioned
      .get({
        path: '/api/path',
        options: { ... },
        ...
      }, handler)
      .addVersion({
         version: 1,
         validate: false,
         security: {
          authz: {
            requiredPrivileges: ['privilege'],
          },
         },
      });
    ```
    
    After
    ```ts
    router.versioned
      .get({
        path: '/api/path',
        options: { ... },
         security: {
          authz: {
            requiredPrivileges: ['privilege'],
          },
         },
        ...
      }, handler)
      .addVersion({
         version: 1,
         validate: false,
      });
    ```

3. **Type adjustments for route wrappers**. Type changes has been made
in:
-
`x-pack/solutions/observability/plugins/infra/server/lib/adapters/framework/adapter_types.ts`
-
`x-pack/solutions/observability/plugins/metrics_data_access/server/lib/adapters/framework/adapter_types.ts`
-
`x-pack/solutions/observability/plugins/synthetics/server/routes/types.ts`
-
`x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/types.ts`

Security was made an optional field for the wrappers defined in those
files, since the default security is provided in the wrapper itself and
then passed down to the core router.

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


__Closes: https://github.com/elastic/kibana/issues/215331__

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-27 12:04:53 -07:00
Francesco Fagnani
b8a29d4096
[Synthetics] Add KQL Filter to TLS Alerting Rule (#215110)
This PR partially solves issue #214346 by adding the KQL Filter when
creating a TLS Alerting Rule.

Because of [the intermediate release
process](https://docs.google.com/document/d/1mU5jlIfCKyXdDPtEzAz1xTpFXFCWxqdO5ldYRVO_hgM/edit?tab=t.0#heading=h.2b1v1tr0ep8m)
the UI to add the new filters is not shown, another PR will enable it
after the next serverless release.

In details:

BE:
- Extended `tlsRuleParamsSchema` to accept `monitorIds`, `locations`,
`tags`, `monitorTypes`, `projects`, `kqlQuery`
- Extended `TLSRuleExecutor` functionality, added tests
- Added new `/internal/synthetics/inspect_tls_rule` endpoint 

FE:
- Added `AlertSearchBar`, `FieldFilters` and `TLSRuleViz` to the
`TLSRuleComponent`, making sure that only `http` and `tcp` monitors are
considered

Final result:


https://github.com/user-attachments/assets/613cdb73-2184-4b10-8dd5-549868b7672d

---------

Co-authored-by: Shahzad <shahzad31comp@gmail.com>
2025-03-27 18:57:51 +01:00
Mykola Harmash
15f17456b4
[Oblt Onboarding] Switch APM OTel onboarding to OTLP service on serverless (#215345)
Closes https://github.com/elastic/kibana/issues/208040

This change adds a new option to ingest APM data using the new managed
OTLP service.

| Classic APM | OTLP |
| --- | --- |
| ![CleanShot 2025-03-26 at 17 06
57@2x](https://github.com/user-attachments/assets/ad542839-30b4-4009-b363-24ac02da3308)
| ![CleanShot 2025-03-26 at 17 07
08@2x](https://github.com/user-attachments/assets/00fa7960-5918-4ae5-b02f-2cfc21579e64)
|


## How to test

1. Open Kibana deployed from this PR
2. Go to "Add Data" screen → Application → Open Telemetry
3. Make sure you're redirected to the Open Telemetry instructions in APM
4. Switch to the Managed OTLP option in the second step
5. Make sure `OTEL_EXPORTER_OTLP_ENDPOINT` variable has the new managed
service URL (it should contain `.ingest` subdomain, e.g.
`https://c045db.ingest.us-east-1.aws.elastic.cloud:443`)
6. In order to test the flow end-to-end you need to instrument a sample
application and configure EDOT Collector. As a shortcut, you can use
[this guide](https://github.com/elastic/opentelemetry-dev/issues/557) to
setup sample applications inside Kubernetes pods and then use the
quickstart K8S OTel flow in Kibana to run the EDOT collector but
replacing the endpoint and API key within the snippet to ones provided
by the APM OTel guide.
2025-03-27 19:13:55 +02:00
Carlos Crespo
4e3db8dd1b
[APM] Service map support for span links (#215645)
closes  [214771](https://github.com/elastic/kibana/issues/214771)
part of: https://github.com/elastic/kibana/issues/109209

## Summary

Adds support for span links to the service map. This includes both
elastic APM and Otel data sources

On the examples below, the connection between `checkoutservice` and
`accountingservice` is done via `kafka/orders`, which contains creates a
span link between these 2 services

| before | after |
|-------|-------|
|<img width="800" alt="image"
src="https://github.com/user-attachments/assets/3b827119-134e-4225-91a0-ba5608bedce7"
/>|<img width="800" alt="image"
src="https://github.com/user-attachments/assets/de0c3304-aebc-4c39-a890-841c43a50259"
/>|

 before | after |
|-------|-------|
|<img width="800" alt="image"
src="https://github.com/user-attachments/assets/14a1db6a-4c69-4683-bdca-3df66300ee1e"
/>|<img width="800" alt="image"
src="https://github.com/user-attachments/assets/524c6332-c92d-4db1-8dff-9655135ff0a3"
/>|


### How to test

1. Synthtrace
- Run `node scripts/synthtrace span_links.ts --live --uniqueIds --clean`
 - Navigate to `Applications > Service Inventory > Service map`

2. Edge cluster
- Connect to an oblt edge cluster
- Inspect the service map for `checkoutservice` and `accountservice`
(both otel)

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-27 17:54:59 +01:00
Cauê Marcondes
900e335546
[APM] Embeddable Trace Waterfall (#216098)
closes https://github.com/elastic/kibana/issues/215756

Using the new embeddable:
```
<ReactEmbeddableRenderer
        type="APM_TRACE_WATERFALL_EMBEDDABLE"
        getParentApi={() => ({
          getSerializedStateForChild: () => ({
            rawState: {
              serviceName: 'foo',
              traceId: 'e7b9d541fae0e25106291f7ac0947acd',
              entryTransactionId: '2d94d9d4fda31c18',
              rangeFrom: '2025-03-26T00:00:00.513Z',
              rangeTo: '2025-03-26T20:52:42.513Z',
              displayLimit: 5, //optional param when omitted it renders the entire waterfall
            },
          }),
        })}
        hidePanelChrome={true}
      />
```

**This video is just an example, I did NOT add the embeddable to
Discover in this PR**


https://github.com/user-attachments/assets/c162d47e-a0bc-4327-8f9f-921d07a022fa
2025-03-27 13:17:52 -03:00
Maryam Saeidi
9061a0876d
Audit info and error logs in observability plugin (#216111)
Closes https://github.com/elastic/observability-dev/issues/4409

## Summary

Auditing log levels
2025-03-27 13:06:32 +02:00
Ievgen Sorokopud
ff5d682244
[Attack Discovery][Scheduling] UI: Implement "Attack Discovery Scheduling" rule creation flow (#12006) (#216087)
## Summary

Main ticket ([internal
link](https://github.com/elastic/security-team/issues/12006))
Filgma link: ([internal
link](https://www.figma.com/design/1AEgYCsQjCsWxAKoErYfL3/9.1-%5BAttack-Discovery%5D-Scheduling-%26-notifications?node-id=3421-195207&t=Y9ejBkDCojHD95qw-4))

With these changes we add create attack discovery schedule flyout.

## Recording


https://github.com/user-attachments/assets/6a1226f2-c45d-4b79-a67d-0e10fac71060

## NOTES

The feature is hidden behind the feature flag:

> xpack.securitySolution.enableExperimental:
['assistantAttackDiscoverySchedulingEnabled']

There is no logic to create actual schedule yet. This will be connected
once https://github.com/elastic/security-team/issues/12003 is done.

For now to see the data returned from the flyout which we gonna use to
create schedule later, you can add console log in
`x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/settings_flyout/schedule/hooks/use_edit_form.tsx`
file within the `handleFormSubmit` function to print the `formData`. The
form data from the recording above looks like this:

```json
{
  "name": "Schedule 1",
  "connectorId": "gemini-1-5-pro",
  "alertsSelectionSettings": {
    "query": {
      "language": "kuery",
      "query": ""
    },
    "filters": [],
    "size": 350,
    "start": "now-7d",
    "end": "now"
  },
  "interval": "24h",
  "actions": [
    {
      "id": "bb9a46e0-46c1-42c7-b186-ddf3ea6fdf84",
      "actionTypeId": ".email",
      "group": "default",
      "params": {
        "message": "Rule {{context.rule.name}} generated {{state.signals_count}} alerts",
        "to": [
          "test@elastic.co"
        ],
        "subject": "Test email 1"
      },
      "frequency": {
        "notifyWhen": "onActiveAlert",
        "throttle": null,
        "summary": true
      },
      "uuid": "78f888f2-aff1-4d34-9ba5-683a6c0d2b5e"
    }
  ]
}
```

### 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] [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
2025-03-27 12:03:34 +01:00
Sergi Romeu
b59e8eb653
[A11y][APM] Adds aria-label to Transaction type select on service overview (#216014)
## Summary

Fixes #210262

This PR adds an `aria-label` to solve the "Select element must have an
accessible name" A11y critical issue.

## How to test
1. Download the [axe
devtools](https://chromewebstore.google.com/detail/axe-devtools-web-accessib/lhdoppojpmngadmnindnejefpokejbdd)
2. Go into a service overview and run the scanner from axe devtools
3. You should see a critical error
4. Checkout this branch
5. Error should be solved
2025-03-27 10:00:49 +01:00
Nathan Reese
3bc1465365
[unified search] optimize async chunk loading (#214483)
PR reduces unifiedSearch chunks into ui chunk, action chunk, and a
autocomplete chunk.

### Before
<img width="350" alt="Screenshot 2025-03-14 at 8 47 10 AM"
src="https://github.com/user-attachments/assets/f54fe21e-7548-48a1-8874-e36377826701"
/>

### After
The second chunk request is because search bar loads KQL suggestions.
This will be addressed in a follow up PR and the search bar will lazy
load suggestions only when interacted with.
<img width="350" alt="Screenshot 2025-03-14 at 12 56 28 PM"
src="https://github.com/user-attachments/assets/8f23ee56-a57a-489b-aeab-caa30f739d03"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-03-26 18:39:58 -06:00
Kylie Meli
6967952189
[Fleet][Security & Observability Onboarding] Generalize and consolidate custom fleet onboarding logic (#215561)
## Summary

Updated fleet custom navigation logic to be more generic and consistent
between security and observability onboarding flows.

## Details

When attempting to start using the custom logic for routing back to
onboarding pages for another project, I noticed inconsistencies in how
we were linking back to the onboarding pages for the `Back to selection`
button on the Integrations overview page and the `Cancel` and `Save and
continue` on the Add integration page. Due to these inconsistencies,
both custom routing mechanisms couldn't both work at the same time. I
re-worked the implementation of the back button to match the cancel/save
buttons and utilize `navigateToApp` to fix.

Now instead of observability utilizing the `observabilityOnboardingLink`
query param, and security utilizing both `observabilityOnboardingLink`
and `onboardingAppId`, both solutions will use `returnAppId` and
`returnPath` (or different names if we don't love these) to route back
to their sourcing locations.

Note: Observability onboarding will also now inherit logic the security
onboarding team added where the same query parameters route back to the
source when a user cancels or saves from the Add integration page (item
3 from [this PR](https://github.com/elastic/kibana/pull/194028))

## Screen recordings

Regular integrations page


https://github.com/user-attachments/assets/0f306bec-657f-4a7a-b2da-25557899b629

Security onboarding


https://github.com/user-attachments/assets/d2a161a0-62ee-40b1-9dd9-5165aea6a65a

Observability onboarding


https://github.com/user-attachments/assets/89f6b9a3-a348-4488-8688-1d5c96716185

Relates: 
- https://github.com/elastic/kibana/issues/181520
- https://github.com/elastic/security-team/issues/11789

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-03-26 13:40:51 -04:00
Luke Gmys
0f7a8478cd
[Security Solution][Notes] Limit notes per document instead of globally (#214922)
## Summary

Related to https://github.com/elastic/kibana/issues/212687

This PR changes the notes behavior so that the maximum allowed count it
100 per document for unassigned notes (notes that do not belong to a
timeline).

## Testing
Just play around with the notes, adding them directly to the alerts in
the alerts table. You can use the script below to add like 99 to observe
the validation behavior that I have changed.

### Performance 
This script adds the maximum notes (100) for all the alerts it will find
in the default index. You can modify it freely.
Make sure you have some alerts setup, then use this script to populate
notes for them:
```https://gist.github.com/lgestc/85e8ce315fbd53dd9c87fad715e1cb9e```

---------

Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
2025-03-26 12:38:36 -05:00
Angela Chuang
169abecdda
[SecuritySolution] Make last conversation local storage keys space aware (#214794)
## Summary

Issue and steps to reproduce:
https://github.com/elastic/kibana/issues/214114




https://github.com/user-attachments/assets/881fb082-a879-4816-b251-da3f2af77661



The best approach to fix this is to make local storage keys space aware.
In this use case, the current key is
`elasticAssistantDefault.lastSelectedConversation`.

Ideally it should be e.g.:
`elasticAssistantDefault.lastSelectedConversation.{spaceId}`

To retrieve spaceId properly, we have to make sure spaceId has been
available when reading the local storage. In other words, the spaceId
cannot be null, undefined, or a fallback value when accessing it.

To achieve that, we have to only render the assistant overlay after
spaceId is available and remove existing spaceId from the
AssistantContext. The reason I removed spaceId from AssistantContext is
because it is at the top of the rendering tree and can block the entire
app if waiting for the spaceId becomes available there.

`useAssistantSpaceId` comes from `SpaceIdContext` which should be render
only when spaceId is available, should be safe to access the exact
spaceId inside Assistant overly.


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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 <42973632+kibanamachine@users.noreply.github.com>
2025-03-26 16:34:48 +00:00
Francesco Fagnani
04d53ec134
[Synthetics] Fix location filter in status rule executor (#215514)
This PR closes #215505 by fixing the location filter when creating a
custom status rule for monitors.



https://github.com/user-attachments/assets/623b21fb-af45-42ae-a120-e38562451062

---------

Co-authored-by: Shahzad <shahzad31comp@gmail.com>
2025-03-26 18:08:25 +02:00
Ryan Keairns
c38cec8db6
[Security] Make tour step go under header (#215810)
## Summary

The tour step on the getting start page goes over the global nav bar on
scroll. This PR makes it go below similar to the rest of the page
content.

**Before**
![CleanShot 2025-03-24 at 14 56
14@2x](https://github.com/user-attachments/assets/e40be0ec-93c3-4d51-bf06-c9c42d5ff131)


**After**
![CleanShot 2025-03-24 at 14 55
31@2x](https://github.com/user-attachments/assets/8d1fb11e-9712-46bf-a895-2e7927896e9e)


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

N/A
2025-03-26 08:56:09 -07:00
Alberto Blázquez
e7bc3b5a93
Refactor Asset Inventory to prepare for "grouping" feature (#215963)
## Summary

Preparation work to close 
- https://github.com/elastic/kibana/issues/202092.

PR followed up by:
- https://github.com/elastic/kibana/pull/212955

The purpose of this PR is to split content (& complexity) between the
top-level `<AllAssets>` and `AssetInventoryDataTable` that now only
encapsulates all things table related. This comes in preparation for the
upcoming grouping functionality where `<AssetInventoryDataTable>` will
be replaced with `<AssetInventoryTableSection>`, which renders a
recursive structure compounded by "groups" that end up rendering such
data table.

On top of that, I've renamed the domain-specific components to start all
with "AssetInventory" (equivalent kebab-case renaming with their file
names). We're also reusing the same "Inventory" page title that
Onboarding uses.

The outcome will be a much cleaner and predictable component tree
similar to the diagram below:

<img width="842" alt="Screenshot 2025-03-25 at 22 48 32"
src="https://github.com/user-attachments/assets/c5fbe773-03a3-41f0-adc4-6d353cf3eb71"
/>

### Checklist

- [ ] 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)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [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
- [ ] 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.
- [ ] [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

No risk since feature is not publicly available yet.
2025-03-26 16:29:10 +01:00
Miriam
a0dfe46b84
[ObsUX][A11y] Change button for link in Pod context menu (#216022)
Closes https://github.com/elastic/kibana/issues/194971

## Summary

The context menu for Kubernetes Pod includes several links to other
views, some of these links were converted to a button because the
`onClick` prop was added.

`EuiListGroupItemProps`

<img width="852" alt="Screenshot 2025-03-26 at 11 04 02"
src="https://github.com/user-attachments/assets/b7fb43b4-1fff-4605-9509-d894ece18e81"
/>

<img width="852" alt="Screenshot 2025-03-26 at 11 03 40"
src="https://github.com/user-attachments/assets/5a7e831d-3bce-42ce-a7f0-46d5556e8a41"
/>

### What was done

- Remove the `onClick` prop
- Hide links when they are not available instead of marking them as
disabled
- The `Create inventory rule` button wasn't changed to a link as it's
opening a flyout

### How to test

- Open the Infrastructure Inventory view and select Kubernetes Pods
- Click on a pod to open the popover
- Review the items' markup or use a screen reader to listen to each item
in the popover
- On advance settings we can enable or disable legacy Uptime, when
disabled link should be hidden

BEFORE


![image](https://github.com/user-attachments/assets/ac590116-e168-4a70-90e1-62f4b5df2d95)

AFTER

<img width="1566" alt="Screenshot 2025-03-26 at 10 59 48"
src="https://github.com/user-attachments/assets/08e8be52-cf8b-424b-aec4-a65246660878"
/>

<img width="815" alt="Screenshot 2025-03-26 at 11 00 51"
src="https://github.com/user-attachments/assets/1df50949-fc98-49b9-88ac-1de956ffbfd8"
/>
2025-03-26 15:17:15 +00:00
Mykola Harmash
6a71d9fb9a
[Onboarding][OTel Host] EDOT configuration send OTLP exporter -> Managed OTLP endpoint on Serverless (#213097)
Closes https://github.com/elastic/kibana/issues/208035

> [!IMPORTANT]
> [One of the
changes](https://github.com/elastic/elastic-agent/pull/7063) needed for
the flow to function is not in the Elastic Agent v18.7.3 that is
currently used by Serverless. We need to wait for the next EA release
before merging this PR.
> As a workaround for testing, after running the first code snipped from
the flow, you can modify the generated `./otel.yml` file to add `ApiKey`
in front of the API key and then start the collector.

This change switches OTel Host quickstart flow on Serverless to the
managed OTel collector as the ingest endpoint. Specifically it:

* Uses a modified APM managed service URL as the endpoint. Later the
OTel endpoint will be exposed separately through the Cloud plugin (ref:
https://github.com/elastic/cloud/issues/137354).
* Uses API key generated by APM to access the managed service. This
later will also should be decoupled from APM (ref:
https://github.com/elastic/kibana/issues/208035#issuecomment-2654482081)
* Modifies the code snipped with the new variables

![CleanShot 2025-03-04 at 14 59
44@2x](https://github.com/user-attachments/assets/3c1afaf6-3a01-4a38-8e8d-1cc0e3e65d44)


## How to test

* Use the Serverless instance deployed from this PR, make sure OTel Host
flow code snippet uses the managed service endpoint, ingest logs from
your computer
* Run the classic Kibana locally, and make sure the OTel Host flow uses
the usual code snippet with ES ingest endpoint, ingest logs from your
computer
2025-03-26 15:36:40 +01:00