Commit graph

1263 commits

Author SHA1 Message Date
Victor Martinez
72bf25dba6
github-action: use pull_request_target to access the secrets (#182773)
Use `pull_request_target` to access the GitHub secrets to destroy the
oblt-test-env created previously.

It's secured enough; it does not run any changes from any PR but does
some other automation
2024-05-07 12:16:18 +02:00
Jon
8b015ebedd
[keystore] Add password support (#180414)
This adds support a password protected keystore. The UX should match
other stack products.

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

```
[jon@mbpkbn1]/tmp/kibana-8.15.0-SNAPSHOT% bin/kibana-keystore create --password
A Kibana keystore already exists. Overwrite? [y/N] y
Enter new password for the kibana keystore (empty for no password): ********
Created Kibana keystore in /tmp/kibana-8.15.0-SNAPSHOT/config/kibana.keystore

[jon@mbpkbn1]/tmp/kibana-8.15.0-SNAPSHOT% bin/kibana-keystore add elasticsearch.username
Enter password for the kibana keystore: ********
Enter value for elasticsearch.username: *************

[jon@mbpkbn1]/tmp/kibana-8.15.0-SNAPSHOT% bin/kibana-keystore add elasticsearch.password
Enter password for the kibana keystore: ********
Enter value for elasticsearch.password: ********

[jon@mbpkbn1]/tmp/kibana-8.15.0-SNAPSHOT% bin/kibana
...
Enter password for the kibana keystore: ********
[2024-04-30T09:47:03.560-05:00][INFO ][root] Kibana is starting

[jon@mbpkbn1]/tmp/kibana-8.15.0-SNAPSHOT% bin/kibana-keystore has-passwd
Keystore is password-protected

[jon@mbpkbn1]/tmp/kibana-8.15.0-SNAPSHOT% ./bin/kibana-keystore show elasticsearch.username
Enter password for the kibana keystore: ********
kibana_system

[jon@mbpkbn1]/tmp/kibana-8.15.0-SNAPSHOT% ./bin/kibana-keystore remove elasticsearch.username
Enter password for the kibana keystore: ********

[jon@mbpkbn1]/tmp/kibana-8.15.0-SNAPSHOT% ./bin/kibana-keystore show elasticsearch.username
Enter password for the kibana keystore: ********
ERROR: Kibana keystore doesn't have requested key.

[jon@mbpkbn1]/tmp/kibana-8.15.0-SNAPSHOT% bin/kibana-keystore passwd
Enter password for the kibana keystore: ********
Enter new password for the kibana keystore (empty for no password):
[jon@mbpkbn1]/tmp/kibana-8.15.0-SNAPSHOT% ./bin/kibana-keystore has-passwd
Error: Keystore is not password protected

[jon@mbpkbn1]/tmp/kibana-8.15.0-SNAPSHOT% ./bin/kibana
...
[2024-04-30T09:49:03.220-05:00][INFO ][root] Kibana is starting
```

## Password input

Environment variable usage is not consistent across stack products. I
implemented `KBN_KEYSTORE_PASSWORD_FILE` and `KBN_KEYSTORE_PASSWORD` to
be used to avoid prompts. @elastic/kibana-security do you have any
thoughts?


- `LOGSTASH_KEYSTORE_PASS` -
https://www.elastic.co/guide/en/logstash/current/keystore.html#keystore-password
- `KEYSTORE_PASSWORD` -
https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-keystore-bind-mount
- `ES_KEYSTORE_PASSPHRASE_FILE` -
https://www.elastic.co/guide/en/elasticsearch/reference/current/rpm.html#rpm-running-systemd
- Beats discussion, unresolved:
https://github.com/elastic/beats/issues/5737


## Release note
Adds password support to the Kibana keystore.
2024-05-06 10:23:29 -05:00
Victor Martinez
63e29efbc6
github-action: undeploy serverless for closed PRs using ci:project-deploy-observability (#182374)
Automate the undeployment for all those Kibana PRs using the label
`ci:project-deploy-observability` once those PRs have been closed
(merged, closed).

This will help with tidying up all the ongoing deployments that were
created automatically as part of the recent automation with
https://github.com/elastic/kibana/pull/181851
2024-05-06 16:32:36 +02:00
Marco Antonio Ghiani
7a69fdd469
[Infra][Logs Explorer] Factor out shared custom hook into a package (#182336)
## 📓 Summary

This work is just the extraction of a utility hook implemented in the
`infra` plugin for re-usability, as there are some scenarios where it
becomes handy in the logs explorer plugin too.

For improved reusability in future, I extracted the useBoolean hook into
a react-hooks package, where additional stateful utility hooks can go in
future.

This also replaces the current usage of the hook in the `infra` plugin
and is used to refactor part of the logs_explorer top nav.

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-06 16:17:39 +02:00
Stratoula Kalafateli
807da63c61
[ES|QL] Fetch the query columns utils (#182338)
## Summary

Revives this https://github.com/elastic/kibana/pull/181969

To do so, I had to create a new package `search-types` and move the
types I need there.

The Discovery team can take it from here.

Note: It also does a cleanup on the types I move, some of them were
declared twice.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-06 10:51:40 +02:00
Marco Antonio Ghiani
747ecea18a
[Discover] Create Discover Shared plugin and features registry (#181952)
## 📓 Summary

Closes #181528 
Closes #181976 

**N.B.** This work was initially reviewed on a separate PR at
https://github.com/tonyghiani/kibana/pull/1.

This implementation aims to have a stateful layer that allows the
management of dependencies between Discover and other plugins, reducing
the need for a direct dependency.

Although the initial thought was to have a plugin to register features
for Discover, there might be other cases in future where we need to
prevent cyclic dependencies.
With this in mind, I created the plugin as a more generic solution to
hold stateful logic as a communication layer for Discover <-> Plugins.

## Discover Shared

Based on some recurring naming in the Kibana codebase, `discover_shared`
felt like the right place for owning these dependencies and exposing
Discover functionalities to the external world.
It is initially pretty simple and only exposes a registry for the
Discover features, but might be a good place to implement other upcoming
concepts related to Discover.

Also, this plugin should ideally never depend on other solution plugins
and keep its dependencies to a bare minimum of packages and core/data
services.

```mermaid
flowchart TD

A(Discover) -- Get --> E[DiscoverShared]
B(Logs Explorer) -- Set --> E[DiscoverShared]
C(Security) -- Set --> E[DiscoverShared]
D(Any app) -- Set --> E[DiscoverShared]
```

## DiscoverFeaturesService

This service initializes and exposes a strictly typed registry to allow
consumer apps to register additional features and Discover and retrieve
them.

The **README** file explains a real use case of when we'd need to use it
and how to do that step-by-step.

Although it introduces a more nested folder structure, I decided to
implement the service as a client-service and expose it through the
plugin lifecycle methods to provide the necessary flexibility we might
need:
- We don't know yet if any of the features we register will be done on
the setup/start steps, so having the registry available in both places
opens the door to any case we face.
- The service is client-only on purpose. My opinion is that if we ever
need to register features such as server services or anything else, it
should be scoped to a similar service dedicated for the server lifecycle
and its environment.
It should never be possible to register the ObsAIAssistant
presentational component from the server, as it should not be permitted
to register a server service in the client registry.
A server DiscoverFeaturesService is not required yet for any feature, so
I left it out to avoid overcomplicating the implementation.

## FeaturesRegistry

To have a strictly typed utility that suggests the available features on
a registry and adheres to a base contract, the registry exposed on the
DiscoverFeaturesService is an instance of the `FeaturesRegistry` class,
which implements the registration/retrieval logic such that:
- If a feature is already registered, is not possible to override it and
an error is thrown to notify the user of the collision.
- In case we need to react to registry changes, is possible to subscribe
to the registry or obtain it as an observable for more complex
scenarios.

The FeaturesRegistry already takes care of the required logic for the
registry, so that `DiscoverFeaturesService`is left with the
responsibility of instantiating/exposing an instance and provide the set
of allowed features.

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
2024-05-03 11:27:32 +02:00
Steph Milovic
e306074aa9
[Security solution] Add additional properties to attack discovery telemetry (#182249) 2024-05-01 21:48:36 -07:00
Cauê Marcondes
97e0f419bf
[Assets] Creating Assets data access plugin (#182108)
Create an empty assets data access plugin so we can start registering
the services(APIs) that will be used to fetch assets type documents.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-30 08:15:23 -07:00
Coen Warmer
d83a7370f9
[Maintenance] Move Asset Manager, Metrics Data Access to /x-pack/plugins/observability_solution (#181970)
## Summary

Title says it all.
2024-04-30 05:38:30 -07:00
Victor Martinez
9035166aa8
github-actions: update command to run the docs validation (#181943)
Update the comment with how to run the docs validation
2024-04-29 15:27:32 +02:00
Marco Antonio Ghiani
600ca62bed
[Logs Explorer][Discover] Move Logs Overview into Discover codebase (#180262)
## 📓 Summary

Closes #180024 

This work aims to move the "Logs Overview" doc view created from the
logs-explorer app into the unified-doc-viewer plugin, creating and
registering this as a preset along the table and source doc views.

To keep control of whether this doc view should be displayed or not, an
`enabled` configuration flag is supported for every doc view and will be
used to determine whether a doc view should load or not in the view.
This `enabled` flag can be programmatically enabled/disabled by
`docView.id` using the 2 new methods added to the `DocViewsRegistry`,
the `enableById` and `disableById` ones.
The customization extension point does not register the content of the
tab, but is limited to enable/disable a preset overview tab.

To allow this change, some shared utilities between the flyout logic and
the smart fields feature have been copied into the `@kbn/discover-utils`
package. The utils will still live in the logs_explorer plugin and are
used by the smart fields feature until this is migrated too into
Discover.

## 💡 Reviewer hints

Although it seems a large PR, most of the changes are on moved files
from logs-explorer into unified-doc-viewer, which is logic already
reviewed. With these changes, there will be a follow-up PR to optimize
the shared parts with the other doc views.

## 🚶 Next steps

To keep the scope of this PR the smallest possible, here are some
changes I'll work out in upcoming PRs built on top of this one.

- [x] Implement a discover registry to enable registering external
features, such as the ObservabilityAIAssistant.
- [x] Integrate ObsAIAssistant with this work through the new discover
features registry.
- [x] Refactor the doc views to share duplicated logic.
- [x] Port the existing e2e tests for the logs overview tab into the
unified-doc-viewer plugin.

https://github.com/tonyghiani/kibana/pull/1

---------

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
2024-04-29 11:54:50 +02:00
Victor Martinez
2f5897a70c
labeller: enable serverless deployment for oblt automatically (#181851)
The GitHub label will automatically deploy a Serverless deployment with the Observability test data, see https://github.com/elastic/kibana/pull/181041
2024-04-29 07:33:11 +00:00
Nathan Reese
60ab2cfe95
PresentationPanel props hidePanelChrome (#181473)
### Changes
1. adds `hidePanelChrome` parameter to `ReactEmbeddableRenderer`. When
true, embeddable is rendered without `PresentationPanel` wrapper
2. Removes `embeddable-explorer` plugin
3. Moves Embeddable developer example into embeddable_examples plugin
4. Creates new examples that demonstrate how to use
`ReactEmbeddableRenderer`
<img width="600" alt="Screenshot 2024-04-23 at 5 19 18 PM"
src="5167a2a4-1968-42e6-92f7-4577c9cda3c6">

Follow-up work to narrow scope of this PR
1. add key concepts to embeddable overview
2. add "Register new embeddable type" tab that details how to create a
new embeddable and shows how you can add embeddable examples to
dashboard
3. group embeddable examples into a single item in "Add panel" menu - to
show best practices of how to keep menu clean
4. remove class based example embeddables

### Test instructions
1. start kibana with `yarn start --run-examples`
5. Open kibana menu and click "Developer examples"
6. Click "Embeddables" card and run examples

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-24 14:05:19 -06:00
Abdul Wahab Zahid
e1ec9ee17e
[Dataset quality] Flyout Summary section (#179479)
Closes https://github.com/elastic/kibana/issues/170492

## Summary

The PR Implements the Dataset Quality Flyout summary KPIs: "Docs count",
"Size", "Services", "Hosts" and "Degraded docs".

|Stateful|Serverless|
|:---:|:---|
|<img alt="Screenshot 2024-03-26 at 19 14 34"
src="d75de56f-0916-48a6-a101-fc3d8f084f4d">|<img
alt="Screenshot 2024-03-26 at 17 02 05"
src="46d58946-2ed5-4c21-b53c-be3d43e7b857">|

"Show all" links for "Services" and "Hosts" metrics depend on some
development in APM and Infra plugins and therefore will be implemented
in a follow up issue.

Note that "Size" metric is excluded on Serverless as the endpoint uses
ES's `_stats` endpoint which is not available on Serverless (at the time
of creation of this PR). The code contains some conditions and cases to
tackle this, which should be considered as a temporary measure. All of
the code related to these changes should either be removed or modified
once there's a way to calculate the size of an index/dataStream on
Serverless (see [related
](https://github.com/elastic/kibana/issues/178954)). The following
changes are made in particular:
 - Size UI component on the Flyout will be hidden on Serverless
- `dataset_quality/data_streams/{dataStream}/details` endpoint will
return `NaN` for size on Serverless
- Unit, integration and end-to-end tests on Serverless handle
"sizeBytes" property accordingly
2024-04-24 13:20:31 +02:00
Pierre Gayvallet
0f3ecf739e
[Security into Core] expose userProfile service from Core (#180372)
## Summary

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

- Introduce the new `userProfile` core service, both on the browser and
server-side.

- Have the security plugin register its API to Core for re-exposition

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-24 01:20:05 -07:00
Victor Martinez
3c71d69bf9
ci: integrate observability deployments with the oblt-test-env (#181041) 2024-04-23 07:55:36 -07:00
Saarika Bhasi
439f4a8876
[ML] Support adding inference_id in a flyout (#180330)
## Summary

* Creates a new package - ` @kbn/inference_integration_flyout` 
* Above package has implementation for adding new inference endpoint id,
including Elastic, third party integration and instructions to upload
via Eland python client, in a flyout.
* The above package is used for supporting semantic_text feature and is
accessed via`add a new inference endpoint` button

## Screen Recording


dbd36634-bd4a-49f1-b1d5-d7b6c90444bc


### Checklist


- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ] [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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-21 21:20:28 -04:00
Nathan L Smith
2d2649f13c
Remove @elastic/obs-ux-infra_services-team from Stack Monitoring CODEOWNERS (#180653)
The "virtual" @elastic/stack-monitoring-team owns this and reviews from
infra services team are not required.
2024-04-18 23:12:21 +00:00
Sébastien Loix
5be49cac39
[Stateful sidenav] Remove analytics IA group (#181132) 2024-04-18 16:12:16 +01:00
Jean-Louis Leysens
29fb11b358
[HTTP/OAS] @kbn/router-to-openapispec (#180683)
## Summary

Introduces a new package for generating OAS from Kibana's routers. This
first iteration includes:

* E2E conversion of Core's `Router` and `CoreVersionedRouter` routes
into a single OAS document (not written to disk or shared anywhere
yet...)
* Support for
[`$ref`](https://swagger.io/docs/specification/using-ref/?sbsearch=%24ref)
by introducing the `meta.id` field `@kbn/config-schema`'s base type.
This is intended to be used only response/request schemas initially.

## TODO

- [x] More unit tests

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-17 04:03:16 -07:00
Rachel Shen
9579635c25
[Share Modal Redesign] Reporting Refactor Modals (#180009)
## Summary

This PR refactors https://github.com/elastic/kibana/pull/179206 to have
each export type be registered in Reporting and then passed into the
share plugin.

This PR is focused on the redesign in terms of the export modals. Test
refactoring will be done in a separate PR.
Partially closes https://github.com/elastic/kibana-team/issues/753

- [x] Need to refactor this PR to include @eokoneyo's general modal
component
- [x] Lens needs to have Export with all three report type options - to
avoid circular dependencies move the Lens CSV stuff into the reporting
plugin vs having it in Lens
- [x] Canvas should not be affected by these changes (so the old
share/reporting code has to stay for canvas)
https://github.com/elastic/kibana/issues/151523 to keep in mind for the
redesign

Failed tests will be covered in this PR
https://github.com/elastic/kibana/pull/180406


### TO TEST 

Mark `share.new_version.enabled: true` in your kibana.dev.yml


### 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] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))

---------

Co-authored-by: Eyo Okon Eyo <eyo.eyo@elastic.co>
Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
2024-04-16 15:01:44 -07:00
Dzmitry Lemechko
c4e40ea205
[CODEOWNERS] add owners for all svl FTR tests (#180802)
## Summary

Part of work to enable automatic Team notifications for serverless test
failures.

This PR adds missing code owners for FTR functions/api integration test
files, so that we can map failed test suite to responsible Team.

I was using `node scripts/check_ftr_code_owners.js` to find missing
owners.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-16 11:15:02 +02:00
Rodney Norris
308f514a45
[Search] Introduced Notebooks view for console (#180400)
## Summary

This PR adds the search-notebooks plugin and a python notebook renderer
to the persistent console.

### Screenshots
Console Closed
<img width="1418" alt="image"
src="8e2e2934-a19f-4204-8a31-1e8eab7fd20f">
Notebooks:
<img width="1418" alt="image"
src="bf9d40ad-352d-482e-8d84-f426c3026c69">
<img width="1418" alt="image"
src="fcf8cac2-4640-49e8-9bce-94a5a853383f">

Console View
<img width="1418" alt="image"
src="9230d1c2-3987-41f8-aa86-77a20509b8c0">

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [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))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-04-15 11:10:28 -05:00
Sander Philipse
1fa7a69fb6
Move shared index management types to package (#179932)
## Summary

This moves a number of types that are used outside of the index
management plugin to a package so we can avoid cyclical dependencies in
the work we're doing to add semantic text as a mapping type. That will
depend on the ML plugin, which has dependencies that themselves depend
on a few types from index management. I split this into a separate PR
for ease of reviewing.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2024-04-10 17:48:06 +02:00
Søren Louv-Jansen
fe507aa0b9
[Obs AI Assistant] Update codeowners (#180385)
This updates the code owners from `obs-knowledge-team` to
`obs-ai-assistant` for all of the ai assistant plugins
2024-04-10 17:18:23 +02:00
Rodney Norris
f385496a40
[Search] introduce notebooks plugin (#179870)
## Summary

Introduced the search_notebooks plugin which has a set of default python
notebooks that can be served to the frontend via API endpoints.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-04 14:16:11 -05:00
Justin Kambic
6a50dae95d
[Synthetics] Port enablement API tests to Serverless (#179861)
## Summary

Related to #179100.

Sets up Synthetics API Integrations suite in Serverless Tests and adds
tests for the enablement endpoint.

Additional API test ports will be posted following up on this in the
coming days.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-04-04 12:23:58 -04:00
Eyo O. Eyo
03696a4561
Share Modal (#179037)
## Summary

This PR is based off of https://github.com/elastic/kibana/pull/176617,
which in turn builds off of the generic tabbed modal component created
here https://github.com/elastic/kibana/pull/176261.
Partially addresses https://github.com/elastic/kibana-team/issues/753

The PR introduces an alternate way of sharing a dashboard by
consolidating the existing share options into a single place.

## TO TEST
Set `share.new_version.enabled: true `in your kibana.dev.yml in order to
see these changes.
- [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: rshen91 <rshen@elastic.co>
2024-04-04 09:06:14 -07:00
Juan Pablo Djeredjian
de25d7cf32
[Security Solution] RFC for Prebuilt Rules Customization - Milestone 3 (#171856)
Resolves: https://github.com/elastic/kibana/issues/171309

## Summary

- Creates an RFC for Milestone 3 of the Prebuilt Rules Customization,
including:
  - rule schema changes
  - mappings
  - migration strategy and technical implementation
  - exporting and importing rules
  - schema-related changes needed in endpoints
- calculation of `isCustomized` field on endpoints that update/patch
rules.
- additional changes needed to `/upgrade/_review` and
`/upgrade/_perform` endpoints
  - concrete diff algorithms
  - UI Changes

- Creates
`x-pack/plugins/security_solution/docs/rfcs/detection_response` folder
and adds it to CODEOWNER file, with owners the Detection Engine and Rule
Management teams.
2024-04-04 17:00:33 +02:00
Sébastien Loix
43de4b5d57
[Stateful sidenav] Update static definitions (#179043) 2024-04-03 15:43:21 +01:00
Jon
2d363d2833
[actions/triage] Omit dev dependency installation (#179664) 2024-04-02 12:39:34 -05:00
Coen Warmer
7b94769f76
[Observability AI Assistant] Update label in path-labeller.yml (#179824)
## Summary

This updates the github label which is added when there are changes in
AI Assistant for Observability owned code.
2024-04-02 13:28:22 +00:00
Jean-Louis Leysens
849f8fb1ac
[HTTP/CDN] Set connect-src to HTTPS only when CDN is configured (#179609)
## Summary

Close https://github.com/elastic/kibana/issues/179061
2024-04-02 13:38:59 +02:00
Walter Rafelsberger
bb33a8e78b
[ML] AIOps: Move code from plugins/aiops/common to packages. (#179178)
## Summary

This moves code from `plugins/aiops/common` to packages. The `aiops`
plugin will from now on have only a `server` and `public` directory.
This is in preparation for additional AIOps related public APIs and to
avoid cyclic dependency problems for other consuming plugins.

- Package `@kbn/aiops-utils` was renamed to `@kbn/aiops-common`.
- For each AIOps feature a package was created:
`@kbn/aiops-change-point-detection`, `@kbn/aiops-log-pattern-analysis`
and `@kbn/aiops-log-rate-analysis`.

### Checklist

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2024-03-28 18:40:36 +01:00
Cauê Marcondes
aadfa5dffd
[UX/Maps] Fixing APM data view id (#179257)
closes https://github.com/elastic/kibana/issues/177461

UX fix:
<img width="813" alt="Screenshot 2024-03-22 at 14 03 58"
src="48352560-d5c4-4258-8bfe-5b8dc6e4bf41">

Maps Obs layer
<img width="1325" alt="Screenshot 2024-03-22 at 16 11 31"
src="a68bbef3-a30a-45e4-987f-b472ee0db394">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-03-28 12:14:32 +00:00
Nathan Reese
c8bfea57c1
[dashboard] decouple "link to library" and "unlink from library" actions from AttributeService (#178584)
There are 2 paths for decoupling from AttributeService
1. replace existing actions with new actions that use
`HasLibraryTransforms` interface. Update all embeddables to implement
`HasLibraryTransforms` interfaces.
2. Rename existing actions as `legacy`. Create new actions that use
`HasLibraryTransforms` interface. Provide a reference implementation for
new actions. Convert embeddables to new `HasLibraryTransforms` interface
as the embeddables get converted to react embeddables.

Option 2 was chosen to limit scope and gradually convert embeddables to
`HasLibraryTransforms` interface.

This PR:
1. Remove `@kbn/presentation-library` package. Interfaces in this
package have been rolled into `@kbn/presentation-publishing` package.
2. Rename existing interface as `HasLegacyLibraryTransforms`
3. Create new interface `HasLibraryTransforms` 
4. Rename `AddToLibraryAction` action to `LegacyAddToLibraryAction`.
Modify action to use `HasLegacyLibraryTransforms` interface and guards.
5. Rename `UnlinkFromLibraryAction` action to
`LegacyUnlinkFromLibraryAction`. Modify action to use
`HasLegacyLibraryTransforms` interface and guards.
6. Rename `LibraryNotificationAction` action to
`LegacyLibraryNotificationAction`. Modify action to use
`LegacyUnlinkFromLibraryAction`.
7. Create new `AddToLibraryAction`. Code action to use
`HasLibraryTransforms` interface.
8. Create new `UnlinkFromLibraryAction`. Code action to use
`HasLibraryTransforms` interface.
9. Create new `LibraryNotificationAction`. Code action to use
`UnlinkFromLibraryAction` action.
10. Update MapEmbeddable to implement `HasLibraryTransforms` interface
so that Map embeddable can be used to test new actions.

### Test
1. install sample web logs
2. create new dashboard
3. Click "Add panel" and select "Maps".
4. Click "Save and return".
5. Save dashboard. Inspect dashboard saved object. Verify panel is
by-value and contains `attributes` in `panelsJSON`
<img width="300" alt="Screenshot 2024-03-22 at 2 49 56 PM"
src="49189613-f7c4-435d-88ab-d9c8ceb1575f">
6. Go back to dashboard and open context menu. Click "more" and then
click "Save to library".
7. Save dashboard. Inspect dashboard saved object. Verify panel is
by-reference and does not contain `attributes` in `panelsJSON`.
<img width="300" alt="Screenshot 2024-03-22 at 2 52 19 PM"
src="e3b2eace-a48d-4dd0-a771-f22436d72935">
8. Go to maps listing page. Verify map is displayed in listing page.
Open map and verify it opens. Add some new layers and save map.
11. Go back to dashboard. Verify map contains new layers added to saved
object.
12. Open context menu. Click "more" and then click "Unlink from
library".
13. Save dashboard and verify map panel is now by-value again.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-03-27 16:27:03 -06:00
Stratoula Kalafateli
804684310f
[ES|QL] Move last packages to the project team (#179538)
Move last packages to the esql prject team
2024-03-27 08:25:55 -07:00
Marco Liberati
fb19e57a4e
[ES|QL] New @kbn/esql-services package (#179029)
## Summary

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

This PR extracts the ES|QL service like "validation", "autocomplete",
"code_action" (quick fixes) and some other services into a separate
package `@kbn/esql-validation-autocomplete` which has no tie with Monaco
editor anymore.

All the AST and grammar logic has been encapsulated into a single
`@kbn/esql-ast` package who contains the `getAst` function together with
the `parser` and `lexer`.

## Validation enhancements

The validation API has been enhanced to gracefully degrade whenever
callbacks are not provided, via the `ignoreOnMissingCallback` option.
Tests are included as well for this scenario.

### Example plugin

An example plugin app has been developed to show to to use the
validation API

<img width="500" alt="Screenshot 2024-03-22 at 17 45 38"
src="ebc172d3-ee61-4f3a-9e42-dcb9b15c7e69">

The app starts with a missing callback:

<img width="855" alt="Screenshot 2024-03-22 at 17 36 22"
src="c9b81370-8a10-487d-b22f-2359e1365a54">

Toggling the ignore option will hide the index error due to the lack of
`getSources` callback:

<img width="816" alt="Screenshot 2024-03-22 at 17 28 17"
src="931f4e5f-3ad6-46f7-97ca-63d7bb66646b">

Warnings are shown as well when detected:

<img width="807" alt="Screenshot 2024-03-22 at 17 35 56"
src="5e3e0537-cba2-475f-946b-0302867384ca">

#### Code snippet

The example app produces a copyable code snippet of the current
configuration of the validator:

![Code
snippet](https://private-user-images.githubusercontent.com/924948/316838987-fd16da58-8790-40b2-851d-b92aca1811dc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTE0NTY0MzUsIm5iZiI6MTcxMTQ1NjEzNSwicGF0aCI6Ii85MjQ5NDgvMzE2ODM4OTg3LWZkMTZkYTU4LTg3OTAtNDBiMi04NTFkLWI5MmFjYTE4MTFkYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwMzI2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDMyNlQxMjI4NTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00ZDhhOGRlMjZjMzZhN2NjNTdkYWMxYTNjOWVkNTA3NDk5NGViOTg2NWEzMTAyZGM4MGYyOTQ0YjQ2N2Q3ZDI1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.H-3r_B57NK1-rS8UbR_bxlNtAMQ0flFGtW0oTIiOlr0)

### Checklist

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-03-27 14:39:48 +01:00
Stratoula Kalafateli
a3cc2b44c9
Move esql code to the new kibana-esql team (#179454)
## Summary

Moving ES|QL ownership to the new esql project team

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-03-27 07:47:08 +01:00
dkirchan
a6293e0937
[Security] Introduced slack token for kbn-failed-test-notifier (#179444)
## Summary

Whenever a test is failing and the label `failed-test` is added or a
test is skipped, then a notification will be sent to the slack channel
of preference of the team. Currently this is enabled only for Security
Solution.

This PR depends on completion of the [PR in
kibana-operations](https://github.com/elastic/kibana-operations/pull/72)
2024-03-26 22:46:51 +01:00
Sander Philipse
a64642b58c
[Search] Create connectors plugin (#178663)
## Summary

Creates a new search-connectors-plugin that houses some shared stateful
code for connectors. Right now this houses just images and a list of
connector types. In the futures this will also house API calls.


### 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] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [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:

| 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

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-03-26 06:56:16 -07:00
Søren Louv-Jansen
bb72b3e8e9
[ObsAiAssistant] Move AI Assistant Management plugin to x-pack (#179235)
This PR moves the AI Assistant Management plugin into x-pack to
co-locate it with the other assistant plugins and to make it possible to
statically import from the other assistant plugins. This is not
currently possible because the Management plugin is in OSS and the other
plugins are in xpack.
2024-03-25 08:36:36 -05:00
Drew Tate
1eae619bea
[ES|QL] grammar sync job (#178347)
## Summary

Introduces a CI job to check for changes to the Elasticsearch grammar.

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

The first time this job runs, it will result in a PR to update the
grammar because of formatting differences. That should be merged. Then,
it will only create a PR when something has changed on the Elasticsearch
side.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-03-21 17:01:48 -05:00
Samiul Monir
ef899e40bf
[Kibana] AI Playground (#178049)
## Summary

We are planning to continue further development in `kibana` and this
feature will be gated.


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

---------

Co-authored-by: Yan Savitski <yan.savitski@elastic.co>
Co-authored-by: Joseph McElroy <joseph.mcelroy@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-03-21 17:10:31 +01:00
Sébastien Loix
37dee75e31
[Stateful sidenav] Add deeplink definitions & hide page side nav (#178861) 2024-03-20 12:39:47 +00:00
Walter Rafelsberger
be9ad681ba
[ML] Consolidate redundant time_buckets into @kbn/ml-time-buckets. (#178756)
## Summary

Follow up to #46227.

Consolidates multiple copies of `time_buckets.js` into
`@kbn/ml-time-buckets`. The scope of this PR is just to consolidate the
files. In follow ups we still need to: Refactor JS to TS and get rid of
the code that uses this using "dependency cache" in the `ml` plugin.

### 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] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2024-03-20 13:39:07 +01:00
Panagiota Mitsopoulou
d5dfee7146
New slo plugin (#177937)
Fixes https://github.com/elastic/kibana/issues/176420

## 🍒 Summary
This PR copies the SLO code that was inside the Observability app into
its own app under `observability-solution/slo` folder.


4f6b8dfb-9612-4d30-ad50-4ee5c55a9c32

## ✔️  Acceptance criteria
- URL of new app: `app/slos`
- Design and functionality are not changed. 
- Git history has been retained for all files in
`x-pack/plugins/observability_solution/slo`.
- SLO should appear on server less
- SLO code inside `observability_solution/observability` code has been
removed. A new clean up round might be needed though for possible
leftovers.
- Burn rate rule is registered within the new slo app
- SLO embeddables are moved inside the new slo app
  - overview
  - alerts embeddable
  - error budget burn down
- Alerts table configuration registration for slo details page and
alerts table embeddable is still done in the observability app. Response
Ops team is working on removing the need to register the alert table
anyway
- Slo app is wrapped into `ApplicationUsageTrackingProvider` which will
send slo `Application usage` information tracked by the `slo` appId
- Redirect old `app/observability/slos` route to `app/slos`
- Rename old `xpack.observability.slo` keys to `xpack.slo` in the
translation files


## 🌮 How to test
Design and functionality didn't change, so simply navigate to existing
slo pages and try to break it
- Slo list page
  - group by
  - unified search
  - toggle buttons
  - actions
- Slo creation
  - try group by as well 
- Slo detail page
  - Actions on top 
  - navigate to overview and alerts tabs
- Create SLO flyout in Logs Explorer
- Create burn rate rules and verify they appear on rules page
- Verify SLO alerts appear on Alerts page and slo details page
- Embeddables
  - Through the dashboard app
- Using the attach to dashboard action on the slo card item on slo list
page and the error budget burn down chart on the slo detail page
- SLOs only for platinum users
- Permissions
- Spaces


## TODO

- [x] Move slo stuff from observability folder to new slo plugin
- [x] Remove old slo stuff from observability folder
- [x] Update references 
- [x] Fix typescript and eslint errors
- [x] Paths
- [x] Locators
- [x] Burn rate rule registration
- [x] Embeddable Alerts table configuration registration
- [x] Embeddables
- [x] Translations
- [x] Verify plugin.ts files contain all registration logic
  - [x] public
  - [x] server
- [x] Final cleanup for observability folder
- [x] Run tests
- [x] Application Usage (Telemetry)
- [x] Permissions

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: shahzad31 <shahzad31comp@gmail.com>
Co-authored-by: Coen Warmer <coen.warmer@gmail.com>
2024-03-19 03:17:34 -07:00
Walter Rafelsberger
8364ce85b3
[ML] AIOps: Add performance journey for log rate analysis. (#178017)
## Summary

Part of #173301.

Add a performance journey for AIOps Log Rate Analysis.

To run the performance journey locally, run:

```
node scripts/run_performance.js --journey-path x-pack/performance/journeys/aiops_log_rate_analysis.ts
```

Review notes:

- The small dataset used isn't set up using `esArchiver`, because it's
just 18 docs we're reusing a file from AIOps integration tests und using
bulk ingest to create the index. The data view necessary to populate the
UI is created with an `kibanaServer.request` call.
- Because of the above, the usual `es/kbnArchiver` cleanup cannot kick
in. To support manual cleanup, I added an `afterSteps` option similar to
the existing `beforeSteps` option. This allows us to delete the index
and data view during teardown.
- Kibana operations team triggered by `.buildkite/ftr_configs.yml`.


Journey showing up in APM:

<img width="1638" alt="image"
src="14f130f5-c125-4390-90d0-96002bc916f3">

### 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] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2024-03-19 09:25:33 +01:00
Elena Stoeva
dbf017ba31
Rename Management team name in codeowners file (#178626)
The AppEx Management team was recently renamed on GitHub from
`platform-deployment-management` to `kibana-management`. This PR updates
the Codeowners file and all references to the team name.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-03-18 15:46:31 +00:00
Sébastien Loix
059e4a57d0
[Stateful sidenav] Breadcrumb switcher (#178112) 2024-03-18 11:01:12 +00:00