ironic-python-agent/ironic_python_agent
Jay Faulkner be8ee50ea1 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
Change-Id: I5254b80717cb5a7f9084e3eff32a00b968f987b7
2024-09-04 09:21:59 -07:00
..
api Use Werkzeug modern version 2022-04-14 10:47:06 +00:00
cmd Support several API and Inspector URLs 2024-01-09 16:43:23 +01:00
extensions Inspect non-raw images for safety 2024-09-04 09:21:59 -07:00
hardware_managers Add mlnx deploy_step entry to enable deploy time firmware 2023-08-31 06:35:39 -07:00
tests Inspect non-raw images for safety 2024-09-04 09:21:59 -07:00
__init__.py Remove eventlet workaround 2024-05-03 08:18:20 -07:00
agent.py Inspect non-raw images for safety 2024-09-04 09:21:59 -07:00
burnin.py Burn-in: Dynamic network pairing 2022-01-10 11:31:33 +01:00
config.py Inspect non-raw images for safety 2024-09-04 09:21:59 -07:00
disk_partitioner.py Import disk_{utils,partitioner} from ironic-lib 2024-03-15 18:45:04 +01:00
disk_utils.py Inspect non-raw images for safety 2024-09-04 09:21:59 -07:00
dmi_inspector.py Collect processor, memory and BIOS output of dmidecode - follow-up 2017-07-27 07:30:54 -07:00
efi_utils.py Step to clean UEFI NVRAM entries 2024-04-11 01:17:23 +12:00
encoding.py Fix serializing ironic-lib exceptions 2020-07-02 12:18:53 +02:00
errors.py Inspect non-raw images for safety 2024-09-04 09:21:59 -07:00
format_inspector.py Inspect non-raw images for safety 2024-09-04 09:21:59 -07:00
hardware.py Fix issues caused/found by new codespell 2024-05-23 15:49:48 -07:00
inject_files.py Import disk_{utils,partitioner} from ironic-lib 2024-03-15 18:45:04 +01:00
inspect.py [codespell] Fix spelling issues in IPA 2023-12-28 10:54:46 -08:00
inspector.py Merge "USB device discovery" 2024-03-28 21:22:53 +00:00
ironic_api_client.py Support several API and Inspector URLs 2024-01-09 16:43:23 +01:00
netutils.py Deprecate LLDP in inventory in favour of a new collector 2023-04-26 19:33:51 +00:00
numa_inspector.py Skip nic numa_node discovery if it's not assigned to a numa_node 2020-01-17 11:15:35 +01:00
partition_utils.py Inspect non-raw images for safety 2024-09-04 09:21:59 -07:00
qemu_img.py Inspect non-raw images for safety 2024-09-04 09:21:59 -07:00
raid_utils.py Import disk_{utils,partitioner} from ironic-lib 2024-03-15 18:45:04 +01:00
tls_utils.py Trivial: avoid deprecated utcnow 2024-01-31 10:09:13 +01:00
utils.py Call evaluate_hardware_support exactly once per hwm 2024-05-22 08:46:21 -07:00
version.py Remove importlib-metadata from requirements 2022-06-21 17:54:39 +02:00