Skip to content

Check for PQC GPG key only on RHEL 10.1 and newer#14462

Merged
vojtapolasek merged 1 commit intoComplianceAsCode:masterfrom
jan-cerny:rhel10_pqc
Feb 27, 2026
Merged

Check for PQC GPG key only on RHEL 10.1 and newer#14462
vojtapolasek merged 1 commit intoComplianceAsCode:masterfrom
jan-cerny:rhel10_pqc

Conversation

@jan-cerny
Copy link
Collaborator

@jan-cerny jan-cerny commented Feb 26, 2026

Description:

The redhat-release RPM package in RHEL 10.0 won't contain the postquantum OpenGPG key. This key will be present in RHEL 10.1 and newer.

Addressing:
Failing rule ensure_redhat_gpgkey_installed in multiple contest tests /hardening/host-os/oscap on RHEL 10.0.

Rationale:

Fixes https://issues.redhat.com/browse/OPENSCAP-6613

Review Hints:

Run contest test /hardening/host-os/oscap on RHEL 10.0 and 10.1.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Used by openshift-ci bot. label Feb 26, 2026
@openshift-ci
Copy link

openshift-ci bot commented Feb 26, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@github-actions
Copy link

This datastream diff is auto generated by the check Compare DS/Generate Diff

Click here to see the full diff
bash remediation for rule 'xccdf_org.ssgproject.content_rule_ensure_redhat_gpgkey_installed' differs.
--- xccdf_org.ssgproject.content_rule_ensure_redhat_gpgkey_installed
+++ xccdf_org.ssgproject.content_rule_ensure_redhat_gpgkey_installed
@@ -20,11 +20,9 @@
   # No CRC error, safe to proceed
   if [ "${GPG_RESULT}" -eq "0" ]
   then
+  # If $REDHAT_RELEASE_KEY file doesn't contain any keys with unknown fingerprint, import it
 
-    echo "${GPG_OUT[*]}" | grep -vE "${REDHAT_RELEASE_FINGERPRINT}|${REDHAT_AUXILIARY_FINGERPRINT}" || {
+    echo "${GPG_OUT[*]}" | grep -vE "${REDHAT_RELEASE_FINGERPRINT}|${REDHAT_AUXILIARY_FINGERPRINT}" || rpm --import "${REDHAT_RELEASE_KEY}"
 
-      # If $REDHAT_RELEASE_KEY file doesn't contain any keys with unknown fingerprint, import it
-      rpm --import "${REDHAT_RELEASE_KEY}"
-    }
   fi
 fi

@jan-cerny jan-cerny added this to the 0.1.80 milestone Feb 26, 2026
@jan-cerny jan-cerny added the productization-issue Issue found in upstream stabilization process. label Feb 26, 2026
@jan-cerny jan-cerny marked this pull request as ready for review February 26, 2026 14:24
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Used by openshift-ci bot. label Feb 26, 2026
@jan-cerny
Copy link
Collaborator Author

@ggbecker has raised a concern that this check was only for RHEL 10 (as a major release), but the PQC GPG key is in both RHEL 9 and RHEL 10

I think we shall extend this PR and make the check for RHEL 9.7 and newer as well.

@jan-cerny jan-cerny marked this pull request as draft February 26, 2026 15:48
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Used by openshift-ci bot. label Feb 26, 2026
@vojtapolasek vojtapolasek self-assigned this Feb 27, 2026
The redhat-release RPM package in RHEL 10.0 won't contain the
postquantum OpenGPG key. This key will be present in RHEL 10.1
and newer.

Addressing:
Failing rule `ensure_redhat_gpgkey_installed` in multiple contest
tests `/hardening/host-os/oscap` on RHEL 10.0.
@jan-cerny
Copy link
Collaborator Author

@ggbecker I have tried to extend the check to RHEL 9. That has revealed that there are some differences between RHEL 9 and RHEL 10 in how the postquantum GPG key is implemented.

Specifically:

  • PQC signing is available in both RHEL 9.7 and RHEL 10.1
  • both RHEL 9.7 and RHEL 10.1 ship the PQC GPG key in the redhat-release RPM package
  • but: on RHEL 9.7 the key is shipped in a separate file /etc/pki/rpm-gpg/RPM-GPG-KEY-PQC-redhat-release whereas on RHEL 10.1 the key is a part of the common file /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
  • on RHEL 9.7 using the PQC signatures is optional and there is an entirely separate copy of RPM with PQ support that is not installed by default. IOW the users need to opt-in to use the key.
  • on RHEL 9.7 the sq command that we use in our RHEL 10 remediation to get the fingerprint isn't available

That means we can't do the same check and remediation on RHEL 9 as we have on RHEL 10.

Also, the release stabilization tests fail on RHEL 10.0, not on RHEL 9. The reason is that in the current CaC code the rule contains checks and remediations for the postquantum GPG key only on RHEL 10.

Therefore, I have removed the RHEL 9 related changes from this PR and I have submitted them as a separate PR in #14475. We will modify that PR later.

This PR splitting will help us to fix the failing stabilization tests on RHEL 10.0 and proceed further with the release.

@jan-cerny jan-cerny marked this pull request as ready for review February 27, 2026 09:04
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Used by openshift-ci bot. label Feb 27, 2026
Copy link
Collaborator

@vojtapolasek vojtapolasek left a comment

Choose a reason for hiding this comment

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

Looks good. I tested with Automatus on RHEL 9, 10.0 and 10.2.
Ansible remediation aborts on 10.2, but unfortunately this is not something we can fix. Relevant PR: ansible/ansible#86157

@vojtapolasek vojtapolasek merged commit 37188e2 into ComplianceAsCode:master Feb 27, 2026
58 of 64 checks passed
@jan-cerny jan-cerny added the backported-into-stabilization PRs which were cherry-picked during stabilization process. label Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backported-into-stabilization PRs which were cherry-picked during stabilization process. productization-issue Issue found in upstream stabilization process.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants