Не удается получить состояние кластера из-за: нет разрешений - PullRequest
0 голосов
/ 09 июля 2020

Что у меня есть :

  • Сервер Ubuntu 18.04
  • Docker
  • amazon/opendistro-for-elasticsearch:1.8.0
  • подстановочный сертификат Letsencrypt (сгенерированный Certbot) для узлов, допустим, это "* .example.com"
  • сертификат Letsencrypt (сгенерированный Certbot) для администратора, скажем, "admin.example.com"

Что я пытаюсь сделать : перезагрузить конфигурацию безопасности, используя plugins/opendistro_security/tools/securityadmin.sh. Я использую эту команду изнутри контейнера

/usr/share/elasticsearch/plugins/opendistro_security/tools/securityadmin.sh -cert config/admin_fullchain.pem -icl -nhnv -cacert config/admin_fullchain.pem -key config/admin_privkey.pem

My elasticsearch.yml содержит

# node certificates config ...
opendistro_security.ssl_cert_reload_enabled: true
opendistro_security.allow_default_init_securityindex: true
opendistro_security.nodes_dn:
  - 'CN=*.example.com'
opendistro_security.authcz.admin_dn:
  - 'CN=admin.example.com'

opendistro_security.audit.type: internal_elasticsearch
opendistro_security.enable_snapshot_restore_privilege: true
opendistro_security.check_snapshot_restore_write_privileges: true
opendistro_security.restapi.roles_enabled: ["all_access", "security_rest_api_access"]
cluster.routing.allocation.disk.threshold_enabled: false
node.max_local_storage_nodes: 1

Обратите внимание, что сертификаты, сгенерированные Certbot, содержат только CN=<domain> в своей теме.

Вывод команды выше очевиден:

Open Distro Security Admin v7
Will connect to localhost:9300 ... done
Connected as CN=admin.example.com
Elasticsearch Version: 7.7.0
Open Distro Security Version: 1.8.0.0
Contacting elasticsearch cluster 'elasticsearch' and wait for YELLOW clusterstate ...
Cannot retrieve cluster state due to: no permissions for [cluster:monitor/health] and User [name=CN=admin.example.com, backend_roles=[], requestedTenant=null]. This is not an error, will keep on trying ...
  Root cause: ElasticsearchSecurityException[no permissions for [cluster:monitor/health] and User [name=CN=admin.example.com, backend_roles=[], requestedTenant=null]] (org.elasticsearch.ElasticsearchSecurityException/org.elasticsearch.ElasticsearchSecurityException)
   * Try running securityadmin.sh with -icl (but no -cl) and -nhnv (If that works you need to check your clustername as well as hostnames in your TLS certificates)
   * Make sure that your keystore or PEM certificate is a client certificate (not a node certificate) and configured properly in elasticsearch.yml
   * If this is not working, try running securityadmin.sh with --diagnose and see diagnose trace log file)
   * Add --accept-red-cluster to allow securityadmin to operate on a red cluster.

Я не могу создать пользователя в Kibana с таким именем CN=admin.example.com из-за недопустимых символов (точек).

Мой вопрос : могу ли я настроить свой кластер так, чтобы сертификат администратора каким-то образом был связан с другим пользователем?

...