Makes it possible to use AWS Elasticsearch provided Kibana that's available only inside the VPC.
It's made for PHP framework - Symfony 4 but you could easily write something similar for other language or framework.
NOTICE:
The simplest way to create a proxy for Kibana was to allow it to use Kibana's default URLs.
That's why you need to enable the proxy for /_plugin/kibana/{resource}
URL.
- Symfony 3.x or 4.x, eg.
"symfony/framework-bundle": "^4.1"
- Symfony PSR HTTP Message Bridge, eg.
"symfony/psr-http-message-bridge": "^1.0"
- Zend Diactoros, eg.
"zendframework/zend-diactoros": "^1.6"
- Guzzle HTTP, eg.
"guzzlehttp/guzzle": "~6.0"
Eg. assuming you're already using Symfony project:
composer require "symfony/psr-http-message-bridge" "zendframework/zend-diactoros" "guzzlehttp/guzzle"
-
Simply create a proxy controller like KibanaController.php.
-
Register it in
services.yaml
to inject Elasticsearch details. Eg.
services:
...
App\Controller\KibanaController:
arguments:
$elasticsearchHost: '%env(ELASTICSEARCH_HOST)%'
$elasticsearchTransport: '%env(ELASTICSEARCH_TRANSPORT)%'
-
Set
ELASTICSEARCH_HOST
andELASTICSEARCH_TRANSPORT
environment variable or hardcode it above. -
Use Kibana by opening /_plugin/kibana/app/kibana
-
(Recommended) Secure Kibana access. Eg. in
security.yaml
add a line like:
security:
access_control:
- { path: ^/_plugin/kibana/, roles: ROLE_SUPER_ADMIN, requires_channel: https }