Skip to content

Update Fedora release keys to 43–46 and accept rpm 6 key packages - #15304

Open
spnngl wants to merge 4 commits into
ComplianceAsCode:masterfrom
spnngl:fedora-gpgkey-rpm6
Open

spnngl wants to merge 4 commits into
ComplianceAsCode:masterfrom
spnngl:fedora-gpgkey-rpm6

Conversation

@spnngl

@spnngl spnngl commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Description:

  • Fedora release keys move from Fedora 37–40 to 43–46 (products/fedora/product.yml, values from fedora-gpg-keys-44-2).
  • ensure_fedora_gpgkey_installed matches the gpg-pubkey package version as either the key's short ID (rpm 4) or its full fingerprint in lower case (rpm 6).
  • The remediation looks for the key in /usr/share/pki/rpm-gpg first, then in /etc/pki/rpm-gpg.
  • Test scenarios for the rule: key_installed.pass.sh, missing_key.fail.sh, unsupported_key.fail.sh (Fedora 40 key only).

Rationale:

  • Fedora 37 to 40 are past their end of life, so the rule failed on every supported release.
  • rpm 6 (Fedora 43 and later) names an imported key after its full fingerprint: Fedora 44 imports its key as gpg-pubkey-36f612dcf27f7d1a48a835e4dbfcf71c6d9f90a6-6786af3b, where rpm 4 names it gpg-pubkey-6d9f90a6-6786af3b. The release, the key's creation time, is the same in both.
  • From Fedora 45, fedora-gpg-keys installs the keys in /usr/share/pki/rpm-gpg and leaves /etc/pki/rpm-gpg empty, so the remediation found no key to import on Fedora 45 and 46.

Review Hints:

  • One commit per change; the first also updates tests/data/product_stability/fedora.yml.

  • Built with ./build_product fedora --rule-id ensure_fedora_gpgkey_installed. Each scenario ran in a fresh container, with openscap-scanner and gnupg2 installed beforehand: run the scenario, evaluate the rule with oscap xccdf eval, and if it failed, remediate with --remediate and evaluate again:

    Container rpm key_installed.pass missing_key.fail unsupported_key.fail
    fedora:43 6.0.2 pass fail → fixed fail → fixed
    fedora:44 6.0.2 pass fail → fixed fail → fixed
    fedora:45 6.1.0 pass fail → fixed fail → fixed
    fedora:rawhide (46) 6.1.0 pass fail → fixed fail → fixed

    Without the /usr/share/pki/rpm-gpg change, remediation leaves the rule failing on fedora:rawhide, and the key-importing scenarios can't find their key file.

  • Earlier manual checks of the OVAL change on rpm 4: fedora:42 (rpm 4.20.1) passes with the Fedora 44 key imported and fails with only the Fedora 42 key. Fedora CoreOS 44 passes as shipped (fails with 0.1.82).

The keys listed were those of Fedora 37 to 40, all past their end of
life: ensure_fedora_gpgkey_installed failed on every supported release.
Values taken from fedora-gpg-keys-44-2.
rpm 6 sets the version of a gpg-pubkey package to the full fingerprint of
the key, where rpm 4 set its short ID: Fedora 44 imports its key as
gpg-pubkey-36f612dcf27f7d1a48a835e4dbfcf71c6d9f90a6-6786af3b. Match
either.
@openshift-ci openshift-ci Bot added the needs-ok-to-test Used by openshift-ci bot. label Nov 5, 2026
@openshift-ci

openshift-ci Bot commented Nov 5, 2026

Copy link
Copy Markdown

Hi @spnngl. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@vojtapolasek

Copy link
Copy Markdown
Collaborator

@spnngl the update looks good, but could you please also add test scenarios? Check out similar rules for rhel to see how it is done.

From Fedora 45, fedora-gpg-keys installs the keys in /usr/share/pki/rpm-gpg
and leaves /etc/pki/rpm-gpg empty, so the remediation of
ensure_fedora_gpgkey_installed found no key to import on Fedora 45 and
46. Look in /usr/share/pki/rpm-gpg first and fall back to
/etc/pki/rpm-gpg for older releases.
The rule had no test scenarios. Cover:

- key_installed: the running release's key is imported.
- missing_key: no key is imported.
- unsupported_key: only the key of Fedora 40, past its end of life, is
  imported; the rule accepted it before the release keys were updated.
@spnngl

spnngl commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

@vojtapolasek Thanks, I added test scenarios in 83037ba: key_installed.pass.sh, missing_key.fail.sh and unsupported_key.fail.sh (only the Fedora 40 key, which the rule used to accept).

Running them showed that from Fedora 45 the keys are only in /usr/share/pki/rpm-gpg, so the remediation found no key to import. 1783204 fixes that. All scenarios pass on Fedora 43, 44, 45 and rawhide; the PR description has the details.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test Used by openshift-ci bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants