Commit graph

4438 commits

Author SHA1 Message Date
Mark Hopkin
fd30f2555f
[Entity Analytics] Asset criticality privileges API (#172441) 2023-12-06 19:50:04 +00:00
Luke G
3390d8c54a
[Security Solution] fix broken encoding for the expandable flyout values (#172603)
## Summary

This fixes an issue with url encoding in the flyout. Turns out that
`rison` does not produce url safe strings by default.
2023-12-06 11:31:00 -06:00
Tim Sullivan
7795901fe7
[Reporting/CSV] Make searches used for export inspectable (#171248)
## Summary

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

## Release note
Added a troubleshooting enhancement for Kibana CSV export to allow users
to inspect the queries used for collecting all of the data.

## Other changes:
* Expose the reporting `csv.scroll` settings to the browser.
* Lazy-load the report job info panel component.
* Fix a few mixups of "setup" and "start" contracts.

## Screenshots
<details>
<summary>Option in Stack Management for CSV report jobs</summary>

![image](a382bfee-ce1f-4229-bf89-bf8836328ad3)
</details>

<details>
<summary>Screencast</summary>


a2fba0f4-0ede-4d97-aad3-4b13351e24a3

</details>

## Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Sébastien Loix <sabee77@gmail.com>
Co-authored-by: Sébastien Loix <sebastien.loix@elastic.co>
2023-12-06 10:09:19 -07:00
Mark Hopkin
2fee5954c5
[Entity Analytics] Update Entity Risk Scoring doc link to point to the new page (#172592)
Follow on from https://github.com/elastic/kibana/pull/172560

As requested by @natasha-moore-elastic
https://github.com/elastic/security-docs/pull/4296#issuecomment-1840370134

The entity risk scoring documentation is moving to a new page and we
need to update this link to fix the build in
https://github.com/elastic/security-docs/pull/4296.
2023-12-06 08:33:39 -07:00
Rudolf Meijering
bccc042a16
Remove dead code left over from legacy to NP migration (#172353)
## Summary

🗑️ 


### 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)
2023-12-06 08:32:56 -07:00
Kyle Pollich
6fe6cdd9d5
[Fleet] Support Elasticsearch output performance presets (#172359)
## Summary

Closes https://github.com/elastic/kibana/issues/166870
Closes https://github.com/elastic/kibana/issues/172525

- Adds a new `preset` field to output saved objects
- Updates REST spec payloads to allow `preset` field in `POST/PUT`
requests to the `/api/fleet/outputs` endpoint
- Adds logic to set default `preset` to `balanced` or `custom` based on
whether a reserved key exists in `output.config_yaml`
- Adds UI to the output settings flyout for providing a preset
- Adds backfill logic to Fleet `setup` that updates all existing outputs
+ redeploys their associated policies to ensure the proper `preset` is
provided on all policies

## To do

- [x] Fix failing tests
- [x] Add a lot of tests + testing instructions
- [x] Allow preconfigured outputs to specify a preset
- [x] Update OpenAPI spec for outputs API
- [x] Disable `EuiSelect` when output is managed
- [x] Add in-product link to performance preset docs once they exist
(might have to be a follow-up? (Follow up:
https://github.com/elastic/kibana/issues/172523)
- [x] Parse YML box contents instead of using basic string lookup for
forcing `custom` preset (Follow up:
https://github.com/elastic/kibana/issues/172525)

## How to test

1. Create a new Elasticsearch output
2. Observe the `Performance preset` dropdown defaults to `balanced`
3. Add a performance setting to the custom YAML box e.g. `bulk_max_size:
1000`
4. Note the callout with the list of reserved keys
5. Note that the dropdown switches to `Custom` and is now disabled
6. Remove the offending key
7. Note the dropdown returns to its normal state
8. Save the output
9. Edit the output and observe the same behaviors

For the backfill
1. Create a local environment with multiple elasticsearch outputs on
`main`
2. Stop Kibana
3. Checkout this PR branch
4. Restart Kibana
5. Observe the ES outputs have been updated to include the appropriate
`preset` value

## Screenshots + Screen recordings


0c25a15e-938d-4747-8846-d51a9ad01968

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-12-06 10:00:47 -05:00
Pierre Gayvallet
9f3f22ae68
Do not expose host in internal API error messages (#172645)
## Summary

Only expose the `path` instead of the full `url` in the internal route
handler error messages
2023-12-06 12:05:40 +01:00
Peter Pisljar
11451b48b8
[Lens] New lens config builder api (#169750)
## Summary

resolves https://github.com/elastic/kibana/issues/163293

Exposes config builder API to build lens configurations via much simpler
API which hides the complexity of lens and allows developers to easily
configure the chart.

sample usage:
```

const builder = new LensConfigBuilder(formulaPublicAPI, dataViewsPublicAPI);
const embeddableInput = await builder.build(
    {
      chartType: 'heatmap',
      title: 'test',
      dataset: {
        esql: 'from kibana_sample_data_ecommerce | count=count() by order_date, product.category.keyword',
      },
      layers: [
        {
          label: 'test',
          breakdown: 'product.category.keyword',
          xAxis: 'order_date',
          value: 'count',
        },
      ],
    }, {
      embeddable: true,
    }
  );
```

pr with sample app: https://github.com/elastic/kibana/pull/171282

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-12-06 03:10:58 -07:00
Coen Warmer
7d990cf749
AI Assistant Management Plugin + Knowledge Base Management (#171933)
## Summary

This PR adds a bunch of plugins to help manage AI Assistant Management
settings.

It offers a 'selection' plugin inside Stack Management where a user can
select which AI Assistant she wants to manage.
The Security team can hook into this one, so settings for both AI
Assistants can be accessed from inside one place inside Stack
Management.

This PR also adds the plugin to manage settings for the AI Assistant for
Observability, including Knowledge Base management. This plugin is
available both in Stack Management (stateful) and Project Settings
(serverless).

## What it looks like

51392ec5-05c9-4947-9bf2-810d8d0b7525


## Detailed
1. **Adds a Stack Management plugin**
(`/src/plugins/ai_assistant_management/selection`). Its primary function
is to render a selection screen to help users navigate to the settings
plugin for the AI Assistant for a specific solution. This plugin is
displayed in Stack Management, which is only available in stateful
versions of Kibana.

2. **Adds a AI Assistant for Observability Settings plugin**
(`/src/plugins/ai_assistant_management/observability`). This plugin
allows management of specific Observability AI Assistant settings. It is
available in stateful versions of Kibana (via the aforementioned Stack
Management plugin) or in serverless versions via Project Management.

3. **Knowledge Base management for Observability AI Assistant**: The AI
Assistant for Observability Settings plugin has a Knowledge Base tab,
which allows users to add / read / update / delete and bulk import
entries into the Knowledge Base of the Observability AI Assistant.

4. **Moving of KB endpoints in Observability AI Assistant plugin**: KB
endpoints and functions were located in the same folder. As this PR adds
new endpoints for the KB for CRUD operations, it also moves the existing
ones from the function folder into a dedicated one so there's a clearer
distinction between kb and functions.

5. **Adding of GenAI Connector inside Chat Flyout**: If the user has
admin rights, it is possible to set up a GenAI connector from within the
Observability AI Assistant Chat Flyout. This provides a faster and more
seamless onboarding experience. If the user does not, she will be
redirected to the Settings page.

## Bug fixes
* Fixes chat item styling issues (padding, background color).

## How to test
* Check if the Stack Management plugin works on stateful
* Check if the AI Assistant Settings plugin works on stateful +
serverless
* Check if CRUD operations on KB work
* Check if searching on KB entries work
* Check if its possible to navigate to KB tab directly
(`app/management/kibana/aiAssistantManagementObservability?tab=knowledge_base`)


## Todo
- [x] Add sorting to getEntries
- [x] Add params for tab routing
- [x] Add unit tests
- [ ] Add API tests
- [ ] Add fallback for already indexed entries when searching

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-12-05 16:07:52 -06:00
Kevin Logan
76b8fae881
[Security Solution] Update detection rule callout for Endpoint Policy protections (#172471)
## Summary
This PR updates the callouts in the Endpoint Policy where we mention the
detection rules associated with Endpoint. This makes it more current and
provides a docs link with more details.

- Banner is added to the top of the Policy page
- Individual banners are removed from the individual cards


![image](39c772fa-ae82-4539-b457-3ef42276cd77)

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-12-05 13:45:49 -07:00
Marshall Main
4a89208489
[Security Solution] Populate alert status auditing fields (#171589)
This PR populates the existing `kibana.alert.workflow_user` field in the
alerts-as-data mappings with the `profile_uid` of the last user to
modify the status of the alert. It also adds a new field,
`kibana.alert.workflow_status_updated_at`, to track the last time the
workflow status was updated and populates it with a timestamp.

Similar to the alert assignment PR, `workflow_user` renders in the table
with a user avatar instead of the raw `profile_uid` value stored in the
alert. The filter in/out buttons on the row cell automatically add a
filter that uses the raw value so that filtering works correctly.

Due to limitations of Kibana's user profile implementation,
`workflow_user` is only populated if a user changes the alert status
using the alert status route (`POST
/api/detection_engine/signals/status`) within an interactive session,
i.e. logs in rather than passes credentials with each API request
([related issue](https://github.com/elastic/kibana/issues/167459)).

## Alerts table

![image](67239ac7-a04e-47ce-8991-d73c102c10f7)


## Alert details

![image](b1469592-27b0-452f-b0b3-28986d448d54)

### Checklist
- [ ] Functional changes are hidden behind a feature flag. If not
hidden, the PR explains why these changes are being implemented in a
long-living feature branch.
- [x] Functional changes are covered with a test plan and automated
tests.
- [x] Stability of new and changed tests is verified using the [Flaky
Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner).
- Flaky test run:
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4130
- [ ] Comprehensive manual testing is done by two engineers: the PR
author and one of the PR reviewers. Changes are tested in both ESS and
Serverless.
- [x] Mapping changes are accompanied by a technical design document. It
can be a GitHub issue or an RFC explaining the changes. The design
document is shared with and approved by the appropriate teams and
individual stakeholders.
  - https://github.com/elastic/security-team/issues/4820 
- [x] Functional changes are communicated to the Docs team. A ticket or
PR is opened in https://github.com/elastic/security-docs. The following
information is included: any feature flags used, affected environments
(Serverless, ESS, or both).
  - https://github.com/elastic/security-docs/issues/4325
2023-12-05 11:12:28 -08:00
Sander Philipse
789230f85b
[Search] Add API key panel to Search Hub (#172301)
## Summary

This adds an API key panel to the Search Hub.



8d0458bd-26e1-40c4-9643-1a91f3924911

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-12-05 11:53:10 -07:00
Tiago Costa
561f89ef45
skip flaky suite (#172597) 2023-12-05 17:33:46 +00:00
Tiago Costa
ae6a2be378
skip flaky suite (#172596) 2023-12-05 17:32:27 +00:00
Tiago Costa
9f41a75b95
skip flaky suite (#172595) 2023-12-05 17:30:37 +00:00
Rachel Shen
39112999b3
Onboarding card redesign (#171586)
## Summary
https://github.com/elastic/kibana-team/issues/671 
[Design
direction](https://www.figma.com/file/RK76YsiCH3TXTh34HR5iZY/GO-v2?type=design&node-id=122-698&mode=design&t=QUZ9fPbMWehmixhN-0)

Closes https://github.com/elastic/kibana/issues/165126
Closes https://github.com/elastic/cloud/issues/120614

- remove the all filter for the solutions
- add the endpoint work into a card
- change the filter behavior to not show highlighting of a specific
solution but remove the other cards
- add telemetry ui counter to capture when a user clicks on a solution
(defaults to search)


## To Test Locally
In the kibana.dev.yml set the following to mimic a cloud cluster:

`elasticsearch.hosts: ["http://localhost:9200"]`
`xpack.cloud.id: 'testID'`

## Next Steps
Have `Home` targeted per solution - basically removing the landing page
where it currently stands
Launch Darkly integration

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
2023-12-05 08:39:00 -07:00
Saarika Bhasi
7ecd525a02
[Search] Move enterprise_search index documents to common package (#172211)
This PR: 
* extracts `enterprise_search` index documents component to common
package.
* Uses EUI pagination, converting Elasticsearch`from` & `size` to EUI
pagination standard for documents list


### Screen Recording


f585d9cc-f92c-44f4-aead-23c75c107a0f


### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-12-05 10:33:15 -05:00
Mark Hopkin
434b1afd42
[Entity Analytics] Update Entity Risk Scoring doc link to point to new page (#172560)
Update: We are now setting the link to a temporary link to get
https://github.com/elastic/security-docs/pull/4296 merged and will then
update to the new page

As requested by @natasha-moore-elastic
[here](https://github.com/elastic/security-docs/pull/4296#issuecomment-1840370134)

The entity risk scorign documentation is moving to a new page and we
need to update this link to fix the build in
https://github.com/elastic/security-docs/pull/4296.
2023-12-05 15:31:52 +00:00
Efe Gürkan YALAMAN
45885a79a0
[Enterprise Search] Dedicated Connectors Page (#172361)
## Summary

- Adds a dedicated Connectors route and Table with search and pagination
- Updates basic functionality of Select Connectors Page (will follow-up
with another PR)

<img width="1289" alt="Screenshot 2023-12-01 at 17 10 22"
src="6ecea3e5-f696-4d05-813f-624d509cd37c">


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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-12-05 08:31:18 -07:00
Yngrid Coello
df0a21cac1
[Dataset quality] Added malformed docs column to table (#172462)
Closes https://github.com/elastic/kibana/issues/170220.

### Changes
- New endpoint added to query malformed docs in elasticsearch `GET
/internal/dataset_quality/data_streams/malformed_docs`
- Decoded response from apis in `data_streams_stats_client.ts` as
suggested by @tonyghiani in
https://github.com/elastic/kibana/pull/171777.
- New synthtrace scenario, malformed logs, where we ingest documents
that will have `_ignored` properties.
- Malformed Docs column was added to `columns.tsx`.

#### Demo


07a76f13-a837-4621-9366-63053a51b489

### How to test?
1. Go to
https://yngrdyn-deploy-kiban-pr172462.kb.us-west2.gcp.elastic-cloud.com/app/observability-log-explorer/dataset-quality
2. `Malformed docs` column should be present and should be sortable

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-12-05 14:33:37 +01:00
Marta Bondyra
e5e64f8c9f
[Unified Field List] fix long single-word values (#172544)
## Summary

Fixes non-wrapping of a single word values:

![image](3a9acfed-15da-4e46-84fc-72f42acc8716)

It worked correctly for long values that are multi words, that's why I
didn't notice it.
<img width="437" alt="Screenshot 2023-12-05 at 10 03 51"
src="2713a65e-c3fb-4bbb-a6f5-49f6cc00ac11">

It was caused by last minute change in my
[PR](https://github.com/elastic/kibana/pull/171076) here: where I
swapped `word-break: break-word;` (deprecated) to `overflow-wrap:
break-word;` which is not equivalent. Changing the value to `anywhere`
solves it.
2023-12-05 14:07:31 +01:00
Angela Chuang
e84d0a0e0c
[SecuritySolution] Update get started page UI (#171078)
## Summary

[Test
env](https://p.elstc.co/paste/Y83spa-G#0BRN87aMZxLJfbVok3W0U-7D/sss9OGfH9IIqw4oHL6)

1. When landing on the page the first time, all the tasks are collapsed.
If visited before, it keeps the last expanded task.
2. When clicking on the task, the url has the task id appended as
`#{taskId}`
3. When visiting the page, if url has `#{taskId}`, the relevant task
should be expanded. If no `#{taskId}` in the url, it expands the last
expanded task according to **local storage**.
4. Tasks completion are checked automatically, users are not able to
undo any tasks unless the **local storage** is cleanned.
5. Task completion criteria:
https://github.com/elastic/security-team/issues/8032 `Onboarding tasks
with success criteria`:

- [x] "create first project" -> ~unexpandable~, already complete when
user arrives
- [x] "watch overview video" -> user clicks to expand (success == users
opens section/clicks "Start")
- [x] "add integrations" -> users clicks to expand and goes to
integration page (success == query fleet to confirm an agent exists with
an integration) `Update we use **indicesExist** from sourcerer to
replace fleet api as some performance issue found when running locally,
not sure how it will affect the production.`
- [x] - after user clicks "Start" and expands, if success criteria is
already met (e.g. agent is installed with an integration), notify user
agent is installed and mark step as complete.
- [x] "view and analyze dashboards" -> users clicks to expand (success
== click action)
- [x] "enable prebuilt rules" -> clicks to expand (success == at least
one rule **enabled**, show enabled rules like integrations above)
- [x] "view alerts" -> user clicks to expand (success == click action)

6. Design:
https://github.com/elastic/kibana/pull/171078#issuecomment-1828562066

https://github.com/elastic/kibana/issues/170643


<img width="2556" alt="Screenshot 2023-12-04 at 16 47 48"
src="c98eb2f5-6b31-43f9-9db5-0829e78bb3c2">



<img width="2548" alt="Screenshot 2023-12-04 at 16 29 50"
src="41cb329c-417f-4b95-b19b-67663380a9a3">


<img width="2546" alt="Screenshot 2023-12-04 at 16 30 47"
src="daa3cf3b-9d2e-4c69-83f1-fcc4817f6b8f">






- Integration added:




1f9aefe4-c20b-4d46-b8b0-1aabf8bd7091




- Integration not added:





8b0d6c6b-0bae-4857-aeb1-715f9f4080b8





29432bfe-f270-4e5e-a1c9-86ad806ea5bb















### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Sergi Massaneda <sergi.massaneda@gmail.com>
2023-12-05 10:50:50 +01:00
Gergő Ábrahám
44d7c0ae95
[EDR Workflows] Add matches capabilities to Endpoint Exception creation (#166002)
## Summary

This PR adds `matches` (`wildcard include`) and `does not match`
(`wildcard exclude`) to fields which support them when creating an
Endpoint exception.

For backwards compatibility with Endpoints < 8.2.0, Manifest Manager
adds the following entry to Endpoint Exceptions containing _only_
wildcards:
```json
{
  "field": "event.module",
  "operator": "included",
  "type": "exact_cased",
  "value": "endpoint"
}
```

> [!Note]
> Warnings for wrongly formatted wildcards don't seem to work correctly
at the moment. #170495 will bring some changes in the related functions,
so this PR is waiting on that to be merged.


<img width="1465" alt="image"
src="db04fe0b-4cb3-4cba-a6d7-622a2239f059">

## Sample manifests
### Linux
⚠️ On Linux, the type is always `wildcard_cased`, see the following
comment for details:
https://github.com/elastic/kibana/pull/120349#issuecomment-989963682
```json
{
  "entries": [
    {
      "type": "simple",
      "entries": [
        {
          "field": "file.path",
          "operator": "included",
          "type": "wildcard_cased",
          "value": "*/test/*"
        },
        {
          "field": "event.module",
          "operator": "included",
          "type": "exact_cased",
          "value": "endpoint"
        }
      ]
    }
  ]
}
```

### Windows
```json
{
  "entries": [
    {
      "type": "simple",
      "entries": [
        {
          "field": "file.path",
          "operator": "included",
          "type": "wildcard_caseless",
          "value": "*/test/*"
        },
        {
          "field": "event.module",
          "operator": "included",
          "type": "exact_cased",
          "value": "endpoint"
        }
      ]
    }
  ]
}
```

### 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
- [ ] 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)
2023-12-05 01:59:45 -07:00
Rachel Shen
7508ee1ed5
[Reporting] Add max concurrent shards setting to schema (#170344)
## Summary

Closes https://github.com/elastic/kibana/issues/161561
This PR exposes the `max_concurrent_shards` setting in the schema for
customers for point in time CSV report generation.

### 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: Tim Sullivan <tsullivan@users.noreply.github.com>
2023-12-04 17:49:50 -07:00
Jiawei Wu
e4805fc9e0
[RAM][Maintenance Window] Maintenance window scoped query frontend changes (#171949)
## Summary
Partially resolves: https://github.com/elastic/kibana/issues/164255,
this is 2/3 of the scoped query changes.

Maintenance window scoped query frontend changes. Adds the ability to
add and edit scoped query for maintenance windows. Due to limitations
with the alerts search bar and each solution fetches AAD fields, we only
allow users to associate scoped query with 1 category (manangement,
o11y, or security solution). The intended usage in this case is for the
user to create multiple maintenance windows if they wish to apply scoped
queries to multiple solutions.

### To test:
go to
`x-pack/plugins/alerting/public/pages/maintenance_windows/constants.ts`
and set `IS_SCOPED_QUERY_ENABLED` to `true`

### Scoped query off, multiple category allowed:

![image](dbf03e8e-f9bd-449c-8d23-0b474fe5a9c4)

### Scoped query on, multiple category disallowed:

![image](368f954a-7671-410b-839b-77f0420f26fa)

### 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: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-12-04 15:18:33 -08:00
Tim Sullivan
f044bcccdb
[shared-ux] no-data analytics page package code cleanup (#172416)
## Summary

1. Update "type" in kibana.jsonc files where applicable for improvement
to developer experience.
2. Create `@kbn/content-management-table-list-view-table-common` package
and update imports

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-12-04 13:07:59 -07:00
Dzmitry Lemechko
d75103eacb
[FTR] add service to test user roles on serverless (#170417)
## Summary

### This PR enables user roles testing in FTR

We use SAML authentication to get session cookie for user with the
specific role. The cookie is cached on FTR service side so we only make
SAML auth one time per user within FTR config run. For Kibana CI service
relies on changes coming in #170852

In order to run FTR tests locally against existing MKI project:
- add `.ftr/role_users.json` in Kibana root dir
```
{
  "viewer": {
    "email": "...",
    "password": "..."
  },
  "developer": {
    "email": "...",
    "password": "..."
  }
}

```
- set Cloud hostname (!not project hostname!) with TEST_CLOUD_HOST_NAME,
e.g.
`export TEST_CLOUD_HOST_NAME=console.qa.cld.elstc.co`


### How to use:

- functional tests:
```
const svlCommonPage = getPageObject('svlCommonPage');

before(async () => {
  // login with Viewer role  
  await svlCommonPage.loginWithRole('viewer');
  // you are logged in in browser and on project home page, start the test 
});

it('has project header', async () => {
  await svlCommonPage.assertProjectHeaderExists();
});
```

- API integration tests:
```
const svlUserManager = getService('svlUserManager');
const supertestWithoutAuth = getService('supertestWithoutAuth');
let credentials: { Cookie: string };

before(async () => {
  // get auth header for Viewer role  
 credentials = await svlUserManager.getApiCredentialsForRole('viewer');
});

it('returns full status payload for authenticated request', async () => {
    const { body } = await supertestWithoutAuth
    .get('/api/status')
    .set(credentials)
    .set('kbn-xsrf', 'kibana');

    expect(body.name).to.be.a('string');
    expect(body.uuid).to.be.a('string');
    expect(body.version.number).to.be.a('string');
});
```

Flaky-test-runner: 

#1
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4081
#2
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4114

---------

Co-authored-by: Robert Oskamp <traeluki@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
2023-12-04 12:09:05 -07:00
Aleh Zasypkin
74210343a2
Allow using JWT credentials to grant API keys. (#172444)
## Summary

In this PR we:
* Allow using JWT credentials to grant API keys
* Extend default value of `elasticsearch.requestHeadersWhitelist` to
include both `authorization` and `es-client-authentication` to support
JWT with required client authentication _by default_. See
https://www.elastic.co/guide/en/elasticsearch/reference/8.11/jwt-auth-realm.html#jwt-realm-configuration
* Add API integration tests for both JWTs with client authentication and
without it


__NOTE:__ We're not gating this functionality with the config flag
(`xpack.security.authc.http.jwt.taggedRoutesOnly`) as we did for the
Serverless offering. It'd be a breaking change as we already implicitly
support JWT authentication without client authentication, and to be
honest, it's not really necessary anyway.

## Testing

Refer to the `Testing` section in this PR description:
https://github.com/elastic/kibana/pull/159117.

Or run already pre-configured Kibana functional test server: 
1. `node scripts/functional_tests_server.js --config
x-pack/test/security_api_integration/api_keys.config.ts`
2. Create a role mapping for JWT user:
```bash
curl -X POST --location "http://localhost:9220/_security/role_mapping/jwt" \
    -H "Authorization: Basic ZWxhc3RpYzpjaGFuZ2VtZQ==" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d "{
          \"roles\": [ \"superuser\" ],
          \"enabled\": true,
          \"rules\": { \"all\": [{\"field\" : { \"realm.name\" : \"jwt_with_secret\" }}] }
        }"
```
3. Send any Kibana API request with the following credentials:
```bash
curl -X POST --location "xxxx"
  -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2tpYmFuYS5lbGFzdGljLmNvL2p3dC8iLCJzdWIiOiJlbGFzdGljLWFnZW50IiwiYXVkIjoiZWxhc3RpY3NlYXJjaCIsIm5hbWUiOiJFbGFzdGljIEFnZW50IiwiaWF0Ijo5NDY2ODQ4MDAsImV4cCI6NDA3MDkwODgwMH0.P7RHKZlLskS5DfVRqoVO4ivoIq9rXl2-GW6hhC9NvTSkwphYivcjpTVcyENZvxTTvJJNqcyx6rF3T-7otTTIHBOZIMhZauc5dob-sqcN_mT2htqm3BpSdlJlz60TBq6diOtlNhV212gQCEJMPZj0MNj7kZRj_GsECrTaU7FU0A3HAzkbdx15vQJMKZiFbbQCVI7-X2J0bZzQKIWfMHD-VgHFwOe6nomT-jbYIXtCBDd6fNj1zTKRl-_uzjVqNK-h8YW1h6tE4xvZmXyHQ1-9yNKZIWC7iEaPkBLaBKQulLU5MvW3AtVDUhzm6--5H1J85JH5QhRrnKYRon7ZW5q1AQ'
  -H 'ES-Client-Authentication: SharedSecret my_super_secret'

....for example....
curl -X GET --location "http://localhost:5620/internal/security/me" \
    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2tpYmFuYS5lbGFzdGljLmNvL2p3dC8iLCJzdWIiOiJlbGFzdGljLWFnZW50IiwiYXVkIjoiZWxhc3RpY3NlYXJjaCIsIm5hbWUiOiJFbGFzdGljIEFnZW50IiwiaWF0Ijo5NDY2ODQ4MDAsImV4cCI6NDA3MDkwODgwMH0.P7RHKZlLskS5DfVRqoVO4ivoIq9rXl2-GW6hhC9NvTSkwphYivcjpTVcyENZvxTTvJJNqcyx6rF3T-7otTTIHBOZIMhZauc5dob-sqcN_mT2htqm3BpSdlJlz60TBq6diOtlNhV212gQCEJMPZj0MNj7kZRj_GsECrTaU7FU0A3HAzkbdx15vQJMKZiFbbQCVI7-X2J0bZzQKIWfMHD-VgHFwOe6nomT-jbYIXtCBDd6fNj1zTKRl-_uzjVqNK-h8YW1h6tE4xvZmXyHQ1-9yNKZIWC7iEaPkBLaBKQulLU5MvW3AtVDUhzm6--5H1J85JH5QhRrnKYRon7ZW5q1AQ' \
    -H 'ES-Client-Authentication: SharedSecret my_super_secret' \
    -H "Accept: application/json"
----
{
  "username": "elastic-agent",
  "roles": [
    "superuser"
  ],
  "full_name": null,
  "email": null,
  "metadata": {
    "jwt_claim_sub": "elastic-agent",
    "jwt_token_type": "access_token",
    "jwt_claim_iss": "https://kibana.elastic.co/jwt/",
    "jwt_claim_name": "Elastic Agent",
    "jwt_claim_aud": [
      "elasticsearch"
    ]
  },
  "enabled": true,
  "authentication_realm": {
    "name": "jwt_with_secret",
    "type": "jwt"
  },
  "lookup_realm": {
    "name": "jwt_with_secret",
    "type": "jwt"
  },
  "authentication_type": "realm",
  "authentication_provider": {
    "type": "http",
    "name": "__http__"
  },
  "elastic_cloud_user": false
}
```

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

----

Release note: The default value of the
`elasticsearch.requestHeadersWhitelist` configuration option has been
expanded to include the `es-client-authentication` HTTP header, in
addition to `authorization`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-12-04 20:07:41 +01:00
Zacqary Adam Xeper
8d1cafff0d
[ES Query] Make rule created in Discover visible in Observability (#171364)
## Summary

Closes #170497 

<img width="483" alt="Screenshot 2023-11-16 at 1 25 18 PM"
src="4d974eab-9641-4618-b52a-2facf4c07667">

Adds scope dropdown to ES Query rules created from Discovery. If Logs or
Metrics are selected, rules created here will be visible in
Observability.

Also makes `Logs` the default consumer when creating a rule from either
Discovery and Observability.


### 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>
2023-12-04 10:36:23 -06:00
Marco Liberati
c07b501e54
Make code editor treeshake-able (#172183)
## Summary

Attempt to reduce bundle size via treeshake

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-12-04 17:29:39 +01:00
Gerard Soldevila
b232a113c5
Retry ES calls when receiving 504 Gateway Timeout (#172439)
## Summary

Address https://github.com/elastic/kibana/issues/172352
2023-12-04 15:05:52 +01:00
Luke G
20160a86f9
[Security Solution] Exclude cold and frozen tiers in analyzer queries (#172162)
## Summary

This PR is a starting point for fixing issues about cold and frozen
tiers hits in analyzer.

It introduces another filter to analyzer queries, preventing us from
hitting beforementioned documents.

Relevant setting:


![image](268750fd-9b98-453a-b171-0f3e3d38e923)
2023-12-04 10:46:43 +01:00
Julia Rechkunova
7346e82c7d
[Discover] Allow sorting only for visible columns (#172077)
- Closes https://github.com/elastic/kibana/issues/172023

## Summary

As
[eui](8eb7277ffd/src/components/datagrid/controls/column_sorting.tsx (L44-L57))
triggers `onSort` for `EuiDataGrid` when `sort` array includes fields
which are not present in `columns` array, it changes the app state. This
results in "unsaved changes" badge although user can't know why.

This PR makes sure that state is not modified when unknown sorting
fields are persisted inside a saved search and user opens such search.

To reproduce the mentioned issue:
- Add columns to the table and define their sorting
- Save the search
- Reopen the search and remove one of the columns which had custom
sorting
- Save the search
- Now open Discover again and reopen the search.

With this PR, "unsaved changes" badge would not appear. 

### 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
2023-12-04 10:18:11 +01:00
Cristina Amico
ad663136c9
[Fleet] Replace dataviews suggestions in KQL searchboxes with internal ones (#172190)
Fixes https://github.com/elastic/kibana/issues/169760
Related to https://github.com/elastic/kibana/issues/171425

## Summary

[Fleet] Replace dataviews suggestions in KQL searchboxes with internal
ones. Now using Fleet mappings to create the suggestions fields instead
of fetching them through dataView plugin.
This is done for two reasons:

- Solves [permission
problems](https://github.com/elastic/kibana/issues/169760) when the user
doesn't have privileges to read Fleet indices
- Allows us to search only those mappings that we want to expose,
instead of all of them

Only weird thing is that the [querystring
component](1f8c816901/src/plugins/unified_search/public/query_string_input/query_string_input.tsx (L161))
has a cap to show max 50 suggestions. Since for agents suggestions we
are showing some more fields, so the ones starting with `u` are not
visible anymore. I though I had a bug in the way I was creating the
`fieldsMap` but in reality there's no way to show more suggestions than
50 (without touching the original component, which I would gladly
avoid).


### Screenshots
There should be no visible difference with the current suggestions. 
<details>
  <summary>Agents</summary>

![Screenshot 2023-12-01 at 10 49
55](af73476c-3de2-40c1-93fc-c6a1c28a8a8a)

![Screenshot 2023-12-01 at 10 49
48](5db8b30f-ff9e-4542-a590-f77285dbeef6)
  
</details>

<details>
  <summary>Agent policies</summary>

![Screenshot 2023-12-01 at 10 50
09](69756149-6769-48a9-9a34-de482e4e37fc)

</details>

<details>
  <summary>Enrollment keys</summary>

![Screenshot 2023-12-01 at 10 50
18](e542550a-9721-4f5c-a05b-32829dd8fcee)


</details>

### Testing
1. With a normal user, navigate to the "agents", "agent policies" and
"enrollment keys" tabs and click on the searchboxes. The suggestions
should be visible as normal
2. Create a user with role Fleet "all", Integrations "all". Log in and
check the above searchboxes, the suggestions should be visible as
normal. Previously they weren't.

### Checklist
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-12-04 09:19:26 +01:00
Cauê Marcondes
7470d2136d
[Profiling] Use CO2 and Cost values provided by the ES Profiling APIs (#170612)
- Removes old flamegraph code replacing it with the ES Flamegraph API
- Creates new user settings
- Adds a feature flag to use the kibana CO2/Cost calculations instead of
the new version
- Reads CO2 and Cost from /Stacktraces and /Flamegraph APIs

Where do we show the CO2 and Cost values?
- Flamegraph toolip
- Flamegraph Frame information flyout
- Diff Flamegraph Summary
- Functions table
- Function information flyout
- Diff Functions Summary

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-12-04 04:59:30 +00:00
Mark Hopkin
f08f40a97e
[Entity Analytics] Use docLinks service for documentation links (#172172)
## Summary

Using the docLinks service means documentation links will always point
to the correct version of the docs for the current Kibana version, not
just the latest docs.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-12-01 22:54:54 -06:00
Sean Story
8fdfa633e5
Add native connector definition for oracle (#172102)
## Summary

Part of https://github.com/elastic/enterprise-search-team/issues/6308
This adds a default configuration for Oracle connectors, which will
allow them to be used as Native Connectors.


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


### 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)
2023-12-01 14:59:46 -06:00
Bryce Buchanan
33c74aeb03
[APM] Mobile crashes & errors (#165892)
## Summary

This PR adds back the `Errors` tab to mobile apm services under the
title `Errors & Crashes`. This new page is split into too sections:
errors, and crashes.

Error Tab:
<img width="1456" alt="Screenshot 2023-10-25 at 10 57 00"
src="20277c31-d88c-44ae-b896-1da4223cb392">

Crashes Tab:
<img width="1454" alt="Screenshot 2023-10-25 at 10 57 35"
src="2b0dea23-cbab-4e68-a14a-c3b14d4bd860">


### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [x] 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 renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


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

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Katerina <kate@kpatticha.com>
2023-12-01 11:28:49 -07:00
Ievgen Sorokopud
1ebdbc380d
[Security Solution][Alerts] Alert (+Investigation) User Assignment (#2504) (#170579)
## Summary

With this PR we introduce a new Alert User Assignment feature:
- It is possible to assign a user/s to alert/s
- There is a new "Assignees" column in the alerts table which displays
avatars of assigned users
- There is a bulk action to update assignees for multiple alerts
- It is possible to see and update assignees inside the alert details
flyout component
- There is an "Assignees" filter button on the Alerts page which allows
to filter alerts by assignees

We decided to develop this feature on a separate branch. This gives us
ability to make sure that it is thoroughly tested and we did not break
anything in production. Since there is a data scheme changes involved we
decided that it will be a better approach. cc @yctercero

## Testing notes

In order to test assignments you need to create a few users. Then for
users to appear in user profiles dropdown menu you need to activate them
by login into those account at least once.


8eeb13f3-2d16-4fba-acdf-755024a59fc2

Main ticket https://github.com/elastic/security-team/issues/2504

## Bugfixes
- [x] https://github.com/elastic/security-team/issues/8028
- [x] https://github.com/elastic/security-team/issues/8034
- [x] https://github.com/elastic/security-team/issues/8006
- [x] https://github.com/elastic/security-team/issues/8025

## Enhancements
- [x] https://github.com/elastic/security-team/issues/8033

### Checklist

- [x] Functional changes are hidden behind a feature flag. If not
hidden, the PR explains why these changes are being implemented in a
long-living feature branch.
- [x] Functional changes are covered with a test plan and automated
tests.
  - [x] https://github.com/elastic/kibana/issues/171306
  - [x] https://github.com/elastic/kibana/issues/171307
- [x] Stability of new and changed tests is verified using the [Flaky
Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner).
- [x]
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/4091
- [x] Comprehensive manual testing is done by two engineers: the PR
author and one of the PR reviewers. Changes are tested in both ESS and
Serverless.
- [x] Mapping changes are accompanied by a technical design document. It
can be a GitHub issue or an RFC explaining the changes. The design
document is shared with and approved by the appropriate teams and
individual stakeholders.
   * https://github.com/elastic/security-team/issues/7647
- [x] Functional changes are communicated to the Docs team. A ticket or
PR is opened in https://github.com/elastic/security-docs. The following
information is included: any feature flags used, affected environments
(Serverless, ESS, or both). **NOTE: as discussed we will wait until docs
are ready to merge this PR**.
   * https://github.com/elastic/security-docs/issues/4226
* https://github.com/elastic/staging-serverless-security-docs/pull/232

---------

Co-authored-by: Marshall Main <marshall.main@elastic.co>
Co-authored-by: Xavier Mouligneau <xavier.mouligneau@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Sergi Massaneda <sergi.massaneda@gmail.com>
2023-12-01 16:26:03 +01:00
Achyut Jhunjhunwala
d24d43c7c1
Fix credentials leak from synthtrace (#172294)
The PR fixes creds leaking in console logs when running Synth.
Synthtrace runs on CI as well where this is not secure to leak
credentials

## Before -

<img width="854" alt="image"
src="41aaeed7-6a2a-4cc6-aabd-d9f4261b861a">

## After

<img width="851" alt="image"
src="1da1392f-c6d3-4604-a802-c906ecd4de23">
2023-12-01 08:06:30 -07:00
renovate[bot]
7f0e025968
Update dependency elastic-apm-node to ^4.2.0 (main) (#172308)
[![Mend Renovate logo
banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [elastic-apm-node](https://togithub.com/elastic/apm-agent-nodejs) |
[`^4.1.0` ->
`^4.2.0`](https://renovatebot.com/diffs/npm/elastic-apm-node/4.1.0/4.2.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/elastic-apm-node/4.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/elastic-apm-node/4.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/elastic-apm-node/4.1.0/4.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/elastic-apm-node/4.1.0/4.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>elastic/apm-agent-nodejs (elastic-apm-node)</summary>

###
[`v4.2.0`](https://togithub.com/elastic/apm-agent-nodejs/releases/tag/v4.2.0)

[Compare
Source](https://togithub.com/elastic/apm-agent-nodejs/compare/v4.1.0...v4.2.0)

For more information, please see the
[changelog](https://www.elastic.co/guide/en/apm/agent/nodejs/current/release-notes-4.x.html#release-notes-4.2.0).

##### Elastic APM Node.js agent layer ARNs

|Region|ARN|
|------|---|

|af-south-1|arn:aws:lambda:af-south-1:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|ap-east-1|arn:aws:lambda:ap-east-1:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|ap-northeast-1|arn:aws:lambda:ap-northeast-1:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|ap-northeast-2|arn:aws:lambda:ap-northeast-2:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|ap-northeast-3|arn:aws:lambda:ap-northeast-3:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|ap-south-1|arn:aws:lambda:ap-south-1:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|ap-southeast-1|arn:aws:lambda:ap-southeast-1:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|ap-southeast-2|arn:aws:lambda:ap-southeast-2:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|ap-southeast-3|arn:aws:lambda:ap-southeast-3:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|ca-central-1|arn:aws:lambda:ca-central-1:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|eu-central-1|arn:aws:lambda:eu-central-1:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|eu-north-1|arn:aws:lambda:eu-north-1:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|eu-south-1|arn:aws:lambda:eu-south-1:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|eu-west-1|arn:aws:lambda:eu-west-1:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|eu-west-2|arn:aws:lambda:eu-west-2:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|eu-west-3|arn:aws:lambda:eu-west-3:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|me-south-1|arn:aws:lambda:me-south-1:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|sa-east-1|arn:aws:lambda:sa-east-1:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|us-east-1|arn:aws:lambda:us-east-1:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|us-east-2|arn:aws:lambda:us-east-2:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|us-west-1|arn:aws:lambda:us-west-1:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

|us-west-2|arn:aws:lambda:us-west-2:267093732750:layer:elastic-apm-node-ver-4-2-0:1|

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/elastic/kibana).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: pgayvallet <pierre.gayvallet@elastic.co>
2023-12-01 15:28:37 +01:00
Dima Arnautov
823552fea5
[ML] Add E5 model configs (#172053)
## Summary

- Adds E5 model configurations available for download, portable and x86
linux optimized.
- Adds `getCuratedModelConfig` shared service to retrieve the model ID
and configuration appropriate for the current cluster architecture.
- Updates description for the ELSER model 
- Renames tabs in the "Add trained model" flyout 
- Renames the `name` property in the `ModelDefinitionResponse` interface
with `model_id`

<img width="1835" alt="image"
src="abaf4f47-d581-493a-af1b-c663a0af9da6">

### 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)
- [ ]
[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
2023-12-01 11:04:47 +01:00
Matthew Kime
2403bc8c88
[data views] Stored fields are always requested, we don't need logic around it (#171815)
## Summary

Stored field handling is basically a dead code path. `['*']` is always
sent so lets push this closer to the query.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-11-30 14:29:12 -06:00
Paulo Henrique
3e9ca7a673
[Security Solution] [Grouping] Add isLoading to groupPanelRenderer params (#172245)
## Summary

This PR forwards the `isLoading` parameter that is sent to the Grouping
component, to allow the consumer to customize groupPanelRenderers to
leverage that property while data is loading when switching between
groups.

Below is a recording demoing how a UI can leverage that option.


db8f476d-00cb-48d9-bdcd-d3c242bec79c
2023-11-30 08:32:49 -08:00
Cee Chen
55b09e22be
Upgrade EUI to v90.0.1 (#172261)
`v90.0.0``v90.0.1`

This release also contains updates to EuiCollapsibleNavBeta, to support
serverless UX (https://github.com/elastic/eui/pull/7337).

---

## [`90.0.1`](https://github.com/elastic/eui/tree/vpatch)

**This release is a backport intended for Kibana 8.12.**

- `EuiSelectable` now allows configurable text truncation via
`listProps.truncationProps`
([#7388](https://github.com/elastic/eui/pull/7388))
- `EuiTextTruncate` now supports a new `calculationDelayMs` prop for
working around font loading or layout shifting scenarios
([#7388](https://github.com/elastic/eui/pull/7388))
2023-11-30 06:10:08 -08:00
Luke G
a2a6cd2a83
[Security Solution] [Flyout] drive flyout state with url or memory + support back button navigation from timelines (#169661)
## Summary

This is a PoC for flyout state (left, right, preview panels) stored
entirely in the url without separate syncing mechanism. It is also
possible to opt in for in-memory storage.

### This vs current solution:
- **browser navigation is supported**
- we dont need to sync anything with in-memory state
- we can remove useImperativeHandle from expandable flyout package
- flyout state can be updated on the individual widget level, without
prop drilling
- when clicking between alerts, current flyout arrangement is retained -
so the tabs you have open etc are still there (no custom code required)
- **it is now possible to investigate something in timeline using the
flyout action & go back to the flyout view**

https://github.com/elastic/security-team/issues/8135

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-30 14:51:55 +01:00
Pierre Gayvallet
62d0ce4c7c
Add CI check to ensure SO mapping addition are done correctly (#172056)
## Summary

Fix https://github.com/elastic/kibana/issues/172055

Add a CI check verifying that any mapping addition (done after a type's
initial introduction) correctly defines the added mappings as a
`mappings_addition` change in a model version of the owning type (or
throws otherwise)

Similar to https://github.com/elastic/kibana/pull/169610

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-30 13:37:11 +01:00
Gerard Soldevila
2eba9098cb
Start the initial status timeout when the service is "started" (#172268)
## Summary

The _plugins status service_ listens to some of the plugins' statuses
through Observables.
If these plugins don't emit an initial status after some time, it
injects a first "timed out" value, with an `unavailable` state.

We're currently starting this 30s timeout at service creation time.
This is not accurate, as other services starting before plugins (e.g.
saved objects + migrations) are time consuming and can leave short to no
time for plugins to `start()` before hitting the 30s timeout.

This PR aims at fixing this, by starting to count when the plugins
`start()` methods are called.
This way, we're actually giving plugins 30s to emit a status.
2023-11-30 04:51:48 -07:00
Pierre Gayvallet
b323fc90a8
Core metrics collection - collect more memory related metrics (#172146)
## Summary

Part of https://github.com/elastic/kibana/issues/171060

Add additional memory metrics for collection:

**process**:
- `process.memory.array_buffers_in_bytes` the
`process.memoryUsage().arrayBuffers` value
- `process.memory.external_in_bytes` the
`process.memoryUsage().external` value

**cgroup**:  (v2 only)
- `os.cgroupMemory.current_in_bytes` value from
`/sys/fs/cgroup/{group}/memory.current`
- `os.cgroupMemory.swap_current_in_bytes` value from
`/sys/fs/cgroup/{group}/memory.swap.current`
2023-11-30 11:47:46 +01:00
Carlos Crespo
092330c2a3
[ObsUX] Move formulas and dashboard config to inventory models (#171872)
## Summary

This PR moves formulas and charts developed for the Hosts View and Asset
Details into the Inventory Models existing structure.

### `metrics_data_access` plugin

This is where the inventory models are found. All charts and formulas
have been moved from `infra` plugin into this plugin Most of the changes
are just about that. I've refactored a few things to help with the
reusability of these charts/dashboards

### `infra` plugin

Changes made here were a consequence of the refactors in the
charts/dashboards config.

### `@kbn/lens-embaddable-utils` package

Just added new types

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-30 10:17:58 +01:00