-
Notifications
You must be signed in to change notification settings - Fork 39
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
Custom CA overwritten when certs::server_ca_cert is undefined #456
Comments
An obvious solution would be to add |
It's not really clear what the problem is. To me this reads as a user error. I don't see the use case where you want custom certificates but not define a server CA. Perhaps we don't enforce it today, but I think it was always assumed you pass in all 3 values. I can imagine that we start to enforce that you pass in all 3 values (key, cert, ca) or fail. We already have some code in https://github.com/theforeman/foreman-installer/blob/develop/hooks/pre_commit/20-certs_update.rb that is related to this.
You can just pass
This is not what we want and a PR will be rejected. |
I ran into this issue when installing a new smart proxy.
When running the installer command, I obviously don't set So, for me smart proxy installation with custom certificates is currently broken and if I installed a smart proxy prior to this change it cannot be upgraded anymore without adding coordinates of cert, key and ca cert pointing to their destinations. If I were to replace the CA I would always do so calling it with |
I think there are two problems here: one for fresh installations of smart proxies, the other one for upgrading existing proxies. A) Installing new proxies: I would simply pass the B) Upgrading proxies: Since I called the installation without the
If you elaborate on what you want, I can come up with a more suitable PR. |
We must manage the file. It sounds like the problem is that we can't properly come up with the value what it should be. I'll need to do some further digging to see what's going on. |
Is it safe to assume we don't want to have the server ca overwritten with default ca if The tar file is probably the common denominator of the problems in this issue and the threads in the Foreman community board. It is also the marker that foreman-installer has ever been called with this parameter. |
The file is always managed. That is the whole model of Puppet: there's a complete definition of the entire state and it will enforce that state. The problem is that somehow the definition of the state is incorrect. |
Yes, I understand your point, you always want to have correctly defined file resource for
|
To be clear: Looking further at the problem, I suspect 433dadc can be a regression. You can see it changes |
I first thought perhaps the tarball itself has the wrong content, but #461 adds a test that tells me otherwise. We don't have any coverage for the content proxy case yet, but such a regression test would be an excellent next step. |
#461 now has a reproducer test. |
Sorry, I was probably not clear about that and sou you put my comments into a context that does not exist. My intention was not to keep annoying anyone with my initial approach. I only asked for more input to come up with a more sophisticated solution. But because "what you want" is still quite a blackbox, how you prioritize parameters, what workflows you have in mind, I went on with my questions. From your posts today I understand you don't want an external contribution to this problem but prefer working on it yourself. Is that correct? |
I wouldn't mind external contributions, but that particular implementation is not the right solution. Now I'm trying to understand what's going on and writing tests is my way of doing so. I think I'm close to a solution, but still experimenting. |
When upgrading a smart proxy with a custom certificate bundle from Foreman 3.10, which uses puppet-certs v17.1.1, to Foreman 3.11, which uses puppet-certs v18.0.0,
foreman-installer
will fail with TLS verification errors.The root cause is this module overwriting the custom CA in
/root/ssl-build/katello-server-ca.crt
with the contents of/root/ssl-build/katello-default-ca.crt
whencerts::server_ca_cert
is undefined in the foreman-installer scenario answers file.This behavior can be seen here. The commit introducing this behavior is 433dadc.
A workaround is to set the following values in
/etc/foreman-installer/scenarios.d/foreman-proxy-content-answers.yaml
The values of certs::server_cert and certs:server_key are required along with certs:server_ca_cert otherwise the installer will fail on the katello-certs-check step.
I am not sure what an appropriate fix would look like. It does seem desirable to use the default CA if it is not explicitly defined. The obvious candidate is testing if
/root/ssl-build/katello-server-ca.crt
already exists before overwriting it with the default CA. Alternatively, applying a migration to explicitly define the values mentioned above. Migrations appear to be outside the scope of this repository however.The text was updated successfully, but these errors were encountered: