Add certificates config keys in config-network#648
Conversation
This patch adds the following certificate variables: - `activator-server-certs` - `queue-proxy-ca` - `queue-proxy-san` - `queue-proxy-server-certs` It is similar to #608. knative/serving#12815 and knative/serving#12770 verifeid the change.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nak3 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov Report
@@ Coverage Diff @@
## main #648 +/- ##
==========================================
+ Coverage 94.56% 94.85% +0.29%
==========================================
Files 38 38
Lines 810 1245 +435
==========================================
+ Hits 766 1181 +415
- Misses 31 52 +21
+ Partials 13 12 -1
Continue to review full report at Codecov.
|
evankanderson
left a comment
There was a problem hiding this comment.
I think we want to have a pattern for queue-proxy SANs which incorporates at least the namespace name, and possibly also the revision name.
I'm less concerned about revision name, but it would be nice if we could use the SAN to prove that we don't "cross the streams" at the networking layer and dispatch a request to a queue-proxy at the wrong namespace.
| # The SAN (Subject Alt Name) used to validate the activator TLS certificate. | ||
| # It must be set when "queue-proxy-ca" is specified. | ||
| # Use an empty value to disable the feature (default). | ||
| # | ||
| # NOTE: This flag is in an alpha state and is mostly here to enable internal testing | ||
| # for now. Use with caution. | ||
| queue-proxy-san: "" | ||
|
|
||
| # The server certificates to serve the TLS traffic from activator to queue-proxy. | ||
| # It is specified by the secret name, which has the "tls.crt" and "tls.key" data field. | ||
| # Use an empty value to disable the feature (default). | ||
| # | ||
| # NOTE: This flag is in an alpha state and is mostly here to enable internal testing | ||
| # for now. Use with caution. | ||
| queue-proxy-server-certs: "" |
There was a problem hiding this comment.
Shouldn't queue-proxies in different namespaces get different SANs and Certs?
There was a problem hiding this comment.
Yes, it should get the different SANs and certs. But for the alpha release, I assumed that:
- admin deploys secret (server certs) in each application namespace with the name specified in
queue-proxy-server-certs. - queue-proxy mounts the secret via volume mount.
The different SANs and certs are very difficult to implement and we need to consider about another traffic ingress -> queue-proxy in the future.
There was a problem hiding this comment.
It seems important that a user in one namespace not have access to the cert being used in a different namespace. SANs feel like the way to do that -- we can start with having the admins manually create the certs using something like Cert-Manager or by hand, and eventually enhance Knative to do this before GA.
There was a problem hiding this comment.
I think we need to validate SAN/certs at service creation time. It should be done for GA. For now its ok to test with shared certs I guess.
| # The server certificates to serve the TLS traffic from ingress to activator. | ||
| # It is specified by the secret name, which has the "tls.crt" and "tls.key" data field. | ||
| # Use an empty value to disable the feature (default). | ||
| # | ||
| # NOTE: This flag is in an alpha state and is mostly here to enable internal testing | ||
| # for now. Use with caution. | ||
| activator-server-certs: "" |
There was a problem hiding this comment.
How about activator-cert-secret if we need this to be configurable? (I'm okay with it being configurable, though I'm not sure how useful that feature might be vs simply having a hard-coded name.)
There was a problem hiding this comment.
I wanted make this configurable as activator can turn on the https serving or not based on the config as:
if networkConfig.ActivatorServerCert != "" {
// activator starts serving https.
}There was a problem hiding this comment.
For the name of activator-cert-secret vs activator-server-certs, we already have the activator ca as activator-ca (without -secert) so it should be consistent?
There was a problem hiding this comment.
I'd thought the activator-ca was the actually CA certificate (which doesn't need to be kept private, because it's a certificate, not keys).
I'd prefer to have the -secret name here, because it provides a clearer clue that this is a value that needs to be kept private as well.
|
For queue-proxy's SANs and certs, it needs to consider about the |
I think the challenge for
I'd be happy with either hard-coding the SAN as equal to the internal cluster service name, or something like |
I would also vote for moving the san/cert info in the ingress part.
SAN can be many things afaik. Could users use the service without the internal name (thinking out loud)? |
|
/lgm |
I'm not sure I understand the comment here. Do you mean move the SAN and Cert info in the KIngress, or into a different phase of the implementation.
SAN is a field in the CA certificate; I don't think we need to align those values with specific resolvable DNS addresses. I think I'm suggesting using the dnsNames field here only because that seems to be supported by cert-manager, but I'm imagining that we'd have a custom validator and wouldn't want other systems using the internal name and attempting validation. |
|
@skonto @evankanderson Is it possible to merge this into 1.4 😅 |
I'd like to understand the plan for queue-proxy certs. Is it to copy a shared cert to each namespace for 1.4, and then to replace them (and the related config options) in 1.5? |
Yes, I assumed that. |
|
I think this probably means that the feature will be pre-alpha for 1.4, but as long as we're fine with throwing out some or all of users configuration when we ship 1.5. /lgtm |
This patch adds the following certificate variables:
activator-server-certsqueue-proxy-caqueue-proxy-sanqueue-proxy-server-certsIt is similar to #608.
knative/serving#12815 and knative/serving#12770
verified the change.
/cc @evankanderson