Commit graph

436 commits

Author SHA1 Message Date
Christiane (Tina) Heiligers
f2aa1faee4
Removes non-backup rollback from upgrade kibana (#189011)
FIx https://github.com/elastic/kibana/issues/158117

Removes section on rolling back without a snapshot.

The changes made to kibana saved objects migration make the process of
rolling back without a snapshot too complex for customers to do alone.
Furthermore, rolling back without a snapshot is not recommended or
supported.

See the changes on `master`
[here](https://kibana_bk_189011.docs-preview.app.elstc.co/guide/en/kibana/master/upgrade-migrations-rolling-back.html)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2024-07-24 14:51:24 +00:00
Pierre Gayvallet
e7d093af36
[doc] fix logs configuration on deb/rpm install guide (#188900)
## Summary

Fix https://github.com/elastic/kibana/issues/87524
2024-07-24 09:01:47 +02:00
elena-shostak
cc50c8dc94
Permissions Policy Reporting (#186892)
## Summary

1. Added top-level `permissionsPolicy` configuration setting.
2. Added support for `report_to` directive.
3. Added support for `Permissions-Policy-Report-Only` header to enable
reporting mode.
4. The [spec](https://www.w3.org/TR/permissions-policy/#reporting)
mentions `featureId` in the reporting body, however the field is
`policyId` in Chromium.

## How to test

- Add in your `kibana.dev.yml`.
```
server.customResponseHeaders.Reporting-Endpoints: violations-endpoint="https://localhost:5601/kibana/internal/security/analytics/_record_violations"
server.securityResponseHeaders.permissionsPolicy: 'microphone=()'
server.securityResponseHeaders.permissionsPolicyReportOnly: 'camera=()'
```
- Make sure you have [dev tools configured for Reporting
API](https://developer.chrome.com/docs/capabilities/web-apis/reporting-api#use_devtools).
- In the browser console invoke `navigator.mediaDevices.getUserMedia({
audio: true, video: true }).catch((e) => {});`
- Open Dev Tools -> Application -> Reporting API. 
You should see 2 reports for permissions violation, one with `report`
disposition and another with `enforce` disposition.

<img width="1285" alt="Screenshot 2024-06-27 at 13 36 12"
src="3f3da7f6-f6b0-4f33-9a81-dff3db0ac2b8">


### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)

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

### Related Issue(s)
https://github.com/elastic/kibana/issues/175113,
https://github.com/elastic/kibana/issues/184939

### Release Note
Added support for Permissions Policy reporting.
2024-07-04 11:06:33 +02:00
Pierre Gayvallet
85f67dd39a
Implement elasticsearch.maxResponseSize config option (#186291)
## Summary

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

- Add a new `elasticsearch.maxResponseSize` config option 
- Set this value to `100mb` on our serverless configuration file

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-06-19 11:04:33 +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
Liam Thompson
cd223cd9b8
[DOCS] Update (Enterprise) Search ingestion tool info (#183233)
Update tools and doc links which have been outdated for a while
2024-05-13 16:57:54 +02:00
Jon
8b015ebedd
[keystore] Add password support (#180414)
This adds support a password protected keystore. The UX should match
other stack products.

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

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

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

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

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

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

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

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

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

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

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

## Password input

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


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


## Release note
Adds password support to the Kibana keystore.
2024-05-06 10:23:29 -05:00
Stef Nestor
ca181965ca
(Doc+) Kibana unavailable if backing indices write blocked (#181244)
Kibana may be unresponsive while backing indices in write block.
2024-05-03 14:19:40 -07:00
Pierre Gayvallet
6aab9948b8
Config: add support for ${VAR:default} syntax (#182139)
## Summary

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

### Release note

The Kibana configuration file now supports assigning default value for
environment variables, using the `${VAR_ENV:defaultValue}` syntax.
2024-05-01 07:55:24 +02:00
Mirko Bez
2ed9f18fc0
Update configuring-logging.asciidoc (#180835)
Update levels ordering

## Summary

The documentation is currently reporting a misleading information
https://www.elastic.co/guide/en/kibana/current/logging-configuration.html#log-level:

<img width="546" alt="image"
src="573f82c5-51f8-4e32-a85d-6895cc1b2041">


indeed the "maximum" should be off and the "minimum" should be all,
because:

>A log record will be logged by the logger if its level **(ed: its
refers to log)** is higher than or equal to the level of its logger.
Otherwise, the log record is ignored.

There is no value smaller than all that will result in all types of logs
being outputted.

### Checklist

Delete any items that are not applicable to this PR.

### 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: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
2024-04-19 08:45:59 +02:00
elena-shostak
6fc0d971dd
[csp] updated policy for form action in reporting mode (#179949)
## Summary

1. Added `Content-Security-Policy-Report-Only` header.
2. Set `form-action` to `self` in reporting mode.
3. Created [visualization for report only CSP
violation](f6bb1300-0bb7-11ee-adde-d5df298171dd?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:'2024-04-03T22:00:00.000Z',to:'2024-04-05T21:30:00.000Z'))).
Generated a couple of reports for testing, here is [telemetry
data](https://stack-telemetry.elastic.dev/s/kibana-platform-security/app/discover#/?_g=(filters:!(),time:(from:now-24h%2Fh,to:now))&_a=(columns:!(timestamp),filters:!(('$state':(store:appState),meta:(alias:'Expected%20CSP%20violation',disabled:!f,index:'14413084-88e4-4fd4-82ba-a69c8b72ec95',negate:!t,params:!((meta:(alias:!n,disabled:!f,field:effectiveDirective,index:'14413084-88e4-4fd4-82ba-a69c8b72ec95',key:effectiveDirective,negate:!f,params:(query:script-src-elem),type:phrase),query:(match_phrase:(effectiveDirective:script-src-elem))),(meta:(alias:!n,disabled:!f,field:blockedURL,index:'14413084-88e4-4fd4-82ba-a69c8b72ec95',key:blockedURL,negate:!f,params:(query:inline),type:phrase),query:(match_phrase:(blockedURL:inline))),('$state':(store:appState),meta:(alias:!n,disabled:!f,field:lineNumber,index:'14413084-88e4-4fd4-82ba-a69c8b72ec95',key:lineNumber,negate:!f,params:(query:'286'),type:phrase),query:(match_phrase:(lineNumber:'286')))),relation:AND,type:combined),query:())),index:'14413084-88e4-4fd4-82ba-a69c8b72ec95',interval:auto,query:(language:kuery,query:'disposition%20:%20%22report%22%20'),sort:!(!(timestamp,desc)))).
4. Added `csp.report_only.form_action` field for additional csp policy
configuration.

### Checklist

Delete any items that are not applicable to this PR.

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

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

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

## Release note
Added `Content-Security-Policy-Report-Only` header support.
2024-04-10 22:39:58 +02:00
Tim Sullivan
982303882e
[Reporting] update logs and docs on headless browser connection (#179882)
## Summary

This resolves some issues we've seen over confusion on configuration and
refused access to Kibana while generating a PNG/PDF report.
2024-04-03 08:15:12 -07:00
Tim Sullivan
2ff5410161
[Reporting/CSV] Deprecate Download CSV, add a config flag to enable (#178159)
Closes https://github.com/elastic/kibana/issues/164104

## Summary

**Replace "Download CSV" with "Generate CSV report" to export a CSV file
from saved search panel, deprecate "Download CSV", use a config flag for
providing the deprecated feature.**

This PR uses the `xpack.reporting.csv.enablePanelActionDownload`
kibana.yml setting, which was previously unused, for choosing behavior
of CSV export in a Dashboard saved search panel, and sets the default
value to `false`. The options allow the user to download a CSV file
without creating a report (deprecated, support will be removed in the
future) or to generate a CSV report (default).

1. Use the config as a flag to switch between implementations:
    - downloading a CSV file without a generated report
    - generating a CSV report
2. Updated documentation
3. Refactored / cleaned up tests
4. Increased API test coverage in Serverless
5. Better error handling in
`packages/kbn-reporting/public/reporting_api_client.ts`

### Checklist

Delete any items that are not applicable to this PR.

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

## Release Note
Kibana CSV Reporting offered a feature allowing users to download a CSV
file from a saved search panel in a dashboard, without having a report
generated. This feature is now deprecated. Now, when users need to
access saved search data from a dashboard panel as CSV, a normal report
will be generated. To access the deprecated functionality, you can add
`xpack.reporting.csv.enablePanelActionDownload: true` to kibana.yml, but
this ability will be removed in a future version of Kibana.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-03-22 18:28:09 -07:00
shainaraskas
a36a370878
[Docs] remove Kibana book-scoped variables (#178676)
## Summary

Removes book-scoped docs variable in preparation for eventual migration
to Docsmobile
2024-03-14 11:53:33 -04:00
Sid
88ddcc43e1
Update referrer policy default to a stricter value (#177559)
### Summary
Update the default value of
`server.securityResponseHeaders.referrerPolicy` to a stricter value:
`strict-origin-when-cross-origin`
2024-03-07 10:49:55 +01:00
Stef Nestor
4cc38e7025
(DOC+) Link Kibana Health Troubleshooting blog to related doc (#177907)
## Summary

👋 howdy, team! I would like to link our Kibana+Security+ResponseOps Dev
approved blog on [Troubleshooting Kibana
Health](https://www.elastic.co/blog/troubleshooting-kibana-health) to
the Kibana doc section about [Troubleshooting Kibana UI
error](https://www.elastic.co/guide/en/kibana/master/access.html#not-ready)
(as it was intended as the more verbose / commentary version of the
doc).


### Checklist

Delete any items that are not applicable to this PR.

### Risk Matrix


### 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: amyjtechwriter <61687663+amyjtechwriter@users.noreply.github.com>
2024-03-05 11:15:27 -07:00
Pierre Gayvallet
38a3b9675d
Add http.payloadTimeout config option (#177309)
## Summary

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

- Add a `http.payloadTimeout` configuration option, to control the
payload timeout
- Set the default value for this option to `20s` (was `10s` previously)
2024-02-22 12:33:49 +01:00
David Kilfoyle
5937e6afd1
[DOCS] Add link to on-prem install tutorial (#176096)
This adds a link on the [Install
Kibana](https://www.elastic.co/guide/en/kibana/current/install.html)
page pointing to a new example walkthrough of the on-prem install steps.


![kib](d81c90e5-f854-44bf-8a1f-3a14e535a07e)
2024-02-05 10:22:15 -05:00
Alex S
96ada94723
Change POST to PUT and _security to security for API example (#173453)
## Summary

Just a small Doc Update. In the first example a POST was used and
towards a non existing handle (`_security` instead of `security`)

In the basic license example posted below this one, this is already
correct.

### Checklist

All checked - none applied. 
(Though first PR in this repository, I am sorry if any mistakes were
made. If so - please point them out, will do better next time 😅 )

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2024-01-03 15:07:21 +01:00
Jon
ee194d32a2
Revert "fix/142865/path.data config unused (#158426)" (#172951)
This reverts commit 86d2f58c09.

Forward port of https://github.com/elastic/kibana/pull/172943 targeting
8.13 and 8.12. See the linked pr for 8.11.3 release notes.

Closes https://github.com/elastic/kibana/issues/172919
2023-12-08 10:22:21 -06:00
Aleh Zasypkin
74210343a2
Allow using JWT credentials to grant API keys. (#172444)
## Summary

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


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

## Testing

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

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

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

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

----

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-12-04 20:07:41 +01:00
Brad White
86d2f58c09
fix/142865/path.data config unused (#158426) 2023-11-28 16:16:47 -08:00
Gerard Soldevila
98b2cfbbb0
Enhance plugin documentation (#146678)
The PR tackles a couple of improvements for the new `'notifications'`
plugin documentation:

- Add a link to the plugin API description in the kibana-dev-docs nav
bar.
- Convert the README to `mdx`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-11-28 20:58:46 +01:00
amyjtechwriter
0b0110a2dd
[DOCS] Linking reporting and sharing page with configure reporting page (#171977)
## Summary

Linking the "[Reporting and
Sharing](https://www.elastic.co/guide/en/kibana/current/reporting-settings-kb.html#reporting-advanced-settings)"
and the "[Configure
reporting](https://www.elastic.co/guide/en/kibana/current/secure-reporting.html)"
documentation pages to each other as they contain information that
relate to each page. Also contains a small formatting fix to a NOTE on
the Configure reporting page.

Closes: #169065
2023-11-28 11:08:01 +00:00
Sébastien Loix
192519d01f
[Cloud] Rename "Endpoints" to "Connection details" (#171982) 2023-11-27 15:58:42 +00:00
Fabio Busatto
ef67add16c
[DOCS] Clarify required privileges to create CSV reports when using index aliases (#170524)
## Summary

If a CSV export is performed on an index alias, it also requires read
access to underlying indices.
This PR adds a note in Kibana docs to make users aware of this
requirement.
2023-11-03 09:47:21 -07:00
Jon
8133f01ffc
Revert "[build/docker] Upgrade Ubuntu base image to 22.04 (#162282)" (#170430)
This reverts commit 9d139f6192.
2023-11-02 12:56:17 -05:00
James Rodewig
9caea77ee4
[DOCS] Deprecate rollups (#169670) 2023-10-25 16:51:49 -04:00
Jon
9d139f6192
[build/docker] Upgrade Ubuntu base image to 22.04 (#162282)
Release note:
The default container's base image has been upgraded from Ubuntu 20.04
to 22.04
2023-10-23 14:49:06 -05:00
Sébastien Loix
92a92fff67
[Cloud] ES endpoint discovery (#167122) 2023-09-28 04:20:53 -07:00
James Rodewig
64e41be6e5
[DOCS] Sync Docker install docs with ES docs (#165990)
**Problem:** The current Kibana Docker install docs use container names that are incompatible with the [ES Docker install docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-cli-run-dev-mode).

**Solution:** Update the Kibana install docs so they use the same container names and better align with the ES docs.

Closes https://github.com/elastic/platform-docs-team/issues/182
2023-09-08 07:26:25 -04:00
James Rodewig
f8cd85535c
[main] [DOCS] Add fr-FR to supported Kibana locales (#165850) (#165875)
# Backport

This will backport the following commits from `8.9` to `main`:
- [[DOCS] Add `fr-FR` to supported Kibana locales
(#165850)](https://github.com/elastic/kibana/pull/165850)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Najwa
Harif","email":"90753689+naj-h@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-09-06T15:01:24Z","message":"[DOCS]
Add `fr-FR` to supported Kibana locales
(#165850)","sha":"bf5fff436549140ea7563071b159301d1f482165","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","Team:Core","release_note:skip","Feature:Configuration","docs","v8.10.0","v8.11.0","v8.9.3"],"number":165850,"url":"https://github.com/elastic/kibana/pull/165850","mergeCommit":{"message":"[DOCS]
Add `fr-FR` to supported Kibana locales
(#165850)","sha":"bf5fff436549140ea7563071b159301d1f482165"}},"sourceBranch":"8.9","suggestedTargetBranches":["8.10","main"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.9","label":"v8.9.3","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/165850","number":165850,"mergeCommit":{"message":"[DOCS]
Add `fr-FR` to supported Kibana locales
(#165850)","sha":"bf5fff436549140ea7563071b159301d1f482165"}}]}]
BACKPORT-->

Co-authored-by: Najwa Harif <90753689+naj-h@users.noreply.github.com>
2023-09-06 12:35:46 -04:00
Stef Nestor
b340cb301b
[DOC+] License not available is KB-ES connection error (#161176)
👋🏼 howdy, team! When Kibana can't connect to Elasticsearch (past finding master /
network issue, just unhealthy cluster ballpark), its code logic cascades
into first tripping warn/error log `license is not available`.

This is a red-herring in that the license can not be determined and user
should investigate the network connection / Elasticsearch health rather
than investigating for lapsed licenses.

Adding this into the "Kibana not ready" docs since it raises at this
point in the flow to hopefully allow users to search-find it in our
official docs rather than e.g. top-goggle-results: [Elastic
Discuss](https://discuss.elastic.co/t/license-not-available/265931),
[external Github](https://github.com/spujadas/elk-docker/issues/349).
2023-07-04 09:26:43 -05:00
Jeramy Soucy
dd3193c88e
Implements default Permissions-Policy header (#158514)
Closes #154252

## Summary

This PR implements a default [permissions policy
header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permissions-Policy)
for Kibana. It takes into consideration only the directives that are
_not_ still in development/pre-release. These directives are:
 - camera
 - display-capture
 - fullscreen
 - geolocation
 - microphone
 - web-share

All directives above are set to an empty or "none" allow list, with the
exception of `fullscreen`. The default permissions policy for Kibana
will be: `camera=(), display-capture=(), fullscreen=(self),
geolocation=(), microphone=(), web-share=()`.

The `display-capture` directive only affects access to the [Screen
capture
API](https://developer.mozilla.org/en-US/docs/Web/API/Screen_Capture_API),
whereas our reporting utilities rely on a headless Chrome feature.
FullyStory also does not appear to rely on capturing the screen, but
rather on [capturing the DOM and
CSS](3600206230-Does-FullStory-work-with-my-complex-site-)
to reproduce the screen and user stories. We have confirmed with
FullStory support that they do not use the Screen capture API
(`getDisplayMedia()`).

The `fullscreen` directive affects access to the
[element.requestFullscreen
API](https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullscreen).
Our fullscreen view for Dashboards and visualizations appear to be
scoped to the Kibana application and not the browser or system, but
there is one use of `requestFullscreen` in the synthetics plugin's
`grid_group_item`, hence the default setting of 'self' here.

## Testing
Due to screen capture reports (PNG & PDF) and fullscreen modes working
with the configuration defined above, I wanted to double-check the
header was working, so I tested both camera and microphone access. I did
this by adding some code into our team's user management screen that
would attempt to access both the camera and microphone. I could confirm
that with the permissions policy header (as defined), no access prompts
would appear for either resource. When I removed the directives for the
camera and microphone from the permissions policy header, prompts
appeared in the browser (Chrome) to approve access to the camera and
microphone.

### Manual Test:
1. Start Elasticsearch and Kibana from this PR
2. Sign into Kibana and open your browser's dev tools
3. In the network tab, inspect one of the requests for localhost
4. In the Headers tab, verify the permissions-policy header is present
with the new default value defined above, `camera=(),
display-capture=(), fullscreen=(self), geolocation=(), microphone=(),
web-share=()`
5. Edit the kibana.yml file, add
`server.securityResponseHeaders.permissionsPolicy: camera=(self)`
6. Refresh Kibana in the browser, verify the permissions-policy header
is present with the value set in kibana.yml in step 5
7. Edit the kibana.yml file, add
`server.securityResponseHeaders.permissionsPolicy: null`
8. Refresh Kibana in the browser, verify the permissions-policy header
is no longer present

## Release Notes:
Security
Adds default Permissions-Policy header including all non-experimental
directives [#158514](https://github.com/elastic/kibana/pull/158514)

---------

Co-authored-by: James Rodewig <james.rodewig@elastic.co>
2023-06-07 19:48:44 +02:00
DeDe Morton
6feb736f86
Fix observability solution name (#158983)
Not sure if the original text was intentional. 

If APM needs to be more prominent here, you could say *Elastic
Observability and APM* , but it's misleading to say that you can use
Elastic APM for all of the use cases listed here.

Note that I didn't search the Kibana Guide for other instances of this
problem; I just noticed this while doing something else and wanted to
make sure it's fixed.

### 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)
2023-06-06 15:18:14 -07:00
Kaarina Tungseth
c5f85b7393
[DOCS] Fixes errors in Troubleshoot Kibana UI error (#158855)
## Summary

Updates `Troubleshoot Kibana UI error` with the following fixes:

- {kib} in error code should Kibana
- code shouldn’t have “`” tick marks wrapping commands
- the bullet list under Step#5 didn’t format
2023-06-01 12:28:09 -06:00
Stef Nestor
c72695125e
[DOC+][Troubleshooting] Kibana Server not Ready yet (#158379)
## Summary

Expands [Kibana not Ready](https://www.elastic.co/guide/en/kibana/master/access.html#not-ready)
doc to
1. allow direct google search
2. expand on the expected troubleshooting steps for common situations seen in Support

### Checklist

### Risk Matrix

### 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: Kaarina Tungseth <kaarina.tungseth@elastic.co>
2023-05-27 07:19:55 -06:00
Alejandro Fernández Haro
995b0a46e9
[DOCS] Telemetry settings: improve phrasing (#158396) 2023-05-25 16:46:08 +02:00
David Kilfoyle
fb9e3c9ec8
[DOCS] Add steps for Docker image verification (#158303)
This adds steps to the [Install Kibana with
Docker](https://www.elastic.co/guide/en/kibana/current/docker.html) page
for verifying the downloaded Docker images. I split apart the original
version which had all the commands in one block. Having them separate
allows us to add in the optional "verify images" step with a link to the
Elasticsearch docs for additional info.

Rel: https://github.com/elastic/dev/issues/2002

**Preview**

---
![Screenshot 2023-05-23 at 1 56 32
PM](7d35b9ad-d0f1-4c01-b26b-6ca469fdc644)

---

![Screenshot 2023-05-23 at 1 47 24
PM](0ec110be-1560-4dcc-8949-792e09846ee9)

---------

Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
2023-05-23 17:19:29 -04:00
Gerard Soldevila
70eb9d3ecb
Update saved objects migrations documentation for 8.8.0 (#158241)
Documentation must reflect changes brought by the [dot kibana
split](https://github.com/elastic/kibana/pull/154888).

Our public facing documentation just mentions two indices e.g.

https://www.elastic.co/guide/en/kibana/8.8/saved-object-migrations.html

https://www.elastic.co/guide/en/kibana/8.8/resolve-migrations-failures.html#upgrade-migrations-old-indices
this one in particular mentions that "all other indices are safe to
delete".
2023-05-23 15:53:52 +02:00
Alex Szabo
6ebfb8aa3e
Improve keystore CLI (#157359)
## Summary

Relates to: #113217

- Add extra documentation to highlight behaviour of the kibana keystore
(for #113217)
- Fix/Tidy-up commands (`create`, `list`) where the extra unused
arguments were preventing the `options` from being passed to the
functions. Also remove unnecessary `async` keyword from the `remove`
command.
- Added new `show` command
```
Usage: bin/kibana-keystore show [options] <key>

Displays the value of a single setting in the keystore. Pass the -o (or --output) parameter to write the setting to a file.

Options:
  -s, --silent         prevent all logging
  -o, --output <file>  output value to a file
  -h, --help           output usage information
```

### Checklist

Delete any items that are not applicable to this PR.

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### 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: Kaarina Tungseth <kaarina.tungseth@elastic.co>
2023-05-16 16:21:25 +02:00
Alex Szabo
58650c5545
Adds documentation to clarify kibana-keystore behaviour (#157146)
## Summary
Addresses #155474 

We've discussed with the team, and decided that we'd retain current
behaviour, and adjust the docs and notes around the behaviour.

fix(keystore): add warning note to explain that input is being JSON
parsed
docs(keystore): add documentation to clarify behavior

### Checklist

- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials

### 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)
2023-05-09 18:02:45 +02:00
Peter Pisljar
b6ea07ac24
removing enableInVisualize references (#156490) 2023-05-03 15:57:07 +02:00
Lisa Cawley
7efe3d53c6
[DOCS] Edits Kibana alerting settings (#155318) 2023-04-27 07:26:19 -07:00
Lisa Cawley
5120d692c8
[DOCS] Remove or move book-scoped attributes (#155210) 2023-04-20 09:12:09 -07:00
Jonathan Buttner
f111d93d08
[Cases] Adding cases settings docs (#154672)
This PR adds the new configuration settings to the docs. The
configurations were added in this PR:
https://github.com/elastic/kibana/pull/154013

---------

Co-authored-by: lcawl <lcawley@elastic.co>
2023-04-11 22:15:26 -04:00
Jon
67fab79f4c
Update on rpm.asciidoc (#150269) (#153333)
Forward port of https://github.com/elastic/kibana/pull/150269 from 7.17.
Thanks to the author of the original PR.

Fixes the checksum filename used to verify the Kibana rpm.

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

---------

Co-authored-by: koso3ht4y <thantzin1802@gmail.com>
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
2023-03-22 00:45:10 +00: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
Thomas Watson
2b82cb7fa2
[@kbn/handlebars] Add support for partials (#150151)
Add support for [partials](https://handlebarsjs.com/guide/partials.html)
to our own implementation of the [handlebars](https://handlebarsjs.com)
template engine.

Closes #139068
2023-02-02 12:59:09 -07:00
gchaps
803c8df070
[DOCS] Updates telemetry settings (#149651)
## Summary

This docs updates the content for the telemetry settings.
2023-01-27 07:06:16 -08:00