Support client certificates in federator#1682
Conversation
99719ea to
775ab37
Compare
jschaul
left a comment
There was a problem hiding this comment.
I know this is still marked as draft, but I had a look already anyway and made a few suggestions.
akshaymankar
left a comment
There was a problem hiding this comment.
Can you please explain whey we have/need let's encrypt staging? Otherwise, the PR looks good.
charts/nginx-ingress-services/templates/certificate_federator.yaml
Outdated
Show resolved
Hide resolved
charts/nginx-ingress-services/templates/certificate_federator.yaml
Outdated
Show resolved
Hide resolved
I thought we could merge it with staging first to see whether things have been configured correctly. Or we could deploy it (and cert-manager) on the CI environment and check if things work there. If you think it's ok to use production immediately, I can of course change it. |
I think it makes sense to try all of this out with staging cert manager first, but to do that we already have |
But we would also need to set the CA to use, since that's different between staging and production. |
Yes, but we shouldn't need to hardcode the CA into our code. We can make the testing person set that in the |
d0f7f06 to
9b56467
Compare
Also add client certificate CA to TLS secret
It is now an error to specify a client certificate without a private key or vice versa. We also fail in case the certificate cannot be parsed, instead of returning an empty certificate chain.
Also add examples of federator configuration
Co-authored-by: jschaul <jschaul@users.noreply.github.com>
Use the same issuer for both certificates. Whether we are using Let's Encrypt staging or production is determined by `certManager.inTestMode` so we don't need a separate issuer to enable staging.
It seems cert-manager takes control of the `ca.crt` key in the secret corresponding to a certificate, so it does not seem possible to set it manually when cert-manager is enabled. Unfortunately, it still needs to be a secret, since the ingress requires it. This commit moves the CA to a separate secret. Therefore, it needs to be set explicitly in the chart values for both federator and the nginx-ingress-services, even if federator secret sharing is enabled.
federator-ca is a configmap, not a secret
78bdb9b to
24aa191
Compare
akshaymankar
left a comment
There was a problem hiding this comment.
Overall looks good, I am not clear on why the client cert is optional.
Renamed to `useSharedFederatorSecret`. Co-authored-by: Akshay Mankar <akshay@wire.com>
Co-authored-by: Akshay Mankar <akshay@wire.com>
Co-authored-by: Akshay Mankar <akshay@wire.com>
|
Post-merge review: Looks good overall. Few minor questions came to mind:
|
|
One more thought: the |
We wanted to deploy the code in this branch to an environment using
This is a mistake, they were originally optional, but then we realized they shouldn't be. There is no way the federator could work without them. So, the docs in config-options needed update and we forgot.
Yes, setting it to always turn "on" will make any requests without a client cert to be rejected.
As said earlier, this is a mistake, I will rectify it by marking this as not optional.
If someone turns
This is not good, if we want the ingress-controller business to be optional. This is similar to how deploying wire-server requires cassandra, elasticsearch, etc to be there. But we don't want to mandate that people use our given cassandra and elasticsearch. So, we already have this ordering problem and I guess we solve it by making sure all our docs tell users to install those things before wire-server. Currently, it is not the case with ingress-controller and services, so I will make that change to our docs. |
This adds support for client authentication using TLS certificates when making requests to a remote backend.
Summary of changes
tlsandcryptoniteChecklist
make git-add-cassandra-schemato update the cassandra schema documentation.