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

Upgrade: forbid upgrading with a key XAPI will reject #167

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ydirson
Copy link
Contributor

@ydirson ydirson commented Sep 16, 2024

XAPI now rejects the default keysize of 7.x era, which must be regenerated before upgrading to 8.3. Let the installer refuse to initiate a situation where a Rolling Pool Upgrade would be unable to proceed, with not-yet-updated slaves holding the running VMs getting refused connection to the updated part of the pool.

This now stops the upgrade with the following screen, but after letting the user give consent for launching the upgrade:

cert-too-small

upgrade.py Outdated
primary_fs.unmount()

def testUpgradeForbidden(self, tool):
if tool.partTableType == constants.PARTITION_DOS:
raise RuntimeError("Upgrade from a DOS partition type is not supported.")
if self.key_size < 2048:
raise RuntimeError("Server certificate is too small, must regenerate on 8.2.1 before upgrade.")
Copy link
Collaborator

@alexbrett alexbrett Sep 16, 2024

Choose a reason for hiding this comment

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

I'm nervous about stating a specific version number, perhaps better to have this as e.g. "Current server certificate is too small (%d bits), please regenerate with at least 2048 bits" % (self.key_size,)?

(It may also be a good idea to encode the 2048 as a MIN_KEY_SIZE constant in case this needs to change in the future)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

adjusted in last push

@ydirson ydirson force-pushed the for-xs/certificate-keysize-protection branch 2 times, most recently from f330c6a to 1871e0a Compare September 16, 2024 14:29
XAPI now rejects the default keysize of 7.x era, which must be
regenerated before upgrading to 8.3.  Let the installer refuse to
initiate a situation where a Rolling Pool Upgrade would be unable to
proceed, with not-yet-updated slaves holding the running VMs getting
refused connection to the updated part of the pool.

Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
@ydirson ydirson force-pushed the for-xs/certificate-keysize-protection branch from 1871e0a to 8ab5b8d Compare September 16, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants