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