Skip to content
This repository was archived by the owner on Feb 5, 2020. It is now read-only.

Conversation

@s-urbaniak
Copy link
Contributor

@s-urbaniak s-urbaniak commented Aug 31, 2017

Currently everything is based off the Kube CA certificate.

This changes it by:

  1. Modularization of TLS bootstrapping into separate modules/tls subsystems. This allows swapping in/out user-provided vs. self-signed certificates.
  2. Configuring a dedicated Dex client CA in Tectonic console pointing to the identity grpc client CA.
  3. Configuring a dedicated OIDC CA (pointing currently to the ingress CA) certificate for the API server.
  4. Configuring a dedicated ingress CA certificate for the Tectonic console.
modules/tls/
├── etcd (self-signed or user-provided)
├── identity
│   └── self-signed
├── ingress
│   ├── self-signed
│   └── user-provided
└── kube
    └── self-signed

/cc @aaronlevy @sym3tri Note this PR introduces manifest changes! I distilled those in 40da8e2:

  1. Added oidc-ca.crt in kube-apiserver-secret.yaml. This can point to the Kube CA in existing clusters.
  2. Changed --oidc-ca-file setting of the API server which previously pointed to the Kube CA and now points to the above oidc-ca.crt
  3. Added the BRIDGE_DEX_CLIENT_CA_FILE env variable in the console deployment which points to the grpc client CA certificate tectonic-identity-grpc-client-secret/ca-cert. This secret is already present in existing clusters.
  4. The ca-cert in the tectonic-ca-cert-secret secret now points to a dedicated ingress CA certificate, currently effectively pointing to the Kube CA in existing clusters. I don't envision a necessary upgrade path here, but added it in this list for completeness.

Fixes INST-64

@s-urbaniak
Copy link
Contributor Author

/cc @alexsomesan @squat

@s-urbaniak
Copy link
Contributor Author

ok to test

@s-urbaniak
Copy link
Contributor Author

ok to test

@s-urbaniak
Copy link
Contributor Author

ok to test

@aaronlevy
Copy link
Contributor

My 30 second take would be:

Added oidc-ca.crt in kube-apiserver-secret.yaml. This can point to the Kube CA in existing clusters.

This would need to have migration code written to copy the kube-ca in existing clusters to the oidc-ca.crt in the secret file.

Changed --oidc-ca-file setting of the API server which previously pointed to the Kube CA and now points to the above oidc-ca.crt

Would require that the above migration is done so that the new secret/path exists. Then if patch implementation is finished this flag could be fixed as part of normal update process. If it's not finished, need to write migration for all existing clusters to update to the new path.

Added the BRIDGE_DEX_CLIENT_CA_FILE env variable in the console deployment which points to the grpc client CA certificate tectonic-identity-grpc-client-secret/ca-cert. This secret is already present in existing clusters.

If we can get the patch implementation finished, this should be handled with the normal manifest update. If not, we need to write migration code to add this env var to all existing clusters.

The ca-cert in the tectonic-ca-cert-secret secret now points to a dedicated ingress CA certificate, currently effectively pointing to the Kube CA in existing clusters. I don't envision a necessary upgrade path here, but added it in this list for completeness.

As long as names/paths didn't change, and only the content this is probably fine.

cc @diegs @yifan-gu @derekparker

@diegs
Copy link
Contributor

diegs commented Aug 31, 2017

Thanks for the heads up, this is a good candidate for early testing using the merge strategy.

type: Opaque
data:
ca-cert: ${ca_cert}
ca-cert: ${ingress_ca_cert}
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be the CA cert for the CA that signed the identity certificates, not the CA that signed the ingress certs. In its current state, tectonic-console will fail to come up because the identity TLS certs are not trusted. I don't think anyone actually requires the ingress CA cert. We can remove it from the ingress certs module API.

Copy link
Contributor Author

@s-urbaniak s-urbaniak Sep 1, 2017

Choose a reason for hiding this comment

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

In our current setup yes, but not in the case of user-provided, externally signed certs. In the case of user provided certs this is the public CA that signed the ingress CSR, i.e. some public authority (I used let's encrypt for my tests).

You need to set BRIDGE_DEX_CLIENT_CA_FILE (Dex's identity GRPC client CA) in console, otherwise console would crash loop as you mentioned, see 40da8e2#diff-75010753e0caeb22b20777ee897ebebdR102. (I don't see this setting in your PR https://github.com/coreos/tectonic-installer/pull/1818/files).

Side note: I tested successfully this PR with certs signed with let's encrypt, providing them as described in https://github.com/s-urbaniak/tectonic-installer/blob/40da8e2a840df0254c15c5b90947e561812bc563/modules/tls/ingress/user-provided/README.md.

I hope that clarifies it a bit. I will draw a graph today which gives more clarity about our TLS topology. @sym3tri and me yesterday did a first pass and he documented the results in https://docs.google.com/document/d/1nRkwCCL5QkqeqUwMPo1ax2gBLzQ-x7keMI98pSxljL4/edit.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm there is one detail that seems odd to me. Does console use BRIDGE_CA_FILE as the Dex CA cert if that cert is not explicitly passed? That is a funny gotcha that we should rectify.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, just confirmed that dex ca defaults to the console ca, that's was the source of my confusion. I'll make sure to add both flags to my PR as well.

@s-urbaniak
Copy link
Contributor Author

ok to test

2 similar comments
@s-urbaniak
Copy link
Contributor Author

ok to test

@s-urbaniak
Copy link
Contributor Author

ok to test

@s-urbaniak
Copy link
Contributor Author

just fyi: also tested that this change becomes idempotent in conjunction with the changes made in the kvo.

@cpanato cpanato closed this Sep 12, 2017
@cpanato cpanato reopened this Sep 12, 2017
@s-urbaniak
Copy link
Contributor Author

@alexsomesan PTAL, CI is flaky, but this PR used to be green (just moved one line in env vars) and tested locally.

alexsomesan
alexsomesan previously approved these changes Sep 12, 2017
Copy link
Contributor

@alexsomesan alexsomesan left a comment

Choose a reason for hiding this comment

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

Looks great from a TF perspective.
I'll trigger the tests one more time.

Ideally we pair this up with a smoke test that procures some certs, injects them into the installer and checks from a client's perspective if all looks as expected.
But I presume that's quite a bit of work, so most likely should be a follow up.

@alexsomesan
Copy link
Contributor

retest this please

Sergiusz Urbaniak added 2 commits September 13, 2017 07:13
This adds a new modules under `modules/tls/*` which is necessary for swappable TLS certificates.
Currently everything is based off the Kube CA certificate.

This changes it by:
1. Configuring a dedicated Dex client CA in Tectonic console pointing to the identity grpc client CA.
2. Configuring a dedicated OIDC CA certificate for the API server.
3. Configuring a dedicated ingress CA certificate for the Tectonic console.

This will allow to specify separate CA certificates.
@s-urbaniak
Copy link
Contributor Author

@alexsomesan

Ideally we pair this up with a smoke test that procures some certs, injects them into the installer and checks from a client's perspective if all looks as expected.
But I presume that's quite a bit of work, so most likely should be a follow up.

Definitely 👍 we can do this though only once optional modules land, currently this is a manual process.

@s-urbaniak
Copy link
Contributor Author

s-urbaniak commented Sep 13, 2017

  • CI failure is a known flake in the vpc test, all other tests are green
  • KVO upgrade migration has been implemented (but not merged yet upstream!)

hence merging to move forward.

@s-urbaniak s-urbaniak merged commit db65ea2 into coreos:master Sep 13, 2017
s-urbaniak pushed a commit that referenced this pull request Sep 13, 2017
s-urbaniak pushed a commit that referenced this pull request Sep 13, 2017
wking added a commit to wking/openshift-installer that referenced this pull request Oct 29, 2018
We set this in both kube-apiserver-secret.go and
openshift-apiserver-secret.go, and we started setting this in db65ea2
(modules/tls: modularize TLS provisioning, 2017-09-13,
coreos/tectonic-installer#1811).  But we have been using the kube-ca
value for it since at least 4d636d3 (asset/manifests: bootstrap
manifest generation, 2018-08-31, openshift#286) and I see no other OpenShift
consumers [1].

[1]: https://github.com/search?q=org%3Aopenshift+oidc-ca.crt&type=Code
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants