Commit graph

76318 commits

Author SHA1 Message Date
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
Ryland Herrick
3df635ef4a
[Detection Engine] Addresses Flakiness in ML FTR tests (#188155)
## Summary

The full chronicle of this endeavor can be found
[here](https://github.com/elastic/kibana/pull/182183), but [this
comment](https://github.com/elastic/kibana/pull/182183#issuecomment-2221517519)
summarizes the identified issue:

> I [finally
found](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6516#01909dde-a3e8-4e47-b255-b1ff7cac8f8d/6-2368)
the cause of these failures in the response to our "setup modules"
request to ML. Attaching here for posterity:
>
> <details>
> <summary>Setup Modules Failure Response</summary>
> 
> ```json
> {
>   "jobs": [
> { "id": "v3_linux_anomalous_network_port_activity", "success": true },
>     {
>       "id": "v3_linux_anomalous_network_activity",
>       "success": false,
>       "error": {
>         "error": {
>           "root_cause": [
>             {
>               "type": "no_shard_available_action_exception",
> "reason":
"[ftr][127.0.0.1:9300][indices:data/read/search[phase/query]]"
>             }
>           ],
>           "type": "search_phase_execution_exception",
>           "reason": "all shards failed",
>           "phase": "query",
>           "grouped": true,
>           "failed_shards": [
>             {
>               "shard": 0,
> "index":
".ml-anomalies-custom-v3_linux_network_configuration_discovery",
>               "node": "dKzpvp06ScO0OxqHilETEA",
>               "reason": {
>                 "type": "no_shard_available_action_exception",
> "reason":
"[ftr][127.0.0.1:9300][indices:data/read/search[phase/query]]"
>               }
>             }
>           ]
>         },
>         "status": 503
>       }
>     }
>   ],
>   "datafeeds": [
>     {
>       "id": "datafeed-v3_linux_anomalous_network_port_activity",
>       "success": true,
>       "started": false,
>       "awaitingMlNodeAllocation": false
>     },
>     {
>       "id": "datafeed-v3_linux_anomalous_network_activity",
>       "success": false,
>       "started": false,
>       "awaitingMlNodeAllocation": false,
>       "error": {
>         "error": {
>           "root_cause": [
>             {
>               "type": "resource_not_found_exception",
> "reason": "No known job with id 'v3_linux_anomalous_network_activity'"
>             }
>           ],
>           "type": "resource_not_found_exception",
> "reason": "No known job with id 'v3_linux_anomalous_network_activity'"
>         },
>         "status": 404
>       }
>     }
>   ],
>   "kibana": {}
> }
> 
> ```
> </details>

This branch, then, fixes said issue by (relatively simply) retrying the
failed API call until it succeeds.

### Related Issues
Addresses:
- https://github.com/elastic/kibana/issues/171426
- https://github.com/elastic/kibana/issues/187478
- https://github.com/elastic/kibana/issues/187614
- https://github.com/elastic/kibana/issues/182009
- https://github.com/elastic/kibana/issues/171426

### 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] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] [ESS Rule Execution FTR x
200](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6528)
- [x] [Serverless Rule Execution FTR x
200](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6529)


### For maintainers

- [x] 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 14:10:25 -05: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
Konrad Szwarc
f96d55a4f5
[EDR Workflows] MKI API tests (#187560)
This pull request introduces two changes to our existing API integration
tests:
1. It restructures the files to follow the security solution-wide
standard.
2. It adds our API integration tests to the periodic MKI pipeline.
[Example
build](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/818)

**Change of Structure:**
All tests have been moved to
`x-pack/test/security_solution_api_integration/test_suites/edr_workflows`
and are grouped by feature and then by licensing.
![Screenshot 2024-07-10 at 11 52
42](223c9138-8702-42f2-a801-a35be87304cb)

**MKI:**
Due to the nature of our tests – their dependence on switching users
and/or modifying internal indices – only 3 out of 7 test suites qualify
to be run in MKI. I've added all test suites to
`.buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_defend_workflows.yml`.
However, the ones that would be skipped are commented out to avoid
consuming resources without providing any value.

**Testing for Regression:**
I've noticed that the `@skipInServerlessMKI` tag is not working as
expected. Tests tagged with `@serverless @skipInServerlessMKI Test Name`
were not being run in the PR pipelines. The grep pattern we were using
in individual configs and in
`x-pack/test/security_solution_api_integration/scripts/index.js`
(`'/^(?!.*@skipInServerless).*@serverless.*/'`) would also match
`@skipInServerlessMKI`.

I've modified the pattern to look for a full word, expecting it to be at
the beginning or end of a string, and to be followed or not followed by
a whitespace. We could use unit tests for these grep patterns 😄

Here is a screenshot of the new regex being tested:

![Screenshot 2024-07-10 at 12 09
28](8b9dd49a-3ca5-458d-9567-ad938847f169)

This led me to double-check whether all our API integration tests are
being executed in both PR and MKI pipelines, all seems to be in place:

**MKI:**
1. Artifacts -
[buildkite](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/817#01909bfb-81ae-47c3-a867-b16de4bfa20e/262-380)
- 0 tests executed due to `@skipInServerlessMKI` present in all top
describe of each test file
2. Authentication -
[buildkite](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/817#01909bfb-81b0-4824-a658-3a881607eb56)
- 0 tests executed due to `@skipInServerlessMKI` present in all top
describe of each test file
3. Metadata -
[buildkite](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/817#01909bfb-81b1-4730-9b51-512b1b554f64/261-386)
- 0 tests executed due to `@skipInServerlessMKI` present in all top
describe of each test file
4. Package -
[buildkite](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/817#01909bfb-81b3-418c-ad33-0cd7dd68ad46/261-370)
- 0 tests executed due to `@skipInServerlessMKI` present in all top
describe of each test file
5. Policy Response -
[buildkite](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/817#01909bfb-81b4-4034-a575-3ddbdde42e24/261-422)
- all tests were executed
6. Resolver -
[buildkite](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/817#01909bfb-81b5-482d-8023-e1f819d3c56e/261-711)
- all but the tests with `@skipInServerless` were executed
7. Response actions -
[buildkite](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-defend-workflows/builds/817#01909bfb-81b7-4561-83a3-6896523cff8f/262-403)
- only one file was executed due to the second one being tagged as
`@skipInServerlessMKI`

**PR:**

All tests are accounted for and executed as expected, no regression.
package suite was never executed since it's `.skip`


policy_response/serverless
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-675b-4fab-a787-e5e472711fb0/3394)
policy_response/ess
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-678f-49c6-ae4f-aee3738713c2/3446)
authentication/serverless
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-6768-4330-9b6c-8328a46a5a99/2352)
authentication/ess
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-67b3-4b9b-ba31-110f737a1f3f/1970)
resolver/ess
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-6759-49a3-8cb7-4b0097cf8975/6266)
resolver/serverless
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-676a-4dfe-bc19-6fd50e42980a/3302)
metadata/serverless
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-676c-49ff-b0a5-cf7acc9c5506/4827)
metadata/ess
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-679e-45e8-aa52-5672baf344df/3000)
response_actions/ess
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-67ad-4826-bb58-4b6330fef338/2760)
response_actions/serverless
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-67b7-4a6a-a37d-d138a7054a41/9654)
artifacts/ess
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-67d6-4926-a93f-b193ab2859be/1158)
artifacts/serverless
[buildkite](https://buildkite.com/elastic/kibana-pull-request/builds/220548#01909c0b-672e-4350-8820-c7fd8d7ef010/2328)

---------

Co-authored-by: Angela Chuang <yi-chun.chuang@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Angela Chuang <6295984+angorayc@users.noreply.github.com>
2024-07-12 14:41:41 +02:00
Marco Liberati
495f66d6eb
[FTR] Fix for env variables read (#188185)
## Summary

Fix #174752

env variables were read on module load, so before the CLI script could
change them based on user flag inputs.
This PR fixes making it lazily read the variable when required picking
up always the fresh value after the CLI set it.

After a first read of the value, it avoids to re-read env variables
again, preventing other scripts to poison it.
2024-07-12 22:24:49 +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
Pierre Gayvallet
49cfa96cc5
ssl.redirectHttpFromPort: use host from request instead of config (#188088)
## Summary

Fix https://github.com/elastic/kibana/issues/24870
2024-07-12 12:03:28 +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
Kibana Machine
00ba9751dd skip failing test suite (#188125) 2024-07-12 06:01:47 +02:00
Tiago Costa
e4fc4b2259
skip failing es promotion suites (#188109) 2024-07-12 04:59:46 +01:00
Tiago Costa
51da2d98a4
skip flaky suite (#179307) 2024-07-12 04:56:01 +01:00
Tiago Costa
a1fb6ba204
skip flaky suite (#186168) 2024-07-12 04:54:43 +01:00
Kibana Machine
cb97153180 skip failing test suite (#188131) 2024-07-12 05:53:55 +02: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
Davis McPhee
4b9a9d704c
[Unified Histogram] Fix metric chart width from 90$ to 90% (#188150)
## Summary

This PR fixes a minor typo from #187981 where the metric chart width is
being set to `90$` instead of `90%`. Now it's the correct size and
doesn't cost 90$ 🙂

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

### 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 18:17:09 -03: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
Julia Rechkunova
ee3543990b
[Discover] Unskip search alert serverless tests on MKI (#187771)
- Closes https://github.com/elastic/kibana/issues/187069
- Closes https://github.com/elastic/kibana/issues/180101
- Closes https://github.com/elastic/kibana/issues/180100

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-07-11 22:57:46 +02:00
Ryland Herrick
48e2b57643
[Security Solution] Skip remaining flaky ML FTR tests (#188029)
This group of tests (#187614) has a sibling group that is already
skipped (#187478).
2024-07-12 04:54:10 +10: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
Davis McPhee
3b396850e8
[Discover] Fix chart getting stuck on loading when switching from ES|QL (#188034)
## Summary

This PR fixes an issue I noticed where the Discover chart can get stuck
on loading when switching from ES|QL to data view mode due to a race
condition:


811448c6-0256-4fe4-a362-bc966d8d9ffd

Really this shouldn't happen, and there's likely an underlying race
condition with the state management causing it which this PR doesn't
address, but it prevents the UX issue of the chart getting stuck in a
visible loading state to users.

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

### 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 15:32:35 -03:00
Davis McPhee
4dd31674d1
[Discover] Increase the comparison field limit to 250 (#188028)
## Summary

This PR increases the Discover comparison field limit to 250:

![comparison](059eda40-4bca-4a20-b480-e420ac0a422e)

Tested using `many_fields` dataset: `node scripts/es_archiver
--kibana-url=http://elastic:changeme@localhost:5601
--es-url=http://elastic:changeme@localhost:9200 load
test/functional/fixtures/es_archiver/many_fields`.

Resolves #187191.

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

### 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 15:30:48 -03:00
Saarika Bhasi
40a6530641
[Index management] Clean up and remove comments from FTR tests (#188130)
Remove irrelevant comment, raised in
[comment](https://github.com/elastic/kibana/pull/188045#discussion_r1674255549)
2024-07-12 04:06:59 +10: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
Jorge Sanz
8670e59dae
[Maps] Update ems-client@8.5.3 (#188099)
Replaces #187679

Updates `@elastic/ems-client` to
[8.5.3](https://github.com/elastic/ems-client/releases/tag/v8.5.3) which
is an update in the library dependencies without any new features.
2024-07-11 19:43:13 +02: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
Tiago Costa
0c0ce0d9c5
chore(NA): update versions after v8.14.4 bump (#188120)
This PR is a simple update of our versions file after the recent bumps.
2024-07-11 16:49:56 +01:00
Pierre Gayvallet
10edbf1054
Enforce correct shape for SO attributes and id during create operations (#187876)
## Summary

Fix https://github.com/elastic/kibana/issues/123575
Fix https://github.com/elastic/kibana/issues/105039

This PR does two things:
- adapt SO ID validation to block empty strings (`""`), we we were
already doing with `undefined`
- add validation of the `attributes` to reject primitives and
`undefined` (only accept objects)
2024-07-12 01:10:48 +10: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