-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Enhancement] Add extra Secret + Password checks to KafkaConnect #3475
Comments
Up for discussion how it would be implemented, but I think it best belongs in the |
Tbh maybe it's just a lack of knowledge on how TLS works for people who make the mistake.
The above has to be in the trust store. Anyway, what do you expect to have in the status? An error about TLS handshake? |
I think this is a very valid point, but on the other hand, I would like to aspire that as little security knolwedge needs to be known as possible to connect to your cluster (if that makes sense). I think however the operator is capable of figuring out bad secrets from what I might define as red flags, for instance the operator doesn't even need to look at the data inside the secret to realize it is bad, i.e. I think also the operator has the liberty of being able to infer if the provided bootstrp belongs to a strimzi instance (i.e. via the name construction - if it suspects that it is a strimzi bootstrap, it could search the listeners in the Kafka object associated, and check that the certificate provided is correct either the default -cluster-ca-cert or the provided ca cert in the spec. This logic would then lead to a warning being put in th status.conditions of the KafkaConnect if the cert smells wrong. Better yet, it could even suggest the correct configuration of the Strimzi Kafka cluster-ca |
Similarly for the password, the operator could simply check that the provided secret name contains the provided key. |
hey, i'd like to give this a go, do you think is ready for dev? if so, assign to me please |
I do not think anyone implemented this yet. But it might be good if @samuel-hawker helps to clarify what exactly should be implemented. |
I'm glad someone is picking this up! I've been thinking on this, and normally the flow is: An error is normally only observed through noticing the deployment is erroring with cm/secret not found or something similar. If we made it fairly generic, we would have the opportunity to implement it for other configurations, such as If the validator fails to find what its looking for, it passes back a user friendly error to the user saying, Does that seem like a reasonable value add still? |
The Secrets or ConfigMaps would normally cause something to fail if they are not valid ... either the Pods will be pending or some exceptions pops up in the operator. So maybe failing with better message is better. @samuel-hawker Did you checked if something like this is already implemented elsewhere? I also wonder how muhc it conflicts with the work in #5549 |
I have not, it would definitely be worth looking into. |
That is correct. But at the same time, to collect the fingerprints it would need to query the secrets. That is where it intersects since we should make sure it doesn't for example query the secrets multiple times etc. |
That makes sense, I will look further into the fingerprints, and will do some searching around other operators and kube projects to see if a similar thing to this has already been done. |
I think there's no need to do an extra query to secrets since that info it's already present while reconciling here . |
You mean from the |
…3475) Signed-off-by: Francisco Becerra <fran.bcra@gmail.com>
Is your feature request related to a problem? Please describe.
For Kafka Connect, one common problem I've seen is people putting the actual password in their
KafkaConnect
Custom Resource (instead of the name of the password field in the secret)It'd be a great enhanement if the operator updated the status of the KafkaConnect CR when you do that, so it says "you asked for password 'blah' but there is no key 'blah' in your secret" or something helpful and friendly like that.
Similarly, there has been some confusion around certs. Where a user has been using a KafkaUser cert in
spec.tls.trustedCertificates
where the KafkaConnect spec was expecting a cluster ca certIt wasn't at all obvious to the user why his connect cluster was broken.
If we could do anything to tell if we've been given the right type of cert, it'd be a huge usability improvement.
An examples:
Describe the solution you'd like
The solution should be if the operator can, at runtime infer any reasoning why it is not working, this should be propagated into the status of the custom resource.
Describe alternatives you've considered
The only other alternative is changing the format of the CR to be clearer the password is a key, i.e.
I think documentation and examples already exist for this that is more than sufficient, but sometimes a user may still make these mistakes
The text was updated successfully, but these errors were encountered: