-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ssl-key
and ssl-crt
removal broke compatibility with a specific TLS use case
#380
Comments
Thank you for reporting us your feedback! The internal ticket has been created: https://warthogs.atlassian.net/browse/KF-5346.
|
After some investigation, the team has agreed to provide support for the removed feature, but instead of bringing back the charm configuration, the proposal is to leverage juju secrets. Considerations for supporting this feature
TLS using juju secretsFrom juju 3.0, we have Changes in
|
After investigating a bit more on how juju secrets are used by other charms, it looks like setting a value of a secret is rather done trough charm actions that have charm code in the backend to allow saving the secret than directly creating the secret from the juju CLI and expecting the charm to access it. Take for instance postgressql, which allow users to set a password by providing an action which at the same time sets a secret for saving its value. That seems to also be the pattern in the juju docs. The juju docs mention that secret events, which we'll use to observe and react to changes in secrets, are only triggered by charm code (see here):
Thus, the proposal for solving this issue may change to implement something similar to postgresql charm:
|
This commits introduces actions that allow users to configure the TLS ingress gateway for a single host directly passing the SSL cert and key to the charm. - save-tls-secret: allows users to pass the ssl-key and ssl-crt values, which the charm saves in a juju secret (owned by the charm) and uses them to reconcile the ingress Gateway with such information. - remove-tls-secret: a handy action that allows users to remove the TLS secret, which in turn removes the TLS configuration from the ingress Gateway. This commit also adds unit and integration tests to increase the coverage due to the recent changes. WARNING: please note this feature is only supported in 1.17 and 1.18, and it will be removed after releasing 1.18 in favour of the TLS provider method. Fixes #380
#394) * feat: add action to handle SSL values as secrets for TLS configuration This commits introduces actions that allow users to configure the TLS ingress gateway for a single host directly passing the SSL cert and key to the charm. - save-tls-secret: allows users to pass the ssl-key and ssl-crt values, which the charm saves in a juju secret (owned by the charm) and uses them to reconcile the ingress Gateway with such information. - remove-tls-secret: a handy action that allows users to remove the TLS secret, which in turn removes the TLS configuration from the ingress Gateway. This commit also adds unit and integration tests to increase the coverage due to the recent changes. WARNING: please note this feature is only supported in 1.17 and 1.18, and it will be removed after releasing 1.18 in favour of the TLS provider method. Fixes #380
#394) * feat: add action to handle SSL values as secrets for TLS configuration This commits introduces actions that allow users to configure the TLS ingress gateway for a single host directly passing the SSL cert and key to the charm. - save-tls-secret: allows users to pass the ssl-key and ssl-crt values, which the charm saves in a juju secret (owned by the charm) and uses them to reconcile the ingress Gateway with such information. - remove-tls-secret: a handy action that allows users to remove the TLS secret, which in turn removes the TLS configuration from the ingress Gateway. This commit also adds unit and integration tests to increase the coverage due to the recent changes. WARNING: please note this feature is only supported in 1.17 and 1.18, and it will be removed after releasing 1.18 in favour of the TLS provider method. Fixes #380
There are charms that use the "create a secret for myself via an action, and put it into the peer relation". This is because in Juju 3.3 when we introduced secrets, we only had application generated secrets such that they could be shared over relation data. In juju 3.4 we added user secrets, such that you can add a secret as the end user, populate the content of that secret, and then share that secret with an application. However, the handle for those secrets, rather than being a relation data bag, is a config entry. I updated one of my charms to prove that it is working, and I did find a couple of rough edges in the ecosystem. But the rough diff for my ubuntu-lite charm was:
So you have to add a config field, with the type of 'secret'. And then you need to handle the fact that the value of the secret id will be supplied in config, and that updates to that secret will be triggered via secret-changed. From the Juju CLI, you then do:
And then in the future you can test:
And that will trigger the |
(Note that the reason I have a custom branch of ops is because of: canonical/operator#1166 which looks to only impact the test suite, not runtime operation.) |
btw, I'm slightly wrong about 3.4. I tested against 3.3 and it also supports the same workflow. I just did:
And in the debug-log I can see it all working:
|
I also confirmed that with juju 3.1 you are able to deploy the charm, but commands like
So you can deploy a charm, that optionally has a config that has a secret, and still allow that to deploy with 3.1 (you just won't have a way to supply that as a user-secret). But you can do the compatibility level in the charm. Or you can set an Assumes of Juju>=3.3 which would mean you don't want to be deployed with 3.1 |
Thanks @jameinel! These examples and context are really helpful! |
Bug Description
Changes introduced by #338 removed the support for enabling TLS for users that only have the
ssl-key
andssl-crt
files generated by an external Certificate Authority (CA). This change affectsistio-operators
v1.17 and latest/edge.That PR removed configuration options that allowed users to pass these values with the assumption that the integration with
tls-certificates-interface
would be a replacement for it. This assumption considered all cases where users wanted to have a charm to provide certificates (a certificates provider) and handle all the required automation, and even considered the case where users would have an in-house CA so they could use charms like themanual-tls-certificates-operator
. The only missing scenario is the one described in the first paragraph.This scenario is still relevant for some users because they can only get the
ssl-key
andssl-crt
from a CA.We should consider options to support this, ideally in a way that can guarantee a good level of security and follows the best recommendations from the maintainers of the tls-certificates interface.
The text was updated successfully, but these errors were encountered: