Commit graph

32517 commits

Author SHA1 Message Date
Ying Mao
32459096ff
Revert TM resource based task scheduling issues (#189529) 2024-07-30 10:53:27 -06:00
Rachel Shen
1f00087e61
[Dashboard] Add maxWidth 's' to Panel Settings flyouts and 'm' to drilldown widths not already specified in dashboard (#189009)
## Summary

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

The Dashboard and Panel Settings Flyouts already seem to be fixed but
the Controls Settings Flyout did not specify the maxWidth.

The drilldown (manage and create) flyouts did not have a maxWidth
specified but based on main, it seems to match medium. To avoid any
unclearness, I have added the maxWidth property to the flyout.

The edit and create drilldowns that didn't have specified maxWidths can
be toggled to each other so they should be the same. I think there can
be a little bit of a debate on which makes the most sense. Although
there is some white space to the right of the buttons in the create
drilldown I think it makes the most sense for the manage drilldowns to
not be cramped and have the maxWidths be medium if possible.

<img width="900" alt="Screenshot 2024-07-24 at 1 19 51 PM"
src="https://github.com/user-attachments/assets/549c34df-5d85-40f4-bfb4-dd5d17d96ca5">

### Edit drilldown
Size s makes it look more cramped and breaks the word Discover onto two
lines:
<img width="626" alt="Screenshot 2024-07-24 at 1 15 09 PM"
src="https://github.com/user-attachments/assets/89013146-f437-4180-8de0-12d033198b88">

Size m
<img width="1044" alt="Screenshot 2024-07-24 at 1 09 35 PM"
src="https://github.com/user-attachments/assets/60dd3838-724a-42c4-b717-c2d7e75a3c10">

### Create drilldown: 
I'm leaning towards size 's' for the create drilldown flyout based on
the following screenshots:

Size s
<img width="631" alt="Screenshot 2024-07-24 at 1 12 46 PM"
src="https://github.com/user-attachments/assets/7e052bbf-3d02-492e-9332-8998b01c95b7">

Size m
<img width="710" alt="Screenshot 2024-07-24 at 1 10 58 PM"
src="https://github.com/user-attachments/assets/6f35ee9c-5858-400d-9498-c90323f44303">
2024-07-26 19:06:32 -06:00
Tiago Costa
339be82b4a
skip flaky suite (#185046) 2024-07-27 00:33:38 +01:00
Tiago Costa
08db3f23ad
skip flaky suite (#189192) 2024-07-27 00:20:55 +01:00
Kevin Delemme
8fb9d64781
chore(investigate): move behind feature flag (#189290) 2024-07-26 14:54:07 -07:00
Mark J. Hoy
25960d251e
[Inference Endpoints View] Adds Amazon Bedrock to Deletion, search and filtering of inference endpoints (#188670)
## Summary

Adds Amazon Bedrock support to the [Inference Endpoints management
UI](https://github.com/elastic/kibana/pull/186206)
(`relevance/inference_endpoints`) management list view.

### 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 <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-26 17:31:34 -04:00
Lisa Cawley
841e95c64b
[OAS][ML] Add sync API tags and description, minor OpenAPI fixes (#189230) 2024-07-26 15:28:43 -05:00
Davis Plumlee
5817a9c9d3
[Security Solution] Integration tests for multi line string field diff algorithm (#188688)
## Summary

Completes https://github.com/elastic/kibana/issues/180159

Switches fields to use the multi line string diff algorithm assigned to
them in the [overarching
ticket](https://github.com/elastic/kibana/issues/180159#issuecomment-2218392217)

Adds integration tests in accordance to
https://github.com/elastic/kibana/pull/188323 for the `upgrade/_review`
API endpoint for the multi line string field diff algorithm.


### Checklist

Delete any items that are not applicable to this PR.

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


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2024-07-26 14:13:11 -04:00
Dima Arnautov
2d83c0e5ea
[ML] Utilize the DataViewLazy in ML plugin (#189188) 2024-07-26 19:56:58 +02:00
Devin W. Hurley
d7493052e2
[Security Solution] [Detections] Adds support for system actions (and cases action) to detection rules (#183937)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Vitalii Dmyterko <92328789+vitaliidm@users.noreply.github.com>
2024-07-26 12:20:39 -05:00
Brad White
1aee15f611 Merge branch 'main' of github.com:elastic/kibana into upstream-main 2024-07-26 11:15:08 -06:00
Brad White
6b64a9f803 Revert "[Security Solution] Auto-bundle Timeline API OpenAPI specs (#188844)"
This reverts commit efb2866d84.
2024-07-26 11:13:30 -06:00
Kylie Meli
77848e3521
[integration automatic-import] appending input.type to title (#189297)
Appending the input type to the title for better clarity during
configuration

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

<img width="816" alt="Screenshot 2024-07-26 at 10 46 26 AM"
src="https://github.com/user-attachments/assets/4c780cc5-7190-498c-b4ff-5633594dcb52">
2024-07-26 13:12:37 -04:00
Luke G
7db28682dd
[Security Solution] Support experimental features in timelines (#189028)
## Summary

Adding generic support for experimental features in timelines

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-26 10:46:40 -05:00
Joe Reuter
03958651d9
Observability Onboarding: Show otel tile on integrations page (#189163)
Similar to how APM is shown as an integration as well, show the new
OTel-based flow on the integrations page so people find it from there as
well:

<img width="991" alt="Screenshot 2024-07-25 at 11 32 46"
src="https://github.com/user-attachments/assets/4d806ed1-4b01-4ac8-985c-0e59708fa4c6">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-26 17:42:03 +02:00
Saikat Sarkar
fcd33b20f3
[Semantic Text UI] Modify select inference popover (#189221)
This PR resolves https://github.com/elastic/search-team/issues/7932

### After this change

![Screenshot 2024-07-25 at 2 12
01 PM](https://github.com/user-attachments/assets/63e1f935-6cdd-4b24-ba86-b28f6df96183)
2024-07-26 09:25:32 -06:00
Maryam Saeidi
b109e75e64
[Log threhsod, SLO burn rate] Save the ECS group by fields at the AAD root level (#189260)
Related to #183220

## Summary

This PR saves ECS groups in the Alert As Data (AAD) document for the log
threshold and SLO burn rate rules.

|Rule|AAD document|
|---|---|
|SLO burn
rate|![image](https://github.com/user-attachments/assets/c5476e33-95d0-4c39-af12-2ef5a9768ab0)|
|Log
threshold|![image](https://github.com/user-attachments/assets/34fc6662-c4c3-4b3e-9d77-f0959f726394)|

### 🧪 How to test
- Create a log threshold and SLO burn rate rule with multiple groups
(both ECS and non-ECS fields)
- Check the related AAD document; you should be able to see the ECS
fields at the root level and not see non-ECS fields there
- Check the same information for the recovered alerts
- Rules without group by should work as before

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-26 17:12:29 +02:00
Maryam Saeidi
9c242ac773
[Log threshold] Fix showing the correct log view in the rule creation flyout (#189205)
Related to #187291

## Summary

This PR passes the rule's logView to the Log threshold rule creation
flyout. Thanks to @Kerry350 and @weltenwort for explaining how this
logic works ❤️

For example, if the log view ID is passed an invalid id, like this:

<img
src="https://github.com/user-attachments/assets/f9d4ac74-9b16-406e-93e5-141ea82d1687"
width=500 />

it will fall back to the default log view will be used, and now we show
the correct log view in the rule flyout.

Example setting:


![image](https://github.com/user-attachments/assets/67b03d70-4e87-433a-830e-295f042bce92)

|Before|After|
|---|---|

|![image](2b727635-8403-4372-9a03-e124f3987ccb)|
2024-07-26 17:11:30 +02:00
Sander Philipse
98a7da9a83
[Search] Fix index error incorrectly showing up (#189283)
## Summary

This fixes a bug where the index error would show up for third-party
models because the logic for determining local models was incorrect.
2024-07-26 09:34:35 -05:00
Thom Heymann
27bddf284f
[Observability Onboarding] Various fixes for Quickstart Onboarding flows (#189134)
Resolves #188643
Resolves #188644
Resolves #188630

## Summary

Various fixes for Quickstart Onboarding flows

Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
2024-07-26 15:14:38 +01:00
Julia Bardi
19010a0747
[Fleet] Re-enable flaky test manage agent policies (#189271)
## Summary

Closes https://github.com/elastic/kibana/issues/189004
2024-07-26 09:05:36 -05:00
Ying Mao
b693df92ff
[Response Ops][Task Manager] Dynamically set capacity for cloud deployments (#189117)
Followup to https://github.com/elastic/kibana/pull/187999

## Summary

Dynamically set capacity for cloud deployments if claim strategy is
`mget`

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-26 09:32:07 -04:00
Yngrid Coello
7bb17aefc3
[Dataset quality] Adding execution context to data quality page within management app (#189272)
This PR aims to improve `context.page_name` within stack telemetry.
After the changes we will start seeing information about dataset quality
in `application:management:data_quality` rather than just a generic
pageName such as `application:management`.

<img width="1728" alt="image"
src="https://github.com/user-attachments/assets/d172353a-824d-46f7-8d5e-7c564375827a">
2024-07-26 08:04:32 -05:00
Maxim Palenov
218146ee69
[Security Solution] Auto-bundle Endpoint Management API OpenAPI specs (#188853)
**Addresses**: https://github.com/elastic/kibana/issues/184428

## Summary

This PR adds scripts for automatic bundling of Endpoint Management API OpenAPI specs as a part of PR pipeline. Corresponding result bundles are automatically committed to the Security Solution plugin `x-pack/plugins/security_solution` in the `docs/openapi/ess/` and `docs/openapi/serverless` folders (similar to https://github.com/elastic/kibana/pull/186384).
2024-07-26 14:59:17 +02:00
Jill Guyonnet
9bc57412bb
[Fleet] Fix namespaces property of created agent policies (#189199)
## Summary

I found a small bug while working on
https://github.com/elastic/kibana/issues/185040: when agent policies are
created, there should be a root-level `namespaces` property, which is
currently missing.

`GET .fleet-policies/_mapping` contains a `namespaces` property with
`keyword` type that was added in
https://github.com/elastic/elasticsearch.

Note: I was looking into removing the existing `data.namespaces`
property, however I don't see any issues with it. It is coming from
[here](f77e4d243f/x-pack/plugins/fleet/server/services/agent_policy.ts (L1140)),
i.e. the `data` property is generated from the full agent policy which
already has a `namespaces` property.

### 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
2024-07-26 14:40:09 +02:00
Liam Thompson
e1f20116cb
[Search] Fix copy nit in semantic search guide (#189249)
- We use "Start by" twice, removes the second instance
- Tweaks inference endpoint copy
2024-07-26 07:33:14 -05:00
Sander Philipse
1457428d7f
[Search] Add index errors in Search Index page (#188682)
## Summary

This adds an error callout to the index pages in Search if the mappings
contain a semantic text field that references a non-existent inference
ID, or an inference ID without a model that has started.
2024-07-26 07:09:05 -05:00
Eyo O. Eyo
6ddffb57fb
Compute dashboard panel selection list lazily (#187797)
## Summary

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

This PR changes how the dashboard panel selection items get computed, it
had previously been computed eagerly, in this implementation panel
selection items would only be computed when the user actually clicks the
`add panel` button, with it's results cached so that subsequent
interactions with the `add panel` button leverages the already computed
data.

**Notable Mention:**
The options presented as the dashboard panel list now only comprise of
uiActions specifically registered with the uiAction trigger
`ADD_PANEL_TRIGGER` and specific dashboard visualisation types. See
https://github.com/elastic/kibana/pull/187797#discussion_r1681320456 to
follow the reasoning behind this.

That been said adding new panels to the dashboard, would be something
along the following lines;


```ts
import { ADD_PANEL_TRIGGER } from '@kbn/ui-actions-plugin/public';

 uiActions.attachAction(ADD_PANEL_TRIGGER, <registredActionId>);

// alternatively
// uiActions.addTriggerAction(ADD_PANEL_TRIGGER, ...someActionDefintion);
````

### Visuals

7c029a64-2cd8-4e3e-af5a-44b6788faa45

### How to test 
- Navigate to a dashboard of choice
- Slow down your network speed using your browser dev tools, refresh
your dashboard, and click on the “Add panel” button as soon as it is
available (before the panels have a chance to load).
- You should be presented with a loading indicator, that eventually is
swapped out for the list of panels available for selection.


### Checklist

Delete any items that are not applicable to this PR.
<!--
- [ ] 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/packages/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
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
<!--
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] 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 renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
-->
2024-07-26 13:54:22 +02:00
Ying Mao
b75d74a9fa
[Response Ops][Alerting] Assigning extra large cost to indicator match rule types (#189220)
Resolves https://github.com/elastic/kibana/issues/189112

## Summary

Adds a mapping to the alerting rule type registry to manage rule types
with a custom task cost and register appropriately. Adds an integration
test to task manager so we can be alerted to task types that register
with non-normal task costs.
2024-07-26 07:43:47 -04:00
Jeramy Soucy
b51c503479
Expose the encrypted saved objects key rotation API as internal in serverless (#189238)
## Summary

In order to begin work for encryption key rotation in serverless, we
will need to expose the endpoint use to bulk re-encrypt saved objects.
This endpoint was previously unregistered in serverless. This PR
registers the API and marks it as internal when a serverless build
flavor is detected.


### Tests
-
x-pack/test_serverless/api_integration/test_suites/common/platform_security/encrypted_saved_objects.ts

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-26 12:45:42 +02:00
Kevin Lacabane
10bfb4b4ae
[eem] narrow down index patterns in definition templates (#189182)
In https://github.com/elastic/kibana/pull/188410 we moved history and
latest index templates from global scope to definition scope. The
definition-scoped templates have a wide pattern that would grep any
other definition template already installed and throw the following
error because of conflicting priority. This change narrows down the
index patterns defined in the templates to only grep the ones from the
installed definition

```
{
  "statusCode": 500,
  "error": "Internal Server Error",
  "message": """[illegal_argument_exception
	Root causes:
		illegal_argument_exception: index template [entities_v1_history_admin-console-services_index_template] has index patterns [.entities.v1.history.*] matching patterns from existing templates [entities_v1_history_builtin_services_from_ecs_data_index_template] with patterns (entities_v1_history_builtin_services_from_ecs_data_index_template => [.entities.v1.history.*]) that have the same priority [200], multiple index templates may not match during index creation, please use a different priority]: index template [entities_v1_history_admin-console-services_index_template] has index patterns [.entities.v1.history.*] matching patterns from existing templates [entities_v1_history_builtin_services_from_ecs_data_index_template] with patterns (entities_v1_history_builtin_services_from_ecs_data_index_template => [.entities.v1.history.*]) that have the same priority [200], multiple index templates may not match during index creation, please use a different priority"""
}
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-26 11:35:40 +02:00
Sebastián Zaffarano
61ad27e863
[Telemetry][Security Solution] Always enrich telemetry documents with license info (#188832) 2024-07-26 10:02:56 +01:00
elena-shostak
3f3713b567
Fixed URL hash appending for space next redirect URL (#189204)
## Summary

Fixed URL hash appending for space next redirect URL.

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

__Fixes: https://github.com/elastic/kibana/issues/189184__
2024-07-26 10:40:50 +02:00
Katerina
59f7b4b3a5
[APM][ECO] Show tour for the ui service experience (#188918)
## Summary

closes https://github.com/elastic/kibana/issues/188902 



https://github.com/user-attachments/assets/d96d3d47-467a-42d2-afd2-deac402f9935
2024-07-26 11:32:57 +03:00
Valeriy Khakhutskyy
bd843dda3f
[ML] Add new custom rule action to force time shift (#188710)
This PR follows up https://github.com/elastic/elasticsearch/pull/110974
and extends the schema for custom rules.

A valid schema looks like this:
```http
POST _ml/anomaly_detectors/my_job/_update
{
	"detectors": {
		"detector_index": 0,
		"custom_rules": [
			// update the detector with a custom rule that forces a time shift of 1 hour back starting now
			{
				"actions": [
					"force_time_shift"
				],
				"params": {
					"force_time_shift": {
"time_shift_amount": 3600}
					}
				},
				"conditions": [{
					"applies_to": "time",
					"operator": "gt",
					"value": "now"
				},
{
					"applies_to": "time",
					"operator": "lt",
					"value": "now+bucket_span"
				},

]
			},
			...
```

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-26 09:04:43 +02:00
Antonio
64b45e0884
[ResponseOps][Rules] OAS schema registration for newly versioned Rule APIs (#189153)
## Summary

Issue:  https://github.com/elastic/kibana/issues/187574

This PR updates `request` and `response` schemas below for rule APIs to
generate OAS documentation:
- `POST /api/alerting/rule/{id?}/_enable`
- `POST /api/alerting/rule/{id?}/_disable`
- `POST /api/alerting/rule/{id?}/_update_api_key`


### How to test

1. Start ES
2. Add `server.oas.enabled: true` to `kibana.dev.yml`
3. Start Kibana `yarn start --no-base-path`
4. `curl -s -u elastic:changeme
http://localhost:5601/api/oas\?pathStartsWith\=/api/alerting/rule/ | jq`
5. Look for `_enable`, `_disable` and `_update_api_key` in the resulting
JSON
2024-07-26 08:10:15 +02:00
Steph Milovic
dd9e94d189
[Bedrock chat] Fixes for BedrockChat model + tools (#189227)
## Summary

BedrockChat was not working as expected when triggering the tools. For
example, trying to invoke alerts tools caused this error:
<img width="1059" alt="Screenshot 2024-07-25 at 11 21 52 AM"
src="https://github.com/user-attachments/assets/fe302d41-482c-4a65-abc1-8d669abf928d">
 

This was not a helpful or proper error message to display. I fixed error
handling to bubble up the correct error:
<img width="857" alt="Screenshot 2024-07-25 at 11 26 08 AM"
src="https://github.com/user-attachments/assets/a4135269-6bcb-436f-bd17-f817c06f3778">

This error has something to do with the BedrockChat model not working
properly. @jacoblee93 is looking into a fix on the LC side.

In the meantime, I changed the prompt around and was able to coerce the
correct responses out of Sonnet 3.5 and Opus for the ESQL and RAG alerts
questions James was testing with:

<img width="1708" alt="alerts-opus"
src="https://github.com/user-attachments/assets/47df0500-6e2f-477b-a3b9-da792f1d9b03">
<img width="1510" alt="alerts-sonnet"
src="https://github.com/user-attachments/assets/0efd5519-196b-4309-9300-194196e5dde3">
<img width="1573" alt="esql-opus"
src="https://github.com/user-attachments/assets/d7f519be-262c-4767-9d84-3fcb4fde089c">
<img width="1580" alt="Screenshot 2024-07-25 at 3 40 05 PM"
src="https://github.com/user-attachments/assets/9d408ab8-2fd5-4bbb-bb2e-bb54e0277717">
2024-07-26 07:26:54 +02:00
Lisa Cawley
e6795e5b0a
[DOCS][OAS] Add descriptions, tags, deprecation to connector APIs (#184956) 2024-07-25 16:46:30 -05:00
Rachel Shen
15942bf69a
[A11y] improve aria labels (#188363)
## Summary

Closes https://github.com/elastic/search-team/issues/7624 to provide
more information to blind users what the programming language is
referring to.

Closes https://github.com/elastic/search-team/issues/7620 to include
more information for the Copy button

### 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/packages/kbn-i18n/README.md)
2024-07-25 15:22:28 -05:00
Saikat Sarkar
e831e837fb
Modify the Inference Endpoints management page based on proposed recommendations (#188783)
This PR resolves these tickets:
https://github.com/elastic/search-team/issues/7930 and
https://github.com/elastic/search-team/issues/7933.

### Empty State

![Screenshot 2024-07-24 at 3 19
21 PM](https://github.com/user-attachments/assets/b85a1d0d-a5ad-4cbd-bd26-c15c98e286dc)




### Tabular Page

![Screenshot 2024-07-24 at 3 20
34 PM](https://github.com/user-attachments/assets/a576f411-ef45-4916-92d7-d3542f42220b)

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
Co-authored-by: István Zoltán Szabó <istvan.szabo@elastic.co>
2024-07-25 14:09:18 -05:00
Ryland Herrick
7aec3f775c
[Detection Engine] Prevent ML job status warning from being displayed for non-ML rule types (#189003)
Followup to https://github.com/elastic/kibana/pull/188267. A demo
instance with these changes can be found
[here](https://rylnd-pr-189003-fix-sticky-ml-warning.kbndev.co/app/security/rules/create).

When not all ML jobs are started, we display a message conveying that
the list of suppression fields might not be complete. In the case of a
non-ML rule, this warning isn't helpful and should be hidden. It also
only shows the warning if one more more ML jobs have been selected.
2024-07-25 14:07:45 -05:00
christineweng
794a948b75
[Security Solution][Analyzer] Refactor styled panels (#188872)
## Summary

This PR is a small refactor of the styled panels in analyzer. Lifted the
wrapper up to the resolver level so that the panels can be reused
without styling. No UI change to the analyzer.
2024-07-25 13:13:32 -05:00
Konrad Szwarc
e386ac3ab9
[EDR Workflows][Osquery] Unskip timelines.cy.ts (#189185)
Added force to click since the parent of the element `timelines.cy.ts`
is supposed to click received `pointer-events: none` style and Cypress
is no longer able to click it without `force()`.

closes https://github.com/elastic/kibana/issues/189136
2024-07-25 11:07:14 -07:00
Kylie Meli
45f63a3b97
[integration automatic-import] Adding ECS 'reserved' fields list and adding check in the invalid ecs check (#189006)
This PR updates the invalid ecs check to include a check for 'reserved'
ECS fields. Reserved ECS fields are valid ecs fields, but ones we do not
want to add mappings for as they are reserved for agent operations or
utilized in categorization.

ECS reserved:
- ecs.version
- error.message
- event.category
- event.created
- event.dataset
- event.ingested
- event.original
- event.type
2024-07-25 14:05:30 -04:00
Maxim Palenov
3732d88680
[Security Solution] Implement shared components conflict resolution functionality (#188812)
**Resolves:** https://github.com/elastic/kibana/issues/188817

## Summary

This PR adds automatic shared components conflict resolution functionality for OpenAPI merger. It boils down to a similar result as `npx @redocly/cli join --prefix-components-with-info-prop title` produces by prefixing shared components with document's title in each source.

OpenAPI bundler intentionally won't solve conflicts automatically since it's focused on bundling domain APIs where conflicts are usually indicators of upstream problems.

## Details

While working with various OpenAPI specs it may happen that different specs use exactly the same name for some shared components but different definitions. It must be avoided inside one API domain but it's a usual situation when merging OpenAPI specs of different API domains. For example domains may define a shared `Id` or `404Response` schemas where `Id` is a string in one domain and a number in another.

OpenAPI merger implemented in https://github.com/elastic/kibana/pull/188110 and OpenAPI bundler implemented in https://github.com/elastic/kibana/pull/171526 do not solve shared components related conflicts automatically. It works perfectly for a single API domain forcing engineers choosing shared schema names carefully. 

This PR adds automatic shared components conflict resolution for OpenAPI merger. It prefixes shared component names with a normalized document's title.

OpenAPI bundler intentionally won't solve conflicts automatically since it's focused on bundling domain APIs where conflicts are usually indicators of upstream problems.

## Example

Consider two following OpenAPI specs each defining local `MySchema`

**spec1.schema.yaml**
```yaml
openapi: 3.0.3
info:
  title: My endpoint
  version: '2023-10-31'
paths:
  /api/some_api:
    get:
      operationId: MyEndpointGet
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MySchema'

components:
  schemas:
    MySchema:
      type: string
      enum:
        - value1
```

**spec2.schema.yaml**
```yaml
openapi: 3.0.3
info:
  title: My another endpoint
  version: '2023-10-31'
paths:
  /api/another_api:
    get:
      operationId: MyAnotherEndpointGet
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MySchema'

components:
  schemas:
    MySchema:
      type: number
```

and a script to merge them

```js
require('../../src/setup_node_env');
const { resolve } = require('path');
const { merge } = require('@kbn/openapi-bundler');
const { REPO_ROOT } = require('@kbn/repo-info');

(async () => {
  await merge({
    sourceGlobs: [
      `${REPO_ROOT}/oas_docs/spec1.schema.yaml`,
      `${REPO_ROOT}/oas_docs/spec2.schema.yaml`,
    ],
    outputFilePath: resolve(`${REPO_ROOT}/oas_docs/merged.yaml`),
    options: {
      mergedSpecInfo: {
        title: 'Merge result',
        version: 'my version',
      },
    },
  });
})();
```

will be merged successfully to

**merged.yaml**
```yaml
openapi: 3.0.3
info:
  title: Merge result
  version: 'my version' 
paths:
  /api/another_api:
    get:
      operationId: MyAnotherEndpointGet
      responses:
        '200':
          content:
            application/json; Elastic-Api-Version=2023-10-31:
              schema:
                $ref: '#/components/schemas/My_another_endpoint_MySchema'
  /api/some_api:
    get:
      operationId: MyEndpointGet
      responses:
        '200':
          content:
            application/json; Elastic-Api-Version=2023-10-31:
              schema:
                $ref: '#/components/schemas/My_endpoint_MySchema'
components:
  schemas:
    My_another_endpoint_MySchema:
      type: number
    My_endpoint_MySchema:
      enum:
        - value1
      type: string
```
2024-07-25 12:33:17 -05:00
Cristina Amico
b90a8f6286
[Fleet] Force field enabled=false on inputs that have all their streams disabled (#188919)
Fixes https://github.com/elastic/integrations/issues/9934

## Summary
From the package policies API it is currently possible to get into a
state where one input is enabled while all its streams are disabled.
This can cause issue with data ingestion etc (see above ticket). Note
that the UI prevents this case from happening.

This PR adds a function to packagePolicies `create` and `update`
handlers that forces `input.enabled = false` when all its streams are
disabled, since an input with no enabled streams is functionally useless
anyway.

A previous version of this PR was doing a validation on the endpoints
but this would introduce a breaking change for some users, so it was
decided to do a forced change to the policy instead.

### Testing
Using cloudwatch integration as an example

### Create a new policy
- Install an integration trough the API that has one input enabled with
all its streams disabled
<details>
  <summary>See POST request</summary>
```
POST kbn:/api/fleet/package_policies
{
  "name": "aws-1",
  "description": "",
  "namespace": "",
  "policy_ids": [
    "agent-default-policy"
  ],
  "enabled": true,
  "inputs": [
    {
      "type": "aws-cloudwatch",
      "policy_template": "cloudwatch",
      "enabled": true,
      "streams": [
        {
          "enabled": false,
          "data_stream": {
            "type": "logs",
            "dataset": "aws.cloudwatch_logs"
          },
          "vars": {
            "log_group_arn": {
              "type": "text"
            },
            "log_group_name": {
              "type": "text"
            },
            "log_group_name_prefix": {
              "type": "text"
            },
            "region_name": {
              "type": "text"
            },
            "log_streams": {
              "value": [],
              "type": "text"
            },
            "log_stream_prefix": {
              "type": "text"
            },
            "start_position": {
              "value": "beginning",
              "type": "text"
            },
            "scan_frequency": {
              "value": "1m",
              "type": "text"
            },
            "api_timeput": {
              "value": "120s",
              "type": "text"
            },
            "api_sleep": {
              "value": "200ms",
              "type": "text"
            },
            "latency": {
              "type": "text"
            },
            "number_of_workers": {
              "type": "integer"
            },
            "tags": {
              "value": [
                "forwarded",
                "aws-cloudwatch-logs"
              ],
              "type": "text"
            },
            "processors": {
              "type": "yaml"
            },
            "preserve_original_event": {
              "value": false,
              "type": "bool"
            },
            "data_stream.dataset": {
              "value": "generic",
              "type": "text"
            }
          }
        }
      ]
    }
  ],
  "package": {
    "name": "aws",
    "title": "AWS",
    "version": "2.21.0"
  },
  "vars": {
    "shared_credential_file": {
      "type": "text"
    },
    "credential_profile_name": {
      "type": "text"
    },
    "access_key_id": {
      "type": "password"
    },
    "secret_access_key": {
      "type": "password"
    },
    "session_token": {
      "type": "password"
    },
    "role_arn": {
      "type": "text"
    },
    "default_region": {
      "value": "",
      "type": "text"
    },
    "proxy_url": {
      "type": "text"
    }
  },
  "force": false
}
```
</details>
The request should succeed and the whole input should be disabled as a
result.

- Repeat the test with the update endpoint, you need to grab the policy
id
```
PUT kbn:/api/fleet/package_policies/84ede2c9-80a0-4f01-b353-0f8ef873faaf
{
    "inputs": [
    {
      "type": "aws-cloudwatch",
      "policy_template": "cloudwatch",
      "enabled": true,
      "streams": [
        {
          "enabled": false,
          "data_stream": {
            "type": "logs",
            "dataset": "aws.cloudwatch_logs"
          }
        }
      ]
    }
  ]
}
```


This request should succeed again and the he whole input should be
disabled again.

### Checklist
- [ ] [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: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-25 12:01:54 -05:00
Lene Gadewoll
2295ba10e0
Upgrade EUI to v95.4.0 (#188865)
`v95.3.0`  `v95.4.0`

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

---

## [`v95.4.0`](https://github.com/elastic/eui/releases/v95.4.0)

- Added `anomalyChart`, `anomalySwimLane`, `changePointDetection`,
`fieldStatistics`, `logPatternAnalysis`, `logRateAnalysis` and
`singleMetricViewer` glyph to `EuiIcon`
([#7873](https://github.com/elastic/eui/pull/7873))

**Bug fixes**

- Fixed overlapping content in `EuiBasicTable` for expanded and
selectable table rows
([#7895](https://github.com/elastic/eui/pull/7895))
- Fixed the alignment of `EuiBasicTable` mobile actions
([#7895](https://github.com/elastic/eui/pull/7895))

**Accessibility**

- Improved `EuiStat`'s screen reader accessibility
([#7864](https://github.com/elastic/eui/pull/7864))

---

## Additional Changes

- reverts temporary fix for overlapping content in nested tables done in
PR [#188374](https://github.com/elastic/kibana/pull/188374)

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-25 09:42:55 -07:00
Tiago Costa
579af1b5a6
skip flaky suite (#178457) 2024-07-25 17:35:59 +01:00
Maryam Saeidi
b17604dbbb
[Metric threshold] Save the ECS group by fields at the AAD root level (#188976)
Related to #183220

## Summary

This PR extracts `getEcsGroups` to a package to save ECS groups in the
Alert As Data (AAD) document for the metric threshold rule.

### 🧪 How to test
- Create a metric threshold rule with multiple groups (both ECS and
non-ECS fields)
- Check the related AAD document; you should be able to see the ECS
fields at the root level and not see non-ECS fields there
- Check the same information for the recovered alerts
- Rules without group by should work as before

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-25 10:20:12 -05:00
Juan Pablo Djeredjian
fb82b0e00d
[Security Solution] Extend the /upgrade/_review endpoint contract and functionality (#187770)
**Resolves: https://github.com/elastic/kibana/issues/180153**
**Resolves: https://github.com/elastic/kibana/issues/188277**

## Summary

- Extend the POST /upgrade/_review API endpoint's contract and
functionality
- Changes `has_conflict` property within each rule field's
`ThreeWayDiff` from `boolean` to `enum` with possible values:
    - `NONE`: no conflicts in three way diff
- `SOLVABLE`: conflict detected but was successfully resolved by our
algorithms
- `NON_SOLVABLE`: conflict detected and could not be resolved by our
algorithms.

- Adds `has_base_version` boolean field within each field diff
calculation. Has values:
- true: the base version of the field was found and is either defined or
undefined
    - false: the base version of the field was not found

- The possible values for `has_conflict` for each concrete diff
algorithm are:
    - **single line strings**: `NO`, `NON_SOLVABLE` 
    - **multi line strings**: `NO`, `SOLVABLE`, `NON_SOLVABLE` 
    - **numbers**: `NO`, `NON_SOLVABLE` 
    - **array of scalar values**: `NO`, `SOLVABLE`

- [ ] Adds new logic to handle
https://github.com/elastic/kibana/pull/186435#issuecomment-2178484224


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2024-07-25 17:08:15 +02:00