Skip to content

Add a temporary hack to enable ML-KEM for Post Quantum Cryptography support#811

Open
hroyrh wants to merge 1 commit into
openshift:mainfrom
hroyrh:ubi-pqc
Open

Add a temporary hack to enable ML-KEM for Post Quantum Cryptography support#811
hroyrh wants to merge 1 commit into
openshift:mainfrom
hroyrh:ubi-pqc

Conversation

@hroyrh
Copy link
Copy Markdown

@hroyrh hroyrh commented Mar 12, 2026

Summary by CodeRabbit

  • New Features
    • Enabled Post Quantum (PQ) cryptography support to enhance platform security in deployment images.
    • Runtime and build images now include updated crypto-policy artifacts so deployments use PQ-aware cryptographic settings by default, improving long-term cryptographic resilience without requiring manual policy changes.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 12, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The prepare-image.sh script has been updated to include post-quantum cryptography (PQC) enablement. Two new installation steps were added: installing the crypto-policies-scripts package and invoking update-crypto-policies with the DEFAULT:PQ configuration. No existing functionality was modified.

Changes

Cohort / File(s) Summary
Post-Quantum Cryptography Enablement
prepare-image.sh
Added 4 lines to install crypto-policies-scripts and configure DEFAULT:PQ policy via update-crypto-policies command.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately describes the main change: adding ML-KEM/PQ crypto support via a temporary hack, which matches the Dockerfile modifications that introduce Post Quantum cryptography policies.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Stable And Deterministic Test Names ✅ Passed Ginkgo test check not applicable; ironic-image repository contains no Go code or test files, only shell scripts and Dockerfiles.
Test Structure And Quality ✅ Passed The custom check for Ginkgo test code quality is not applicable to this pull request, as the repository contains only Dockerfiles and shell scripts with no Go code or Ginkgo tests present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot requested review from dtantsur and elfosardo March 12, 2026 10:08
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 12, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hroyrh
Once this PR has been reviewed and has the lgtm label, please assign elfosardo for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Dockerfile.ocp`:
- Around line 11-12: The runtime image never receives the PQ crypto policy
because the COPY --from=policy /etc/crypto-policies /etc/crypto-policies is
performed in the builder stage only; update the Dockerfile so the final stage
also copies /etc/crypto-policies from the policy stage into the final image (add
the same COPY --from=policy /etc/crypto-policies /etc/crypto-policies inside the
final stage after its FROM ... AS <final> line), ensuring the path and
ownership/permissions are preserved.

In `@Dockerfile.scos`:
- Around line 11-12: The Dockerfile currently copies /etc/crypto-policies only
into the builder stage (COPY --from=policy /etc/crypto-policies
/etc/crypto-policies) so the final runtime image never receives it; modify the
final/runtime stage to also copy the PQ policy from the policy stage (or from
builder if you prefer) into /etc/crypto-policies (e.g., add a COPY --from=policy
/etc/crypto-policies /etc/crypto-policies inside the final stage after the stage
declaration that produces the shipped image) and ensure file
ownership/permissions are preserved so ML-KEM can use the policy at runtime.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ebca49b3-320c-47d1-9d74-a0003e6dd62c

📥 Commits

Reviewing files that changed from the base of the PR and between 0c07656 and 72d9767.

📒 Files selected for processing (2)
  • Dockerfile.ocp
  • Dockerfile.scos

Comment thread Dockerfile.ocp Outdated
Comment on lines +11 to +12
# Temporary hack to enable Post Quantum(PQ) platform support
COPY --from=policy /etc/crypto-policies /etc/crypto-policies
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

The runtime OCP image still misses the PQ policy.

This COPY only affects builder. The final stage at Line 17 is a new image and never receives /etc/crypto-policies, so the released OCP image will continue using its default crypto policy.

Suggested fix
 FROM registry.ci.openshift.org/ocp/4.22:base-rhel9
 
+COPY --from=policy /etc/crypto-policies /etc/crypto-policies
+
 ENV REMOTE_SOURCES=${REMOTE_SOURCES:-"requirements*.cachito"}
 ENV REMOTE_SOURCES_DIR=${REMOTE_SOURCES_DIR:-"/remote_sources_dir/"}
 ENV PKGS_LIST=main-packages-list.ocp
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Dockerfile.ocp` around lines 11 - 12, The runtime image never receives the PQ
crypto policy because the COPY --from=policy /etc/crypto-policies
/etc/crypto-policies is performed in the builder stage only; update the
Dockerfile so the final stage also copies /etc/crypto-policies from the policy
stage into the final image (add the same COPY --from=policy /etc/crypto-policies
/etc/crypto-policies inside the final stage after its FROM ... AS <final> line),
ensuring the path and ownership/permissions are preserved.

Comment thread Dockerfile.scos Outdated
@elfosardo
Copy link
Copy Markdown

/hold

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 12, 2026
@elfosardo
Copy link
Copy Markdown

/test images

@hroyrh
Copy link
Copy Markdown
Author

hroyrh commented Mar 17, 2026

This pr is not needed, we will wait for the right image to be available.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
Dockerfile.scos (1)

4-4: Use a fixed policy base image version/digest, not ubi:latest.

Using latest introduces non-deterministic builds and weakens supply-chain traceability. Pin to a known tag or digest.

Suggested change
-FROM registry.redhat.io/ubi9/ubi:latest as policy
+ARG POLICY_BASE_IMAGE=registry.redhat.io/ubi9/ubi:9.5
+FROM ${POLICY_BASE_IMAGE} AS policy

As per coding guidelines, "-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Dockerfile.scos` at line 4, The Dockerfile's build stage named "policy" uses
an unpinned base image ("FROM registry.redhat.io/ubi9/ubi:latest as policy"),
causing non-deterministic builds; update that FROM line to reference a specific,
immutable image tag or digest (e.g., a UBI9 version tag or `@sha256`:... digest)
so the "policy" stage is reproducible and supply-chain traceable, and then
rebuild/verify the image with the pinned reference.
Dockerfile.ocp (1)

4-4: Pin the policy base image instead of using ubi:latest.

A floating tag makes builds non-reproducible and can change PQ policy behavior unexpectedly over time. Prefer a fixed tag (or digest) for stability and traceability.

Suggested change
-FROM registry.redhat.io/ubi9/ubi:latest as policy
+ARG POLICY_BASE_IMAGE=registry.redhat.io/ubi9/ubi:9.5
+FROM ${POLICY_BASE_IMAGE} AS policy

As per coding guidelines, "-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Dockerfile.ocp` at line 4, The Dockerfile currently uses a floating base
image tag in the build stage ("FROM registry.redhat.io/ubi9/ubi:latest as
policy"); change this to a pinned, immutable reference (specific version tag or
digest) for the "policy" stage to ensure reproducible builds and stable PQ
behavior—replace the "ubi:latest" tag with a fixed tag (e.g., a specific ubi9
minor patch tag) or an `@sha256` digest for the registry.redhat.io/ubi9/ubi image
so the "policy" build stage always uses the exact same base image.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@Dockerfile.ocp`:
- Line 4: The Dockerfile currently uses a floating base image tag in the build
stage ("FROM registry.redhat.io/ubi9/ubi:latest as policy"); change this to a
pinned, immutable reference (specific version tag or digest) for the "policy"
stage to ensure reproducible builds and stable PQ behavior—replace the
"ubi:latest" tag with a fixed tag (e.g., a specific ubi9 minor patch tag) or an
`@sha256` digest for the registry.redhat.io/ubi9/ubi image so the "policy" build
stage always uses the exact same base image.

In `@Dockerfile.scos`:
- Line 4: The Dockerfile's build stage named "policy" uses an unpinned base
image ("FROM registry.redhat.io/ubi9/ubi:latest as policy"), causing
non-deterministic builds; update that FROM line to reference a specific,
immutable image tag or digest (e.g., a UBI9 version tag or `@sha256`:... digest)
so the "policy" stage is reproducible and supply-chain traceable, and then
rebuild/verify the image with the pinned reference.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2b022a9f-c37d-46fa-9f60-a0d7ed3bdcd7

📥 Commits

Reviewing files that changed from the base of the PR and between 0ebdea3 and 478dda8.

📒 Files selected for processing (2)
  • Dockerfile.ocp
  • Dockerfile.scos

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Dockerfile.ocp`:
- Around line 3-4: The Dockerfile has a `RUN update-crypto-policies --set
DEFAULT:PQ` placed before any `FROM`, which is invalid; move that command into a
build stage by adding a new stage (e.g., a `policy` stage) that starts with a
`FROM` and runs `update-crypto-policies` there, then have later stages inherit
from that stage (or run the `update-crypto-policies` command in each stage that
needs PQ) so the final runtime stage (currently around line 46) either uses
`FROM policy as runtime` or copies the updated policy from the `policy` stage
into the runtime stage; update references to the `policy` stage name
accordingly.

In `@Dockerfile.scos`:
- Around line 3-4: Move the standalone RUN update-crypto-policies into a new
intermediate stage named "policy" that is created FROM the same base image, run
update-crypto-policies in that "policy" stage, and then change the existing
"builder" stage and the final runtime stage to inherit from that policy stage
(use FROM ... AS builder and FROM --from=policy for the final stage) so both
builder and final images pick up the updated crypto policy and the RUN no longer
appears before any FROM.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 09b65fdb-c7e2-4e7e-ad62-64740ac9d5f8

📥 Commits

Reviewing files that changed from the base of the PR and between 478dda8 and f8706c4.

📒 Files selected for processing (2)
  • Dockerfile.ocp
  • Dockerfile.scos

Comment thread Dockerfile.ocp Outdated
Comment on lines +3 to +4
# Temporary hack to enable Post Quantum(PQ) platform support
RUN update-crypto-policies --set DEFAULT:PQ
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

RUN before FROM is invalid Dockerfile syntax — build will fail.

A RUN instruction requires a base image context and cannot precede the first FROM. Hadolint correctly flags this as error DL3061.

To apply the crypto policy, the RUN must execute inside a build stage. If PQ policy is needed in multiple stages (including the final runtime image at line 46), each stage must either inherit from a common policy stage or run the command independently:

Suggested approach using a shared policy stage
-# Temporary hack to enable Post Quantum(PQ) platform support
-RUN update-crypto-policies --set DEFAULT:PQ
-
-FROM registry.ci.openshift.org/ocp/4.22:base-rhel9 AS builder
+FROM registry.ci.openshift.org/ocp/4.22:base-rhel9 AS policy
+# Temporary hack to enable Post Quantum(PQ) platform support
+RUN update-crypto-policies --set DEFAULT:PQ
+
+FROM policy AS builder

Then also update the final runtime stage to inherit from policy:

-FROM registry.ci.openshift.org/ocp/4.22:base-rhel9
+FROM policy
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Temporary hack to enable Post Quantum(PQ) platform support
RUN update-crypto-policies --set DEFAULT:PQ
FROM registry.ci.openshift.org/ocp/4.22:base-rhel9 AS policy
# Temporary hack to enable Post Quantum(PQ) platform support
RUN update-crypto-policies --set DEFAULT:PQ
FROM policy AS builder
🧰 Tools
🪛 Hadolint (2.14.0)

[error] 4-4: Invalid instruction order. Dockerfile must begin with FROM, ARG or comment.

(DL3061)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Dockerfile.ocp` around lines 3 - 4, The Dockerfile has a `RUN
update-crypto-policies --set DEFAULT:PQ` placed before any `FROM`, which is
invalid; move that command into a build stage by adding a new stage (e.g., a
`policy` stage) that starts with a `FROM` and runs `update-crypto-policies`
there, then have later stages inherit from that stage (or run the
`update-crypto-policies` command in each stage that needs PQ) so the final
runtime stage (currently around line 46) either uses `FROM policy as runtime` or
copies the updated policy from the `policy` stage into the runtime stage; update
references to the `policy` stage name accordingly.

Comment thread Dockerfile.scos Outdated
Comment on lines +3 to +4
# Temporary hack to enable Post Quantum(PQ) platform support
RUN update-crypto-policies --set DEFAULT:PQ
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Same invalid RUN before FROM — mirrors Dockerfile.ocp.

As with Dockerfile.ocp, this RUN precedes any FROM and will cause the build to fail (Hadolint DL3061). Apply the same fix: create a policy stage from the base image, run the crypto-policy command there, then have both builder (line 6) and the final stage (line 13) inherit from it.

Suggested fix
-# Temporary hack to enable Post Quantum(PQ) platform support
-RUN update-crypto-policies --set DEFAULT:PQ
-
-FROM quay.io/centos/centos:stream9 AS builder
+FROM quay.io/centos/centos:stream9 AS policy
+# Temporary hack to enable Post Quantum(PQ) platform support
+RUN update-crypto-policies --set DEFAULT:PQ
+
+FROM policy AS builder

And for the final runtime stage:

-FROM quay.io/centos/centos:stream9
+FROM policy
🧰 Tools
🪛 Hadolint (2.14.0)

[error] 4-4: Invalid instruction order. Dockerfile must begin with FROM, ARG or comment.

(DL3061)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Dockerfile.scos` around lines 3 - 4, Move the standalone RUN
update-crypto-policies into a new intermediate stage named "policy" that is
created FROM the same base image, run update-crypto-policies in that "policy"
stage, and then change the existing "builder" stage and the final runtime stage
to inherit from that policy stage (use FROM ... AS builder and FROM
--from=policy for the final stage) so both builder and final images pick up the
updated crypto policy and the RUN no longer appears before any FROM.

…upport

Signed-off-by: Himanshu Roy <hroy@redhat.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@prepare-image.sh`:
- Around line 11-13: Guard the post-quantum policy activation by making the
install/enable conditional: only attempt to install crypto-policies-scripts if
the package is available (check with rpm -q or dnf list), check that the
DEFAULT:PQ profile exists/is supported (e.g., use update-crypto-policies --show
or --list to verify) before calling update-crypto-policies --set DEFAULT:PQ, and
skip this whole block when the system is in FIPS mode (detect via
/etc/system-fips or /proc/cmdline). If any check fails, emit a clear log message
and continue without changing the global crypto policy. Ensure you reference the
exact commands in the script: crypto-policies-scripts and update-crypto-policies
--set DEFAULT:PQ, and the FIPS detection using /etc/system-fips or
/proc/cmdline.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c676743d-98a9-4a69-b930-93fe5abee009

📥 Commits

Reviewing files that changed from the base of the PR and between f8706c4 and b5ba597.

📒 Files selected for processing (1)
  • prepare-image.sh

Comment thread prepare-image.sh
Comment on lines +11 to +13
# Enable PQC
dnf install -y crypto-policies-scripts
update-crypto-policies --set DEFAULT:PQ
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, find and inspect the prepare-image.sh file
find . -name "prepare-image.sh" -type f

Repository: openshift/ironic-image

Length of output: 84


🏁 Script executed:

# List repository structure to understand context
git ls-files | head -20

Repository: openshift/ironic-image

Length of output: 438


🏁 Script executed:

# Read the prepare-image.sh file to verify the context
wc -l ./prepare-image.sh

Repository: openshift/ironic-image

Length of output: 87


🏁 Script executed:

# Read the file with line numbers
cat -n ./prepare-image.sh

Repository: openshift/ironic-image

Length of output: 2903


🌐 Web query:

update-crypto-policies DEFAULT:PQ profile availability RHEL Fedora crypto-policies-scripts

💡 Result:

The DEFAULT:PQ profile is a valid system-wide cryptographic subpolicy that enables post-quantum cryptography (PQC) algorithms, such as hybrid ML-KEM (e.g., ML-KEM-768 with X25519) and ML-DSA, on top of the DEFAULT policy. It is available in RHEL 9.7+ and RHEL 10+, and in recent Fedora releases (e.g., Fedora 42, 43, rawhide) via the crypto-policies package. To use it: 1. Ensure crypto-policies-scripts is installed: sudo dnf install crypto-policies-scripts 2. Set the policy: sudo update-crypto-policies --set DEFAULT:PQ 3. Reboot for full effect: sudo reboot 4. Verify: update-crypto-policies --show In RHEL 10.0, PQC required the crypto-policies-pq-preview package and TEST-PQ subpolicy (Technology Preview). From RHEL 10.1, PQC (including PQ subpolicy support) is enabled by default in predefined policies; use NO-PQ to disable. Fedora integrates upstream changes from the fedora-crypto-policies GitLab repo, including PQ support in modules like TEST-PQ.pmod and NO-PQ.pmod, with recent changelogs confirming ML-KEM/ML-DSA integration.

Citations:


🌐 Web query:

crypto-policies PQ.pmod module post-quantum DEFAULT:PQ

💡 Result:

The PQ.pmod is a policy module file in the crypto-policies system used in RHEL, Fedora, and derivatives like Oracle Linux for enabling post-quantum cryptography (PQC) algorithms system-wide. It is located at /usr/share/crypto-policies/policies/modules/PQ.pmod (or TEST-PQ.pmod in earlier tech preview versions). To enable it: sudo update-crypto-policies --set DEFAULT:PQ (requires crypto-policies-pq-preview package in older versions; integrated in RHEL 10.1+ DEFAULT policy). Reboot to apply. It prioritizes hybrid ML-KEM (e.g., MLKEM768-X25519) key exchange and ML-DSA signatures in TLS/SSH/etc., protecting against quantum "harvest now, decrypt later" attacks. Supported in OpenSSL, GnuTLS, NSS, OpenSSH. .pmod files modify base policies (.pol) by adding (+item) or removing (-item) algorithms, e.g., +MLKEM768-X25519 to group= list with highest priority.

Citations:


🌐 Web query:

update-crypto-policies --set FIPS override behavior unintended

💡 Result:

The command update-crypto-policies --set FIPS sets the system-wide cryptographic policy to the FIPS level on RHEL and compatible systems (e.g., AlmaLinux, Rocky Linux). This configures cryptographic backends like OpenSSL, GnuTLS, NSS, and others to use only FIPS-approved algorithms by generating policy files in /etc/crypto-policies/back-ends/. No widespread bugs or unintended override behaviors were found in official documentation for this specific command on the host system. It behaves as documented: it overwrites /etc/crypto-policies/config with "FIPS", applies the policy (unless --no-reload is used), and recommends a reboot for full effect since policies load at application startup. Potential related issues include: - Running without root privileges causes "permission denied" errors. - update-crypto-policies --check may report mismatches if back-end files were manually edited or after package updates without re-running the command. - In containers (e.g., Podman on FIPS-enabled hosts), Podman intentionally bind-mounts host FIPS back-ends but strips subpolicy modifiers (e.g., FIPS:TEST-MOD shows as plain FIPS inside container). This is by design to avoid config incompatibilities between host/container library versions; run update-crypto-policies inside the container or build custom images. - fips-mode-setup --enable (for full FIPS mode) sets plain FIPS even if a subpolicy like FIPS:OSPP was active, requiring re-application afterward (fixed in later versions). - Some apps (e.g., sshd in FIPS mode) may need explicit config includes (RHEL 9: Include /etc/crypto-policies/back-ends/opensshserver.config in sshd_config; RHEL 8 uses systemd). Testing sshd -T requires sourcing the policy file for accurate runtime view. - Ubuntu's crypto-policies package generates files but lacks integration, so policies have no effect. For full FIPS compliance, use fips-mode-setup --enable (adds fips=1 kernel param, dracut module), regenerate keys, and reboot. update-crypto-policies --set FIPS alone does not enable kernel FIPS mode or guarantee FIPS 140 compliance.

Citations:


🏁 Script executed:

# Check the Dockerfiles for base images and FIPS-related content
head -20 Dockerfile.fcos Dockerfile.ocp Dockerfile.okd Dockerfile.scos 2>/dev/null | grep -E "FROM|FIPS|crypto|RUN.*prepare-image"

Repository: openshift/ironic-image

Length of output: 398


🏁 Script executed:

# More comprehensive check of all Dockerfiles for prepare-image.sh invocation and base images
for f in Dockerfile.*; do
  echo "=== $f ==="
  head -30 "$f"
done

Repository: openshift/ironic-image

Length of output: 3836


🏁 Script executed:

# Verify OS versions in the base images to see DEFAULT:PQ support likelihood
rg "crypto-policies|DEFAULT:PQ|PQ\.pmod" --type shell --type bash

Repository: openshift/ironic-image

Length of output: 95


🏁 Script executed:

# Check if there's any version pinning or OS version info in comments/docs
cat README.md | head -50

Repository: openshift/ironic-image

Length of output: 2329


Guard PQ policy activation; unconditional global override risks build failures and FIPS compliance.

Lines 12–13 unconditionally enable post-quantum cryptography under strict error mode (line 3). This can break builds when DEFAULT:PQ profile or PQ.pmod module is unavailable in the base image, and unintentionally overrides FIPS-configured environments—a concern given the existing FIPS awareness in the script (lines 34–36).

Suggested hardening
-# Enable PQC
-dnf install -y crypto-policies-scripts
-update-crypto-policies --set DEFAULT:PQ
+# Enable PQC (explicit opt-in)
+if [[ "${ENABLE_PQC:-false}" == "true" ]]; then
+    dnf install -y crypto-policies-scripts
+
+    current_policy="$(update-crypto-policies --show || true)"
+    if [[ "${current_policy}" == FIPS* ]]; then
+        echo "Refusing to override FIPS crypto policy with DEFAULT:PQ" >&2
+        exit 1
+    fi
+
+    if [[ -f /usr/share/crypto-policies/policies/modules/PQ.pmod ]]; then
+        update-crypto-policies --set DEFAULT:PQ
+    else
+        echo "PQC policy module (PQ.pmod) not available in this image" >&2
+        exit 1
+    fi
+fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Enable PQC
dnf install -y crypto-policies-scripts
update-crypto-policies --set DEFAULT:PQ
# Enable PQC (explicit opt-in)
if [[ "${ENABLE_PQC:-false}" == "true" ]]; then
dnf install -y crypto-policies-scripts
current_policy="$(update-crypto-policies --show || true)"
if [[ "${current_policy}" == FIPS* ]]; then
echo "Refusing to override FIPS crypto policy with DEFAULT:PQ" >&2
exit 1
fi
if [[ -f /usr/share/crypto-policies/policies/modules/PQ.pmod ]]; then
update-crypto-policies --set DEFAULT:PQ
else
echo "PQC policy module (PQ.pmod) not available in this image" >&2
exit 1
fi
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@prepare-image.sh` around lines 11 - 13, Guard the post-quantum policy
activation by making the install/enable conditional: only attempt to install
crypto-policies-scripts if the package is available (check with rpm -q or dnf
list), check that the DEFAULT:PQ profile exists/is supported (e.g., use
update-crypto-policies --show or --list to verify) before calling
update-crypto-policies --set DEFAULT:PQ, and skip this whole block when the
system is in FIPS mode (detect via /etc/system-fips or /proc/cmdline). If any
check fails, emit a clear log message and continue without changing the global
crypto policy. Ensure you reference the exact commands in the script:
crypto-policies-scripts and update-crypto-policies --set DEFAULT:PQ, and the
FIPS detection using /etc/system-fips or /proc/cmdline.

@hroyrh
Copy link
Copy Markdown
Author

hroyrh commented Mar 20, 2026

/test images

1 similar comment
@hroyrh
Copy link
Copy Markdown
Author

hroyrh commented Mar 23, 2026

/test images

@hroyrh
Copy link
Copy Markdown
Author

hroyrh commented Mar 23, 2026

/retest-required

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 23, 2026

@hroyrh: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

openshift-merge-bot Bot pushed a commit that referenced this pull request Mar 25, 2026
🐛 fix: correct dhcp tag for ipv6 pxe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants