Skip to content

Synchronise 2023.1 with upstream #80

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

Merged
merged 3 commits into from
Sep 9, 2024

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Sep 9, 2024

This PR contains a snapshot of 2023.1 from upstream stable/2023.1.

juliakreger and others added 3 commits September 6, 2024 09:25
Also removes a number of non-voting jobs which have no possibility
of fixing.

Change-Id: I5c3b6d3dd4370bccd21a1b6af8f3070410b4b455
- Remove and disable examples job as it is not a valid check to import
  the hwm without it being loaded into IPA first, as objects such as
  the configuration object won't be loaded yet.
- Change nodeset for centos build so it works and re-enable the check
  job so we can be certain it's working.

Change-Id: Icf20e71e8061bb886885c1b2e29bd13ccac37ade
This is a backport of two changes merged together to facilitate
backporting:

The first is a refactor of disk utilities:

Import disk_{utils,partitioner} from ironic-lib

With the iscsi deploy long gone, these modules are only used in IPA and
in fact represent a large part of its critical logic. Having them
separately sometimes makes fixing issues tricky if an interface of
a function needs changing.

This change imports the code mostly as it is, just removing run_as_root and
a deprecated function, as well as moving configuration options to config.py.

Also migrates one relevant function from ironic_lib.utils.

The second is the fix for the security issue:

Inspect non-raw images for safety

When IPA gets a non-raw image, it performs an on-the-fly conversion
using qemu-img convert, as well as running qemu-img frequently to get
basic information about the image before validating it.

Now, we ensure that before any qemu-img calls are made, that we have
inspected the image for safety and pass through the detected format.

If given a disk_format=raw image and image streaming is enabled
(default), we retain the existing behavior of not inspecting it in
any way and streaming it bit-perfect to the device. In this case, we
never use qemu-based tools on the image at all.

If given a disk_format=raw image and image streaming is disabled, this
change fixes a bug where the image may have been converted if it was not
actually raw in the first place. We now stream these bit-perfect to the
device.

Adds two config options:
- [DEFAULT]/disable_deep_image_inspection, which can be set to "True" in
  order to disable all security features. Do not do this.
- [DEFAULT]/permitted_image_formats, default raw,qcow2, for image types
  IPA should accept.

Both of these configuration options are wired up to be set by the lookup
data returned by Ironic at lookup time.

This uses a image format inspection module imported from Nova; this
inspector will eventually live in oslo.utils, at which point we'll
migrate our usage of the inspector to it.

Closes-Bug: #2071740
Co-Authored-By: Dmitry Tantsur <dtantsur@protonmail.com>
Change-Id: I5254b80717cb5a7f9084e3eff32a00b968f987b7
@github-actions github-actions bot requested a review from a team as a code owner September 9, 2024 06:23
@github-actions github-actions bot added automated Automated action performed by GitHub Actions synchronisation labels Sep 9, 2024
@priteau priteau merged commit e9cabcb into stackhpc/2023.1 Sep 9, 2024
@priteau priteau deleted the upstream/2023.1-2024-09-09 branch September 9, 2024 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automated Automated action performed by GitHub Actions synchronisation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants