From Fedora Project Wiki
(Upgrade/compatibility impact)
(announcing the change)
 
(13 intermediate revisions by 2 users not shown)
Line 4: Line 4:


== Summary ==
== Summary ==
Implementing new logic in DNF5 to remove expired and obsolete PGP keys from the system.
Implementing new logic in DNF5 to remove expired and obsolete repository keys from the system.


== Owner ==
== Owner ==
Line 11: Line 11:


== Current status ==
== Current status ==
[[Category:ChangePageIncomplete]]
[[Category:ChangeAnnounced]]
<!-- When your change proposal page is completed and ready for review and announcement -->
<!-- When your change proposal page is completed and ready for review and announcement -->
<!-- remove Category:ChangePageIncomplete and change it to Category:ChangeReadyForWrangler -->
<!-- remove Category:ChangePageIncomplete and change it to Category:ChangeReadyForWrangler -->
Line 28: Line 28:
ON_QA -> change is fully code complete
ON_QA -> change is fully code complete
-->
-->
* [Announced]
* [https://lists.fedoraproject.org/archives/list/devel-announce@lists.fedoraproject.org/thread/SYL6WOCZZBDC6UE4GZOPVD2NXM5P6LIV/ Announced]
* [<will be assigned by the Wrangler> Discussion thread]
* [https://discussion.fedoraproject.org/t/f42-change-proposal-dnf5-expired-keys-system-wide/138978 Discussion thread]
* FESCo issue: <will be assigned by the Wrangler>
* FESCo issue: <will be assigned by the Wrangler>
* Tracker bug: <will be assigned by the Wrangler>
* Tracker bug: <will be assigned by the Wrangler>
Line 35: Line 35:


== Detailed Description ==
== Detailed Description ==
We aim to address customer issues when installing RPM packages from repositories while outdated repository keys are present on the system. These issues include expired keys, obsolete signing algorithms (e.g., SHA1), or other problems that could be easily detected by tools like an RPM PGP linter. Currently, GPG checks fail, and users must manually remove expired keys using commands like `rpm -e gpg-pubkey-...`.
We aim to address customer issues when installing RPM packages from repositories while outdated repository keys are present on the system. These issues include expired keys, obsolete signing algorithms (e.g., SHA1), or other problems that could be easily detected by tools like an RPM PGP linter. Currently, PGP checks fail, and users must manually remove expired keys using commands like `rpmkeys --delete`.


The proposed solution is a new LIBDNF5 plugin. This plugin will act as a hook, checking for invalid repository PGP keys on the system before executing a DNF transaction.
The proposed solution is a new LIBDNF5 plugin. This plugin will act as a hook, checking for invalid repository PGP keys on the system before executing a DNF transaction.
Line 48: Line 48:
== Feedback ==
== Feedback ==
The proposed solution has been discussed with affected users, including the Mock and Copr teams, as part of the discussions around [https://github.com/rpm-software-management/dnf-plugins-core/pull/533 the existing solution in DNF4].
The proposed solution has been discussed with affected users, including the Mock and Copr teams, as part of the discussions around [https://github.com/rpm-software-management/dnf-plugins-core/pull/533 the existing solution in DNF4].
Additionally, [https://github.com/kubernetes/release/issues/3840 a report from the Kubernetes release team] highlights a similar issue, which should also be addressed under the defined behavior.


== Benefit to Fedora ==
== Benefit to Fedora ==
Line 61: Line 59:
** No additional work identified at this time.
** No additional work identified at this time.


* Release engineering: [https://pagure.io/releng/issues #Releng issue number] <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
* Release engineering: [https://pagure.io/releng/issue/12477 #12477]
<!-- Does this feature require coordination with release engineering (e.g. changes to installer image generation or update package delivery)?  Is a mass rebuild required?  include a link to the releng issue.
The issue is required to be filed prior to feature submission, to ensure that someone is on board to do any process development work and testing and that all changes make it into the pipeline; a bullet point in a change is not sufficient communication -->


* Policies and guidelines: N/A (not needed for this Change) <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
* Policies and guidelines: N/A (not needed for this Change)
<!-- Do the packaging guidelines or other documents need to be updated for this feature?  If so, does it need to happen before or after the implementation is done?  If a FPC ticket exists, add a link here. Please submit a pull request with the proposed changes before submitting your Change proposal. -->


* Trademark approval: N/A (not needed for this Change)
* Trademark approval: N/A (not needed for this Change)
<!-- If your Change may require trademark approval (for example, if it is a new Spin), file a ticket ( https://pagure.io/Fedora-Council/tickets/issues ) requesting trademark approval from the Fedora Council. This approval will be done via the Council's consensus-based process. -->


== Upgrade/compatibility impact ==
== Upgrade/compatibility impact ==
No compatibility or upgrade issues expected.
No compatibility or upgrade issues expected.


== Early Testing (Optional) ==
== How To Test ==
<!-- This is an optional step for system-wide changes to avail of. If you would like to build an initial proof of concept of your change and have a member of Fedora QA help you write and/or run some initial basic tests on your code, please email tests@fedoraproject.org and include the link to your change proposal. This step is *optional*. -->
A good reproducer is already described in [https://github.com/rpm-software-management/dnf5/issues/1192#issuecomment-2018483474 this comment] within the upstream issue.


Do you require 'QA Blueprint' support? Y/N <!-- Optional Step for System-Wide Changes only -->
You can list all installed key hashes along with their names using:


== How To Test ==
`rpmkeys --list`
<!-- This does not need to be a full-fledged document. Describe the dimensions of tests that this change implementation is expected to pass when it is done.  This can be based off of the above section if early testing has been completed. If it needs to be tested with different hardware or software configurations, indicate them.  The more specific you can be, the better the community testing can be.


Remember that you are writing this how to for interested testers to use to check out your change implementation - documenting what you do for testing is OK, but it's much better to document what *I* can do to test your change.
To query the key block info, use:


A good "how to test" should answer these four questions:
`rpm -q --qf "%{DESCRIPTION}" gpg-pubkey-<KEYHASH>` (note: `rpmkeys --export <KEYHASH>` on newer RPM releases)


0. What special hardware / data / etc. is needed (if any)?
To get the end date in a human-readable format, run:
1. How do I prepare my system to test this change? What packages
need to be installed, config files edited, etc.?
2. What specific actions do I perform to check that the change is
working like it's supposed to?
3. What are the expected results of those actions?
-->


<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
`rpm -q --qf "%{DESCRIPTION}" gpg-pubkey-<KEYHASH> | gpg --show-keys --with-colon | cut -d':' -f7 | xargs -I{} date -d @{}
`


== User Experience ==
Note that not all keys have a defined end of validity date.
<!-- If this change proposal is noticeable by users, how will their experiences change as a result?


This section partially overlaps with the Benefit to Fedora section above. This section should be primarily about the User Experience, written in a way that does not assume deep technical knowledge. More detailed technical description should be left for the Benefit to Fedora section.
You can also try running a transaction using a COPR repository with the `faketime` command from `libfaketime`:


Describe what Users will see or notice, for example:
`faketime '+10years' dnf install <pkg_name_from_copr>`
  - Packages are compressed more efficiently, making downloads and upgrades faster by 10%.
  - Kerberos tickets can be renewed automatically. Users will now have to authenticate less and become more productive. Credential management improvements mean a user can start their work day with a single sign on and not have to pause for reauthentication during their entire day.
- Libreoffice is one of the most commonly installed applications on Fedora and it is now available by default to help users "hit the ground running".
- Green has been scientifically proven to be the most relaxing color. The move to a default background color of green with green text will result in Fedora users being the most relaxed users of any operating system.
-->


== Dependencies ==
The above should fail without the functionality introduced by this proposal. After deploying the new plugin, it should prompt the user about the expired PGP key and ask for removal.
<!-- What other packages (RPMs) depend on this package?  Are there changes outside the developers' control on which completion of this change depends?  In other words, completion of another change owned by someone else and might cause you to not be able to finish on time or that you would need to coordinate?  Other upstream projects like the kernel (if this is not a kernel change)? -->


<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
== User Experience ==
For interactive users, a prompt will appear informing them about each outdated key on the system and asking for confirmation to remove it. For non-interactive users, there will be no change to the workflow.


== Dependencies ==
No additional work is expected.


== Contingency Plan ==
== Contingency Plan ==
 
* Contingency mechanism: Disable the new plugin from running by default.
<!-- If you cannot complete your feature by the final development freeze, what is the backup plan?  This might be as simple as "Revert the shipped configuration".  Or it might not (e.g. rebuilding a number of dependent packages).  If you feature is not completed in time we want to assure others that other parts of Fedora will not be in jeopardy.  -->
* Contingency deadline: Fedora 42 branching from Rawhide
* Contingency mechanism: (What to do?  Who will do it?) N/A (not a System Wide Change)  <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
* Blocks release? No
<!-- When is the last time the contingency mechanism can be put in place?  This will typically be the beta freeze. -->
* Contingency deadline: N/A (not a System Wide Change)  <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
<!-- Does finishing this feature block the release, or can we ship with the feature in incomplete state? -->
* Blocks release? N/A (not a System Wide Change), Yes/No <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
 


== Documentation ==
== Documentation ==
<!-- Is there upstream documentation on this change, or notes you have written yourself?  Link to that material here so other interested developers can get involved. -->
The new behavior will be documented in the upstream DNF5 documentation.
 
<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
N/A (not a System Wide Change)


== Release Notes ==
== Release Notes ==

Latest revision as of 17:19, 3 December 2024

Managing expired PGP keys in DNF5

This is a proposed Change for Fedora Linux.
This document represents a proposed Change. As part of the Changes process, proposals are publicly announced in order to receive community feedback. This proposal will only be implemented if approved by the Fedora Engineering Steering Committee.

Summary

Implementing new logic in DNF5 to remove expired and obsolete repository keys from the system.

Owner

Current status

  • Targeted release: Fedora Linux 42
  • Last updated: 2024-12-03
  • Announced
  • Discussion thread
  • FESCo issue: <will be assigned by the Wrangler>
  • Tracker bug: <will be assigned by the Wrangler>
  • Release notes tracker: <will be assigned by the Wrangler>

Detailed Description

We aim to address customer issues when installing RPM packages from repositories while outdated repository keys are present on the system. These issues include expired keys, obsolete signing algorithms (e.g., SHA1), or other problems that could be easily detected by tools like an RPM PGP linter. Currently, PGP checks fail, and users must manually remove expired keys using commands like rpmkeys --delete.

The proposed solution is a new LIBDNF5 plugin. This plugin will act as a hook, checking for invalid repository PGP keys on the system before executing a DNF transaction.

  • Interactive mode: The plugin will prompt the user to confirm the removal of each invalid key.
  • Non-interactive mode (e.g., with -y or --assumeno): The plugin will proceed automatically based on the specified user action, either removing the keys or retaining them.

By default, this behavior will be enabled in DNF5, with the option to disable it through configuration.

This enhancement stems from a request in upstream issue and builds upon the existing solution in DNF4. Unlike DNF4's implementation, which is not enabled by default, this change will be integral to the default DNF5 functionality, aligning with its role as the primary package manager in Fedora.

Feedback

The proposed solution has been discussed with affected users, including the Mock and Copr teams, as part of the discussions around the existing solution in DNF4.

Benefit to Fedora

This change enables the automatic management of repository keys during software installation or upgrades.

Scope

  • Proposal owners:
    • Implement a new LIBDNF5 plugin to manage repository PGP keys automatically.
  • Other developers:
    • No additional work identified at this time.
  • Policies and guidelines: N/A (not needed for this Change)
  • Trademark approval: N/A (not needed for this Change)

Upgrade/compatibility impact

No compatibility or upgrade issues expected.

How To Test

A good reproducer is already described in this comment within the upstream issue.

You can list all installed key hashes along with their names using:

rpmkeys --list

To query the key block info, use:

rpm -q --qf "%{DESCRIPTION}" gpg-pubkey-<KEYHASH> (note: rpmkeys --export <KEYHASH> on newer RPM releases)

To get the end date in a human-readable format, run:

rpm -q --qf "%{DESCRIPTION}" gpg-pubkey-<KEYHASH> | gpg --show-keys --with-colon | cut -d':' -f7 | xargs -I{} date -d @{}

Note that not all keys have a defined end of validity date.

You can also try running a transaction using a COPR repository with the faketime command from libfaketime:

faketime '+10years' dnf install <pkg_name_from_copr>

The above should fail without the functionality introduced by this proposal. After deploying the new plugin, it should prompt the user about the expired PGP key and ask for removal.

User Experience

For interactive users, a prompt will appear informing them about each outdated key on the system and asking for confirmation to remove it. For non-interactive users, there will be no change to the workflow.

Dependencies

No additional work is expected.

Contingency Plan

  • Contingency mechanism: Disable the new plugin from running by default.
  • Contingency deadline: Fedora 42 branching from Rawhide
  • Blocks release? No

Documentation

The new behavior will be documented in the upstream DNF5 documentation.

Release Notes