From Fedora Project Wiki
(Feedback)
(announcing the change)
 
(18 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 44: Line 44:
By default, this behavior will be enabled in DNF5, with the option to disable it through configuration.
By default, this behavior will be enabled in DNF5, with the option to disable it through configuration.


This enhancement stems from a request in [https://github.com/rpm-software-management/dnf5/issues/1192 upstream issue] and builds upon the [https://github.com/rpm-software-management/dnf-plugins-core/pull/533 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.
This enhancement stems from a request in [https://github.com/rpm-software-management/dnf5/issues/1192 upstream issue] and builds upon [https://github.com/rpm-software-management/dnf-plugins-core/pull/533 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 ==
== 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 ==
<!-- What is the benefit to the distribution?  Will the software we generate be improved? How will the process of creating Fedora releases be improved?
This change enables the automatic management of repository keys during software installation or upgrades.
 
      Be sure to include the following areas if relevant:
      If this is a major capability update, what has changed?
          For example: This change introduces Python 5 that runs without the Global Interpreter Lock and is fully multithreaded.
      If this is a new functionality, what capabilities does it bring?
          For example: This change allows package upgrades to be performed automatically and rolled-back at will.
      Does this improve some specific package or set of packages?
          For example: This change modifies a package to use a different language stack that reduces install size by removing dependencies.
      Does this improve specific Spins or Editions?
          For example: This change modifies the default install of Fedora Workstation to be more in line with the base install of Fedora Server.
      Does this make the distribution more efficient?
          For example: This change replaces thousands of individual %post scriptlets in packages with one script that runs at the end.
      Is this an improvement to maintainer processes?
          For example: Gating Fedora packages on automatic QA tests will make rawhide more stable and allow changes to be implemented more smoothly.
      Is this an improvement targeted as specific contributors?
          For example: Ensuring that a minimal set of tools required for contribution to Fedora are installed by default eases the onboarding of new contributors.
 
    When a Change has multiple benefits, it's better to list them all.
 
    Consider these Change pages from previous editions as inspiration:
    https://fedoraproject.org/wiki/Changes/Annobin (low-level and technical, invisible to users)
    https://fedoraproject.org/wiki/Changes/ParallelInstallableDebuginfo (low-level, but visible to advanced users)
    https://fedoraproject.org/wiki/Changes/VirtualBox_Guest_Integration (primarily a UX change)
    https://fedoraproject.org/wiki/Changes/NoMoreAlpha (an improvement to distro processes)
    https://fedoraproject.org/wiki/Changes/perl5.26 (major upgrade to a popular software stack, visible to users of that stack)
-->


== Scope ==
== Scope ==
* Proposal owners:
* Proposal owners:
<!-- What work do the feature owners have to accomplish to complete the feature in time for release?  Is it a large change affecting many parts of the distribution or is it a very isolated change? What are those changes?-->
** Implement a new LIBDNF5 plugin to manage repository PGP keys automatically.


* Other developers: <!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
* Other developers:  
<!-- What work do other developers have to accomplish to complete the feature in time for release?  Is it a large change affecting many parts of the distribution or is it a very isolated change? What are those changes?-->
** 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. -->


* Alignment with the Fedora Strategy:
== Upgrade/compatibility impact ==
<!-- Does your proposal align with the current Fedora Strategy: https://discussion.fedoraproject.org/t/fedora-strategy-2028-february-march-planning-work-and-roadmap-til-flock/43618 ? It's okay if it doesn't, but it's something to consider -->
No compatibility or upgrade issues expected.


== Upgrade/compatibility impact ==
== How To Test ==
<!-- What happens to systems that have had a previous versions of Fedora installed and are updated to the version containing this change? Will anything require manual configuration or data migration? Will any existing functionality be no longer supported? -->
A good reproducer is already described in [https://github.com/rpm-software-management/dnf5/issues/1192#issuecomment-2018483474 this comment] within the upstream issue.


<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
You can list all installed key hashes along with their names using:


== Early Testing (Optional) ==
`rpmkeys --list`
<!-- 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*. -->


Do you require 'QA Blueprint' support? Y/N <!-- Optional Step for System-Wide Changes only -->
To query the key block info, use:


== How To Test ==
`rpm -q --qf "%{DESCRIPTION}" gpg-pubkey-<KEYHASH>` (note: `rpmkeys --export <KEYHASH>` on newer RPM releases)
<!-- 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 get the end date in a human-readable format, run:


A good "how to test" should answer these four questions:
`rpm -q --qf "%{DESCRIPTION}" gpg-pubkey-<KEYHASH> | gpg --show-keys --with-colon | cut -d':' -f7 | xargs -I{} date -d @{}
`


0. What special hardware / data / etc. is needed (if any)?
Note that not all keys have a defined end of validity date.
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 -->
You can also try running a transaction using a COPR repository with the `faketime` command from `libfaketime`:


== User Experience ==
`faketime '+10years' dnf install <pkg_name_from_copr>`
<!-- 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.
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.


Describe what Users will see or notice, for example:
== User Experience ==
  - Packages are compressed more efficiently, making downloads and upgrades faster by 10%.
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.
  - 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 ==
== Dependencies ==
<!-- 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)? -->
No additional work is expected.
 
<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->
 


== 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