Commit graph

175 commits

Author SHA1 Message Date
elena-shostak
d839b03027
FTR http2 configs for security tests (#186444)
## Summary

Added FTR configs over http2 for security tests.

- `security_api_integration/oidc.http2.config.ts`
- `security_api_integration/saml.http2.config.ts`
- `security_functional/oidc.http2.config.ts`
- `security_functional/saml.http2.config.ts`

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

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

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-06-21 20:27:24 +02:00
Pierre Gayvallet
dea26c6450
Add http2 support for Kibana server (#183465)
## Summary

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

Add support for `http2` to the Kibana server. `http2` can be enabled by
setting `server.protocol: http2` in the Kibana config file.

*Note: by default, enabling `http2` requires a valid `h2c`
configuration, meaning that it can only run over HTTPS with TLS1.2+*

```yaml
## kibana.yaml
server.protocol: http2
server.ssl.enabled: true
server.ssl.key: path/to/key
server.ssl.certificate: path/my/cerf
```

## What is this PR doing

### Add HTTP2 support for the Kibana server

#### - Plug http2 to the Kibana server 

Even if HAPI was never officially updated to really support HTTP2,
node's `http`/`https`/`http2` modules are compatible enough to be able
to just instantiate an http2 server/listener and provide it to HAPI "as
a plain https listener". There were some tweaks to do (mostly silencing
a few warnings that HAPI was causing by sending http2-illegal headers
such as `Connection`), but overall, it went smoothly.

#### - Add config validation

By default, Kibana will require a valid `h2c` configuration to accept
enabling `http2`. It means that TLS must be enabled and that TLS1.2+
should at least be in the list of supported SSL protocols
(`server.ssl.supportedProtocols`). Note that default value of this
setting includes TLS1.2 and 1.3.

#### - Add escape hatch to run `h2` without `h2c`

In some situations, it may be required to enable http2 without a valid
`h2c` configuration. Kibana supports it, by setting
`server.http2.allowUnsecure` to `true`.

(*Note, however, that if http2 is enabled without TLS, ALPN protocol
negotiation won't work, meaning that most http2 agents/clients will fail
connecting unless they're explictly configured to use http2.*)

### Add documentation about this new feature

#### - Update the user-facing doc about this new `server.protocol`
setting

Update the user-facing Kibana settings documentation to include this
`http.protocol` setting (and refer to `server.http2.allowUnsecure`)

**Note: this setting, and this feature, are considered as experimental**

### Adapt our dev tooling to support running Kibana with http2 enabled

#### - Add a `--http2` flag to the dev CLI

Enabling this flag will add the proper configuration settings to run
Kibana with `http2` enabled in an (almost) valid `h2c` configutation.

*Note: when using this flag, even if listening on the same port, the
Kibana server will be accessible over https, meaning that you need to
use https in your browser to access it. Aka `http://localhost:5601`
won't work, you need to use `https://localhost:5601`. Also, we're using
the self-signed dev certificates, meaning that you must go though the
scary warning of your browser*

#### - Implement an http2-compatible base-path proxy

The current base path proxy is based on `hapi` and `hapi/h2o2`. I tried
for a bunch hours trying to hack around to make it work with http2
proxying, but ultimately gave up and implemented a new version from
scratch.

Note that with some additional efforts, this new http2 basepath proxy
could probably fully replace the existing one and be used for both http1
and http2 traffic, but it's an optimization / refactoring that did not
feel required for this PR.

### Adapt the FTR to run suites against http2

#### - Add support to run FTR test suite against an h2c-enabled Kibana

Note that with ALPN, clients using http1 should be (and are) able to
communicate with http2 Kibana, given h2c/alpn allows protocol
negitiation. So adapting our FTR tooling was not really about making it
work with http2 (which worked out of the box), but making it work with
**the self signed certifcates we use for https on dev mode**

Note that I'm not a big fan of what I had to do, however, realistically
this was the only possible approach if we want to run arbitrary test
suites with TLS/HTTP2 enabled without massively changing our FTR setup.

Operations and QA, feel free to chime in there, as this is your
territory.

#### - Change some FTR test suites to run against an HTTP2-enabled
server

I added a quick `configureHTTP2` helper function to take any "final" FTR
suite config and mutate it to enable `http2`. I then enabled it on a few
suites locally, to make sure the suites were passing correctly.

I kept two suites running with http2 enabled:
- the `console` oss functional tests
- the `home` oss functional tests

We could possibly enable it for more, but we need to figure out what
kind of strategy we want on that matter (see below)

## What is this pull request NOT doing

#### - Making sure everything works when HTTP2 is enabled

I navigated the applications quite a bit, and did not see anything
broken, however I obviously wasn't able to do a full coverage. Also, the
self-signed certificate was a huge pain to detect issues really caused
by http2 compared to issues because the local setup isn't valid `h2c`.

In theory though (famous last words) anything not doing http/1.1
specific hacks such as bfetch should work fine with http2, given that
even if using non-http2 clients, ALPN should just allow to fallback to
http/1.x (this part was tested)

#### - Enabling HTTP2 by default

PR isn't doing it for obvious reasons. 

#### - Enabling HTTP2 for all FTR suites

First of all, it's not that easy, because it requires adapting various
parts of the config (and even some var env...), and we don't have any
proper way to override config "at the end". For instance, if you add the
http2 config on a top level config (e.g. the oss functional one that is
reuse by the whole world - learned the hard way), it won't work because
higher-level configs redefined (and override) the `browser` part of the
config, loosing the settings added to run the browser in insecure mode.

Secondly, I'm not sure we really need to run that many suites with http2
enabled. I learned working on that PR that we only have like one suite
where https is enabled for the Kibana server, and I feel like it could
be fine to have the same for http2. In theory it's just a protocol
change, unless parts of our apps (e.g. bfetch) are doing things that are
specific to http/1.1, switching to http2 should be an implementation
detail.

But I'd love to get @elastic/kibana-operations and @elastic/appex-qa
opinion on that one, given they have more expertise than I do on that
area.

- Running performances tests

We should absolutely run perf testing between http/1.1 over https and
http/2, to make sure that it goes into the right directly (at least in
term of user perceived speed), but I did not do it in the scope of this
PR (and @dmlemeshko is on PTO so... 😅)

## Release Note

Add support for `http2` to the Kibana server. `http2` can be enabled by
setting `server.protocol: http2` in the Kibana config file.

Note: by default, enabling `http2` requires a valid `h2c` configuration,
meaning that it can only run over HTTPS with TLS1.2+

Please refer to the Kibana config documentation for more details.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-03 09:34:13 +02:00
Pierre Gayvallet
148eeec0fe
Update supertest and superagent to latest version (#183587)
## Summary

Related to https://github.com/elastic/kibana/issues/7104

Update supertest, superagent, and the corresponding type package, to
their latest version.

(of course, types had some signature changes and we're massively using
supertest in all our FTR suites so the whole Kibana multiverse has to
review it)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-05-17 04:23:21 -07: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
Tre
46707e46de
[FTR] Mv test subjs svc to shared location (#174048)
## Summary

Refactoring general ui service to a kbn package.

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-01-09 11:43:39 +00:00
Dzmitry Lemechko
f9a4962b48
[ftr] abort retry on invalid webdriver session (#174092)
## Summary

Since many our e2e tests use Retry service, we might have a situation
with retry running for some time (**20,30, 120 seconds** ) before
reaching timeout while browser already crashed and Webdriver is not
functioning properly.

This PR updates Retry service with checking error name before retry
attempt: if it is the WebDriver critical error, retry is aborted and we
fail test fast.

It should help with long useless logging messages as well:

Before:

```
         │ debg --- retry.try error: no such window: target window already closed
         │      from unknown error: web view not found
         │        (Session info: chrome=120.0.6099.129)
         │ debg Find.findByCssSelector('[data-test-subj="canvasExpressionInput"]') with timeout=10000
         │ debg --- retry.try failed again with the same message...
         │ debg Find.findByCssSelector('[data-test-subj="canvasExpressionInput"]') with timeout=10000
         │ debg --- retry.try failed again with the same message...
         ...
         │ERROR Browser is closed, no artifacts were captured for the failure
         └- ✖ fail: Canvas Canvas app expression editor shows autocomplete when typing
         │      retry.try timeout: NoSuchWindowError: no such window: target window already closed
         │ from unknown error: web view not found
         │   (Session info: chrome=120.0.6099.129)
         │     at Object.throwDecodedError (/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/error.js:524:15)
         │     at parseHttpResponse (/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/http.js:601:13)
         │     at Executor.execute (/Users/dmle/github/kibana/node_modules/selenium-webdriver/lib/http.js:529:28)
         │     at processTicksAndRejections (node:internal/process/task_queues:95:5)
         │     at Task.exec (prevent_parallel_calls.ts:28:20)
         │   Error: retry.try timeout: NoSuchWindowError: no such window: target window already closed
         │   from unknown error: web view not found
         │     (Session info: chrome=120.0.6099.129)
         │       at Object.throwDecodedError (node_modules/selenium-webdriver/lib/error.js:524:15)
         │       at parseHttpResponse (node_modules/selenium-webdriver/lib/http.js:601:13)
         │       at Executor.execute (node_modules/selenium-webdriver/lib/http.js:529:28)
         │       at processTicksAndRejections (node:internal/process/task_queues:95:5)
         │       at Task.exec (prevent_parallel_calls.ts:28:20)
         │       at onFailure (retry_for_success.ts:17:9)
         │       at retryForSuccess (retry_for_success.ts:59:13)
         │       at RetryService.try (retry.ts:31:12)
         │       at Proxy.clickByCssSelector (find.ts:417:5)
         │       at TestSubjects.click (test_subjects.ts:164:5)
         │       at Context.<anonymous> (expression.ts:92:7)
         │       at Object.apply (wrap_function.js:73:16)
         │
         │
       └-> "after all" hook for "shows autocomplete when typing"
         │ debg unloading docs from archive at /Users/dmle/github/kibana/x-pack/test/functional/fixtures/kbn_archiver/canvas/default.json
         │ info deleting 1 objects { space: undefined }
         │ succ 1 saved objects deleted
       └-> "after all" hook: afterTestSuite.trigger for "shows autocomplete when typing"
         │ERROR Browser window is already closed
``` 

After:

```
         │ debg --- retry.try error: no such window: target window already closed
         │      from unknown error: web view not found
         │        (Session info: chrome=120.0.6099.129)
         │ERROR Browser is closed, no artifacts were captured for the failure
         └- ✖ fail: Canvas Canvas app expression editor shows autocomplete when typing
         │      Error: WebDriver session is invalid, retry was aborted
         │       at retryForSuccess (retry_for_success.ts:64:13)
         │       at RetryService.try (retry.ts:31:12)
         │       at MonacoEditorService.getCodeEditorValue (monaco_editor.ts:25:5)
         │       at Context.<anonymous> (expression.ts:83:34)
         │       at Object.apply (wrap_function.js:73:16)
         │
         │
       └-> "after all" hook for "shows autocomplete when typing"
         │ debg unloading docs from archive at /Users/dmle/github/kibana/x-pack/test/functional/fixtures/kbn_archiver/canvas/default.json
         │ info deleting 1 objects { space: undefined }
         │ succ 1 saved objects deleted
       └-> "after all" hook: afterTestSuite.trigger for "shows autocomplete when typing"
         │ERROR Browser window is already closed
     └-> "after all" hook in "Canvas app"
       │ debg set roles = superuser
       │ debg creating user test_user
       │ debg created user test_user
     └-> "after all" hook: afterTestSuite.trigger in "Canvas app"
       │ERROR Browser window is already closed
   └-> "after all" hook: afterTestSuite.trigger in "Canvas"
     │ERROR Browser window is already closed

5 passing (17.0s)
1 failing

1)    Canvas
       Canvas app
         expression editor
           shows autocomplete when typing:

      Error: WebDriver session is invalid, retry was aborted
       at retryForSuccess (retry_for_success.ts:64:13)
       at RetryService.try (retry.ts:31:12)
       at MonacoEditorService.getCodeEditorValue (monaco_editor.ts:25:5)
       at Context.<anonymous> (expression.ts:83:34)
       at Object.apply (wrap_function.js:73:16)


```
2024-01-02 22:01:26 +01:00
Yulia Čech
a29b0f4573
[Console] Add api integration tests for serverless (#172306)
## Summary

This PR adds api integration test for Console routes: some were missing
on stateful and all are now enabled on serverless.
2023-12-05 10:26:51 +01:00
Alejandro Fernández Haro
fd09c26d15
async-import plugins in the server side (#170856)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-15 00:55:56 -07:00
Paul Bianciardi
c72d4d3372
Update new codeowners for Obs team changes (#170182)
Updates new teams as codeowners for Observability team changes.

Also took the opportunity to:
- Delete some paths that no longer exist
- Split infra code ownership between teams (from #168992)
2023-11-08 14:30:17 +00:00
Maxim Palenov
58adee01a0
[Security Solution] Support Serverless Cypress tests with different roles (#169017)
**Addresses:** https://github.com/elastic/kibana/issues/164451

## Summary

This PR allows to run role based reused between ESS and Serverless Cypress tests.

## Details

The main idea behind is to make environmental differences for tests unnoticeable. As Serverless env already has roles and users but ESS env allows to create any possible role and user we just need to create Serverless roles and corresponding users + specific ESS roles and corresponding users in ESS env before running any ESS tests. This way tests will run in a similar env and don't have to bother by roles/users creation in test suites. This is achieved by using separate Cypress support files (Cypress includes `support/e2e.js` by default) `ess_e2e.ts` and `serverless_e2e.ts` executed for corresponding environments. `ess_e2e.ts` contains logic to create mentioned above roles and users while `serverless_e2e.ts` doesn't contain such logic.

_Only one user created per role and user has the same name as its corresponding role with `changeme` password._

To have an ability to create roles we need to store their definitions somewhere. It's also convenient to have JSON definitions instead of YAML. Plus Serverless roles should be pulled from `project-controller` repo but it's not addressed in this PR. I've chosen the following locations

- Serverless Security roles in `packages/kbn-es/src/serverless_resources/security_roles.json`. While `@kbn/es` is a common package it has `serverless_resources` folder containing `roles.yml` with a mix of `https://github.com/elastic/project-controller/blob/main/internal/project/observability/config/roles.yml`, `https://github.com/elastic/project-controller/blob/main/internal/project/esproject/config/roles.yml` and `https://github.com/elastic/project-controller/blob/main/internal/project/security/config/roles.yml` copied from `project-controller` and used for ES data restore. As there is no automation yet it looks logical to keep Security roles subset next to ES Serverless resources.
- ESS Security specific roles in `x-pack/plugins/security_solution/common/test/ess_roles.json`

On top of that the following has been done

- `reader` role replaced  with `t1_analyst` where possible in tests (besides `e2e/explore/cases/attach_alert_to_case.cy.ts` but it's purely ESS test so it's fine) as `reader` is ESS specific and make harder to run the same tests in ESS and Serverless environments but both roles are almost equivalent
- `login()` helper function accepts all known roles (Serverless + ESS) but throws an exception if a custom ESS role is used under Serverless env
- `x-pack/plugins/security_solution/server/lib/detection_engine/scripts/roles_users` isn't necessary anymore as `security_roles.json` + `ess_roles.json` contain all the necessary data to create roles and users

### Does it enable role support for MKI environments?

No. This PR only enabling role support for Non-MKI Serverless environments. MKI env has predefined roles but not users. This will be addressed in a follow up PR.

## Flaky test runner

Two unskiped in this PR Serverless Cypress tests using non default role `detection_response/detection_alerts/missing_privileges_callout.cy.ts` and `detection_response/prebuilt_rules/prebuilt_rules_install_update_authorization.cy.ts`  [150 runs](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3723) 🟢 (there is one env related failure but it doesn't look related to the changes in this PR)
2023-10-31 09:39:47 -07:00
Alejandro Fernández Haro
5bbae7f14e
Add meta to the FTR logs to make them more actionable (#169456) 2023-10-26 10:37:58 +02:00
Dzmitry Lemechko
ac8d73ac6d
[ftr] fix test users for serverless (#161280)
## Summary

This PR fixes few issues occurring while running FTR API tests against
actual serverless project.

How to run:
```
TEST_CLOUD=1 ES_SECURITY_ENABLED=1 NODE_TLS_REJECT_UNAUTHORIZED=0 TEST_ES_URL=<your_es_url_with_credentials> TEST_KIBANA_URL=<your_es_url_with_credentials> node  --no-warnings scripts/functional_test_runner --es-version=8.9.0 --config x-pack/test_serverless/api_integration/test_suites/search/config.ts --bail
```

The first error is faced during Elasticsearch version validation

```
ERROR Error: attempted to use the "es" service to fetch Elasticsearch version info but the request failed: ResponseError: {"ok":false,"message":"Unknown resource."}
          at SniffingTransport.request (/Users/dmle/github/kibana/node_modules/@elastic/transport/src/Transport.ts:535:17)
          at processTicksAndRejections (node:internal/process/task_queues:96:5)
          at Client.InfoApi [as info] (/Users/dmle/github/kibana/node_modules/@elastic/elasticsearch/src/api/api/info.ts:60:10)
          at FunctionalTestRunner.validateEsVersion (functional_test_runner.ts:129:16)
          at functional_test_runner.ts:64:11
          at FunctionalTestRunner.runHarness (functional_test_runner.ts:251:14)
          at FunctionalTestRunner.run (functional_test_runner.ts:48:12)
          at log.defaultLevel (cli.ts:112:32)
          at run.ts:70:7
          at withProcRunner (with_proc_runner.ts:29:5)
          at run (run.ts:69:5)
          at FunctionalTestRunner.validateEsVersion (functional_test_runner.ts:131:13)
          at processTicksAndRejections (node:internal/process/task_queues:96:5)
          at functional_test_runner.ts:64:11
          at FunctionalTestRunner.runHarness (functional_test_runner.ts:251:14)
          at FunctionalTestRunner.run (functional_test_runner.ts:48:12)
          at log.defaultLevel (cli.ts:112:32)
          at run.ts:70:7
          at withProcRunner (with_proc_runner.ts:29:5)
          at run (run.ts:69:5)
```

Since there is no version term in case of serverless, we can skip
version check by using newly added to FTR schema `serverless` property
(`false` by default). It is set to `true` in root FTR config
`/shared/config.base`.

The next error is related to ESArchiver relying on `ES` FTR service to
provide ESClient.

```
ResponseError: security_exception
   │ 	Root causes:
   │ 		security_exception: unable to authenticate user [system_indices_superuser] for REST request [/kibana_sample_data_flights]
```

It is fixed by using the default user (from host url) instead of
`system_indices_superuser` we use in stateful run.
2023-07-10 10:09:07 +02:00
Lukas Olson
4b7d18b5c3
[bfetch] Use versioned router (#161317)
## Summary

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

Uses the new versioned router capabilities for the bfetch plugin.

### Checklist

- [ ]
[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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-07-07 16:48:02 -07:00
Matthew Kime
26d4ba5c3e
[data views] Use versioned router for REST routes (#158608)
## Summary

Version alllll the data view routes.

Best viewed with whitespace hidden -
https://github.com/elastic/kibana/pull/158608/files?diff=unified&w=1

In this PR:
- All REST (public and internal) routes are versioned
- Internal routes are called with version specified
- Internal and public routes are now stored in directories labeled as
such
- All routes have a response schema
- All responses are typed with `response` types, separate from internal
api types. This is to help prevent unacknowledged changes to the api.
- Moves some functional tests from js => ts

For follow up PRs:
- Move to `internal` path for internal routes
- Proper typing and schema for `fields_for_wildcard` filter

Closes https://github.com/elastic/kibana/issues/157099
Closes https://github.com/elastic/kibana/issues/157100

---------

Co-authored-by: Julia Rechkunova <julia.rechkunova@gmail.com>
2023-06-12 22:01:03 -05:00
Lukas Olson
34ada8a9a6
[data.search] Use versioned router (#158520)
## Summary

Step 1 of https://github.com/elastic/kibana/issues/157095.

Uses the new versioned router capabilities for the search routes (`POST`
and `DELETE`).

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

### 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>
Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
2023-06-07 10:33:39 +02:00
Rachel Shen
50a4fc4916
[Shared UX] Adoption of Shared UX Route component (#150357)
## Summary

This PR removes all imports of Route from react-router-dom and
'@kbn/kibana-react-plugin/public' and instead imports Route from
@kbn/shared-ux-router.

### Context
Based on
https://github.com/elastic/kibana/issues/132629#issue-1243243678 This PR
executes steps 2 - 4:

> 2. To make the transition easier, we want to re-export other
react-router-dom exports alongside the modified' Route'.
> 3. Solutions should start using that Route component in place of the
one from react-router-dom. I.e. replace all occurrences of import { ...
} from 'react-router-dom' with import { ... } from
'@kbn/shared-ux-router'.
> 4. All manual calls to useExecutionContext are not needed anymore and
should be removed.

### Future PR

Looks like this might be getting worked on in:
https://github.com/elastic/kibana/pull/145863 (thanks!)

> Introduce an ESlint rule that ensures that react-router-dom is not
used directly in Kibana and that imports go through the new
@kbn/shared-ux-router package.

This is tangentially accomplished through
https://github.com/elastic/kibana/pull/150340 but only addresses using
Route through @kbn/kibana-react-plugin/public'


### 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: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
2023-02-14 19:25:04 +00:00
Spencer
1b85815402
[packages] migrate all plugins to packages (#148130)
Fixes https://github.com/elastic/kibana/issues/149344

This PR migrates all plugins to packages automatically. It does this
using `node scripts/lint_packages` to automatically migrate
`kibana.json` files to `kibana.jsonc` files. By doing this automatically
we can simplify many build and testing procedures to only support
packages, and not both "packages" and "synthetic packages" (basically
pointers to plugins).

The majority of changes are in operations related code, so we'll be
having operations review this before marking it ready for review. The
vast majority of the code owners are simply pinged because we deleted
all `kibana.json` files and replaced them with `kibana.jsonc` files, so
we plan on leaving the PR ready-for-review for about 24 hours before
merging (after feature freeze), assuming we don't have any blockers
(especially from @elastic/kibana-core since there are a few core
specific changes, though the majority were handled in #149370).

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-08 21:06:50 -06:00
Thomas Watson
50444bbd59
Change default value of csp.disableUnsafeEval to 'true' (#150157)
This change ensures that the `unsafe-eval` source expression isn't included in
the Kibana Content Security Policy (CSP) by default.

Users can set `csp.disableUnsafeEval: false` to reintroduce `unsafe-eval`.
However, since this config option is deprecated as of this commit, it's
recommended to instead set `csp.script_src: ['unsafe-eval']`.

Closes #150156
2023-02-07 07:07:13 -05:00
Spencer
c8f83ed2eb
Move real plugins out of 'fixtures' dirs (#148756)
The location of plugins was previously somewhat irrelevant, but as we
move into packages it's more important that we can find all plugins in
the repository, and we would like to be able to do that without needing
to maintain a manifest somewhere to accomplish this. In order to make
this possible we plan to find any plugin/package by spotting all
kibana.json files which are not "fixtures". This allows plugin-like code
(but not actual plugin code) to exist for testing purposes, but it must
be within some form of "fixtures" directory, and any plugin that isn't
in a fixtures directory will be automatically pulled into the system
(though test plugins, examples, etc. will still only be loaded when the
plugin's path is passed via `--plugin-path`, the system will know about
them and use that knowledge for other things).

Since this is just a rename Operations will review and merge by EOD Jan
12th unless someone has a blocking concern.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-12 12:38:49 -07:00
Dzmitry Lemechko
bc2cb5dc61
[code coverage] removing instrumentation & plugin for functional tests (#148748)
## Summary

Quite awhile ago we decided to stop collecting code coverage for our
functional (e2e, api integration) FTR tests.
This is a cleanup PR to remove the code we no longer use.


### 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-01-12 16:44:48 +01:00
John Dorlus
20ebb175df
Added Rollups CCS Test (#144074)
* Removed comment of the issue that was referenced for the skip. But the tests were already skipped.

* Unskipping test as a fix has been made. 138510

* Made CCS test for rollups and made it conditional based on configuration.

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Fixed issues in build.

* Added comment to rollups test and using super user until the perms issue is fixed.

Co-authored-by: cuffs <cuffs@cuffss-Office-MacBook-Pro.local>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-10-28 15:20:50 -04:00
Spencer
50b3b57d9e
[ftr] add first-class support for playwrite journeys (#140680)
* [ftr] add first-class support for playwrite journeys

* [CI] Auto-commit changed files from 'node scripts/generate codeowners'

* fix jest test

* remove ability to customize kibana server args, if we need it we can add it back

* remove dev dir that doesn't exist

* fix typo

* prevent duplicated array converstion logic by sharing flag reader

* remove destructuring of option

* fix scalability config and config_path import

* fix start_servers args and tests

* include simple readme

* fix jest tests and support build re-use when changes are just to jest tests

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-09-22 01:06:46 -07:00
Dzmitry Lemechko
7b0033f68c
[scalability testing] store relative path to kbnArchives/esArchives in dataset extractor output file (#139891)
* update journeys, save testData in output json

* fix config inheritance

Co-authored-by: spalger <spencer@elastic.co>
2022-09-01 18:34:40 +02:00
Tim Sullivan
160058a8c1
[search/public] expose showWarnings(inspector) method on search service (#138342)
* add showWarning to search service

* add comments

* add unit tests

* test foo

* cleanup

* add s to property name in test

* comments for api items

* use the warnings when calling showWarnings

* change showWarning to just show a single warning

* put handleWarnings on the request adapter

* comment

* simplify 1

* fix lens unit test

* remove underscoring for unused variables

* revert inspector changes, extract the response warnings in the search service

* fix bug

* remove console.log

* re-apply typescript fixes to app test code

* declutter

* add test, improve comments

* fix some unexported public api items

* include rawResponse in the warning structure

* fix lint

* tweak clean up example app

* SearchResponseWarnings and SearchResponseWarningNotification

* fix export bug

* not include shardStats if there are no warnings

* Update src/plugins/data/common/search/types.ts

* simplify SearchResponseWarnings interface

* remove array copying

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* comments for api_docs

* simplify per feedback

* Pass callback to handleResponse in showWarnings

* export more public types

* update example to make possible to show shard failure

* pr cleanup

* eslint fix

* allow example app to not show default warnings

* move extractWarning and related types to inspector plugin

* wip functional test of example app

* fix test references

* finish functional test

* relocate extractWarnings back to search/fetch

* fix test

* remove need for isTimeout, isShardFailure

* ts fix

* improve test

* Change showWarnings to accept the RequestAdapter

* use showWarnings in vis_types/timeseries

* more tests

* use handle_warning name

* fix ts

* add reason field to SearchResponseWarning

* fix component snapshot

* update comments

* test cleanup

* fix test

* ensure notification appears only once

* fix and cleanup

* fix ts

* fix response.json bug

* use top-level type, and lower-level reason.type

* cleanup

* fix shard failure warning in tsvb per feedback

cc @flash1293

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
2022-08-31 11:22:24 -07:00
Carlos Crespo
b58d07e05b
[Stack Monitoring] Add OpenTelemetry metrics to Monitoring Collection plugin (#135999)
* Add otel metrics to alerting plugin

* clean up otel poc

* Bump @opentelemetry/api-metrics and @opentelemetry/exporter-metrics-otlp-grpc versions to 0.30.0

* Add integration test for prometheus endpoint; improve reademe.md

* Fix tsconfig.base.json missing entries

* Bump @opentelemetry/sdk-metrics-base; clean up

* Rename PrometheusExporter properties

* Readme formatting tweaks

* Fix incorrect path

* Remove grpc dependency

* Add grpc back for handling auth headers

* Fix comment positioning

* Include authenticated OTLP in readme

* Extract dynamic route into a new file

* Enable otlp logging and compatibility with env vars

* Enable OTEL_EXPORTER_OTLP_ENDPOINT env var

Co-authored-by: Mat Schaffer <mat@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-07-14 13:29:09 +02:00
Spencer
f5688a68a5
[ftr] rework kibana arg parsing, extend loggers correctly (#135944) 2022-07-08 08:54:56 -05:00
Thomas Watson
dc9f2732a1
Add csp.disableUnsafeEval config option to remove the unsafe-eval CSP (#124484)
Adds a new experimental Kibana setting called `csp.disableUnsafeEval` which will default to `false`. When set to `true`, it will remove `unsafe-eval` from our CSP.

Also introduces a new module called `@kbn/handlebars` which is a replacement for the official `handlebars` module used in the frontend. This new module is necessary in order to avoid calling `eval`/`new Function` from within `handlebars` which is not allowed once `unsafe-eval` is removed from our CSP.

The `@kbn/handlebars` module is simply an extension of the main `handlebars` module which adds a new compile function called `compileAST` (as an alternative to the regular `compile` function). This new function will not use code-generation from strings to compile the template but will instead generate an AST and return a render function with the same API as the function returned by the regular `compile` function.

This is a little bit slower method, but since this is only meant to be used client-side, the slowdown should not be an issue.

The following limitations exists when using `@kbn/handlebars`:

The Inline partials handlebars template feature is not supported.

Only the following compile options will be supported:
- `knownHelpers`
- `knownHelpersOnly`
- `strict`
- `assumeObjects`
- `noEscape`
- `data`

Only the following runtime options will be supported:
- `helpers`
- `blockParams`
- `data`

Closes #36311
2022-05-23 11:01:56 -07:00
Spencer
f3d69b8197
[@kbn/dev-utils] break out more pieces (#132292)
* [@kbn/dev-utils] break out more pieces

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-05-17 11:19:20 -05:00
Dzmitry Lemechko
80427ea1ba
[scalability testing] extend FTR config with optional scalability configuration (#132047)
* [scalability testing] extend FTR config

* update schema with defaults for testData
2022-05-11 20:29:30 +02:00
Pierre Gayvallet
e4c11e3f39
Newsfeed: always use feeds.elastic.co (#131786)
* Newsfeed: always use `feeds.elastic.co`

* fix FTR test
2022-05-10 09:16:15 +02:00
Spencer
2a78f350e1
break out parts of @kbn/dev-utils (#130509)
* break out parts of @kbn/dev-utils

* autofix imports and kbn/pm dist

* update readme for @kbn/stdio-dev-helpers

* finish renames
2022-04-19 12:24:58 -05:00
spalger
3730dd0779 fix all violations 2022-04-16 01:37:30 -05:00
Dmitry Tomashevich
0427952e76
[Discover] Extend Elasticsearch query rule with search source based data fetching (#124534)
* [Discover] introduce .index-threshold rule

* [Discover] change filters in alert expression

* [Discover] fix cursor issue

* [Discover] add loading

* [Discover] separate validation params

* [Discover] add view alert route

* [Discover] enable "view in app" for alert created from discover

* [Discover] fix filter popover

* [Discover] fix linting, unit tests

* [Discover] fix remaining tests

* [Discover] add unit tests, add link back to stack management for es query

* Update src/plugins/discover/public/application/view_alert/view_alert_route.tsx

* [Discover] add tool tip for data view without time field

* [Discover] add info alert about possible document difference that triggered alert and displayed documents

* [Discover] update unit test

* [Discover] fix unit tests

* Update x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type/alert_type.ts

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type/alert_type.ts

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type/alert_type.ts

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update src/plugins/discover/public/application/main/components/top_nav/open_alerts_popover.tsx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* [Discover] fix unit tests

* [Discover] fix security solution alerts

* [Discover] fix eslint errors

* [Discover] fix unit tests

* Update x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type/alert_type.ts

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* Update x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type/alert_type.ts

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* [Discover] apply suggestions

* [Discover] fix tests

* Update x-pack/plugins/stack_alerts/server/alert_types/es_query/alert_type/alert_type.ts

* [Discover] remove close button in filters

* Improve code structure

* Fix missing name in fetchEsQuery

* Fix messages

* Fix messages, again

* Refactor

* Refactor, add tests + a bit more of documentation

* Move size field, change text

* Implement readonly callout

* change icon in callout

* add padding to popover

* Hide query and filter UI if there are no values to display

* [Discover] add unit test, improve comparator types

* [Discover] fix linting and unit test

* [Discover] add es query alert integration tests

* [Discover] fix linting

* [Discover] uncomment one expect

* [Discover] fix latesTimestamp for searchSource type, unify test logic

* Update x-pack/plugins/stack_alerts/public/alert_types/es_query/expression/search_source_expression.tsx

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>

* [Discover] apply suggestions

* [Discover] make searchType optional, adjust tests

* [Discover] remove updated translations

* [Discover] apply suggestions

* [Discover] fix unit test

* [Discover] close popover on alert rule creation

* [Discover] apply suggestions

* [Discover] add first functional test

* [Discover] implement tests

* Move functionals x-pack since ssl is needed

* Fix potential flakiness in functional test

* [Discover] remove timeout waiter

* Fix functional test

- adding permissions to fix the functional

* [Discover] add logger

* [Discover] add more log points

* [Discover] wait for indices creation finished

* Try to fix the functional flakiness
- by creating data views in a serial way
- lets see if that work

Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
Co-authored-by: andreadelrio <andrea.delrio@elastic.co>
2022-04-01 14:57:57 +05:00
Spencer
0821c31fa5
[ftr] implement support for accessing ES through CCS (#126547)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-03-07 15:27:41 -07:00
Spencer
be1028c345
[functional/security/test-user] remove naked boolean (#126652)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-03-03 08:56:56 -07:00
Robert Oskamp
befefc3347
FTR - check ES security before creating system_indices_superuser (#124948)
This PR adds a check if ES security is enabled before creating the system_indices_superuser in the security service.
2022-02-08 16:32:10 +01:00
Robert Oskamp
8989ead2d6
Functional test runner creates system_indices_superuser (#124008)
This PR fixes the functional test runner for execution against cloud (and other existing deployments) by making sure the system_indices_superuser exists.
2022-02-04 11:23:47 +01:00
Matthew Kime
f3ff2291f5
less deprecated index pattern apis (#124313) 2022-02-02 10:39:59 -06:00
Alejandro Fernández Haro
7dedc8871c
[Fixtures/Newsfeed] Server-side importing public types (#123923) 2022-01-27 17:08:25 +01:00
Rudolf Meijering
c64c766444
Log deprecations originating from Kibana on debug level (#123660)
* Log deprecations originating from Kibana on debug level

* Surface debug level deprecation logs on CI

* Review feedback
2022-01-25 04:38:05 -07:00
Tyler Smalley
23739f5f4d
Support for superuser not having write access (#123337)
Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
Co-authored-by: Timothy Sullivan <tsullivan@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-01-24 09:39:08 -08:00
Aleh Zasypkin
2ba281b8aa
Cleaning up after DLS functional tests. (#122426) 2022-01-11 09:50:57 +01:00
Rudolf Meijering
1a6a9ae438
Surfacing deprecations with rich context from ES warning header (#120044)
* First stab at surfacing deprecations from warning header

* Log deprecations with error level but disable logger context by default

* Don't filter out error logs from ProcRunner

* Another try at not having messages ignored on CI

* Log deprecation logs with warn not info

* Tests

* Let write() do it's writing

* Commit pre-built @kbn/pm package

* Second try to commit pre-built @kbn/pm package

* Enable deprecation logger for jest_integration even though logs aren't interleaved

* Apply suggestions from code review

Co-authored-by: Luke Elmers <lukeelmers@gmail.com>

* deprecations logger: warn for kibana and debug for users

* Refactor split query and deprecation logger out of configure_client

* Unit test for tooling_log_text_writer

* Fix TS

* Use event.meta.request.params.headers to include Client constructor headers

* Fix tests

* Ignore deprecation warnings not from Elasticsearch

* Log on info level

* Log in JSON so that entire deprecation message is on one line

* commit built kbn-pm package

Co-authored-by: Luke Elmers <lukeelmers@gmail.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-12-08 18:32:44 +01:00
Frank Hassanabad
ae7b5a9be9
[Security Solutions] Adds bsearch service to FTR e2e tests to reduce flake, boilerplate, and technique choices (#116211)
## Summary

Fixes flake tests of:
https://github.com/elastic/kibana/issues/115918
https://github.com/elastic/kibana/issues/103273
https://github.com/elastic/kibana/issues/108640
https://github.com/elastic/kibana/issues/109447
https://github.com/elastic/kibana/issues/100630
https://github.com/elastic/kibana/issues/94535
https://github.com/elastic/kibana/issues/104260

Security solution has been using `bsearch` and has encountered flake in various forms. Different developers have been fixing the flake in a few odd ways (myself included) which aren't 100%. This PR introduces a once-in-for-all REST API retry service called `bsearch` which will query `bsearch` and if `bsearch` is not completed because of async occurring due to slower CI runtimes it will continuously call into the `bsearch` with the correct API to ensure it gets a complete response before returning.


## Usage

Anyone can use this service like so:
```ts
const bsearch = getService('bsearch');
const response = await bsearch.send<MyType>({
 supertest,
 options: {
   defaultIndex: ['large_volume_dns_data'],
}
  strategy: 'securitySolutionSearchStrategy',
});
```

If you're using a custom auth then you can set that beforehand like so:
```ts
const bsearch = getService('bsearch');
const supertestWithoutAuth = getService('supertestWithoutAuth');
const supertest supertestWithoutAuth.auth(username, password);
const response = await bsearch.send<MyType>({
 supertest,
 options: {
   defaultIndex: ['large_volume_dns_data'],
  }
  strategy: 'securitySolutionSearchStrategy',
});
```

## Misconceptions in the tests leading to flake
* Can you just call the bsearch REST API and it will always return data first time? Not always true, as when CI slows down or data increases `bsearch` will give you back an async reference and then your test will blow up.
* Can we wrap the REST API in `retry` to fix the flake? Not always but mostly true, as when CI slows down or data increases `bsearch` could return the async version continuously which could then fail your test. It's also tedious to tell everyone in code reviews to wrap everything in `retry` instead of just fixing it with a service as well as inform new people why we are constantly wrapping these tests in `retry`.
* Can we manually parse the `bsearch` if it has `async` for each test? This is true but is error prone and I did this for one test and it's ugly and I had issues as I have to wrap 2 things in `retry` and test several conditions. Also it's harder for people to read the tests rather than just reading there is a service call. Also people in code reviews missed where I had bugs with it. Also lots of boiler plate.
* Can we just increase the timeout with `wait_for_completion_timeout` and the tests will pass for sure then? Not true today but maybe true later, as this hasn't been added as plumbing yet. See this [open ticket](https://github.com/elastic/kibana/issues/107241). Even if it is and we increase the timeout to a very large number bsearch might return with an `async` or you might want to test the `async` path. Either way, if/when we add the ability we can increase it within 1 spot which is this service for everyone rather than going to each individual test to add it. If/when it's added if people don't use the bsearch service we can remove it later if we find this is deterministic enough and no one wants to test bsearch features with their strategies down the road.

## Manual test of bsearch service
If you want to manually watch the bsearch operate as if the CI system is running slow or to cause an `async` manually you manually modify this setting here:
https://github.com/elastic/kibana/blob/master/src/plugins/data/server/search/strategies/ese_search/request_utils.ts#L61

To be of a lower number such as `1ms` and then you will see it enter the `async` code within `bsearch` consistently

## Reference PRs
We cannot set the wait_for_complete just yet
https://github.com/elastic/kibana/issues/107241 so we decided this was the best way to reduce flake for testing for now. 

### 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
2021-10-27 14:22:45 -06:00
Mikhail Shustov
3c8fa527a7
[ES] Upgrade client to v8.0 (#113950)
* bump to a pre-8.0 version

* export KibanaClient from /lib sub-folder

* workaround the problem of the absence of estypes

* update es client usage in pacakges

* export estypes from another path

* import errors from root

* import errors from root 2

* update transport import

* update import path for /api/types

* update import path for /api/types

* import errors from top export

* use TransportResult instead if ApiResponse

* fix errors in client_config

* fix src/core/server/saved_objects/migrationsv2/actions/integration_tests/actions.test.ts

* use KibanaClient in mock. we dont export the original Client

* fix client mocks

* fix errors on SO

* fix remaining core errors

* update estype import path

* fix errors in data plugin

* fix data_views

* fix es_ui_shared

* fix errors in interactive_setup

* fix errors in ./test folder

* add @elastic/transport to the runtime deps

* fix errors in packages

* fix erros in src/core

* fix errors in test/

* fix an error in actions plugin

* woraround and fix errors in APM plugin

* fix errors in canvas

* fix errors in event_log

* fix errors in fleet

* fix errors in ILM

* fix errors in infra

* fix errors in ingest_pipeline

* fix errors in lens

* fix errors in license_management

* fix errors in licensing

* fix errors in logstash

* fix errors in ml

* fix errors in monitoring

* fix errors in observability

* fix errors in rule_registry

* fix errors in reporting

* fix errors in rule_registry

* fix errors in security

* fix errors in security_solution

* fix errors in snapshot_restore

* fix errors in transform

* fix errors in UA

* fix errors in uptime

* fix errors in x-pack/test

* fix eslint errors

* fix new errors

* use default HTTP Connection. Undici does not support agent config options keepAlive and maxSockets

* create does not accept require_alias option

* update deps

* use transport types exported from ES client package

* fix ErrorCause | string errors

* do not use enum

* fix errors in data plugin

* update x-pack code

* fix transport

* fix apm search request

* do not crash on reporting

* fix kbn-test build

* mute reporting error to start

* fix ftr build

* another attempt

* update import path

* address or mute new errors

* REMOVE me. pin transport version temporarily.

* remove deep imports from transport package

* fix jest crash

* fix product check tests

* remove unnecessary ts-expect-error

* fix a few failed unit tests

* bump to canary 24

* remove unnecessary ts-expect-error

* remove dependency on transport

* fix types in tests

* mute errors in xpack tests

* product check doesn;t  spam in logs anymore

* filterPath --> filter_path

* ignoreUnavailable --> ignore_unavailable

* ignoreUnavailable --> ignore_unavailable

* trackScores --> track_scores

* trackTotalHits --> track_total_hits

* fix es-arcives

* fix data plugin crashes

* fix watcher test utils

* rollback unnecessary changes

* fix another problem in es-archiver

* fix scroll. for whatever reason scroll fails when request scroll_id in body

* add meta: true in kbn-securitysolution-es-utils

* bump client to canary 25

* fix errors in accordance with the es client spec

* update securityscolution-es-utils

* unify scroll api in reporting and fix tests

* fix unit tests in watcher

* refactor APM to abort request with AbortController API

* fix missing es client calls in tests

* fix missing meta in detection engine FTR tests

* fix another bunch of errors in js tests

* fix wrong coercion

* remove test-grep pattern

* fix apm unit test

* rename terminateAfter to terminate_after in infra plugin

* rename terminateAfter to terminate_after in uptime plugin

* rename terminateAfter to terminate_after in apm plugin

* fix security roles FTR tests

* fix reference

* fix post_privilidges test

* fix post_privilidges

* bump client to 26

* add meta for index_management test helpers

* remove ts-expect-error caused by bad type in reason

* bump client to 27

* REMOVE me. workaround until fixed in the es client

* fix incorrect type casting

* swtich from camelCase params

* use `HttpConnection` for FTR-related clients

* bump client to 29

* Revert "REMOVE me. workaround until fixed in the es client"

This reverts commit c038850c09.

* fix new util

* revert repository changes

* do not crash if cannot store event_loop data

* fix new estypes imports

* fix more types

* fix security test types and add ts-ignore for custom ES client

* fix more estypes imports

* yet more ts violations

* line by line fixing is hard

* adapt `evaluateAlert` from infra as it's also used from FTR tests

* use convertToKibanaClient in FTR test instead of meta:true in plugin code

* migrate from deprecated API in fleet

* fix intergration tests

* fix fleet tests

* fix another fleet test

* fix more tests

* let's call it a day

* Removes custom header check on 404 responses, includes es client ProductNotSupportedError in EsUnavailableError conditional (#116029)

* Removes custom header check on 404 responses, includes es client ProductNotSupportedError in EsUnavailableError conditional

* Updates proxy response integration test

* disable APM until compatible with client v8

* skip async_search FTR test

* use kbnClient in integration tests

* bump version to 29

* bump to 30

* have configureClient return a KibanaClient instead of Client, remove resolved violations.

* bump to 31

* bump to 31

* Revert "bump to 31"

This reverts commit 5ac713e640.

* trigger stop to unusubscribe

* update generated docs

* remove obsolete test

* put "as" back

* cleanup

* skip test

* remove new type errors in apm package

* remove ErrorCause casting

* update a comment

* bump version to 32

* remove unnecessary ts-expect-error in apm code

* update comments

* update to client v33

* remove outdated type definition

* bump to 34 without params mutation

* unskip the test that should not fail anymore

* remove unnecessary ts-expect-error comments

* update to v35. body can be string

* move `sort` to body and use body friendly syntax

* fix a failing test. maps register the same SO that has been already registered by home

Co-authored-by: pgayvallet <pierre.gayvallet@gmail.com>
Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
2021-10-26 14:08:22 +02:00
Thomas Watson
f152787a68
Remove deprecated xpack.security.enabled config option (#111681)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-10-25 14:12:05 -04:00
Robert Oskamp
f7174809e1
Functional tests - fix retry.waitFor not timing out correctly (#113905)
This PR fixes bugs in test services, where retry.waitForWithTimeout and find.descendantExistsByCssSelector do not time out correctly.
2021-10-07 11:23:33 +02:00
Pierre Gayvallet
a4b74bd398
[8.0] Remove legacy logging (#112305)
* remove kbn-legacy-logging package

* remove legacy service

* remove legacy appender

* remove LegacyObjectToConfigAdapter

* gix types

* remove @hapi/good / @hapi/good-squeeze / @hapi/podium

* remove `default` appender validation for `root` logger

* remove old config key from kibana-docker

* fix FTR config

* fix dev server

* remove reference from readme

* fix unit test

* clean CLI args and remove quiet option

* fix type

* fix status test config

* remove from test config

* fix snapshot

* use another regexp

* update generated doc

* fix createRootWithSettings

* fix some integration tests

* another IT fix

* yet another IT fix

* (will be reverted) add assertion for CI failure

* Revert "(will be reverted) add assertion for CI failure"

This reverts commit 78d5560f9e.

* switch back to json layout for test

* remove legacy logging config deprecations

* address some review comments

* update documentation

* update kibana.yml config examples

* add config example for `metrics.ops`

Co-authored-by: Tyler Smalley <tyler.smalley@elastic.co>
2021-10-05 13:30:56 +02:00
Tre
240716d2ee
[QA][SO INFO SVC] Drop in-test jq filtering (#113655) 2021-10-04 21:02:51 +01:00
Tre
0b4a8c081c
[QA][SO INFO SVC] Add jq filtering (#113302) 2021-10-01 16:52:20 +01:00