SovereignCloudStack / issues

This repository is used for issues that are cross-repository or not bound to a specific repository.
https://github.com/orgs/SovereignCloudStack/projects/6
2 stars 1 forks source link

Implement the ability in Ansible Kolla to deploy RabbitMQ with inter-node comunication encrypted via TLS #468

Open fdobrovolny opened 1 year ago

fdobrovolny commented 1 year ago

Epic #462

As an SCS Operator, I want to be able to deploy RabbitMQ with TLS encryption enabled between the RabbitMQ cluster nodes so that I can have OpenStack services communication E2E encrypted.

When this is implemented #469 is immidietly required as cli would stop working:

Once a node has inter-node connection configured with TLS, CLI tools such as rabbitmqctl and rabbitmq-diagnostics also must use TLS to talk to the node. Plain TCP connections will be fail.

Therefore:

As an SCS Operator, I want to be able to use rabbitmqctl with the RabbitMQ cluster with TLS encryption enabled between the RabbitMQ cluster nodes, so that I can use CLI tools for debugging.

https://www.rabbitmq.com/clustering-ssl.html

As pointed out below there is some capability regarding TLS of Kolla in RabbitMQ as of now mainly rabbitmq_enable_tls and om_rabbitmq_enable_tls. This should be extended to fulfill all objectives.

Definition of Ready:

Definition of Done:

berendt commented 1 year ago

I think this is already implemented:

https://github.com/openstack/kolla-ansible/blob/master/ansible/roles/rabbitmq/templates/rabbitmq.conf.j2#L23-L30

fdobrovolny commented 1 year ago

@berendt I think you are correct, I was going of off the docs page:

https://docs.openstack.org/kolla-ansible/latest/reference/message-queues/rabbitmq.html

But I think you commented under the wrong issue I think it is #469.

berendt commented 1 year ago

Should be the right issue. I will enable the RabbitMQ inter-node encryption. This will also enable the client-server traffic encryption.

When om_rabbitmq_enable_tls is true (it defaults to the value of rabbitmq_enable_tls), applicable OpenStack services will be configured to use oslo.messaging with TLS enabled.
fdobrovolny commented 1 year ago

I think: rabbitmq_enable_tls enables SSL listener rather then https://www.rabbitmq.com/clustering-ssl.html om_rabbitmq_enable_tls enables Oslo messaging to use the TLS endpoint.

As the docs state:

Encryption of the following channels is not currently supported:

  • RabbitMQ cluster traffic between RabbitMQ server nodes
  • RabbitMQ CLI communication with RabbitMQ server nodes
  • RabbitMQ Management API and UI (backend connection from HAProxy to RabbitMQ)

But I think I wrote the #469 wrong as it was supposed to address the "RabbitMQ CLI communication with RabbitMQ server nodes" and now looking into it closer seems like that was meant like configure the CLI client to use the TLS endpoint.

As for the inter-node communication it requires the inet_tls flag is not present https://github.com/openstack/kolla-ansible/blob/master/ansible/roles/rabbitmq/templates/rabbitmq-env.conf.j2#L5

berendt commented 1 year ago

om_rabbitmq_enable_tls defaults to the value of rabbitmq_enable_tls. With https://github.com/osism/testbed/issues/1826 I will set rabbitmq_enable_tls to true (this is related to this issue) and this will results in om_rabbitmq_enable_tls = true as well.

berendt commented 1 year ago

As for the inter-node communication it requires the inet_tls flag is not present https://github.com/openstack/kolla-ansible/blob/master/ansible/roles/rabbitmq/templates/rabbitmq-env.conf.j2#L5

I think we should add this with a check on rabbitmq_enable_tls.

MatusJenca2 commented 10 months ago

This issue progress (December):

horazont commented 9 months ago

As mentioned in https://github.com/SovereignCloudStack/issues/issues/462#issuecomment-1884472190 we have seen spurious TLS errors with RabbitMQ cluster encryption ("certificate has expired" even though it hadn't). This was not reproducible. In case you can reproduce this, we'd be interested to hear about that.

For general configuration of RabbitMQ TLS encryption, you can look at the steps the YAOOK project did to enable cluster encryption for RabbitMQ here:

fdobrovolny commented 9 months ago

In yaook there is basicaly all stuff about the RabbitMQ already done we can use it as inspiration for ansiblle kolla.

berendt commented 8 months ago

In yaook there is basicaly all stuff about the RabbitMQ already done we can use it as inspiration for ansiblle kolla.

Is there any progress on the inter RabbbitMQ communication?

MatusJenca2 commented 6 months ago

I just started working on this again, while I am waiting for the other upstream work to be reviewed/merged Progress

MatusJenca2 commented 5 months ago

Upstream PR: https://review.opendev.org/c/openstack/kolla-ansible/+/921381

Upstream PR (certificates):https://review.opendev.org/c/openstack/kolla-ansible/+/921380