Commit graph

32202 commits

Author SHA1 Message Date
Steph Milovic
f72a321a9c
[Security solution] Fix regenerate button with LangGraph (#188249) 2024-07-13 08:16:12 -06:00
Tomasz Kajtoch
c2997378d4
Upgrade EUI to v95.3.0 (#187342)
`v95.2.0``v95.3.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.3.0`](https://github.com/elastic/eui/releases/v95.3.0)

- Updated `EuiThemeProvider`s to allow modifying/setting custom
`breakpoint`s in nested usage (as opposed to only at the top
`EuiProvider` level) ([#7862](https://github.com/elastic/eui/pull/7862))

**Bug fixes**

- Fixed a Chrome/Edge CSS `mask-image` bug that was affecting scroll
overflow shadow utilties
([#7855](https://github.com/elastic/eui/pull/7855))

**CSS-in-JS conversions**

- Converted `EuiColorPicker` to Emotion; Removed `$euiColorPickerWidth`
([#7845](https://github.com/elastic/eui/pull/7845))
- Converted `EuiColorPickerSwatch` to Emotion
([#7853](https://github.com/elastic/eui/pull/7853))
- Converted `EuiColorPalettePicker` and `EuiColorPaletteDisplay` to
Emotion ([#7854](https://github.com/elastic/eui/pull/7854))
  - Removed `$euiColorPaletteDisplaySizes`
  - Removed `@mixin euiColorPaletteInnerBorder`
- Removed `$euiColorPickerValueRange0`, `$euiColorPickerValueRange1`,
`$euiColorPickerSaturationRange0`, `$euiColorPickerSaturationRange1`,
and `$euiColorPickerIndicatorSize`
([#7859](https://github.com/elastic/eui/pull/7859))

**Accessibility**

- Updated the `aria-label` attribute for the `EuiFilePicker` remove file
button ([#7860](https://github.com/elastic/eui/pull/7860))

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-13 16:03:15 +02:00
Rickyanto Ang
f5fda2ce79
[Cloud Security] Adding Auth check on API (#186937)
## Summary

This PR addresses the issue where currently only some of our API does
Auth check. All of our API should be doing this. Furthermore we are
adding new API FTR to cover this scenario as well

Notes:
Currently Benchmark related API FTR is blocked by
https://github.com/elastic/kibana/issues/188059
2024-07-12 14:39:59 -07:00
Paul Tavares
1a920d1301
[Security Solution][Endpoint] Add kill-process command for SentinelOne to the Response Console (#187917)
## Summary

- Adds the `kill-process` command to Response Console for SentinelOne
hosts
- Note that in order to access this command, the
`responseActionsSentinelOneKillProcessEnabled` feature flag must be
enabled

> [!IMPORTANT]
> When entered, the response action will be sent to SentinelOne's system
for execution, but the response action will remain in `pending` in
Kibana for now. A follow up PR will introduce the necessary logic for
completing the aciton and displaying the results
2024-07-13 05:36:32 +10:00
Yuliia Naumenko
1d5cf48a97
[Security AI Assistant] Changing chat related internal APIs to become public (#188139)
## Summary

In this PR Security Gen AI related APIs are changed from internal to
public.

Conversations APIs:
- POST/PUT/GET/DELETE
`"/api/security_ai_assistant/current_user/conversations/{id}"`
- GET `"/api/security_ai_assistant/current_user/conversations/_find"`

Prompts APIs:

- POST `"/api/security_ai_assistant/prompts/_bulk_action"`
- GET `"/api/security_ai_assistant/current_user/conversations/_find"`

Anonymization APIs:

- POST `"/api/security_ai_assistant/anonymization_fields/_bulk_action"`
- GET `"/api/security_ai_assistant/anonymization_fields/_find"`
2024-07-12 12:23:09 -07:00
Jen Huang
4c0db61e6d
[UII] Remove action links and buttons when secrets field is disabled (#188252)
## Summary

Resolves #187642 

This PR removes action links and buttons to replace and convert secrets
fields if the field itself is disabled, for cases like the user not
having write permissions:

<img width="730" alt="image"
src="https://github.com/user-attachments/assets/957ad858-74bf-4f28-a212-148253e4ca0f">

<img width="716" alt="image"
src="https://github.com/user-attachments/assets/d70f7946-8b62-4e13-9d16-98ddac26b826">

Also applies sentence casing to `Service token` label.

### 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-12 14:31:16 -04:00
Eyo O. Eyo
fdd67f7070
fix dashboard scroll issue for when lens inline config is opened. (#188236)
## Summary

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

This PR adds a side effect to opening the inline config editor to
disable scroll on the document body, this way the user's scroll
interaction if any remains within the open inline lens config editor,
whilst keeping ~on~ the panel whose configuration is being modified in
focus.

#### Previously:

![ScreenRecording2024-07-12at15 23 35-ezgif
com-video-to-gif-converter](https://github.com/user-attachments/assets/1ed0823f-24f4-4b05-a17e-04a5b1218763)

#### After

![ScreenRecording2024-07-12at16 20 27-ezgif
com-video-to-gif-converter](https://github.com/user-attachments/assets/d6e136ca-778b-4216-8beb-1a9f2e2aa6e5)


<!--
### 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
- [ ] [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
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] 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-13 03:53:47 +10:00
Jatin Kathuria
309b907e59
[Security Solution] Fix - Notes Flyout Product Feedback (#188129)
# Summary

Fixes below bugs based on feedback from @paulewing.


## Event Details Toggle in Notes

@paulewing requested to remove the event toggle 

|Before|After|
|---|---|
|![Bildschirmfoto 2024-07-11 um 17 48
15](2b45d3a9-6f1a-4f05-8824-10e2c6265266)|
![Bildschirmfoto 2024-07-11 um 17 46
01](b02c06ff-f556-4894-a588-a88bcdd8bc8c)|


## Notes Flyout remains open when switching tabs
|Before|After|
|---|---|
|<video
src="4228d2d6-c2ad-40dc-9e6c-ec049f834e8f"
/>|<video
src="0e010c22-4539-4428-9b1b-3b323a9f491c"
/>|


## Notes Flyout should be resizable

As shown in above video, notes flyout is now resizable.
2024-07-13 03:20:19 +10:00
jennypavlova
9440ea5071
[ObsUx][APM] Update survey forms for new experience (#188203)
Closed #188193

## Summary

This PR changes the survey URL for all service pages when the new
experience is enabled (from `https://ela.st/services-feedback` to
`https://ela.st/entity-services-feedback`)

|Services form | Entity Services form |
|--------------|----------------------|
|
![image](https://github.com/user-attachments/assets/c3744892-7e9e-4926-88f2-705512b40012)
|
![image](https://github.com/user-attachments/assets/e8656611-d5fc-4ac6-9156-3a4b55b33fa6)
|

Testing:
- When the new experience is enabled all service pages should have the
new link (without traces and dependencies)
<img width="1917" alt="Screenshot 2024-07-12 at 12 49 54"
src="https://github.com/user-attachments/assets/7ec42151-060d-4bcc-bb80-ad79820a2f8b">
<img width="1889" alt="Screenshot 2024-07-12 at 12 48 32"
src="https://github.com/user-attachments/assets/4db632c7-8226-4251-b319-75f7d60f8453">
<img width="1900" alt="Screenshot 2024-07-12 at 12 50 56"
src="https://github.com/user-attachments/assets/4155905f-d56f-429c-8a72-732306310997">

- When the classic view is selected the form links should not show
 

![image](https://github.com/user-attachments/assets/45dbf548-5c3e-403f-b89a-5fb5e0e83290)

- The form prefilling should work the same way as before:


https://github.com/user-attachments/assets/6c024dcf-46e1-489e-8e7c-888a69881ad6
2024-07-12 17:47:45 +02:00
Joe McElroy
aca82181a8
[Playground] [Bug] Previous messages now sent to LLM (#188123)
## Summary

Now that we are using ChatModel, we should be sending previous messages
in the conversation history.

This change:
- defines the prompt as a system prompt
- sends all previous conversations into the ChatModel
- sends the question as a separate message
- update the examples to showcase this flow

### 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
- [ ] [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 is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] 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)
2024-07-13 01:37:04 +10:00
Milton Hultgren
66e3f08c1d
[EEM] Remove duplicates from latest data set (#187699)
By only grouping on `entity.id` we should be able to remove duplicates
in the latest indices.
This PR also removes the values found for `entity.identityFields` and
replaces it with a list of those field names.
This PR also lifts the values for the identity fields to the root of the
document.
This PR removes the `displayName` from the historical documents.

### How to test

Source data:
```
PUT index_a
{
  "mappings": {
    "properties": {
      "a": {
        "type": "keyword"
      },
      "@timestamp": {
        "type": "date"
      }
    }
  }
}

PUT index_b
{
  "mappings": {
    "properties": {
      "b": {
        "type": "keyword"
      },
      "@timestamp": {
        "type": "date"
      }
    }
  }
}

POST index_a/_doc
{
  "a": "same",
  "@timestamp": "2024-07-05T12:33:06.162Z"
}

POST index_b/_doc
{
  "b": "same",
  "@timestamp": "2024-07-05T12:33:06.162Z"
}
```

Entity definition:
```
POST kbn:/internal/api/entities/definition
{
  "id": "bucket_key",
  "name": "Bucket key",
  "type": "service",
  "indexPatterns": [
    "index_*"
  ],
  "timestampField": "@timestamp",
  "lookback": "5m",
  "identityFields": [
    {
      "field": "a",
      "optional": true
    },
    {
      "field": "b",
      "optional": true
    }
  ],
  "displayNameTemplate": "{{a}}{{b}}",
  "history": {
    "timestampField": "@timestamp",
    "interval": "5m"
  }
}
```

### Change in the format of the resulting documents
```
"identityFields": {
  "a": null,
  "b": "same"
},
```
=>
```
"identityFields": [
  "a",
  "b"
],
```
2024-07-12 16:59:18 +02:00
Mykola Harmash
25a4e242a2
[Onboarding] Change k8s troubleshooting doc URL (#188207)
Two minor fixes for the k8s onboarding:

- Make the troubleshooting link point to the whole page instead of the
Kubernetes section which is for now is not very relevant
- Remove `fill` from the copy button after we start monitoring data
2024-07-13 00:26:35 +10:00
Carlos Crespo
f2d1a8b6d2
[Infra] Limit the number of metrics accepted by Snapshot API (#188181)
part of [3628](https://github.com/elastic/observability-dev/issues/3628)
- private


## Summary

After adding 20 items, users can no longer add more metrics and will see
the "Add metric" button disabled with a tooltip

<img width="1713" alt="image"
src="https://github.com/user-attachments/assets/c784b08b-e118-4491-b53d-46bfde898216">


### How to test

- Start a local Kibana instance pointing to an oblt cluster
- Navigate to Infrastructure
- Try to add more than 20 metrics in the Metrics dropdown.
2024-07-12 15:53:53 +02:00
Juan Pablo Djeredjian
ccfdd69223
[Security Solution] Replace PrebuiltRuleAsset schema construction with Zod transform (#188092)
## Summary

Pending work from: https://github.com/elastic/kibana/pull/186615

- The previous implementation to create `PrebuiltRuleAsset` with some
RuleResponse fields ommited from it had the disadvantage of being built
with a discriminated union where all rule types had to be re-listed. If
a new type was added, then it would have required manually adding the
type to that union as well, which would have been surely forgotten.
- This replaces that schema construction to use a Zod transform which
simply eliminates the omitted fields using a Zod transform.


### 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-12 15:24:16 +02:00
Sebastián Zaffarano
a120c510b9
[Telemetry][Security Solution] Use the proper index to query builtin alerts (#187859)
## Summary

https://github.com/elastic/kibana/pull/177263 changed the way
`telemetry-prebuilt-rule-alerts` get data from elastic, but it changed
the index used to run the queries. This PR fixes it using the proper
index.
2024-07-12 15:17:43 +02:00
Maxim Palenov
577a58334f
[Security Solution] Add missing Detections API OpenAPI specs (#186764)
**Addresses:** https://github.com/elastic/kibana/issues/183661

## Summary

This PR adds missing OpenAPI specs for the following Detections API endpoints available in both Serverless and ESS

- `POST /api/detection_engine/rules/preview`

and the following API endpoints available in ESS only

- `GET /api/detection_engine/privileges`
- `POST /api/detection_engine/rules/_bulk_delete`
2024-07-12 23:16:29 +10:00
Dmitrii Shevchenko
415ed2e437
[Fleet] Avoid loading package saved objects into memory before deleting them (#188004)
**Resolves: https://github.com/elastic/kibana/issues/187975**

## Summary

When upgrading or re-installing a package, all saved objects from a
previous package are loaded into memory using `bulkResolve`. This
creates unnecessary memory pressure for packages containing thousands of
saved objects, like the `security_detection_engine` package.

To mitigate that, we are now skipping saved object resolution for
packages known to be installed in `8.x`.

While testing locally on a package containing ~5000 detection rules, I
observed a significant drop in memory usage, from 1.17GB to 1.05GB at
peak.

**Before:**
![Screenshot 2024-07-11 at 11 11
06](e535569e-03f0-404e-9937-4867839846ae)

**After:**
![Screenshot 2024-07-11 at 11 02
32](889e6ade-9cd7-4cbc-a220-3e8bc507fba5)
2024-07-12 13:05:51 +02:00
SylvainJuge
180fc2917f
remove quotes for otel auth config (#186797)
### Summary

When doing configuration of an OpenTelemetry agent, most of the
environment variables are provided with only the value, but the auth
headers one is using quotes.

When using a shell script or YAML to set environment variables, the
value has to be quoted due to spaces, but it's not always the case, for
example when setting an environment variable in Windows.

Also, removing the quotes makes it consistent with other environment
variable values.

### Screenshot before

![Screenshot from 2024-06-24
11-21-52](8b2c513a-a5d2-4a50-b908-6d14240bf169)
2024-07-12 11:07:00 +02:00
Shahzad
e017b0e8ed
[Synthetics] Allow ssl.certificate_authorities arrays (#187952)
## Summary

Fixes https://github.com/elastic/kibana/issues/183300 !!

Allows arrays of string for `ssl.certificate_authorities`

### test project monitor

heartbeat.monitors:
- type: http
  name: Todos Lightweight
  id: todos-lightweight
  enabled: true
  urls: "https://elastic.github.io/synthetics-demo/"
  schedule: '@every 3m'
  timeout: 16s
  ssl:
    certificate_authorities: ['/etc/ca.crt']
2024-07-12 10:59:09 +02:00
Kevin Lacabane
c861f63dd7
[eem] add option to delete indices when deleting definition (#188116) 2024-07-12 08:12:30 +02:00
Dario Gieselaar
5b8967884b
[Obs AI Assistant] Support for Gemini connector (#188002)
Implements support for the Gemini connector:

- Adds the `.gemini` connector type id to the allowlisted connectors
- Create an adapter for the Gemini connector type that formats and
parses requests/responses in the format of Gemini on Vertex

What's still missing:
- Native function calling. We use simulated function calling for now.
There are some changes in the function schemas to prepare for this
(Gemini blows up when there are dots in property names).
- E2E tests. The Gemini connector always calls out to an external
endpoint, which causes the call to fail because we cannot hardcode
actual credentials.
2024-07-12 08:53:23 +03:00
Jen Huang
b7c96f4c09
[UII] Fill in empty values for constant_keyword fields from existing mappings (#188145)
## Summary

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

Some packages declare `constant_keyword` type fields without an explicit
value. This causes ES to fill in the value in the mappings using the
first ingested value.

When upgrading this type of package & field after the value has already
been populated in this way, the mappings update fail due to pushing a
`null` value into an existing value, triggering unnecessary rollovers.

This PR fixes that by filling in the empty values from the existing
mappings.

## Test
1. On an empty cluster, turn on debug logs
2. Set up Fleet Server policy and Fleet Server agent
3. Force install old version of Elastic Agent integration, v1.19.2:
```
POST kbn:/api/fleet/epm/packages/elastic_agent/1.19.2
{
  "force": true
}
```
4. Create a new empty policy, **deselect system and agent monitoring**
(otherwise the integration will be upgraded, we do not want this yet)
5. Manually add Elastic Agent integration v1.19.2 to the new policy
6. Edit the policy to enable logs and metrics monitoring
7. Enroll agent into the policy, confirm that monitoring logs and
metrics are being ingested and that a value exists for `event.dataset`
mapping for the logs:
```
GET logs-elastic_agent*/_mappings
```
```
            "dataset": {
              "type": "constant_keyword",
              "value": "elastic_agent"
            }
```
9. Upgrade Elastic Agent integration to v1.20.0 (note we are not
upgrading to the newest versions, 2.0+, because these **are** expected
to trigger rollovers for some data streams):
```
POST kbn:/api/fleet/epm/packages/elastic_agent/1.20.0
{
  "force": true
}
```
10. Confirm in Kibana logs that no rollovers triggered during the
upgrade
11. Confirm that there is still only 1 backing index for monitoring
logs:
```
GET logs-elastic_agent*
```

### 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
2024-07-12 13:05:03 +10:00
Philippe Oberti
1f82d5d68c
[Security Solution] - remove expandableFlyoutDisabled feature flag (#187759) 2024-07-12 09:27:31 +10:00
Sandra G
81b1705ea6
[Obs AI Assistant] hide ai assistant menu item when in a disabled space (#188017)
Hides AI Assistant button when in a space where the AI Assistant is
disabled
2024-07-11 17:06:24 -04:00
Jan Monschke
b97f309926
[SecuritySolution][Threat Hunting Investigation] Fix timeline showing as changed when it wasn't actually changed (#188106)
## Summary

Fixes https://github.com/elastic/security-team/issues/9646

The embedded discover's `update` mechanism has changed and the `grid`
and `hideChart` properties keep changing on initial sync, causing the
timeline show as `changed` when it actually didn't. These two properties
are not important to actually determine the changed state of timeline
and we can therefore ignore them.
2024-07-11 20:45:04 +02:00
Dominique Clarke
84ca0e85b5
[Synthetics] rename files (#187486)
## Summary

Renames some files in the synthetics plugin to remove references to
Uptime.
2024-07-11 14:43:13 -04:00
christineweng
751ba218a9
[Security Solution] Document flyout investigation guide and response action updates (#187920)
## Summary

This PR updates the UI for investigation guide and response actions per
updated [Figma
mock](https://www.figma.com/design/882AiMJMr1GMKnXN5G6WDa/Component-library?node-id=2500-131607&t=JBKKkcwOOMjURFWu-0).

### Investigation guide

Alerts with investigation guide

![image](f5a98d30-2e33-4965-ac19-7709b63dcfcc)

In alert preview

![image](d2976a5a-3b76-40c3-a8cf-fa025487c240)

In rule creation (alert preview)

![image](b33e4b5d-22ab-4afd-aa6b-01cd6de83469)


No Investigation guide

![image](ad8d3e65-2054-49ce-99df-aec6d586b83d)


### Response action
In alert preview

![image](c1fb778c-a6c3-40a5-b2ad-2470970d8c0c)

In rule creation (alert preview)

![image](de7eef9d-3b59-4629-8466-f8c5eee9dd9f)

Normal response button

![image](90503ec9-caab-4d93-b0f2-355635055b5f)

### 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)
- [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-12 04:02:11 +10:00
Uri Weisman
7ef0b033b2
[Cloud Security] Fix GCP single account msg typo (#188113) 2024-07-11 20:07:54 +03:00
Shahzad
b20c75b85d
[SLOs] Schedule now rollup transform after creation (#188104)
## Summary

Schedule now rollup transforms after creation !!
2024-07-12 02:58:54 +10:00
Janki Salvi
6b0d628053
[ResponseOps][Cases] Fix template's custom fields bugs (#187591)
## Summary

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

## Testing behaviour: 
Issue 1: verify similar behaviour from API as well.

1. Create a template
2. Add new toggle custom field with default value as true
3. Go to create case, See that new toggle custom field has value: true
4. Select recently created template
5. Toggle custom field new custom field with it's default value

Issue 2: verify similar behaviour from API as well.
1. Create a text custom field with default value
2. Create a template
3. Set text custom field value to empty
4. Save template
5. Go to create case
6. Select recently created template
7. See that text custom field value is updated as per template's custom
field value
2024-07-11 17:13:19 +01:00
Joe Reuter
7520f28a61
OTel onboarding: Update snapshot (#188008)
Updates snapshot version for serverless OTel onboarding flow
2024-07-11 17:04:02 +02:00
Gergő Ábrahám
05587a21bc
[Security Solution][Defend Workflows] Unskip e2e cypress tests (#188013)
## Summary

unskip tests that were skipped because of Agent vs Fleet server version
mismatch

looks like the temporary issue is fixed, so this PR unskips the tests,
while trying to find a long-term solution in the meanwhile

closes #187932
closes #170373
closes #168284
closes #168340
closes #173464
closes #172326
2024-07-11 16:53:10 +02:00
Rachel Shen
f57d9c5f01
[Global Search] Limit characters for global search bar (#186560)
## Summary

This PR limits the number of characters that can be input into the
global search bar. The character limit can be specified with the config
value `xpack.global_search_bar.input_max_limit` with a default of
`1000`. When an input that exceeds the configured character limit is
provided a descriptive visual notice is displayed to the user.

## Visual 
<img width="662" alt="Screenshot 2024-07-04 at 19 28 39"
src="cf30f589-fe65-40a9-b9c8-ce0f235d206e">


## How to test

- run the following command below in the browser console, which would
create a string that exceeds the configured default search character
limit and copy it to your clipboard
```ts
	copy(Array.from(new Array(1001)).reduce((acc) => acc+'a', ''))
```
- open up kibana, simply paste the value that should exist in your
clipboard in the global search input field and you should be presented
with a result similar to the image above.

---------

Co-authored-by: Eyo Okon Eyo <eyo.eyo@elastic.co>
2024-07-11 07:50:20 -07:00
Alexey Antonov
2ebd0ed3c4
fix: [Obs Synthetics > Monitor detail][KEYBOARD]: Thumbnail images must take keyboard focus, open modal on keypress, and manage focus correctly (#187446)
Closes: https://github.com/elastic/observability-dev/issues/3687

## Description

The synthetics monitors include thumbnail screenshots that open a larger
preview window. These thumbnails must take keyboard focus, manage the
`Enter` and `Space` keypresses to open the modal, and return focus to
the originating thumbnail when the modal is closed. Screenshots attached
below.

### Steps to recreate

1. Open the
[Synthetics](https://keep-serverless-fyzdg-f07c50.kb.eu-west-1.aws.qa.elastic.cloud/app/synthetics)
view
2. Create a monitor if none exist
3. Click on that monitor and navigate to the [full monitor
detail](8b88e937-f917-4f12-9325-8ab005cffea5?locationId=us_central_qa)
view
4. Click on a thumbnail and verify the modal opens
5. Press `ESC` or the Close "X" and then press `TAB` to verify focus is
not on the thumbnail

### What was changed?: 

1. Added `tabIndex=0` was for ScreenshotImage for handle keyboard
navigation
2. `ScreenshotImage` API was sightly changed: `onMouseEnter` ->
`onFocus`; `onMouseLeave` -> `onBlur`

### Screen: 


a68df4b0-71c7-47ec-add7-41536027613c
2024-07-11 10:46:03 -04:00
Sergi Massaneda
490bbdb3f6
[Integration Assistant] Implement unit tests for the UI (#187590)
## Summary

Unit tests for the Integration Assistant UI components

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-11 15:43:31 +01:00
Davis Plumlee
76cc844cf4
[Security Solution] Integration tests for scalar array diff algorithm (#187778)
## Summary

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

Switches fields to use the scalar array diff algorithms assigned to them
in the [overarching
ticket](https://github.com/elastic/kibana/issues/180162#issuecomment-2152936375)

Adds integration tests in accordance to
https://github.com/elastic/kibana/pull/186325 for the upgrade/_review
API endpoint for the scalar array 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-11 10:21:25 -04:00
Alexey Antonov
faebb6546d
fix: [Obs Synthetics > Monitor Detail][SCREEN READER] Icons and repeated controls need unique accessible labels: 0013 (#188058)
Closes: https://github.com/elastic/observability-dev/issues/3651

# Description 

Observability has a lot of icons that are used for controls and table
row actions. These icons often have the same aria-label repeated across
rows. While this meets the letter of SC 1.3.1: Info and Relationships,
the repeated generic labels do not usually answer question what users
are editing, or what users are deleting. We want to provide clear labels
for each row to make the implicit relationships sighted users depend on,
explicit for screen reader users.

# Steps to repeat
1. Open the Inventory view
2. Turn on a screen reader
3. Traverse through the tables in screenshots
4. Verify the buttons do not describe what test run or document you're
taking action on

# What was changed?: 
1. `title`, `arial-label` attributes were updated for `EuiButtonIcon`'s

# Screen:
 
<img width="1546" alt="image"
src="fedc7756-d077-4a6e-bd80-af49b69b541c">



<img width="1546" alt="image"
src="ec0364c8-8fe5-448d-9a4d-c5f2b19a171d">
2024-07-11 16:44:53 +03:00
Kevin Lacabane
c38011f075
[eem] add managed flag to entity definition resources (#187965)
Add managed meta property to entity definition resources. a flag will
show up in the corresponding UIs

![Screenshot 2024-07-10 at 14 15
13](b813f384-3c86-4913-8d18-12c5d5fc0721)
![Screenshot 2024-07-10 at 14 15
46](1896a751-be81-4f28-b0c9-1d7001251446)
2024-07-11 15:38:20 +02:00
Michael Olorunnisola
9cb7451f6b
[Investigations][Timeline] - Fix table styling issues (#187911)
## Summary

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

This PR:
1. Fixes the ellipsis of the row cells when the row renderers are
enabled
2. Re-enables the row height toggle being able to change the height of
the custom grid body row
3. Aligns the icons and row text to the top of the row, how the default
table behaves



9c68cbdd-d288-43c7-9b2d-6a5f6dad7e6b
2024-07-11 08:44:48 -04:00
Paul Tavares
3b9ac48d57
[Security Solution][Endpoint] Fix Response Console not displaying the platform icon for non-Windows hosts when opened from an alert (#188030)
## Summary

- Fixes `useAlertResponseActionsSupport()` hook so that the OS platform
is retrieved from the alert's `host.os.type`
- Note: tests already exist to validate this, however, the mocks were
also incorrectly typed. Those are now corrected as well.
2024-07-11 08:26:01 -04:00
Julia Bardi
5761a382e1
[Fleet] Missing policy filter in Fleet Server check to enable secrets (#187935)
## Summary

Closes https://github.com/elastic/kibana/issues/187933
Closes https://github.com/elastic/kibana/issues/186845

Fixed missing policy filter when checking if Fleet Servers met minimum
version to enable secrets storage.
The integration tests cover now a case where there are no fleet servers
but there are agents with minimum version, to verify that the query
filters them out.

Manual verification is hard because you can't enroll an agent without
enrolling FS with at least the same version.
It could be done by manually creating docs in `.fleet-agents`.

### 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-11 12:57:01 +02:00
Mark Hopkin
12bd8fe53a
[Entity Analytics] Remove links to legacy risk scoring docs (#187585)
## Summary

Related to https://github.com/elastic/security-docs/issues/5489. We had
a few places where we incorrectly link to the legacy
user/host risk scoring docs. 

In deleting the links I found we had two `RiskSummary` components which
components which I have renamed `RiskSummaryPanel` and
`FlyoutRiskSummary` to make life easier.

<img width="770" alt="Screenshot 2024-07-04 at 15 47 14"
src="20e26a15-4975-4165-9c56-bb328c508bee">

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-11 20:43:51 +10:00
Sander Philipse
460b52077f
[Semantic text] Make semantic text work with non-root level fields (#187154)
## Summary

This makes semantic text work with non-root level reference fields. It
also correctly adds copy_to to existing copy_to fields instead of
replacing them, and streamlines a lot of the code.

To test these changes:

- Create an index
- Go to the index mappings page at
`app/management/data/index_management/indices/index_details?{yourIndexName}=blah&tab=mappings`
- Add an object field with a text field inside
- Add a semantic text field referencing that text field
- If you're on a Macbook, create a new inference endpoint with the model
`.elser_model_2` instead of using the default inference endpoint.
- Add a second semantic text field referencing that text field
- Save your mappings
- Use JSON view to verify that the newly created text field contains a
`copy_to` field referencing both newly created semantic text fields
- Verify that the newly created semantic text fields are also in the
JSON view



### Checklist

Delete any items that are not applicable to this PR.

- [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)
- [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/))
- [x] 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))
- [x] 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))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
2024-07-11 20:35:56 +10:00
Jatin Kathuria
092e57408f
[Security Solution] Fix - Unified Timeline Style fixes (#187937)
## Summary

## Unified Timeline

### Before 
![issue_unified_timeline
mov](d60634b8-3f54-4aab-8264-7d20e269077d)


### After

![Styles_old_timeline
mov](aa5eb6eb-511b-421a-abb4-fed7e5c93cd1)

## Old Timeline

### Before

![issue_old_timeline
mov](9719af8d-9485-4673-a9b7-dcc1028e8a66)

### After

![Styles_old_timeline
mov](1f9b2c76-2dc5-4de4-b1f5-a09fdada550c)

## Row Renderers

### Before

![grafik](9ddf057c-2a04-4f7e-9ba7-8940683e059d)

### After

![grafik](c6628a7c-f07e-4a04-843c-7a7e220243dc)

## Stripes patterns in row renderer

Notice the color changes to grow for the same row when `Row Renderer` is
switched.

### Before

![styles_row_renderer_switch_stripes_fixed
mov](0d356771-1562-42aa-8256-de29c6879cd4)


### After

![styles_row_renderer_switch_stripes
mov](95d32feb-9a1f-40f0-9574-db2770980a05)
2024-07-11 20:21:56 +10:00
Pierre Gayvallet
6a72c26689
[licensing] Log a warning when fetching a missing license (#187942)
## Summary

Fix https://github.com/elastic/kibana/issues/101865
2024-07-11 12:03:19 +02:00
jennypavlova
35b5fcc4c4
[APM] Add sparklines to the multi-signal view table (#187782)
Closes #187567

## Summary

This PR adds sparklines to the multi-signal view table


![image](d29aa76f-1ec1-4720-bf85-84e818971bc0)

## Testing 

1. Enable `observability:apmEnableMultiSignal` in advanced settings
 
<details>


<summary>2. Run the entities definition in the dev tools</summary>


```
POST kbn:/internal/api/entities/definition
{
  "id": "apm-services-with-metadata",
  "name": "Services from logs and metrics",
  "displayNameTemplate": "test",
  "history": {
    "timestampField": "@timestamp",
    "interval": "5m"
  },
  "type": "service",
  "indexPatterns": [
    "logs-*",
    "metrics-*"
  ],
  "timestampField": "@timestamp",
  "lookback": "5m",
  "identityFields": [
    {
      "field": "service.name",
      "optional": false
    },
    {
      "field": "service.environment",
      "optional": true
    }
  ],
  "identityTemplate": "{{service.name}}:{{service.environment}}",
  "metadata": [
    "tags",
    "host.name",
    "data_stream.type",
    "service.name", 
    "service.instance.id",
    "service.namespace",
    "service.environment",
    "service.version",
    "service.runtime.name",
    "service.runtime.version",
    "service.node.name",
    "service.language.name",
    "agent.name",
    "cloud.provider",
    "cloud.instance.id",
    "cloud.availability_zone",
    "cloud.instance.name",
    "cloud.machine.type",
    "container.id"
  ],
  "metrics": [
    {
      "name": "latency",
      "equation": "A",
      "metrics": [
        {
          "name": "A",
          "aggregation": "avg",
          "field": "transaction.duration.histogram"
           
          
        }
      ]
    },
    {
      "name": "throughput",
      "equation": "A / 5",
      "metrics": [
        {
          "name": "A",
          "aggregation": "doc_count",
          "filter": "transaction.duration.histogram:*"
        }
      ]
    },
    {
      "name": "failedTransactionRate",
      "equation": "A / B",
      "metrics": [
        {
          "name": "A",
          "aggregation": "doc_count",
          "filter": "event.outcome: \"failure\""
        },
        {
          "name": "B",
          "aggregation": "doc_count",
          "filter": "event.outcome: *"
        }
      ]
    },
    {
      "name": "logErrorRate",
      "equation": "A / B",
      "metrics": [
        {
          "name": "A",
          "aggregation": "doc_count",
          "filter": "log.level: \"error\""
        },
        {
          "name": "B",
          "aggregation": "doc_count",
          "filter": "log.level: *"
        }
      ]
    },
     {
      "name": "logRatePerMinute",
      "equation": "A / 5",
      "metrics": [
        {
          "name": "A",
          "aggregation": "doc_count",
          "filter": "log.level: \"error\""
        }
      ]
    }
  ]
}
```

</details>

3. Generate data with synthrace

    1. logs only: `node scripts/synthtrace simple_logs.ts`
    2. APM only: `node scripts/synthtrace simple_trace.ts` 

4. Open services inventory
- the sparklines should be visible next to the values in the table (big
screen only like in the services table)
   
<img width="1920" alt="image"
src="698de74c-0d54-4f70-9802-5b80bfc74511">

   - on small screens, the sparklines should not be visible
      
<img width="989" alt="image"
src="4bef372d-7b1c-4e50-a3e2-d11ec0df5bc1">
2024-07-11 12:00:26 +02:00
Gergő Ábrahám
a4cd90b6f3
[EDR Workflows] Add warning for duplicated event.category for Process Descendant event filter (#187844)
## Summary


![warning](998b8c57-f852-4983-b545-80c810f21a54)


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

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-11 11:40:56 +02:00
Pratham Shirbhate
1f7fdfdfe4
[Fleet][Cloud] Enrollment token table may show an empty last page #167663 (#188049)
Fixes #167663 

## Summary

Fixes the creation of extra empty page at pagination of 5 rows


### Video 


cdac6a22-f239-4b70-b40c-93fc727418a6

Co-authored-by: Julien Lind <julien.lind@elastic.co>
2024-07-11 19:15:54 +10:00
Juan Pablo Djeredjian
7950fb85ca
[Security Solution] Handle specific fields in /upgrade/_review endpoint and refactor diff logic to use Zod (#186615)
Fixes: https://github.com/elastic/kibana/issues/180393

## Summary

Handles specific fields in `/upgrade/_review` endpoint upgrade workflow,
as described in https://github.com/elastic/kibana/issues/180393.

Achieves this with two mechanisms:

1. Removing fields from the `PrebuiltRuleAsset` schema, which excludes
the field from the diff calculation completely.
2. Manually removing the diff calculation for certain fields, by
excluding them from
`/common/api/detection_engine/prebuilt_rules/model/diff/diffable_rule/diffable_rule.ts`

Also, refactors a part of the codebase from its prior usage of `io-ts`
schema types to use autogenerated Zod types.

With this refactor, most of the
`x-pack/plugins/security_solution/common/api/detection_engine/model/rule_schema_legacy`
could be deleted. Unluckily some of the types manually created there are
still used in some complex types elsewhere, so I added a note to that
file indicating that those should be migrated to Zod, so that the legacy
folder can finally be deleted.


### Checklist

Delete any items that are not applicable to this PR.

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


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

---------

Co-authored-by: Georgii Gorbachev <georgii.gorbachev@elastic.co>
2024-07-11 10:59:06 +02:00
Alexey Antonov
d0d3847c7e
fix: [Obs Cases][SCREEN READER] Icons and repeated controls need unique accessible labels: 0003 (#188005)
Closes: https://github.com/elastic/observability-dev/issues/3640

# Description
Observability has a lot of icons that are used for controls and table
row actions. These icons often have the same aria-label repeated across
rows. While this meets the letter of SC 1.3.1: Info and Relationships,
the repeated generic labels do not usually answer question what users
are editing, or what users are deleting. We want to provide clear labels
for each row to make the implicit relationships sighted users depend on,
explicit for screen reader users.


# What was changed?:

1. `aria-label` attribute was updated for `CasesTable` -> `ActionColumn`

# Screen 

<img width="1546" alt="image"
src="014f613f-91b6-4bbb-a8f0-04a4e30ff3ba">
2024-07-11 11:30:14 +03:00