Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Feature: ability to specify multiple certificate authorities #709

Open
@adongy

Description

@adongy

Describe the feature:

I'd like to be able to specify multiple certificate authorities for the security settings of my cluster.

Currently, the playbook only supports a single file:

- name: Upload SSL Certificate Authority
become: yes
copy:
src: "{{ es_ssl_certificate_authority }}"
dest: "{{ es_ssl_certificate_path }}/{{ es_ssl_certificate_authority | basename }}"
owner: "{{ es_user }}"
group: "{{ es_group }}"
mode: "640"
#Restart if this changes
notify: restart elasticsearch
when: (es_ssl_certificate_authority is defined) and (es_ssl_certificate_authority|length > 0)

{% if es_ssl_certificate_authority %}
xpack.security.transport.ssl.certificate_authorities: "{{ es_ssl_certificate_path }}/{{ es_ssl_certificate_authority | basename }}"
{% endif %}

{% if es_ssl_certificate_authority %}
xpack.security.http.ssl.certificate_authorities: "{{ es_ssl_certificate_path }}/{{ es_ssl_certificate_authority | basename }}"
{% endif %}

The official documentation describes the parameters as a "List of paths to PEM encoded certificate files that should be trusted." https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html#_pem_encoded_files_2

My usecase is rolling updates of certificate authorities without cluster downtime.

Currently, Elasticsearch dynamically reloads certificates when they are updated.
When the verification_mode is set to certificate or full, if the new certificate is signed by the CA, the update is transparent: other cluster nodes will still validate the certificate and continue communication.

Best practices for CAs recommend rotating the authority regularly. If there is only one file declared in the configuration, as soon as a node reloads the new authority, it will not accept communication with other cluster nodes that have not updated their certificate to be signed by the new authority.

A solution to this is having multiple certificate authorities declared, replace one of them with the new authority while keeping the old one, update each node's certificates to be signed by the new authority, and remove the old authority at the end.


In our case, the playbook could be updated in a retrocompatible way by checking the variable type: variable is string is true when it's a string and false when it's a list (unfortunately, strings will pass both of the string and sequence test). It should work for both the jinja template and the tasks.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions