-
Notifications
You must be signed in to change notification settings - Fork 897
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
[V2V] Conversion Host - Handle CA bundle from UI #18762
[V2V] Conversion Host - Handle CA bundle from UI #18762
Conversation
I don't think I like this. IMO we should modify Can we attach the CA to the same authentication? Or is there a reason not to associate it with a specific ssh key? I'm not that up on CA certs, so forgive my ignorance. |
The authentication we create is for CloudForms to connect to the conversion host. The CA bundle will be deployed to the conversion host, so that it can connect to OpenStack endpoint. So, that's two different purpose. In the future, I hope we have a way to associate the CA bundle to the OpenStack provider authentication directly. |
Oh, I see, it's passed up to the v2v wrapper. |
@@ -68,6 +68,8 @@ def enable(params, auth_user = nil) | |||
|
|||
ssh_key = params.delete(:conversion_host_ssh_private_key) | |||
|
|||
osp_ca_bundle = params.delete(:osp_ca_bundle) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this param name. @mturley what say you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong opinion here. @fdupont-redhat, @djberg96 and I briefly discussed using openstack_tls_ca_certs
to be consistent with the default_tls_ca_certs
used by classic-ui for RHV. Not sure how much this name matters on the backend, but anything is fine for the UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me. We have the ems_type as the prefix and a common suffix with RHV.
I've changed it.
Not exactly. It's passed to the playbook that copies it on the conversion host and update CA trust database on the conversion host. This way, it's like a natively trusted certificate and all programs will trust it, including virt-v2v-wrapper. |
@fdupont-redhat if the ca cert bundle is present, do we need to enable an ssl verify key of any sort? |
@djberg96 nope. It's transparently used. Anyhow, that's a topic we need to revisit for 5.11 to make sure the whole chain is consistent and maybe add some options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving on the condition that @mturley is ok with the param name. :)
app/models/conversion_host.rb
Outdated
@@ -202,7 +202,7 @@ def check_conversion_host_role(miq_task_id = nil) | |||
tag_resource_as('disabled') | |||
end | |||
|
|||
def enable_conversion_host_role(vmware_vddk_package_url = nil, vmware_ssh_private_key = nil, miq_task_id = nil) | |||
def enable_conversion_host_role(vmware_vddk_package_url = nil, vmware_ssh_private_key = nil, osp_ca_bundle = nil, miq_task_id = nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about this now....is there anything that was explicitly passing in a task_id? If so, the param ordering change could be significant.
In the future I think we should change this to keyword params, but that's for another time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that the order is really important there as nothing else is using it.
But you're right, passing a hash might be a good option, in a follow up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mturley is it possible the task_id is getting used on a retry or status check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djberg96 I don't think so, not from the UI anyway. We're only checking status by polling for all tasks, and retry just uses the request_params
from the existing task to start a new enablement, it doesn't pass the task_id anywhere.
@@ -211,7 +211,7 @@ def enable_conversion_host_role(vmware_vddk_package_url = nil, vmware_ssh_privat | |||
:v2v_transport_method => source_transport_method, | |||
:v2v_vddk_package_url => vmware_vddk_package_url, | |||
:v2v_ssh_private_key => vmware_ssh_private_key, | |||
:v2v_ca_bundle => resource.ext_management_system.connection_configurations['default'].certificate_authority | |||
:v2v_ca_bundle => openstack_tls_ca_certs || resource.ext_management_system.connection_configurations['default'].certificate_authority |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @fdupont-redhat @djberg96 couple of things:
First:
resource.ext_management_system.connection_configurations['default'].certificate_authority
Unless I'm reading this wrong, that looks like it can be replaced by resource.ext_management_system.certificate_authority
because we delegate :certificate_authority
to the :default_endpoint
which is all the connection_configurations['default']
does but you should try this yourself, untested
Second:
Why don't we just allow users to enter their certificate authority to the OSP provider and continue to do this in a provider agnostic way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @fdupont-redhat @djberg96 couple of things:
First:
resource.ext_management_system.connection_configurations['default'].certificate_authority
Unless I'm reading this wrong, that looks like it can be replaced by
resource.ext_management_system.certificate_authority
because we delegate:certificate_authority
to the:default_endpoint
which is all theconnection_configurations['default']
does but you should try this yourself, untested
Nice one. I'll test in a follow-up PR.
Second:
Why don't we just allow users to enter their certificate authority to the OSP provider and continue to do this in a provider agnostic way?
The UI doesn't allow you to enter the certificate authority. We'll create an RFE. Unless you know how to do it and we missed it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt you missed it, but given that RHV does this already it sounds like an easily solvable problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, RHV does it but I'm not sure how the backend would handle this. Today, to enable SSL validation with custom CA, you need to install the CA certs on the appliance manually (update-ca-trust
), which is not very convenient at scale. We started the conversation on ManageIQ/manageiq-providers-openstack channel on Gitter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually the API clients (aka fog) allow you to pass your CA when you initiate the connection so that you don't have to modify the system certificate authorities.
Since we don't have an issue with openshift refresh I'm going to assume they just allow self signed certs without verification (@aufi correct me if I'm wrong here) so this would be specifically for v2v.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the main issue is that users will expect that the CA certificate is used by OpenStack provider code and that they don't have to install it manually. So, it's more about setting the wrong expectations with the new field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And we can enable that in the future, I want to avoid having multiple ways of doing things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me too. That's definitely an RFE, but it requires more work to identify how it is leveraged by fog-openstack. Comment from @aufi on Gitter:
I wasn't able display ExtManagementSystem.connection_configuration['default'] which doesn't work for me on master (and ExtManagementSystem.connection_config contains MIQ database settings, if ovirt uses it also for provider connection settings, it might be OK, I just didn't know it).
Looking on fog-openstack (and excon which is used as HTTP client), there is :ssl_ca_path expecting path with CA files what means that CA certs should be stored in filesystem. I might have missed something, but so far I haven't found an easy way to pass CA cert content from MIQ DB to fog-openstack API calls, so it looks to be more complex to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agrare I've created the RFE to keep track of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I'm alright with this as is but really really really (3 reallys means it is serious) don't want to forget about moving this out of here and to the provider
e1bdca2
to
6616dea
Compare
Checked commits fabiendupont/manageiq@74d6dcc~...6616dea with ruby 2.3.3, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay for now, want to follow up to remove this for master and use the provider default endpoint CA
…dle_cacert_from_ui [V2V] Conversion Host - Handle CA bundle from UI (cherry picked from commit d3248d6) https://bugzilla.redhat.com/show_bug.cgi?id=1711036
Hammer backport details:
|
In current implementation, we look for the CA bundle in the provider configuration. However, for OpenStack provider, it's not possible to provide the certificate authority in the UI. So, we plan on asking the user to provide it in the conversion host wizard, until we have a way to provide it when configuring the provider. This PR adds support for an API param named
osp_ca_bundle
openstack_tls_ca_certs
that will be passed to the backend, which will pass it as thev2v_ca_bundle
extra var.Associated RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1708359