Skip to content

Conversation

@Miciah
Copy link
Contributor

@Miciah Miciah commented Nov 21, 2019

No description provided.

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 21, 2019
has a custom default certificate?
- If so, should the operator publish the default certificate itself to
`router-ca`?
- If the operator publishes custom default certificates to `router-ca`,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bullet point seems to summarize the need for a single well-known reference point for components to collect the relevant cert(s) that allow them to communicate with other components on the cluster.

I'm very interested in how these questions are answered. If for some reason a bundle of all relevant certs should not be published, I'd definitely like to see that the alternative is clearly documented.


## Summary

The ingress operator publishes a `router-ca` configmap in the

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what it does now, correct? Not a summary of what will be added?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. This describes the current behavior.


### Goal

Publish the ingress operator's signing certificate, if used, in a well-known

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, if custom default certs are used, publish those?


Publishing the ingress operator's signing certificate does not help
if the administrator configures a custom default certificate.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though we do need a path forward for this case as well.

@ironcladlou
Copy link
Contributor

ironcladlou commented Nov 21, 2019

@benjaminapetersen
Copy link

Interesting. Would be curious to know why we would want different approaches. Namely, why config.openshift.io/inject-proxy-cabundle: "true" is used for the proxy CA, but not something like config.openshift.io/inject-default-cabundle: "true" would not be used to get the default CA. I'm not opposed to the well-known router-ca in openshift-config-managed, just contemplating the divergence of patterns.

In practice, we have to add a ResourceSyncController() to sync the router-ca to a configmap within our namespace, and then use the configmap.

Could the approaches be unified?

@benjaminapetersen
Copy link

Also, is there ever a case where a custom CA is used without proxy?

@Miciah Miciah force-pushed the router-ca-configmap branch from ae26a08 to 81be130 Compare November 22, 2019 03:46
@Miciah
Copy link
Contributor Author

Miciah commented Nov 22, 2019

Interesting. Would be curious to know why we would want different approaches. Namely, why config.openshift.io/inject-proxy-cabundle: "true" is used for the proxy CA, but not something like config.openshift.io/inject-default-cabundle: "true" would not be used to get the default CA. I'm not opposed to the well-known router-ca in openshift-config-managed, just contemplating the divergence of patterns.

Good idea. The router-ca configmap was ad hoc; the proxy API was designed later, with more deliberation. It makes sense to learn from the design process of the latter and re-use the pattern.

@Miciah
Copy link
Contributor Author

Miciah commented Nov 22, 2019

Latest push adds the suggestion to inject the ingress CA into specifically labeled configmaps à la proxy config.

@benjaminapetersen
Copy link

That sounds great, like the consistency, like dropping the ResourceSyncer(). Just need to make sure we know what to do if it is conditionally published (I assume the annotation would be ignored, the CM would not be populated... need to know what to fallback on).


### Inject the Ingress CA into ConfigMaps with a Well Known Label

Instead of or in addition to publishing the `router-ca` ConfigMap, the ingress

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds good to me. Since it is inject-ingress-cabundl instead of inject-default-cabundle, will we be able to assume that we can simply use it? As a consumer, we don't have to care if it is default or custom?

@benjaminapetersen
Copy link

I've commented mostly on UX/correct usage path, lets definitely ensure security issues are documented here as well.

@benjaminapetersen
Copy link

Going to cross reference this openshift/cluster-ingress-operator#331


Instead of or in addition to publishing the `router-ca` ConfigMap, the ingress
operator could inject the ingress CA into all ConfigMaps with a specific label,
for example `config.openshift.io/inject-ingress-cabundle: "true"`. This approach
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having the ingress operator inject the ingress ca cert, why not have the existing trust bundle publishing controller handle this? The controller can be expanded to watch for the router-ca configmap, add the cert to the cluster-wide trusted ca bundle configmap and have the combined bundle injected into components. Most of this workflow is already implemented and this approach would allow a single operator to manage cluster-wide trust bundle publishing and injection. All components that rely on routes to verify access, should already be setup for the trust bundle injection so no additional changes should be required.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of re-using an existing controller. However, we would still need a distinct annotation because components that need to trust the proxy CA may not need to trust router-ca, and we must maintain separation of chains of trust.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, I get your point and agree. I did a review of the the ingress operator cert code and I see the router-ca configmap is only created when it's the self generated cert (i.e. no ingress controllers define defaultCertificate). Why does the ingress operator publish the self generated cert and not user-defined certs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The operator publishes the CA that it uses to sign operator-generated default certificates. If a custom default certificate is provided, we have the certificate but not the signing CA for that certificate (unless the administrator happens to include the CA in the default certificate secret, which we cannot assume to be the case). What @deads2k has proposed is to publish the custom default certificate itself as if it were the CA, which is technically wrong but will work for Go-based clients.

@danehans
Copy link
Contributor

How does this enhancement relate to https://github.com/openshift/enhancements/pull/115/files? It may be a good idea to reference this enhancement and how the two relate.

@Miciah Miciah force-pushed the router-ca-configmap branch from 78d64f8 to 0e0d6ad Compare December 3, 2019 15:31
@Miciah
Copy link
Contributor Author

Miciah commented Dec 9, 2019

How does this enhancement relate to https://github.com/openshift/enhancements/pull/115/files? It may be a good idea to reference this enhancement and how the two relate.

I think the enhancements are not directly related. #126 concerns documenting and modifying how the ingress operator communicates with other components about certificates that the administrator can already configure through an established API whereas #115 concerns a new API for administrators to configure certificates and explicitly does not concern how components communicates with each other:

This enhancement does not address components with existing X.509 trust-distribution mechanisms.

@Miciah
Copy link
Contributor Author

Miciah commented Dec 9, 2019

openshift/cluster-ingress-operator#331 to add default-ingress-cert has merged, and I have opened openshift/cluster-ingress-operator#336 to backport openshift/cluster-ingress-operator#331 to 4.3.z, so we are well underway in executing this enhancement.

@Miciah Miciah changed the title Add router-ca configmap enhancement Add default-ingress-cert ConfigMap enhancement Dec 9, 2019
@ironcladlou
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 18, 2019
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ironcladlou, Miciah

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 18, 2019
@openshift-merge-robot openshift-merge-robot merged commit 5fea2e7 into openshift:master Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants