Skip to content

Commit aba422c

Browse files
tsullivanlegregogchaps
committed
[Reporting] Document Network Policy configuration (elastic#80431)
* [Reporting] Document Network Policy configuration * Apply suggestions from code review Co-authored-by: Larry Gregory <lgregorydev@gmail.com> * Apply suggestions from code review Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com> * remove detail about policy acting on responses * Update docs/user/reporting/network-policy.asciidoc Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com> * lowercase network policy * typo Co-authored-by: Larry Gregory <lgregorydev@gmail.com> Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
1 parent 7f01b85 commit aba422c

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

docs/settings/reporting-settings.asciidoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ When `xpack.reporting.capture.browser.type` is set to `chromium` (default) you c
203203
exist. Configure this to a unique value, beginning with `.reporting-`, for every
204204
{kib} instance that has a unique `kibana.index` setting. Defaults to `.reporting`.
205205

206+
| `xpack.reporting.capture.networkPolicy`
207+
| Capturing a screenshot from a {kib} page involves sending out requests for all the linked web assets. For example, a Markdown
208+
visualization can show an image from a remote server. You can configure what type of requests to allow or filter by setting a
209+
<<reporting-network-policy, network policy>> for Reporting.
210+
206211
| `xpack.reporting.roles.allow`
207212
| Specifies the roles in addition to superusers that can use reporting.
208213
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: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
[role="xpack"]
2+
[[reporting-network-policy]]
3+
=== Restrict requests with a Reporting network policy
4+
5+
When Reporting generates PDF reports, it uses the Chromium browser to fully load the {kib} page on the server. This
6+
potentially involves sending requests to external hosts. For example, a request might go to an external image server to show a
7+
field formatted as an image, or to show an image in a Markdown visualization.
8+
9+
If the Chromium browser is asked to send a request that violates the network policy, Reporting stops processing the page
10+
before the request goes out, and the report is marked as a failure. Additional information about the event is in
11+
the Kibana server logs.
12+
13+
[NOTE]
14+
============
15+
{kib} installations are not designed to be publicly accessible over the Internet. The Reporting network policy and other capabilities
16+
of the Elastic Stack security features do not change this condition.
17+
============
18+
19+
==== Configure a Reporting network policy
20+
21+
You configure the network policy by specifying the `xpack.reporting.capture.networkPolicy.rules` setting in `kibana.yml`. A policy is specified as
22+
an array of objects that describe what to allow or deny based on a host or protocol. If a host or protocol
23+
is not specified, the rule matches any host or protocol.
24+
25+
The rule objects are evaluated sequentially from the beginning to the end of the array, and continue until there is a matching rule.
26+
If no rules allow a request, the request is denied.
27+
28+
[source,yaml]
29+
-------------------------------------------------------
30+
# Only allow requests to placeholder.com
31+
xpack.reporting.capture.networkPolicy:
32+
rules: [ { allow: true, host: "placeholder.com" } ]
33+
-------------------------------------------------------
34+
35+
[source,yaml]
36+
-------------------------------------------------------
37+
# Only allow requests to https://placeholder.com
38+
xpack.reporting.capture.networkPolicy:
39+
rules: [ { allow: true, host: "placeholder.com", protocol: "https:" } ]
40+
-------------------------------------------------------
41+
42+
A final `allow` rule with no host or protocol will allow all requests that are not explicitly denied.
43+
44+
[source,yaml]
45+
-------------------------------------------------------
46+
# Denies requests from http://placeholder.com, but anything else is allowed.
47+
xpack.reporting.capture.networkPolicy:
48+
rules: [{ allow: false, host: "placeholder.com", protocol: "http:" }, { allow: true }];
49+
-------------------------------------------------------
50+
51+
A network policy can be composed of multiple rules.
52+
53+
[source,yaml]
54+
-------------------------------------------------------
55+
# Allow any request to http://placeholder.com but for any other host, https is required
56+
xpack.reporting.capture.networkPolicy
57+
rules: [
58+
{ allow: true, host: "placeholder.com", protocol: "http:" },
59+
{ allow: true, protocol: "https:" },
60+
]
61+
-------------------------------------------------------
62+
63+
[NOTE]
64+
============
65+
The `file:` protocol is always denied, even if no network policy is configured.
66+
============
67+
68+
==== Disable a Reporting network policy
69+
70+
You can use the `xpack.reporting.capture.networkPolicy.enabled: false` setting to disable the network policy feature. The default for
71+
this configuration property is `true`, so it is not necessary to explicitly enable it.

0 commit comments

Comments
 (0)