-
Notifications
You must be signed in to change notification settings - Fork 150
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
Add custom CA runtime config option #2721
base: main
Are you sure you want to change the base?
Conversation
This commit adds custom_certificates:ca option to the kiwi.yml runtime configuration. Setting this configuration option will then inject CA certificate to the chroot after bootstrap phase. System phase then can connect to repositories requiring custom CA.
Hi @aaannz, thanks for your effort. I do believe we already have some options to achieve what you are looking for.
Not an option because you don't want to package it
Not an option because you don't want to change the image description I don't have a strong opinion with adding a third method via the runtime configuration file but I believe it looks more like abusing the runtime config :) That config file exists to influence the behavior of the builder and not to modify the root tree. From that perspective I'd like to seek input from @Conan-Kudo and @davidcassany too. If we support this it needs to be handled in its own namespace in the config file, but that you already do with So let's see what others have to say Thanks |
Right. I have no problem adding this as a command line option instead of runtime config, similarly like we have Or I can add removal of this runtime config added certificate at the end of the prepare phase. |
Why wouldn't we just expose the yum repo settings for certificates? This works with DNF and Zypper. |
Interesting idea. So
Correct? |
It would be in the kiwi description XML, not
You would set it in repository section and it would make kiwi copy it into a temporary file and configs would be generated as appropriate. |
But the point here is that I don't want the user to adapt a kiwi template for this particular build system. |
I don't have too much of an issue with the runtime config for CA bundles, but there's no way I'd want this without it also being properly possible in the kiwi description XML. It is common for SSL certs to be needed for repos anyway. And even with description XML, your build system can rewrite things to use correct URLs and CA certs if you wanted. |
@aaannz I wondered what is wrong with the packaging solution ? Providing the CA as a package including the needed post install actions seems like the cleanest and best maintainable solution to this issue. In addition you can pass a package to be installed as a commandline parameter to kiwi as you seem to do it right now. I wondered why you want to move away from this concept ?
That's true. Currently we have a declarative way to handle signing certificates for repositories. kiwi has no declarative way to import system certificates to the key pool. This is done via packages and tools of the distribution (update-ca-certificates). Therefore if we add a generic way to import certificates it should be done declarative in the image description first e.g. <certificates>
<certificate name="foo"/>
</certificates> along with feature we allow this setting also on the commandline. In the end you can then say
and it will do the same as with the section in the XML description. Same concept as we have for packages and other elements. That should provide a solution acceptable to @aaannz, please correct me when wrong. It will also keep the builder configuration free from code that it should imho not have and it is compatible with our rules to describe an image. Thoughts ? |
That makes sense to me. This pattern is much more palatable than putting stuff in the "mystery meat" |
This commit adds custom_certificates:ca option to the kiwi.yml runtime configuration.
Setting this configuration option will then inject CA certificate to the chroot after bootstrap phase. System phase then can connect to repositories requiring custom CA.
Draft note
I open this as a draft PR to discuss if this is viable approach.
Our use case is with SUSE Multi-Linux Manager build hosts. We usually have custom PKI in place so to access repositories provided by SMLM we need to have custom CA certificate. Previously we accomplished this by using bootstrap package added by
--add-bootstrap-package
option, however we are moving away from building RPMs with our certificate and need another way to pass plain certificate file.We cannot use usual means like specifying file in template
root
directory as we need to call update-ca-certificates to load the certificate and also do not want to modify our users templates.What do you think about this? If this is ok, I will add unit tests to this PR.