Commit graph

182 commits

Author SHA1 Message Date
James Gowdy
6a6df9d72f
[ML] Module filtering (#168721)
Adds a new `tags` property to our ML Modules which contains an array of
strings to used to filter the modules returned when calling
`/internal/ml/modules/get_module` or `/internal/ml/modules/recognize`

Adds a new kibana config setting `xpack.ml.compatibleModuleType` which
will enforce a module filter.
This setting supports the values `security`, `observability` or `search`
and will be used by the serverless projects to ensure only modules
relevant to the current project are discoverable.

When matching against the `xpack.ml.compatibleModuleType` setting,
modules with no tags will be returned along with modules which match the
`compatibleModuleType` value.

The endpoints `/internal/ml/modules/get_module` and
`/internal/ml/modules/recognize` can also take a `filter` query
parameter in the form of a comma separated list of values. If any of
these filter values match a module's tags, the module will be returned.
Modules with no tags will not be matched when using the `filter`
parameter.

This PR also updates the security plugin to apply a `security` filter
when retrieving modules and running recognize. This will improve
performance, especially for recognize which runs the queries from every
module on the supplied index pattern.

Examples

**Running the Security serverless project.**
Request:
`/internal/ml/modules/get_module` 
Response:
All modules containing `tags: ["security"]`
Plus all modules with no `tags` or `tags: []`

Request:
`/internal/ml/modules/get_module?filter=observability` 
Response:
An empty list

**Running stateful es**
Request:
`/internal/ml/modules/get_module` 
Response:
All modules

Request:
`/internal/ml/modules/get_module?filter=security` 
Response:
Only modules containing `tags: ["security"]` 

Request:
`/internal/ml/modules/get_module?filter=security,observability` 
Response:
Modules containing `tags: ["security"]`  and `tags: ["observability"]`

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-10-26 16:55:48 +01:00
Shahzad
8217f3e360
[Synthetics] Disable synthetics integration in serverless (#169793) 2023-10-26 00:47:05 -07:00
Nathan L Smith
416a95417d
Enable infra in serverless (#167559)
Branch with Infra UI enabled in Serverless. 

This exists for us to have a working environment based on main, but with
infra turned on. We could merge this at a later date when we plan to
enable Infra on serverless.

Fixes https://github.com/elastic/kibana/issues/167850
Fixes #168065
Fixes #168853
2023-10-23 11:50:50 -07:00
Elena Stoeva
6a6b83e60c
[Serverless][Index Management] Hide Storage size column in Data streams (#169280)
Fixes https://github.com/elastic/kibana/issues/167654

## Summary

This PR removes the Storage size column in Data stream in serverless as
the data stream stats API on serverless doesn't currently return the
storage size.

### How to test:

Verify that the column is not displayed in serverless:

1. Start Es with `yarn es serverless` and Kibana with `yarn
serverless-{es/oblt/security}`
2. Go to Stack Management -> Index Management -> Data Streams
3. Switch on the "Include stats" toggle
4. Verify that the "Storage size" column is not shown in the table.

Verify that the column is displayed in stateful:

1. Start Es with `yarn es snapshot` and Kibana with `yarn start`
2. Go to Stack Management -> Index Management -> Data Streams
3. Switch on the "Include stats" toggle
4. Verify that the "Storage size" column is shown in the table.


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


### 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-10-23 18:05:23 +01:00
Yulia Čech
11b1bc77a6
[Index Management] Update editable index settings for Serverless (#168884)
## Summary

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

This PR limits which index settings are displayed on the index details
page, "Settings" tab in the edit mode. On serverless only a handful of
index settings will be editable by the user. The UI only prevents
displaying some index settings, but it's still possible for the user to
type in a setting that can't be edited. That is the case on dedicated as
well.

### How to test
1. Start Serverless ES and Kibana
2. Navigate to Index Management and create a test index
3. Click on the index name and on the details page click the tab
"Settings"
4. Toggle the "Edit mode" switch and verify that only editable settings
are displayed.

#### Screenshot
<img width="527" alt="Screenshot 2023-10-16 at 20 25 49"
src="e6678cca-3494-4c63-ae66-ace9c823d12d">
2023-10-18 15:22:54 +02:00
Julia Bardi
0350f17c54
[Fleet] Task to publish Agent metrics (#168435)
## Summary

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

Added a new kibana task that publishes Agent metrics every minute to
data streams installed by fleet_server package.

Opened the pr for review, there are a few things to finalize, but the
core logic won't change much.

To test locally:
- Install fleet_server package 1.4.0 from
[this](https://github.com/elastic/integrations/pull/8145) pr to get the
mappings
- Start kibana locally, wait for a few minutes for the metrics task to
run (every minute)
- Go to discover, `metrics-*` index pattern, filter on
`data_stream.dataset: fleet_server.*`
- Expect data to be populated in `fleet_server.agent_status` and
`fleet_server.agent_versions` datasets.

<img width="1787" alt="image"
src="615af9df-fe4b-4c17-8c8c-88646c403a18">



### 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-10-18 13:49:16 +02:00
Anton Dosov
b207f24dab
[Serverless] Improve observability project empty state in analytics apps (#168598)
## Summary


fix https://github.com/elastic/kibana/issues/166233 (this is a short
term fix that removes "analytics" references from the empty state page
in serverless observability analytics apps)

![Screenshot 2023-10-17 at 12 12
53](6912940e-11ba-440d-a67d-241737f20e5d)
2023-10-17 14:58:56 +02:00
Nicolas Chaulet
c77f30f64a
[Fleet] Enable package filtering in serverless using an exclude list (#167445) 2023-10-16 12:35:34 -04:00
Yuliia Naumenko
679716d0b1
Security solution newsfeed for Serverless (#168737)
Bringing back security newsfeed for serverless project
2023-10-12 14:19:28 -07:00
Rachel Shen
f5caf787af
[Reporting][Serverless] Make screenshotting in reporting plugin optional and disable in serverless (#168373)
## Summary

Closes [#168379](https://github.com/elastic/kibana/issues/168379)

### After
In logs for yarn serverless-es
```[2023-10-09T15:09:02.887-06:00][INFO ][plugins-service] Plugin "screenshotting" is disabled.```

### 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-10-12 13:32:32 -06:00
Sergi Massaneda
c7df950bd7
[Security Solution] Static config settings for serverless (#167856)
## Summary

This PR implements a standard way to have different static settings for
the serverless and ess (stateful) environments. It centralizes flags,
which were set using different approaches previously, in a single
configuration.

This aims to make it easier for developers to enable/disable parts of
the application in serverless projects.

Default:
```
  sideNavEnabled: true,
  ILMEnabled: true,
  ESQLEnabled: true,
```

Serverless:
```
xpack.securitySolution.offeringSettings: {
    sideNavEnabled: false, # Internal security side navigation disabled, the serverless global chrome navigation is used instead
    ILMEnabled: false, # Index Lifecycle Management (ILM) functionalities disabled, not supported by serverless Elasticsearch
    ESQLEnabled: false, # ES|QL disabled, not supported by serverless Elasticsearch
  }
```

### Consume the settings

#### Server 
- Plugin parsed `ConfigType`:
`this.config.settings.ESQLEnabled`

#### UI
- Plugin attribute: 
`this.configSettings.ESQLEnabled`.
- Components can access it from Kibana services:
`useKibana().services.configSettings.ESQLEnabled;`

---------

Co-authored-by: Vitalii Dmyterko <92328789+vitaliidm@users.noreply.github.com>
2023-10-09 15:11:51 +02:00
Alejandro Fernández Haro
5475946662
[Serverless] ES should ignore the version mismatch (#168076) 2023-10-05 14:27:29 +02:00
Michael Olorunnisola
96a1ef4581
[Security Solution][Timeline] - ESQL in timeline (#166764)
## Summary

This PR leverages the work done
[here](https://github.com/elastic/kibana/pull/165596) to introduce ES|QL
into timeline. The goal of this PR is to provide security users easy
access to ESQL from within the security solution. It will be released in
`technical preview` for the 8.11 release.

<img width="1725" alt="image"
src="0e275cf7-bbce-476b-b1dc-8936427ad14f">

### Checklist

Delete any items that are not applicable to this PR.

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

---------

Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Jatin Kathuria <jtn.kathuria@gmail.com>
2023-10-04 08:34:00 +02:00
Vitalii Dmyterko
b03b2fd477
[Security Solution][Detection Engine] adds ES|QL rule type to Security Detections rules (#165450)
## Summary

- related [epic](https://github.com/elastic/security-team/issues/6196)
- introduces new ES|QL rule type in Technical Preview Stage

- historical POC architecture
[document](https://docs.google.com/document/d/1hcKzNrDEIrmoWwWoqas1YZ-bd8Kk5NRjJNSUaCvSntM/edit#heading=h.gheuu8zcz481)(internal
link). Some of the information there can be outdated, but might be
useful for historical context of some tech decision. In future, detailed
technical documentation will be added

### UI

ES|QL query component introduced in rule edit/creation form

Rule name override supports values returned from ES|QL query
As agreed on Adv. correlation WG, we don't introduce similar possibility
for risk score/severity override at this point

<details>
<summary>How it looks like in UI</summary>
<img width="2082" alt="Screenshot 2023-09-21 at 11 52 59"
src="14c94e36-ca90-496d-a7a5-4a31899d25b6">
<img width="2079" alt="Screenshot 2023-09-21 at 11 53 14"
src="9abd53ec-a0f4-4481-8b1f-4ecccdc5feae">
<img width="2072" alt="Screenshot 2023-09-21 at 12 14 17"
src="58e4f9eb-c15f-4849-bba0-bc1b92e8c945">


</details>


### Context

We introduced concept of Aggregating and Non-aggregating rules for
ES|QL. It depends on, whether STATS..BY command used in query

**Aggregating rule** - is a rule that uses
[stats…by](https://esql.docs-preview.app.elstc.co/guide/en/elasticsearch/reference/master/esql-stats-by.html)
grouping commands. So, its result can not be matched to a particular
document in ES. This can lead to possibly duplicated alerts, since we
are using document `id` to deduplicate alerts. We are going to introduce
suppression for all rule types in future, that would help to mitigate
this case
```
FROM logs*
| STATS count = COUNT(host.name) BY host.name
| SORT host.name
```

**Non-aggregating rule** - is a rule that does not use
[stats…by](https://esql.docs-preview.app.elstc.co/guide/en/elasticsearch/reference/master/esql-stats-by.html)
grouping commands. Each row in result can be tracked to a source
document in ES. For this type of rule operator \`[metadata _id, _index,
_version]\` is required to be used after defining index source. This
would allow deduplicate alerts and link them with the source document.

```
FROM logs* [metadata _id, _index, _version]
| WHERE event.id == "test"
| LIMIT 10
```

### Serverless Feature Flag

ES|QL won't be available for Serverless as for 8.11 release, so it will
be hidden by Security experimental feature flag `esqlRulesDisabled`. All
UI changes will be hidden (it's mostly Form creation) and rule type
won't be registered, which prevents rule to be created, returned in
search if it exists or execute.

### Test envs
- Serverless qa, [admin link to
project](https://admin.qa.cld.elstc.co/projects/security/ef79684f92d64f27b69e1b04de86eb1a),
disabled there
- internal
[link](https://elastic.slack.com/archives/C03E8TR26HE/p1693848029955229)
to test env for Stateful


### Rule schema changes

introduces value `esql` to `type` property
introduces value `esql` to `language` property

### Tests coverage
- cypress tests (as per 27/09/2023 added cypress tests for rule
creation/edit/details,bulk_edit))
- functional tests for rule execution(exceptions, overrides, preview and
actual rule execution)
  - functional tests for bulk_edit

 #### Flaky test runner
- [cypress esql
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3233#_),
non failed of added


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


### 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>
2023-09-30 09:45:34 +01:00
Josh Dover
a42d601fe5
[Fleet] Add retries w/ backoff to Fleet setup on Kibana boot (#167246)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Julia Bardi <90178898+juliaElastic@users.noreply.github.com>
2023-09-28 14:34:50 +02:00
Kerry Gallagher
b2271a9fd7
[Logs+] Remove configurable redirects to Discover (#167151)
## Summary

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

Removes configurable app targets. Only the standard logs app is
registered (Note: [Infra is disabled in
serverless](https://github.com/elastic/kibana/pull/165289) observability
/ security projects currently).

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-09-27 18:02:37 +01:00
Kerry Gallagher
d7e88167fa
[Logs+] Improve observability log explorer global search behaviour (#167164)
## Summary

- Closes https://github.com/elastic/kibana/issues/166854 by disabling
the Observability Log Explorer plugin in the es and security serverless
projects.

- Closes https://github.com/elastic/kibana/issues/166912 by expanding
results with `keywords`.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-09-27 12:01:36 +01:00
James Gowdy
e0ae59fa60
[ML] Switching to config files for serverless ML features (#166477)
Switches to using the serverless config file to enabled/disable ML
features rather than a function shared from the setup contract.
Storing these flags in a config file means they are already available
when setup runs and so can be used when registering integrations into
other plugins.

Removes the dependency on ML from `security_solution_serverless`,
`serverless_observability` and `serverless_search`
2023-09-21 14:46:19 +01:00
Nicolas Chaulet
e02c8740ec
[Fleet] Support registry filtering with spec.min and spec.max (#166733) 2023-09-20 10:59:19 -04:00
Mark Hopkin
238428076c
[Fleet] Show snapshot version in agent upgrade modal + allow custom values (but not in serverless) (#165978)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-09-11 12:56:39 +02:00
Carlos Crespo
7ba355483f
[Infra] Disable infra plugin in serverless projects (#165289)
closes https://github.com/elastic/kibana/issues/158925

## Summary

This PR disables the infra plugin in the `oblt` and `security` projects

### Oblt
**Navbar**
<img width="300" alt="image"
src="f88fd2a5-ed58-4bcf-b5ad-5b25357daf5c">

**Saved Objects**
<img width="800" alt="image"
src="4140760c-2572-4391-8977-bc97fcd14bb8">



**Server-side APIs**
<img width="800" alt="image"
src="eb22b024-dfd5-4c7f-b760-bfd2c633f759">

**Infra routes**
/metrics/inventory

<img width="500" alt="image"
src="6ddba766-c6f0-40d0-9183-2bcbae348d52">

**Alert rules**
<img width="300" alt="image"
src="d03d087e-d562-425b-a4d9-a17d5fe0b158">


### APM

Infra links hidden in the Transaction "Investigate" pop up menu
<img width="800" alt="image"
src="d9364d55-6e06-4ac0-8668-6ce2331a6250">

Infra links removed from Services Overview Instance actions
<img width="800" alt="image"
src="73410e5c-be6c-4174-8df0-76fb6a25b2f6">

** Server Routes **

<img width="800" alt="image"
src="488f639b-81e8-497d-a55e-4e7f31644bc5">

<img width="800" alt="image"
src="4366005a-2eb8-4f33-8d1e-09865cad06b4">

<img width="800" alt="image"
src="46b34d0d-8171-4d8d-bfb8-fd4c32583fbb">





### Security

**Saved Objects**
<img width="800" alt="image"
src="14f08e7e-565b-42e9-8fc4-753d1b54c14a">



**Server-side APIs**
<img width="800" alt="image"
src="eb22b024-dfd5-4c7f-b760-bfd2c633f759">

**Infra routes**
/metrics/inventory

<img width="500" alt="image"
src="6ddba766-c6f0-40d0-9183-2bcbae348d52">


### How to test

- Start a local ES instance
- run `yarn serverless-oblt` and `yarn serverless-security`
- Validate the screenshots above.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-09-08 15:05:28 +02:00
Rodney Norris
2490b5dec6
[Serverless Search] Disable Grok debugger & Painless Lab (#165772)
## Summary

Updated the grok debugger and painless lab plugins to handle the
`enabled` config flag so they can easily be disabled for serverless
search.

### Screenshots
Before:

![image](7552954b-11f1-4c6f-9007-148a8c765c3f)

After:
<img width="1914" alt="image"
src="ad48ba1b-0f1d-4da3-aeac-4868781f6832">
2023-09-07 15:26:23 -07:00
Alexi Doak
03f0cdc327
[ResponseOps][Alerting] Create xpack.actions.queued.max circuit breaker (#164632)
Resolves https://github.com/elastic/kibana/issues/162264


## Summary

Adds a limit on the maximum number of actions that can be queued with a
circuit breaker. The limit in serverless is set to 10,000, and 1,000,000
in the other environments.

- If a rule execution exceeds the limit, the circuit breaker kicks in
and stops triggering actions.
- Alerting rule's status updated to warning when circuit breaker is hit

Did not update the `enqueueExecution` bc it's going to be removed in
https://github.com/elastic/kibana/pull/165120.


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


### To Verify

- Create a 2 rules that have actions
- Set `xpack.actions.queued.max` in kibana.yml to a low number like 2 or
3
- Use the run soon button to queue up actions and hit the circuit
breaker.
- The actions will not be scheduled and the rule status will be set to
warning

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-09-07 06:59:01 -07:00
Shahzad
6969803357
[Serverless] Disable synthetics and uptime in serverless (#165898)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-09-07 14:09:35 +02:00
Jiawei Wu
456f47f3ab
[RAM] Introduce maxScheduledPerMinute rule circuit breaker and route (#164791)
## Summary
Resolves: https://github.com/elastic/kibana/issues/162262

This PR is the backend changes to add a circuit breaker
`xpack.alerting.rules.maxScheduledPerMinute` to both serverless and
other environments that limits the number of rules to 400 runs / minute
and 10000 runs / minute, respectively. There will be another PR to
follow this one that gives the user UI hints when creating/editing rules
that go over this limit.

This circuit breaker check is applied to the following routes:
- Create Rule
- Update Rule
- Enable Rule
- Bulk Enable Rule
- Bulk Edit Rule

Also adds a new route: `/internal/alerting/rules/_schedule_frequency` to
get the current total schedules per minute (of enabled rules) and the
remaining interval allotment.

### 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>
Co-authored-by: lcawl <lcawley@elastic.co>
Co-authored-by: Xavier Mouligneau <xavier.mouligneau@elastic.co>
2023-09-06 09:13:36 -07:00
Sander Philipse
b335c3abbc
[Search] Extract connectors to package (#165590)
## Summary

This moves connectors functions to a shared package so Serverless Search
and Enterprise Search can both use it.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-09-06 14:33:05 +02:00
Stratoula Kalafateli
5d6812966a
[ES|QL] Technical preview in Discover and Dashboards (#146971)
## Summary

Closes https://github.com/elastic/kibana/issues/137810
Part of https://github.com/elastic/kibana/issues/163248

This PR is the **first iteration** of the new ES|QL language in kibana.
The majority of the functionality is based on the existing functionality
for SQL (which has already been merged). This builds on top of it to
enable the functionality for ES|QL. We decided to remove SQL for now so
this PR enables ES|QL and hides SQL. We are not removing the code for
now.

### Important notes:
- This PR contains basic autocomplete functionality for the ES|QL
commands. We want to improve it in follow up PRs
- The majority of the tests for SQL were moved to work with ES|QL
instead
- The search strategy is a very simple endpoint for now as we don't have
async search nor pagination
- Now that we remove SQL, the ui for ES|QL selection has changed
- The documentation for ESQL has been handled by the docs team so it is
already reviewed and in sync with the official documentation
- ES|QL is disabled in serverless projects for now

### Changes from SQL:
- The Discover histogram now is being created with ES|QL (using the
date_trunc function). This gives it the ability to be saved on a
dashboard and also to be edited inline.
- ES|QL sometimes returns some warnings (on the search headers). For
example when we are trying to date parse a string that doesnt contain a
valid date). These warnings are also reported on the UI. There is a bug
in ES and the warning doesnt come always
https://github.com/elastic/elasticsearch-internal/issues/1465)
- We have 2 types of commands:
- Transformational commands (keep, stats) -> when they exist in the
query Discover should render the Table view (selected columns)
- Non transformational commands (all the others) -> in that case
Discover renders the Document view
  - ESQL switch on advanced settings is now on by default


**Discover view with non transformational commands**
<img width="1678" alt="image"
src="abe100e1-01e9-4fe0-9b89-6d8bdf6443fc">


**Discover view with transformational commands**
<img width="1679" alt="image"
src="e46af422-daeb-4be5-88cf-522211674ff5">


### Missing
- ESQL autocomplete is not perfect, we are going to work on it on a
future PR. Specifically:
- There is a bug in autocomplete, sometimes writing a query overwrites
the existing one, will deal with it in a future PR
  - Further improvements

### Checklist

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

---------

Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
Co-authored-by: Peter Pisljar <peter.pisljar@elastic.co>
Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
Co-authored-by: Davis McPhee <davis.mcphee@elastic.co>
2023-09-01 12:22:00 +03:00
Alejandro Fernández Haro
0ea37c1b42
[On-Week] Hot update of APM/EBT labels (#157093) 2023-08-31 14:36:20 +02:00
Felix Stürmer
ad59308b24
[Log Explorer] Convert log explorer profile into standalone app (#164493)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani01@gmail.com>
2023-08-31 14:18:44 +02:00
Jon
aebd6f3923
[node] Enable openssl legacy provider (#163190)
This is to prevent a breaking change in a minor release of Kibana due to
an underlying upgrade of Node.js to v18.
The legacy provider can be disabled by removing
`--openssl-legacy-provider` in `config/node.options`.

[Node.js
documentation](https://nodejs.org/docs/latest-v18.x/api/cli.html#--openssl-legacy-provider)
[OpenSSL
documentation](https://www.openssl.org/docs/man3.0/man7/OSSL_PROVIDER-legacy.html)

---------

Co-authored-by: Thomas Watson <w@tson.dk>
2023-08-30 11:51:10 -07:00
Jean-Louis Leysens
5739f1f561
[Saved Objects] Remove runOnRoles: ['ui'] from serverless config (#164968)
## Summary

Enable ZDT migrations to run on `migrator` node roles (the default).

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

|---------------------------|-------------|----------|-------------------------|
| Issues when rolling out Kibana's | Med. | Low | It's possible this
change could lead to interruption in internal Elastic environments |
2023-08-30 11:58:16 +02:00
Luke Elmers
d6db6b7b4a
Adjust migrations and elasticsearch service settings for serverless. (#165050) 2023-08-29 10:25:51 +02:00
Anton Dosov
243142d9c1
[Serverless Elasticsearch] Fix user is blocked from moving forward when opening Discover, Dashboard, or Visualize Library 2023-08-28 15:24:34 +01:00
Sander Philipse
7df567289a
[Search] Set up empty connectors page (#164340)
This adds an empty connectors page to the Elasticsearch project. The
Enterprise Search plugin exports relevant connectors data and functions,
the Search plugin simply consumes these.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-23 15:56:50 -05:00
Alison Goryachev
a14f76d96c
[Index Management] Disable index stats on serverless (#163849) 2023-08-23 08:18:48 -04:00
Jeramy Soucy
fe0ffab1da
Prepare the Security domain HTTP APIs for Serverless (#162087)
Closes #161337

## Summary

Uses build flavor(see #161930) to disable specific Kibana security,
spaces, and encrypted saved objects HTTP API routes in serverless (see
details in #161337). HTTP APIs that will be public in serverless have
been handled in #162523.

**IMPORTANT: This PR leaves login, user, and role routes enabled. The
primary reason for this is due to several testing mechanisms that rely
on basic authentication and custom roles (UI, Cypress). These tests will
be modified to use SAML authentication and serverless roles in the
immediate future. Once this occurs, we will disable these routes.**

### Testing
This PR also implements testing API access in serverless.
- The testing strategy for disabled routes in serverless is to verify a
`404 not found `response.
- The testing strategy for internal access routes in serverless is to
verify that without the internal request header
(`x-elastic-internal-origin`), a `400 bad request response` is received,
then verify that with the internal request header, a `200 ok response`
is received.
- The strategy for public routes in serverless is to verify a `200 ok`
or `203 redirect` is received.

~~blocked by #161930~~
~~blocked by #162149 for test implementation~~

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@elastic.co>
2023-08-23 12:34:45 +02:00
Ersin Erdal
9079b1c60b
Enable requeue_invalid_tasks config for functional tests (#163768)
Makes isSystemAction field in RawConnector optional and enables
`requeue_invalid_tasks` config for functional tests.
2023-08-17 13:53:02 +03:00
Mike Côté
fd389ce372
Set serverless and test setting for task manager state validation (#163743)
Part of https://github.com/elastic/kibana/issues/155764.

In this PR, I'm setting the
`xpack.task_manager.allow_reading_invalid_state` serverless setting to
`false` so Kibana doesn't allow reading invalid state when loading
tasks.

I'm also doing the same for the functional tests to ensure valid task
state is always read.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-08-16 10:58:22 -07:00
Brandon Kobel
a13b6787b0
Adding serverless circuit breakers for alerting rules and actions (#163835)
## Summary

Setting circuit breakers for alerting rules and actions as previously
agreed upon in: [2023-07 Serverless Alerting Circuit
Breakers](https://docs.google.com/document/d/1Ux5IMgay5G0fAmYpVPr6WTFtE9yhutFYf_dPAfEPa5s/edit)
2023-08-15 13:14:48 -04:00
Nathan Reese
78250515ff
fix Canvas available in search in serverless (#163740)
Closes https://github.com/elastic/kibana/issues/163442

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-08-14 10:43:15 -06:00
Alison Goryachev
97f44c1e50
[Index Management] Disable legacy index templates (#163518) 2023-08-14 10:40:16 -04:00
Nicolas Chaulet
312b254266
[Fleet] Disable Fleet for serverless ES projects (#163609) 2023-08-14 10:01:54 -04:00
Stratoula Kalafateli
8511078c19
[Graph] disable application in serverless (#163582)
## Summary

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

This PR disables graph in serverless. Specifically:

- creates a serverless yml setting for disabling graph
- adds the setting in serverless.yml
2023-08-14 13:21:21 +03:00
Janki Salvi
dc949ee373
[Cases] Hide cases in stack management UI (#163037)
## Summary

fixes https://github.com/elastic/kibana/issues/160337

This PR 
- hides cases in the serverless Elasticsearch project, cases APIs throw
error
- throws 403 from API when `owner=cases` for security or observability
serverless mode
- verifies the behaviour in serverless functional as well as
api_integration tests

**How to test**

- Boot up `es` serverless solution and make sure that `cases` from the
navbar is hidden and cannot not be accessible through url as well
- Boot up `observability` or `security` serverless solutions and make
sure that `cases` is available in the navbar and works fine
- Boot up classic kibana and make sure that the left navbar has the same
menu entries it always had.

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



20c1974e-44f0-45b0-80aa-e644fec148ff

### 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>
2023-08-09 17:52:36 +02:00
Miriam
adb9573cb2
Revert "[APM] Add index.fast_refresh to .apm-custom-link" (#163142)
Reverts elastic/kibana#159674

The Elasticsearch team has changed their guidance about `fast_refresh`
and want this setting to be applied from within an Elasticsearch plugin
2023-08-08 08:34:48 +01:00
Stratoula Kalafateli
0fba094cd0
[Visualizations] Serverless yml settings (#162959)
## Summary

Adds the necessary yml settings to the serverless config. These settings
are making ui changes in dashboards / visualizations editors and they
apply for all projects.

For testing run `yarn start --serverless=es` and check that the ui is
working as expected with the legacy editors (TSVB, agg based) in a read
only mode.
2023-08-07 11:57:40 +03:00
Christiane (Tina) Heiligers
f2e23d7cc0
Enable API protection in serverless (#162149) 2023-08-04 13:35:49 -07:00
Jon
bd3b54c51d
[node] Restore default Node.js 16 DNS lookup behavior (#163025)
Starting in Node.js 17 the IP address from a DNS lookup resolves in the
order returned from the resolver. Prior versions resolve with IPv4
addresses sorted before IPv6 addresses.

This restores the previous behavior. In distributions, this can be
configured via the `--dns-result-order` flag in `node.options`.

Closes #163006
[Node.js 17
changelog](https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V17.md)

[Documentation](https://nodejs.org/docs/latest-v18.x/api/cli.html#--dns-result-orderorder)

Testing

1) Resolve localhost to 127.0.0.1 and then ::1 in `/etc/hosts`
2) `yarn start`. Logs should indicate connecting to elasticsearch over
127.0.0.1:9200
2023-08-04 08:27:06 -05:00
Kurt
7770ccc19f
Removing 'showNavLinks' config option and displaying Avatar menu for serverless (#162140)
## Summary

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

The avatar menu needs to be displayed for serverless. It was previously
required to be hidden in serverless, so a config 'showNavLinks' was
added. This config is no longer needed, so it has been removed.

## Testing

Start KB with the `--serverless` flag and login as `elastic`.

The Avatar should appear in the top right coner.
2023-07-31 16:31:37 -04:00
Rachel Shen
5864674ff6
Enable CSV reporting in serverless (#162358)
## Summary

This PR sets up the reporting plugin for the serverless implementation
by adding properties to the existing reporting config.

Image reporting is enabled for dev mode but disabled for serverless.
Canvas is disabled for serverless.

## To Test

Run `yarn es snapshot --license trial` in one terminal and then `yarn
start`. Load sample data and you should be able to see the option to
have PDF and PNG reports in Dashboard's Share Menu.

![Screenshot 2023-07-25 at 9 40 30
AM](c258a14d-6cc7-4fdf-9bb1-4dc3b15d371b)

Now run `yarn es snapshot --license trial` and `yarn serverless-es`. You
should see that Dashboard's share menu does not include PDF or PNG
Reports. However there is still the option to see run CSV reports and
see the Reporting in Management.

![Screenshot 2023-07-25 at 9 42 16
AM](638691dc-6c2f-41ed-a8d3-d5d38c15fa91)


### 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>
Co-authored-by: Timothy Sullivan <tsullivan@elastic.co>
2023-07-28 14:06:01 -06:00