Skip to content

Commit baf182f

Browse files
committed
[Reporting] Document Network Policy configuration
1 parent 5bf7966 commit baf182f

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

docs/settings/reporting-settings.asciidoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,11 @@ a| `xpack.reporting.capture.browser`
248248
exist. Configure this to a unique value, beginning with `.reporting-`, for every
249249
{kib} instance that has a unique <<kibana-index, `kibana.index`>> setting. Defaults to `.reporting`.
250250

251+
| `xpack.reporting.capture.networkPolicy`
252+
| Capturing a screenshot from a Kibana page involves sending out requests for all the linked web assets. For example, a Markdown
253+
visualization can show an image from a remote server. You can configure what kind of requests to allow or filter by setting a
254+
Network Policy for Reporting. See <<reporting-network-policy, Network Policy>> for more details.
255+
251256
| `xpack.reporting.roles.allow`
252257
| Specifies the roles in addition to superusers that can use reporting.
253258
Defaults to `[ "reporting_user" ]`. +

docs/user/reporting/configuring-reporting.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,4 @@ to point to a proxy host requires that the Kibana server has network access to
7575
the proxy.
7676

7777
include::{kib-repo-dir}/user/security/reporting.asciidoc[]
78+
include::network-policy.asciidoc[]
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
[role="xpack"]
2+
[[reporting-network-policy]]
3+
=== Restricting requests with a Reporting Network Policy
4+
5+
When {report-features} generates PDF reports, it uses the Chromium browser to fully load the Kibana page on the server. This
6+
potentially involves sending requests to external hosts, for example, a request may go to an external image server for showing a
7+
field formatted as an image, or to show an image in a Markdown visualization.
8+
9+
If the Chromium browser is requested to send a request that violates the network policy, Reporting will stop processing the page
10+
before the request goes out, and the report will be marked as a failure. Additional information about the event can be found in
11+
Kibana's server logs.
12+
13+
A network policy applies not only to outgoing requests, but also incoming responses. That means if a request goes out to an allowed
14+
host, but is redirected and a response returns from a denied host, the response will be denied, and the report will fail.
15+
16+
[NOTE]
17+
============
18+
Kibana installations are not designed to be publicly accessible over the Internet. The Reporting network policy and other capabilities
19+
of the Elastic Stack security features do not change this condition.
20+
============
21+
22+
==== Configuring Reporting Network Policy
23+
24+
You configure the network policy by specifying the `xpack.reporting.capture.networkPolicy.rules` setting in `kibana.yml`. A policy is specified as
25+
an array of objects that describe what to allow or deny based on an optionally-provided host and/or protocol. If a host or protocol
26+
is not specified, the rule will match any host or protocol, respectively.
27+
28+
The rule objects are evaluated sequentially from the beginning to the end of the array, and continue until there is a matching rule.
29+
If none of the rules allow a request, the request will be denied.
30+
31+
[source,yaml]
32+
-------------------------------------------------------
33+
# Only allow requests to placeholder.com
34+
xpack.reporting.capture.networkPolicy:
35+
rules: [ { allow: true, host: "placeholder.com" } ]
36+
-------------------------------------------------------
37+
38+
[source,yaml]
39+
-------------------------------------------------------
40+
# Only allow requests to https://placeholder.com
41+
xpack.reporting.capture.networkPolicy:
42+
rules: [ { allow: true, host: "placeholder.com", protocol: "https:" } ]
43+
-------------------------------------------------------
44+
45+
A final `allow` rule with no host or protocol will allow all requests that are not explicitly denied.
46+
47+
[source,yaml]
48+
-------------------------------------------------------
49+
# Denies requests from http://placeholder.com, but anything else is allowed.
50+
xpack.reporting.capture.networkPolicy:
51+
rules: [{ allow: false, host: "placeholder.com", protocol: "http:" }, { allow: true }];
52+
-------------------------------------------------------
53+
54+
A network policy can be composed of multiple rules.
55+
56+
[source,yaml]
57+
-------------------------------------------------------
58+
# Allow any request to http://placeholder.com but for any other host, https is required
59+
xpack.reporting.capture.networkPolicy
60+
rules: [
61+
{ allow: true, host: "placeholder.com", protocol: "http:" },
62+
{ allow: true, protocol: "https:" },
63+
]
64+
-------------------------------------------------------
65+
66+
[NOTE]
67+
============
68+
The `file:` protocol will always be denied, even if there is no network policy configured.
69+
============
70+
71+
==== Disabling Reporting Network Policy
72+
73+
You can use the `xpack.reporting.capture.networkPolicy.enabled: false` setting to disable the network policy feature. The default for
74+
this configuration property is `true`, so it is not necessary to explicitly enable it.

0 commit comments

Comments
 (0)