Skip to content
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

Fixes #20021 - Optionally generate CA public cert with other CAs certs #160

Closed
wants to merge 1 commit into from

Conversation

sean797
Copy link
Member

@sean797 sean797 commented Jun 16, 2017

@sean797 sean797 force-pushed the multiple-cas branch 7 times, most recently from 82c6145 to f489455 Compare June 16, 2017 15:53
Gemfile Outdated Show resolved Hide resolved
@sean797 sean797 force-pushed the multiple-cas branch 4 times, most recently from 9353db3 to 7281824 Compare June 20, 2017 17:37
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Apologies for the late review.

So the use case for this is that every katello node is a CA and you bundle all the other CAs into it? I think this is a hard part of Katello and I doubt I fully understand this aspect.

spec/acceptance/certs_ca_spec.rb Outdated Show resolved Hide resolved
Gemfile Outdated Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
@sean797 sean797 force-pushed the multiple-cas branch 4 times, most recently from 2c1d4a5 to 4db617f Compare August 24, 2017 17:16
@sean797
Copy link
Member Author

sean797 commented Aug 24, 2017

@ekohl thanks for your review! Updated 👍

Yes, that's it. This CA cert is also bundled in the smart-proxy-certs.tar when generated. Making sure that the smart proxies install CA certs from all Katello nodes and trust them, currently it'll just trust the one the smart-proxy-certs.tar came from.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Interesting. I'll need some time to verify this. Maybe @timogoebel could have a look as well since you're looking at this as well.

lib/puppet/type/ca.rb Outdated Show resolved Hide resolved
lib/puppet/type/ca.rb Show resolved Hide resolved
spec/acceptance/certs_ca_spec.rb Outdated Show resolved Hide resolved
@ekohl
Copy link
Member

ekohl commented Sep 6, 2017

Like we discussed on IRC: I'm afraid this pattern won't scale well since every "node" will be a CA. I do like your acceptance tests and I will use it to write some more

@ekohl ekohl mentioned this pull request Sep 6, 2017
@sean797
Copy link
Member Author

sean797 commented Sep 7, 2017

So we discussed a little more on IRC, putting it here for a wider audience and allow us to think about it a little more:

I don't think we should require an external CA service like freeIPA or others (although that may be a nice optional feature) I think an option may be:

Candlepin node(s) are the default CA(s) and they trust each other if there is more than one.
Other component nodes (qpidd(s), Katello(s), Smart Proxies) would all be setup using a certs.tar or similar. Server CA certs would be optionally supplied when generating Katello(s) or Smart Proxies certs.tar from a candlepin node, just how foreman-proxy-content-certs-generate works today.

@ekohl
Copy link
Member

ekohl commented Sep 7, 2017

I could be convinced of merging this even if we're not going to use it as the default multi-server setups but I'd like the opinion of other maintainers because how we deploy certs is still somewhat unfamiliar to me.

@ehelms
Copy link
Member

ehelms commented Feb 16, 2018

Help remind me -- we need to append because we can't rely on defining a directory of CA certs in all cases to point to vs. a single CA file?

I think it would help me to wrap my brain around the scenarios where multiple CAs would come into play. Feel free to walk me through it like a freshman in college. HA concepts are a weakness of mine that I want to understand better :)

@sean797
Copy link
Member Author

sean797 commented Feb 20, 2018

Help remind me -- we need to append because we can't rely on defining a directory of CA certs in all cases to point to vs. a single CA file?

Sorry not sure what you mean here? My goal is to have the clients & Foreman Proxies trust either of the CAs on my Candlepin nodes (right now with our supported monolithic install that also includes app, pulp, qpid, ect..)

I think it would help me to wrap my brain around the scenarios where multiple CAs would come into play. Feel free to walk me through it like a freshman in college. HA concepts are a weakness of mine that I want to understand better :)

Sure, so HA means Highly Available, if a system is acting in an active/passive mode then that is normally considered HA, as one node will take over when the other fails, normally with a outage as the traffic fails over, if fail over is manual then the outage will likely be longer (but this is still considered to be HA)

I'm trying to make it possible to load balance our application(s) active/active not active/passsive. This will allow for there to be no fail over process which will allow users to add extra capacity to the system by adding more nodes, as well as make it natively HA (HA without pacemaker).

At the the heart of things its super simple idea. Be able to add active component nodes independently without sharing anything to increase capacity and resilience. The nodes shouldn't share any resources, if they require shared storage you just move the Single Point of Failure (SPOF) to the storage system.


This PR allows me to have 2 CAs that each candlepin node uses. I have tested it with 2 monolithic Katello nodes and a single Smart Proxy & Client.

How does this relate to certificates?
Certificates need to be stored somewhere, today we probably could put the certs on shared storage and scale nodes but that just moves to SPOF somewhere else, doesn't really solve the problem.

Any other approaches?
Yes! I think we could use certmonger and/or freeIPA or some other similar service but that also moves the SPOF somewhere else, though freeIPA can be made active/active (I think?) it adds yet more complexity to HA Katello and I don't know how that would work when candlepin issues certs for clients.

@ehelms
Copy link
Member

ehelms commented Feb 22, 2018

First off, thanks for the explanation! That helped a ton in wrapping my brain around how to think about this approach.

The last gap of knowledge to help me fill in is "2 CAs that each Candlepin node uses". Are you saying in this case two root CAs, essentially what is katello-default-ca, are generated and given to each Candlepin instance? And that Candlepin is able to take both CAs and anytime a certificate request is made, Candlepin is able to then cut certificates for each CA to hand to clients?

@sean797
Copy link
Member Author

sean797 commented Feb 22, 2018

I was thinking:

  • CP-node1 would have CA1
  • CP-node2 would have CA2

When my client registers or attaches a new sub, one of those nodes would pick up the request and give my client a cert & key. So my client would potentially have:

  • client key from CA1
  • client cert from CA1
  • CA cert contain both CA1 & CA2 (this comes from the katello-ca-consumer RPM)

My Pulp nodes would then provide content to clients with client certs from either CA1 or CA2. Their certs would come from a certs.tar (like Smart Proxies today) or similar (as would Katello app nodes)

But like I said, this need experimentation, other ideas may also work or be a better architecture to go with.

@bkearney
Copy link

@ehelms Any update on this?

@theforeman-bot

This comment has been minimized.

@theforeman-bot

This comment has been minimized.

@sean797
Copy link
Member Author

sean797 commented Feb 14, 2019

It needs some work to get the tests green, but functionally this PR is fine. I'm happy to get tests passing if we want to merge this - there was some debate previously regarding this approach.

@zjhuntin zjhuntin closed this Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants