Commit graph

46297 commits

Author SHA1 Message Date
Charlotte Alexandra Wilson
874cee2c57
[refactoring] Distinguish User Controls from Risk Engine in DashboardEnablementPanel (#212441)
## Summary
This PR refactors naming and logic in EntityStoreEnablementModal to
improve readability and better distinguish between:
1. Feature enablement state – Whether Risk Score or Entity Store is
actually enabled.
2. User-selected state – Whether the user has checked the corresponding
toggle.

#### Changes

- Renamed disabled → canToggle to clearly represent UI interaction.
- Renamed enablements → userSelectedEnablements to reflect user-selected
toggle states, not feature enablement.
- Refactored shouldAllowEnablement logic for clarity and correctness:
- If riskScore is enabled, return whether the user has enabled
entityStore.
- If entityStore is enabled, return whether the user has enabled
riskScore.
     - Otherwise, return true if either toggle is selected.
- Updated corresponding tests to reflect naming and logic changes.

## Testing/Validation
Manually tested the toggling behaviour still works as before and modal
still shows warning, and disables the "enable" button when there are no
available options selected.

### Validation Video


https://github.com/user-attachments/assets/0f2a3f59-e2a0-4c8b-a350-70a9573a8566
2025-02-26 14:29:21 +01:00
Kyle Pollich
8972d5b973
[Fleet] Disable logfile input for agentless integrations (#212455)
## Summary

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

cc @qcorporation

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-26 08:27:32 -05:00
Ievgen Sorokopud
a2b2e81b5b
[Bug][Assistant API] - chat/complete endpoint is not persisting the model response to the chosen conversation ID (#11783) (#212122)
## Summary

BUG: https://github.com/elastic/security-team/issues/11783

This PR fixes the behaviour of the
`/api/security_ai_assistant/chat/complete` route where the `persist`
flag:
1. when set to `true` does not append the assistant reply to existing
conversation
2. when set to `false` appends user message to existing conversation

### Expected behaviour


[Details](https://github.com/elastic/security-team/issues/11783#issuecomment-2674565194).

1. `conversationId == undefined && persist == false`: no new
conversations and nothing persisted
2. `conversationId == undefined && persist == true`: new conversations
is created and both user message and assistant reply appended to the new
conversation
3. `conversationId == 'existing-id' && persist == false`: nothing
appended to the existing conversation
4. `conversationId == 'existing-id' && persist == true`: both user
message and assistant reply appended to the existing conversation

### Testing

* Use this `curl` command (with replace `connectorId` and
`conversationId`) to test the endpoint.

```
curl --location 'http://localhost:5601/api/security_ai_assistant/chat/complete' \
--header 'kbn-xsrf: true' \
--header 'Content-Type: application/json' \
--data '{
  "connectorId": "{{my-gpt4o-ai}}",
  "conversationId": "{{existing-conversation-id | undefined}}",
  "isStream": false,
  "messages": [
    {
      "content": "Follow up",
      "role": "user"
    }
  ],
  "persist": true
}'
```

* To retrieve the conversation ID:
(/api/security_ai_assistant/current_user/conversations/_find)
* `conversationId` can be either existing conversation id or `undefined`
2025-02-26 12:03:09 +01:00
James Gowdy
0121f4b87b
[ML] File upload api refactor (#210865)
Adds a v2 version of the file upload api which spits away the upload
initialisation step from the data upload api.
Previously the import data API would behave differently depending on
whether an ID was passed to it. If an ID was not present, the api would
"initialize the upload" by creating the index, mappings and pipeline.
Subsequent calls to the api would the pass in an ID as well as the data.
The ID being present meant the data would be ingested.
The ID had not other purpose other than signifying whether this was the
initial call to create the index or the subsequent calls to ingest the
data.
This change adds a new `initialize_import` api which is called first to
create the index et al.
Subsequent calls to the `import` api behave as before and the data is
ingested.

A temporary v1 version of the `import` has been kept for backwards
compatibility during upgrades.

The `initialize_import` also creates multiple ingest pipelines by
default. Improving the previous "hacked in" addition of having two sets
of pipelines passed to it to provide backwards compatibility.
2025-02-26 10:39:30 +00:00
Alex Prozorov
14e7f6007e
[Cloud Security] fix rules flaky test suite (#212198)
## Summary

This PR fixes the flakiness of of rules page test suite -
https://github.com/elastic/kibana/issues/178413
Issues there were handled are:
1. Removing the set up of fleet server before every test which caused
flakiness.
![Screenshot 2025-02-24 at 9 54
40](https://github.com/user-attachments/assets/6913be9d-45aa-46fa-9923-671ed0d67f98)


2. Fixing race conditions.
3. Use retry.try function to re-execute in places where flakiness was
observed due to not waiting enough time before doing the action.

### Checklist

Reviewers should verify this PR satisfies this list as well.
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2025-02-26 12:05:55 +02:00
Maryam Saeidi
f5c4f203fc
Attempt to fix flaky sidenav test (#212213)
Fixes #195153

## Summary

Waiting for the page to be loaded and the side nav item to exist before
clicking.
2025-02-26 10:42:27 +01:00
Rickyanto Ang
9d1d297ae9
Move Findings Flyout to Security Solution or Shared Package Phase 1 (#212053)
## Summary

As a part of Expandable Findings flyout, we will need to move some
Constants, Types, Functions, Components into Security Solution plugin or
Shared package

This PR is phase 1 for Findings (Misconfiguration flyout) which include
moving constants and types into shared package or security solution
plugin

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-26 00:53:24 -08:00
Georgii Gorbachev
c9616593c1
[Security Solution] Refactor prebuilt rule customization test plans, part 3 (#212420)
**Epic:** https://github.com/elastic/kibana/issues/174168
**Partially addresses:**
https://github.com/elastic/kibana/issues/202068,
https://github.com/elastic/kibana/issues/202078,
https://github.com/elastic/kibana/issues/202079
**Follow-up to:** https://github.com/elastic/kibana/pull/211472

## Summary

We're cleaning up and refactoring our existing test plans for prebuilt
rule customization, upgrade, and export/import workflows.

Specifically, this PR:

- Updates the common structure of test plans:
- Adds a tip to each test plan's header to help with navigating all our
test plans for prebuilt rules.
- Introduces a new `Requirements` section to each one and consolidates
assumptions, technical requirements and product requirements under it.
- Each `Product requirements` section now contains relevant user stories
and other product details. In the document flow this is kept close to
the `Scenarios` section.
  - Updates the test plan template according to the updated structure.
- Moves the documentation about customizable and non-customizable rule
fields to the common info document.
- Restores the lost changes from commit
bde4612e52.

No "functional" changes have been made to any test plans, such as
adding, removing, or updating any scenarios. The only functional-like
changes were made to the user stories when creating/updating the product
requirements sections.

This PR wraps up the refactoring efforts aimed to prepare the test plans
for being "functionally" changed and improved in follow-up PRs. In the
following PRs, we're going to cover the logic described in
https://github.com/elastic/kibana/issues/210358, address any gaps in the
coverage, and improve the scenarios structure and wording.

## Review tip

It might be easier to review this PR commit-by-commit as each of them
contains logically cohesive changes.
2025-02-26 09:39:32 +01:00
Dmitry Gurevich
d685e54225
Fix cloud UI sanity tests (#212368)
## Summary

This PR fixes the `Querying provider data` tests executed on the
`Findings` page.

Sanity UI tests successfully
[run](3783519246).

![Screenshot 2025-02-26 at 10 27
31](https://github.com/user-attachments/assets/f2447f62-fafa-4e58-a98c-5abbf7f08c42)
2025-02-26 10:28:18 +02:00
Joe Reuter
d348f746ff
🌊 Codeownership restructure (#212337)
As a first step towards making parts of streams owned by different teams
working on it, this PR gives some of the things to the logs UX team.

These routes and views are clearly associated with the workstreams the
logs UX team moves forward. It's still expected that a lot of changes
(but probably not all) will have at least a portion outside of this code
area, but it's meant to put a starting point into place to make the
separation stronger over time.

For the API it's just about certain route handlers. For the UI, the
relevant components are pulled into a separate directory to encapsulate
them somewhat.

---------

Co-authored-by: Milton Hultgren <miltonhultgren@gmail.com>
2025-02-26 09:01:55 +01:00
Jon
8debfd62fc
[build] Replace Ubuntu base image with UBI (#212155)
https://buildkite.com/elastic/kibana-artifacts-snapshot/builds/5618
2025-02-25 17:20:48 -06:00
Patryk Kopyciński
c822109a49
[Security Assistant] Fix Knowledge Base API (#211367)
## Summary

Fixes bugs related to Security Assistant Knowledge Base API

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
Co-authored-by: Davis Plumlee <56367316+dplumlee@users.noreply.github.com>
Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
Co-authored-by: Chris Cowan <chris@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Arturo Lidueña <arturo.liduena@elastic.co>
Co-authored-by: Jon <jon@elastic.co>
Co-authored-by: Rodney Norris <rodney.norris@elastic.co>
Co-authored-by: Elena Shostak <165678770+elena-shostak@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: Irene Blanco <irene.blanco@elastic.co>
Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>
Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
2025-02-25 23:00:00 +00:00
Maryam Saeidi
cb6e0be122
Attempt to fix flaky burn rate test (#212039)
Fixes #211439

## Summary

@simianhacker pointed out that the `alignEventsToInterval` setting
aligns the data generation so that we have the exact number of documents
in each bucket; I noticed this setting is missing for the burn rate rule
test.

### How to run the test

```
// Server
node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts

// Test
node scripts/functional_test_runner --config=x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts --grep="Burn rate rule"
```

Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
2025-02-25 21:36:26 +01:00
Maryam Saeidi
3b1c352df9
Attempt to fix AlertSummaryWidget flaky test (#212107)
Fixes #198102

## Summary

The check that fails is related to status:All
[here](https://github.com/elastic/kibana/blob/main/x-pack/test/observability_functional/apps/observability/pages/rule_details_page.ts#L191):

```
expect(url.includes('status%3Aall')).to.be(true);
```

It seems the status is active from the previous step:

<img
src="https://github.com/user-attachments/assets/8fa33035-d54a-4bfd-9e06-fff696767598"
width=500 />


This PR adds a retry to accommodate a delay in changing URLs.

Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
2025-02-25 21:13:04 +01:00
Paul Tavares
1ee97c3c8f
[Security Solution][Endpoint] Add validation to artifact create/update APIs for management of ownerSpaceId (#211325)
## Summary


#### Changes in support of space awareness

> currently behind feature flag:
`endpointManagementSpaceAwarenessEnabled`

- Add logic to the server-side Lists plugin extension points for
endpoint artifacts to ensure that only a user with the new Global
Artifact Management privilege can update/change/add `ownerSpaceId` tags
on an artifact
- Added validation to all endpoint artifacts (Trusted Apps, Event
Filters, Blocklists, Host Isolation Exceptions and Endpoint Exceptions)


#### Other changes:

- Fix UI bug that failed to display artifact submit API failures. API
errors are now displayed in the artifact's respective edit/create forms
if encountered
- Fixed a bug where "unknown" artifact `tags` were being dropped
whenever the artifact assignment (global, per-policy) was updated in the
UI








## 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>
2025-02-25 14:52:08 -05:00
Samiul Monir
0e02a32892
Updating preconfigured connector name (#211927)
## Summary

Update Preconfigured connector name to `Elastic LLM`.

<img width="1504" alt="Screenshot 2025-02-20 at 11 29 02 AM"
src="https://github.com/user-attachments/assets/aa0a32f7-f1b2-4496-8c2e-7773f017c153"
/>

### ES3 Testing instruction
No additional config needed. Once run in local machine, the changes
should reflect automatically.

### ESS instructions
In `kibana.dev.yml` file, add
```
# xpack.actions.preconfigured:
   Elastic-LLM:
     name: Elastic LLM
     actionTypeId: .inference
     exposeConfig: true
     config:
       provider: 'elastic'
       taskType: 'chat_completion'
       inferenceId: '.rainbow-sprinkles-elastic'
       providerConfig:
         model_id: 'rainbow-sprinkles'
```
and the preconfigured endpoint with updated name should be visible.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [X] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2025-02-25 14:21:22 -05:00
Katerina
9a1d70d5d2
[Perfomance] Add is_initial_load meta (#206645)
closes https://github.com/elastic/observability-dev/issues/4185 

## Summary

This PR adds the `is_initial_load` parameter to the meta field to
distinguish whether the `onPageReady` trigger occurs during the initial
load or a page refresh.

Refactoring: 
- Removed the `target` field. as `context.pageName` now provides the
necessary information
- Refactor APM instrumentation to simplify it

Fixes: 
- https://github.com/elastic/observability-dev/issues/3464  


### ⚠️  Instrumentation 

The plugins need to call the following function: 

``` onPageRefreshStart()```


This method adds a performance marker `start::pageRefresh` to indicate when a page refresh begins. This marker is used along with an end marker `end::pageReady` to determine the total refresh duration.


 
https://github.com/user-attachments/assets/62587d18-b33e-437b-9774-d8e196dbf764

https://github.com/user-attachments/assets/e9c9a761-57bc-4743-9cc7-ea7634696ee3



### How to test
- Checkout the PR
- make sure you run `yarn kbn bootstrap`
- go to any page that has onPageReady function instrumented (ex services)  


### TODO
- Once approved, update docs

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-25 20:48:51 +02:00
christineweng
74e1320276
[Security Solution] Convert isolate host to standalone flyout (#211853)
## Summary

Ref: https://github.com/elastic/kibana/issues/207596

This PR fixed a bug where when user has a alert open in preview, then
clicks isolate/release host, the panel opens in the background. This is
because the isolate host panel was called via `openRightPanel`, which
only replaces the panel and not opens a new flyout. To make the isolate
host flyout consistent with other actions, this PR converts the panel
into a normal EUI flyout.


https://github.com/user-attachments/assets/7da4baa0-61ee-4166-9ff1-57c1078a1547


**How to test**
- Apply license (platinum+)
- To enable the isolate/release host button, you can use this command
`yarn test:generate --fleet --withNewUser=test:changeme`


### Checklist

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2025-02-25 12:11:36 -06:00
Dominique Clarke
c75ecb3c51
[User experience] add UX test plan (#212272)
## Summary

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

Adds a small manual test plan for the UX app.

The UX app is quite small and straightforward so the test plan is pretty
basic.
2025-02-25 11:54:53 -05:00
Efe Gürkan YALAMAN
45768bae66
Deprecate Behavioral Analytics and Maintanence for Search Applications (#212031)
## Summary

Deprecation warnings for Behavioral Analytics removal from sidebar
Maintenance mode warnings for Search Applications.

<img width="1714" alt="Screenshot 2025-02-21 at 12 55 19"
src="https://github.com/user-attachments/assets/d97c55c4-1592-489f-bb0c-01adef09d12d"
/>
<img width="1728" alt="Screenshot 2025-02-21 at 12 55 23"
src="https://github.com/user-attachments/assets/8bf0f414-2614-4576-9268-c572ba8bf49d"
/>
<img width="1727" alt="Screenshot 2025-02-21 at 12 55 38"
src="https://github.com/user-attachments/assets/10751fe7-cf92-4487-8e0c-6ec81940594c"
/>
<img width="1724" alt="Screenshot 2025-02-21 at 12 55 47"
src="https://github.com/user-attachments/assets/354b0bc7-5f25-4016-9fb0-87ec26a032be"
/>
<img width="1728" alt="Screenshot 2025-02-21 at 12 56 16"
src="https://github.com/user-attachments/assets/ff695078-5f15-4a40-9966-2767a0773fa1"
/>
<img width="1663" alt="Screenshot 2025-02-21 at 12 56 21"
src="https://github.com/user-attachments/assets/8d0f9867-e226-4a7d-822e-be600d947a46"
/>
<img width="1536" alt="Screenshot 2025-02-21 at 12 56 37"
src="https://github.com/user-attachments/assets/cb0c4b01-e3f8-444c-a05a-a48e2f6933f2"
/>
<img width="1453" alt="Screenshot 2025-02-21 at 12 56 41"
src="https://github.com/user-attachments/assets/7fb3353f-4319-48da-8123-905240af0b64"
/>

<img width="1271" alt="Screenshot 2025-02-25 at 18 07 30"
src="https://github.com/user-attachments/assets/24235ed7-8a8b-4846-a4fb-2d5cbc3946ea"
/>

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
2025-02-25 16:50:56 +00:00
Tomasz Ciecierski
7bd5aa6fba
[EDR Workflows] Fix CrowdStrike's runscript availability in Defend (#211889) 2025-02-25 17:37:45 +01:00
Alex Prozorov
6bf5166018
[Cloud Security] fix findings_alerts flaky test suite (#212271)
## Summary

This PR fixes the flakiness of of rules page test suite -
https://github.com/elastic/kibana/issues/168991
Issues there were handled are:
1. Waiting for page title to appear in the rules page.
2. Waiting for the toast message to appear before checking data
visibility.


### Checklist

Reviewers should verify this PR satisfies this list as well.
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2025-02-25 18:22:39 +02:00
Kenneth Kreindler
638ae14772
[Security Solution] [AI Assistant] Remove citations feature flag (#212204)
## Summary

Removes the citations feature flag added in this PR:
https://github.com/elastic/kibana/pull/206683

#### How to test:
- Add the feature flag to kibana.dev.yaml
`xpack.securitySolution.enableExperimental:
['contentReferencesEnabled']`
- Start Kibana
- You should see the log 
```
The following configuration values are no longer supported and should be removed from the kibana configuration file:

    xpack.securitySolution.enableExperimental:
      - contentReferencesEnabled
```
- Remove the feature flag from kibana.dev.yaml
- Restart Kibana
- You should not see the log
- Open the Security AI assistant
- Check "Show citations" exists in the assistant settings menu
<img width="869" alt="image"
src="https://github.com/user-attachments/assets/34a4c812-bccd-4eef-a9f9-7c834faff951"
/>

- Ask the assistant a question about your knowledge base or an alert.
The response should contain a citation. (if it does not, append "include
citations" to your prompt)
- Use the shortcut option + c to toggle citations on and off. Observe if
this works as expected.


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [X] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [X]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [X] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [X] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [X] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [X] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [X] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-25 15:42:29 +00:00
Patryk Kopyciński
8c456d1e1e
Fix calling Sonnet 3.7 (#212372)
## Summary

Fixes 
<img width="1509" alt="image"
src="https://github.com/user-attachments/assets/ba409fde-f52b-4864-a81a-70025ef61f2f"
/>
2025-02-25 16:41:55 +01:00
Jill Guyonnet
0d0995cb26
[Fleet] Add task for automatic agent upgrades (#211019)
## Summary

Closes https://github.com/elastic/ingest-dev/issues/4722

### Implementation checklist

- [x] Handle fetching agent policies and agents at scale
- [x] Only consider active agents for upgrade
- [x] Agents already on or upgrading to target version are included in
the count but not considered for upgrade
- [x] Agents stuck in updating are considered for upgrade
- [x] Bulk upgrade actions triggered by the task have an added
`isAutomatic:true` flag
- [x] Use rollout duration to spread bulk upgrade in time (1h or longer
depending on agent count)

### Testing

- This should be tested with real Elastic Agents (that will upgrade and
have `upgrade_details`).
- Edit the task interval in order to test how the task logic handles
agents already upgrading.
- Edit the agents batch size in order to test how the task logic handles
agents at scale.
- We should also check that space awareness is respected if enabled.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Risk of incorrectly triggering agent upgrades. Probability should be
very low if the agent policy does not have `required_versions` set.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-25 16:38:18 +01:00
Gerard Soldevila
ec12886ab7
Ignore test-generated files (#212375)
## Summary

We don't want them added by devs unwillingly.
2025-02-25 15:19:18 +00:00
José Luis González
965cbbabc0
[Search][Connectors] Fixing custom connector icon rendering (#212225)
## Summary

Fixing areas where we were not rendering well the custom connector icon
as described in this ticket:
https://github.com/elastic/search-team/issues/9362

![CleanShot 2025-02-24 at 13 16
44@2x](https://github.com/user-attachments/assets/9db5a0f6-92a7-4d92-97e2-620ad93b617d)

![CleanShot 2025-02-24 at 13 16
58@2x](https://github.com/user-attachments/assets/392dc640-ad01-43d8-9b6a-112d439b3486)

![CleanShot 2025-02-24 at 13 17
07@2x](https://github.com/user-attachments/assets/c92efa28-8a4b-4941-acc2-be59f08e5a21)

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
2025-02-25 15:49:33 +01:00
Alejandro Fernández Haro
52ab19db2d
Upgrade ES client to 9.0.0-alpha.3 (#208776)
## Summary

Updating the ES client to 9.0. 

Resolves #116102

## What changes?

**Breaking change**: `body` has been removed.

Most of the changes are about bringing all the content inside the body
as a root attribute to the API params:

```diff
const response = await client.search({
  index: 'test',
-  body: {
    query: {
      match_all: {}
    }
-  }
})
```

For this reason, enabling the "Hide whitespace changes" option when
reviewing is recommended.

Some exceptions to this rule:

* Bulk APIs replace the `body` array with `operations` array (direct
replacement)
* Index Put Settings API replace `body` array with `settings` (direct
replacement)
* Msearch replaces the `body` array with `searches` array (direct
replacement)
* Document Index API replaces `body` with `document` (direct
replacement)
* Create Repository replaces `body` with `repository` (direct
replacement)

Because of a known issue in the client
(https://github.com/elastic/elasticsearch-js/issues/2584), there's still
an escape hatch to send data in the body in case the specific use case
requires it via `// @ts-expect-error elasticsearch@9.0.0
https://github.com/elastic/elasticsearch-js/issues/2584`, but it
shouldn't be abused because we lose types. In this PR we've used it in
those scenarios where we reuse the response of a GET as the body of a
PUT/POST.

### Other changes

* `estypes` can be imported from the root of the library as `import type
{ estypes } from '@elastic/elasticsearch';`
* `estypesWithBody` have been removed
* `requestTimeout`'s 30s default has been removed in the client. This PR
explicitly adds the setting in all client usages.


### Identify risks

- [x] The client places unknown properties as querystring, risking body
params leaking there, and causing 400 errors from ES => Solved by
forcing `body` usage there via `// @ts-expect-error elasticsearch@9.0.0
https://github.com/elastic/elasticsearch-js/issues/2584`. The next
version of the client will address this.
- [x] We need to run the MKI tests to make sure that we're not breaking
anything there =>
https://elastic.slack.com/archives/C04HT4P1YS3/p1739528112482629?thread_ts=1739480136.231439&cid=C04HT4P1YS3

---------

Co-authored-by: Gloria Hornero <gloria.hornero@elastic.co>
2025-02-25 14:37:23 +00:00
Konrad Szwarc
3492f12c6c
[EDR Workflows] OpenApi Missing Content - Endpoint Management (#212205)
Part of DW team effort -
https://github.com/elastic/security-team/issues/11804

This PR aligns the property/schema descriptions and examples in
AsciiDocs with OpenAPI schemas. The primary goal of this PR was not to
extend or enhance the documentation but to migrate from one system to
another.

Ascii docs -
https://www.elastic.co/guide/en/kibana/8.17/osquery-manager-api.html
OpenApi generated docs -
https://www.elastic.co/docs/api/doc/kibana/operation/operation-endpointgetactionslist

Changes:

Copied missing property descriptions from AsciiDoc to OpenApi properties
Copied existing AsciiDoc examples for both requests and responses
Fixed falsy query object in some GET requests - in OpenApi it was
defined as an object, not as path query params.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: natasha-moore-elastic <137783811+natasha-moore-elastic@users.noreply.github.com>
2025-02-25 13:18:56 +00:00
Ido Cohen
7f2df7cd42
Fix Chart Trend by Severity Bug 2025-02-25 13:24:50 +02:00
Efe Gürkan YALAMAN
93931f9e3b
Remove Search Applications and Behavioral Analytics from search (#211888)
## Summary

Removes Search Applications from globalSearch due to maintenance mode.
Removes Behavioral Analytics from globalSearch due to deprecation.


Summarize your PR. If it involves visual changes include a screenshot or
gif.
<img width="1203" alt="Screenshot 2025-02-21 at 13 45 48"
src="https://github.com/user-attachments/assets/c3397cd1-4786-43b1-a10f-78b41ccaca2f"
/>
<img width="1105" alt="Screenshot 2025-02-21 at 13 45 57"
src="https://github.com/user-attachments/assets/4d671653-f918-47bf-afd4-77fcd71bae06"
/>


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] [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
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2025-02-25 12:16:31 +01:00
Gerard Soldevila
97095f0ac3
SKA: Update and breakdown x-pack/.gitignore (#212341)
## Summary
* Removes unneeded entries from `x-pack/.gitignore`.
* Moves `x-pack/test/` entries to a new, more specific file.
2025-02-25 11:34:42 +01:00
Nikita Indik
8e3d423572
[Security Solution] Fix incorrect diff display after switching versions (#211901)
**Resolves: https://github.com/elastic/kibana/issues/208085**

## Summary

Fixes a bug where incorrect diff was shown for ABC SOLVABLE cases in
prebuilt rule upgrade flyout.

### Before


https://github.com/user-attachments/assets/cc56e115-24e9-4e6c-b5fc-26704c506137

### After


https://github.com/user-attachments/assets/c27978d7-76ce-4dd4-8b78-4680625cd922

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-25 11:29:05 +01:00
Alex Szabo
7f5f5a940b
Revert "SKA: Update and breakdown x-pack/.gitignore (#212335)"
This reverts commit 50039f6c2e.
2025-02-25 11:01:27 +01:00
Gerard Soldevila
50039f6c2e
SKA: Update and breakdown x-pack/.gitignore (#212335)
## Summary
* Removes unneeded entries from `x-pack/.gitignore`.
* Moves `x-pack/test/` entries to a new, more specific file.
2025-02-25 10:58:10 +01:00
Irene Blanco
af3409518f
[Discover][APM] Custom overview tab for data_stream.type: "traces" in the new trace data source profile detail flyout (#210612)
## Summary

Closes https://github.com/elastic/kibana/issues/208693 and
https://github.com/elastic/kibana/issues/211785

This PR introduces a new Overview tab that will appear when the new
traces data source profile is enabled, and a `data_stream.type:
"traces"` document is being checked.

![Screenshot 2025-02-11 at 16 34
35](https://github.com/user-attachments/assets/0ab4e8bc-cb08-4582-8dc8-8a1065eb673a)


### Fields highlighted for clarity
|Transaction|Span|
|-|-|
|![Screenshot 2025-02-11 at 16 25
14](https://github.com/user-attachments/assets/c67b01d1-e494-4101-9834-5736b7f21835)|![Screenshot
2025-02-11 at 16 24
34](https://github.com/user-attachments/assets/c6e6e9d5-bc24-4993-a09c-c14ab55411dc)|

### Actions available for each field
![Screen Recording 2025-02-11 at 15 27
08](https://github.com/user-attachments/assets/e02b0850-d05b-434c-8f0f-9d5bda7c7beb)


### Detailed flat name for the dependency field
Since the source of the Dependency field cannot be easily assumed, we've
decided to add some metadata for it.

![Screenshot 2025-02-11 at 15 26
54](https://github.com/user-attachments/assets/6ed076bc-784a-4edb-8361-e1c2c3375e83)

### Filtering by transaction name on a span
It's important to note that `transaction.name` may not be present in a
span document. As a result, filtering by this field would likely return
only transaction documents, as they have `transaction.name` defined. cc:
@patpscal

![Screen Recording 2025-02-11 at 16 29
16](https://github.com/user-attachments/assets/526f7295-d88e-4688-aa9d-be1af542278b)

## How to test
* Add the following to your `kibana.dev.yml`:
```yaml
discover.experimental.enabledProfiles:
  - traces-data-source-profile
```
* Run synthtrace with `traces_logs_entitities.ts`
```
node scripts/synthtrace traces_logs_entities.ts  --from=now-24h --to=now
```
* Go to Discover and make sure the APM data view is selected
* Open the flyout for any document with `data_stream.type: "traces"`

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>
Co-authored-by: Carlos Crespo <crespocarlos@users.noreply.github.com>
2025-02-25 09:08:19 +01:00
Elena Shostak
7bca2d437f
xpack.security.loginAssistanceMessage img centering and resize (#212035)
## Summary

Fixed image resize for image used in
`xpack.security.loginAssistanceMessage`.

```
xpack.security.loginAssistanceMessage: >
   ![BrAINs!](646ba194a2/illustration-hero-esre.png "brains")
```

Before
<img width="876" alt="Screenshot 2025-02-21 at 17 29 23"
src="https://github.com/user-attachments/assets/e141d689-236b-46cf-a7bc-ed0a04c40513"
/>


After


<img width="814" alt="Screenshot 2025-02-21 at 17 29 10"
src="https://github.com/user-attachments/assets/3e5e8122-02a4-43b0-b256-de7561078fbc"
/>

__Fixes: https://github.com/elastic/kibana/issues/212034__

## Release Note
Fixed image resize for image used in
`xpack.security.loginAssistanceMessage`.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-25 05:32:36 +00:00
Davis Plumlee
3f3c8c8a48
[Security Solution] Adds normalization for filter meta field diff (#210191)
**Fixes: https://github.com/elastic/kibana/issues/206527**
**Partially addresses: https://github.com/elastic/kibana/issues/209518**

## Summary

Adds a normalization to the `filters` field in the rule diffing
calculation that omits all filter fields other than the `query` field
and the `negate` and `disabled` fields within the `meta` object. This
makes our diffing logic much more robust and resilient as we only
compare data in the rule fields that have an impact on the query itself
and not the fields that relate to UI implementation (`alias`, `key`,
etc).

### To test

- Open a prebuilt rule with `filters` in the non-customized rule
parameters (e.g. `PowerShell Script with Discovery Capabilities`)
- Edit the rule and save without editing
- The rule should remain unmodified even though more fields have been
added to the rule's `filters` field

Unless the user adds or deletes a filter on the rule, the rule should
only be marked as customized under 3 circumstances:

- The user negates the filter (adds NOT to the beginning of the filter)
- The user disables the filter
- The user changes the filter query

All other scenarios (such as adding a custom name for the filter) should
not change the rule's customized status

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2025-02-25 00:19:55 +00:00
Rodney Norris
02b4617f29
[Search] test(search-classic-nav): improve errors & unskip (#212303)
## Summary

Updating some of the error messages and testing the classic nav FTR
suite unskipped. This was skipped back in Dec, but seems to be green
now. 🤞 issue has already been resolved.

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

### 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
2025-02-24 16:46:56 -06:00
Kibana Machine
8fc1aa11e6 skip failing test suite (#211959) 2025-02-25 09:15:45 +11:00
Davis Plumlee
427d2d9929
[Security Solution] Adds prebuilt rule import/export cypress tests (#212172)
**Partially addresses:** https://github.com/elastic/kibana/issues/202079

## Summary

Adds cypress tests in accordance to
https://github.com/elastic/kibana/pull/204889

Follow-up to: https://github.com/elastic/kibana/pull/206893

Adds tests for rule import and export related to the prebuilt rule
customization epic.
### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] 🟢 ESS x50:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7923
- [x] 🟢 Serverless x50:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7924
2025-02-24 22:17:44 +01:00
Arturo Lidueña
837c76105e
tests forwarding systemMessage to the LLM (#212027)
Closes #211910

## Summary  
Currently, we validate that `inferenceClient.chatComplete` is called
twice (once for the title and once for the conversation) and that the
expected system message is included in each call. However, we do not
explicitly verify that the system message is actually passed to the LLM.

To improve reliability, we should introduce a test that directly
inspects the request sent to the LLM via `LLMProxy`.

### Solution - Add a test that explicitly inspects the request sent to
the LLM via `LLMProxy`. :
Forward the system message to the LLM'
Forward User Instructions via System Message to the LLM
sends the system message as the first message in the request to the LLM
2025-02-24 19:59:56 +00:00
Chris Cowan
57f83bc201
[DataForge] Align events to the nearist interval (#211951)
## Summary
 
This PR changes the behavior of `indexing.alignEventsToInterval: true`
(`--align-events-to-interval`) to align the events to the nearest
interval instead of being based on when the command was called. This
change is to help increase the predictability of the documents. This
will also decrease the effects of the index latency on the events.

### Before

If the script was started at `2025-02-20T00:50:34.203Z` with `--interval
10000` then the events will be offset every `10` seconds from the start
time.

### After

If the script was started at `2025-02-20T00:50:34.203Z` with `--interval
10000` then the events will be offset from `2025-02-20T00:50:00.000Z`
every `10` seconds from the start time.

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-24 19:34:49 +00:00
Jatin Kathuria
681cef4590
Siem Migrations - Fix rules upload API Error Test. (#212290)
## Summary

This PR fixes a incorrect UI test :

- Rules Upload File component should only display API Error in case it
occurs, while previously the tests was check if the button is disabled
or not. Disability of button is irrelevant.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.


- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2025-02-24 18:59:41 +00:00
Davis Plumlee
ca6cc7520b
[Security Solution] Adds prebuilt rule customization cypress tests (#212170)
**Partially addresses:** https://github.com/elastic/kibana/issues/202068

## Summary

Adds tests in accordance to
https://github.com/elastic/kibana/pull/204888

Follow-up to https://github.com/elastic/kibana/pull/207016

Adds cypress tests for the prebuilt rule customization features

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] 🟢 ESS x50:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7925
- [x] 🟢 Serverless x50:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7926
2025-02-24 19:35:21 +01:00
Nick Partridge
4a8928d5d4
[Lens] Fix filter labels (#211998)
Fixes issue causing filter labels to render as `undefined`. Filter labels now display correctly.
2025-02-24 10:02:48 -07:00
Pablo Machado
46c8c17728
[Security Solution] Fix integration test (#211278)
## Summary

Reenable a couple of entity store integration tests.

- [x] REMOVE THE `.only` BEFORE MERGING IT
- [wip] Flaky test runner
2025-02-24 17:27:00 +01:00
Charlotte Alexandra Wilson
ba9210c259
[Security Solution] Fix Incorrect Enable Button Behavior in Entity Store Modal (#212078)
## Summary

Ensure Enable Button Considers Disabled State of Risk Score & Entity
Store. Previously only used the checked state of the toggle.

### Reproduce the Issue
Steps, as [per bug
ticket:](https://github.com/elastic/kibana/issues/209242#issue-2826951496)

1. Kibana version 8.16.0 or above should exist
2. Navigate to the Dashboards tab under Security
3. Select Entity Analytics dashboard
4. Click on the enable button and enable risk score
5. Disable the options for Entity store
6. Then again select the enable button for Entity store
7. Disable the enable button
8. Observe the Enable button is still enabled

### After Issue Solved

Same steps as above, but should show the warning and disable the button.

#### Videos

Videos show when either riskScore or entityStore is enabled, and the
other is unchecked, the warning should show and the button should be
disabled.


https://github.com/user-attachments/assets/236f9e69-f810-4116-9948-38fd27d4d945



https://github.com/user-attachments/assets/2971e845-5d46-4eac-997a-79b3b17922c0

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-02-24 14:35:30 +00:00
Davis Plumlee
a51e96eae2
[Security Solution] Adds prebuilt rule customization integration tests (#207016)
## Summary

Adds tests in accordance to
https://github.com/elastic/kibana/pull/204888

Adds integration tests for the prebuilt rule customization features

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] 🟢 ESS x100:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7919
- [x] 🟡 Serverless x100:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7920
- [x] 🟡 Serverless x100
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7927

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2025-02-24 15:35:17 +01:00
Agustina Nahir Ruidiaz
fd18951f8f
[SecuritySolution] Numbers of Network KPI metric are cropped (#211460)
## Summary

Fix issue https://github.com/elastic/kibana/issues/210806


### Network Page
| Before | After |
|--------|-------|
| ![Network
Before](https://github.com/user-attachments/assets/0b3277f7-dbe2-41a4-ac76-05a806bb42e8)
| ![Network
After](https://github.com/user-attachments/assets/12b16e81-d13b-495f-9d46-a4154aa8e0cf)
|

### Host Page
| Before | After |
|--------|-------|
| ![Host
Before](https://github.com/user-attachments/assets/1338b0e5-f4b1-4d1a-ad54-da392f0eff07)
| ![Host
After](https://github.com/user-attachments/assets/48af01d9-a4aa-450d-ac81-e2b4a724363f)
|

### Users Page
| Before | After |
|--------|-------|
| ![Users
Before](https://github.com/user-attachments/assets/d7acdf4d-9a4f-4b67-923c-a184e13b367f)
| ![Users
After](https://github.com/user-attachments/assets/43bf36bd-1e3b-47d7-b121-0d4142b18cbe)
|


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Karen Grigoryan <karen.grigoryan@elastic.co>
2025-02-24 11:18:12 -03:00