-
Notifications
You must be signed in to change notification settings - Fork 74
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
Trust part 2 - How to use a bundle? #59
Comments
Look at this project > https://github.com/smallstep/autocert < for inspiration. We're using it currently for injecting the pub. CA cert of the CA we're self-hosting. It's working pretty well. However, sometimes, the only caveat, is that at |
That's definitely an approach that can be taken! If we can rely on users to add init containers and update entrypoints that makes it a lot easier. Part of the issue here is working out what's reasonable for users to do to be able to use the bundles we generate. Automating any of this is hard for several reason. I'll use "TMBundle" to mean "a bundle created by trust-manager".
I think the long term is probably that there has to be some kind of upstream k8s standard for this. Without that, I think automating this is always going to miss some edge cases. Documenting and improving usage is definitely a priority of mine but it's prioritised behind public trust bundles and bundle output formats! |
Possibly related KEP for "Trust Anchor Sets": kubernetes/enhancements#3257 Some additional wrinkles:
|
Not only does java use a different Trust Store mechanism (which is sometimes tied to the distro's trust store), but different distros use different CA trust store configurations and different update commands:
|
Thanks @evankanderson and @gclawes! I think we're aware of the points you both raised, which is great validation! JKS files for Java is definitely on the roadmap. I don't think any of the issues raised should be serious problems. The openssl symlink stuff would be wild to try and solve but I'm not aware of a need for us to actually solve that. |
Oh I really forgot that I opened this issue. Having a quick scan through there's a couple things that might help with the issues presented in comments:
I think particularly the last article (i wrote) should help address some of the comments about how to actually use this in Kubernetes with applications. It'll be different for certain languages of course and I don't cover all those previously mentioned, but it might be a good starting place. I'm tempted to close out this issue and if there are specific challenges that haven't been addressed, they are raised as new concerns. |
I can add that we will also support password-less PKCS12 truststores in our next release, ref. #163 (with a few follow-up fix-PRs). 😉 |
To update this thread, trust-manager has changed a fair bit since raising this issue, but the question does still remain on how best to consume a We discussed this topic (thanks to @erikgb for bringing it up) on the cert-manager bi-weekly call yesterday (30th Nov 2023). I created two action for myself to follow up:
We also briefly mentioned some related issues / feature requests that might make
Clearly on big topic we identified which has many possible options is auto-mounting a bundle into the default locations. But default locations change per image base. @SpectralHiss has kindly offered to gather a list of the commone places used by various language and OS bases as a starting point in this effort. The other area was making use of Both options are currently difficult or at the very least need something extra, or some documentation, so we will keep this issue open and hope to come to a clearer strategy for "how you use a Bundle". |
I have found it common that a cm and secret are both too small to store the needed certs plus additional certs requiring a pvc to be needed instead. If we expect folks to use an initContainer then why have something in every namespace? We could just use curl to get the latest ca-bundle using a trust-manager rest api. Along that line though, if using a pvc, could we not use a ReadOnlyMany pvc so we only need one? Or possibly create a pvc in every namespace... or use a namespace label to indicate a ca-bundle pvc should be created there? |
I have found it common that a cm and secret are both too small to store the needed certs plus additional certs requiring a pvc to be needed instead. If we expect folks to use an initContainer then why have something in every namespace? We could just use curl to get the latest ca-bundle using a trust-manager rest api. Along that line though, if using a pvc, could we not use a ReadOnlyMany pvc so we only need one? ... |
Issues go stale after 90d of inactivity. |
/remove-lifecycle stale |
Now that I have installed
trust
, configured a bundle and I have a configMap propagated around the various namespaces of my cluster, I now need to feasibly use said CA bundle with applications. I think there are some usability and security concerns to accommodate here:update-ca-certificates
at runtimeAm I right in thinking that the best approach to update CA's trusted at runtime of a non-root container, is to effectively use a privileged init container with a shared volume with the application and some entrypoint.sh type magic? Something like the suggestion here
Perhaps it's easier to explain where I think I would like to be. I manage clusters with many tenants. I would like at runtime to automatically inject my trusted CA bundle to applications. Application use only that bundle without having to be specifically referenced by the tenants applications and deployments.
End result is that you effectively control trust at runtime through the cluster without requiring tenant changes. There is then potential to roll trust by refreshing or creating new bundles. This sort of reflects my experience that TLS is usually a platform / security concern and that application teams tend not to care about the runtime environment so much. Say for example an environment relying on internal CAs.
I'm not sure how achievable the above is, but perhaps some documentation on the trust project on typical use cases might be a start at least? At least highlight the gaps or limitations to address.
The text was updated successfully, but these errors were encountered: