From Fedora Project Wiki
(Initial change page)
 
m (Ready for announcement)
(One intermediate revision by the same user not shown)
Line 7: Line 7:
We want to update the Polkit rule currently controlling access to the rpm-ostree daemon on Fedora Atomic Desktops to do the following:
We want to update the Polkit rule currently controlling access to the rpm-ostree daemon on Fedora Atomic Desktops to do the following:
* Enable users to update the system without being an administrator or typing a password.
* Enable users to update the system without being an administrator or typing a password.
* Restrict the current rule for administrators to make more operations explicitely require a password.
* Restrict the current rule for administrators to make more operations explicitly require a password.
 
<!-- A sentence or two summarizing what this change is and what it will do. This information is used for the overall changeset summary page for each release. Note that motivation for the change should be in the Benefit to Fedora section below, and this part should answer the question "What?" rather than "Why?". -->


== Owner ==
== Owner ==
Line 17: Line 15:


== Current status ==
== Current status ==
[[Category:ChangePageIncomplete]]
 
[[Category:ChangeReadyForWrangler]]
<!-- 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 26: Line 25:


* Targeted release: [https://docs.fedoraproject.org/en-US/releases/f41/ Fedora Linux 41]
* Targeted release: [https://docs.fedoraproject.org/en-US/releases/f41/ Fedora Linux 41]
* Last updated: <!-- this is an automatic macro — you don't need to change this line -->  {{REVISIONYEAR}}-{{REVISIONMONTH}}-{{REVISIONDAY2}}
* Last updated: {{REVISIONYEAR}}-{{REVISIONMONTH}}-{{REVISIONDAY2}}
* [Announced]
* [Announced]
* [<will be assigned by the Wrangler> Discussion thread]
* [<will be assigned by the Wrangler> Discussion thread]
Line 49: Line 48:
* https://gitlab.com/fedora/ostree/sig/-/issues/7
* https://gitlab.com/fedora/ostree/sig/-/issues/7
* https://github.com/rohanssrao/silverblue-privesc/issues/4
* https://github.com/rohanssrao/silverblue-privesc/issues/4
* https://bugzilla.redhat.com/show_bug.cgi?id=2203555


Initial work in:
Initial work in:
* https://src.fedoraproject.org/rpms/fedora-release/pull-request/324
* https://src.fedoraproject.org/rpms/fedora-release/pull-request/324
* https://src.fedoraproject.org/rpms/fedora-release/pull-request/325
* https://src.fedoraproject.org/rpms/fedora-release/pull-request/325
<!-- Expand on the summary, if appropriate.  A couple sentences suffices to explain the goal, but the more details you can provide the better. -->


== Feedback ==
== Feedback ==


Nothing here so far beyond comments in the PRs, which have mostly been addressed.
Nothing here so far beyond comments in the PRs, which have mostly been addressed.
<!-- Summarize the feedback from the community and address why you chose not to accept proposed alternatives. This section is optional for all change proposals but is strongly suggested. Incorporating feedback here as it is raised gives FESCo a clearer view of your proposal and leaves a good record for the future. If you get no feedback, that is useful to note in this section as well. For innovative or possibly controversial ideas, consider collecting feedback before you file the change proposal. -->


== Benefit to Fedora ==
== Benefit to Fedora ==
Line 68: Line 64:
This is also a step towards the goals of the [https://fedoraproject.org/wiki/SIGs/ConfinedUsers Confined Users Special Interest Group (SIG)].
This is also a step towards the goals of the [https://fedoraproject.org/wiki/SIGs/ConfinedUsers Confined Users Special Interest Group (SIG)].


<!-- What is the benefit to the distribution?  Will the software we generate be improved? How will the process of creating Fedora releases be improved?
== Scope ==


      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 ==
* Proposal owners:
* Proposal owners:
** Implement the change in the polkit rules
** Implement the change in the polkit rules
** Validate that this changes works on all Fedora Atomic Desktops (notably with GNOME Software and Plasma Discover)
** Validate that this changes works on all Fedora Atomic Desktops (notably with GNOME Software and Plasma Discover)
<!-- 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?-->
* Other developers:
* Other developers:
** Developers depending on the current polkit rules might have to adapt their software. We don't know of any software impacted right now.
** Developers depending on the current polkit rules might have to adapt their software. We don't know of any software impacted right now.
<!-- 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?-->
* Release engineering: N/A (not needed for this Change)
* Release engineering: N/A (not needed for this Change)
<!-- 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)
* 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: Not specificaly
* Alignment with the Fedora Strategy: Not specificaly
<!-- 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 -->


== Upgrade/compatibility impact ==
== Upgrade/compatibility impact ==
Line 130: Line 81:


If administrators previously disabled or overwrote the current polkit rules, then they might have to update their override for the new behavior.
If administrators previously disabled or overwrote the current polkit rules, then they might have to update their override for the new behavior.
<!-- 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? -->
<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->


== Early Testing (Optional) ==
== Early Testing (Optional) ==
<!-- 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? No
Do you require 'QA Blueprint' support? No
Line 197: Line 142:
** Rebase to any version: `rpm-ostree rebase ...` (try with Kinoite on Silverblue, etc.)
** Rebase to any version: `rpm-ostree rebase ...` (try with Kinoite on Silverblue, etc.)
** Change kernel argments: `rpm-ostree kargs --append=foo=bar`
** Change kernel argments: `rpm-ostree kargs --append=foo=bar`
<!-- 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.
A good "how to test" should answer these four questions:
0. What special hardware / data / etc. is needed (if any)?
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 -->


== User Experience ==
== User Experience ==
Line 221: Line 150:


Unprivileged users will be able to update the system.
Unprivileged users will be able to update the system.
<!-- 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.
Describe what Users will see or notice, for example:
  - 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 ==
== Dependencies ==


The rules are shipped as part of the `fedora-release` RPM. There are no other dependencies.
The rules are shipped as part of the `fedora-release` RPM. There are no other 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)? -->
<!-- REQUIRED FOR SYSTEM WIDE CHANGES -->


== Contingency Plan ==
== Contingency Plan ==
Line 256: Line 170:


To be written once the change is accepted.
To be written once the change is accepted.
<!-- The Fedora Release Notes inform end-users about what is new in the release.  Examples of past release notes are at https://docs.fedoraproject.org/en-US/fedora/latest/release-notes/ -->
<!-- The release notes also help users know how to deal with platform changes such as ABIs/APIs, configuration or data file formats, or upgrade concerns.  If there are any such changes involved in this change, indicate them here.  A link to upstream documentation will often satisfy this need.  This information forms the basis of the release notes edited by the documentation team and shipped with the release.
Release Notes are not required for initial draft of the Change Proposal but has to be completed by the Change Freeze.
-->

Revision as of 11:59, 23 May 2024

Unprivileged updates for Fedora Atomic Desktops

Important.png
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

We want to update the Polkit rule currently controlling access to the rpm-ostree daemon on Fedora Atomic Desktops to do the following:

  • Enable users to update the system without being an administrator or typing a password.
  • Restrict the current rule for administrators to make more operations explicitly require a password.

Owner

Current status

  • Targeted release: Fedora Linux 41
  • Last updated: 2024-05-23
  • [Announced]
  • [<will be assigned by the Wrangler> 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

This change tries to address two issues:

  • Give more users the permission to update their systems as this should be an entirely safe operation on Fedora Atomic Desktops.
    • Silverblue already automatically update the system and Flatpaks by default and Kinoite is looking at doing it as well: https://fedoraproject.org/wiki/Changes/KDEKinoiteAutoUpdateByDefault
    • We will thus enable all active and interactive users to update the system without being an administrator or typing a password.
    • Note that this is only about system updates (and repo metadata updates) and no other operations.
  • Reduce access to the most privileged operations of rpm-ostree for administrators to avoid mistakes.
    • The current setup is not directly a security issue as it only allows those operations for users that are part of the wheel group and thus assumed to be administrators.
    • However, some of those operations can be more dangerous than others so we should ask the administrator to confirm them or let them do it via sudo.
    • Operations such as changing kernel arguments, installing a local package, rebasing to another image, etc. will thus be removed from the current Polkit rule and will now require the administrator password, similarly to calling it via sudo.
    • Only the install/uninstall packages from the repos, upgrade, rollback, cancel and cleanup operations will remain password-less, to match the behavior on package mode Fedora with dnf.

See:

Initial work in:

Feedback

Nothing here so far beyond comments in the PRs, which have mostly been addressed.

Benefit to Fedora

This change will make it easier to setup a Fedora system with non-administrator (unprivileged) users that can still update the system without administrator intervention. Note that major version upgrades (rebase operation) will still require privileges (or an administrator password) for now. This is due to a limit of the current rpm-ostree interface.

This is also a step towards the goals of the Confined Users Special Interest Group (SIG).

Scope

  • Proposal owners:
    • Implement the change in the polkit rules
    • Validate that this changes works on all Fedora Atomic Desktops (notably with GNOME Software and Plasma Discover)
  • Other developers:
    • Developers depending on the current polkit rules might have to adapt their software. We don't know of any software impacted right now.
  • Release engineering: N/A (not needed for this Change)
  • Policies and guidelines: N/A (not needed for this Change)
  • Trademark approval: N/A (not needed for this Change)
  • Alignment with the Fedora Strategy: Not specificaly

Upgrade/compatibility impact

This change does not remove any interface so it should not have any impact for users on upgrade. If some of the now "password-full" operations were used previously, they will now ask for a password.

If administrators previously disabled or overwrote the current polkit rules, then they might have to update their override for the new behavior.

Early Testing (Optional)

Do you require 'QA Blueprint' support? No

How To Test

  • Write the following file:

/etc/polkit-1/rules.d/org.projectatomic.rpmostree1.rules

polkit.addRule(function(action, subject) {
    if ((action.id == "org.projectatomic.rpmostree1.repo-refresh" ||
         action.id == "org.projectatomic.rpmostree1.upgrade") &&
        subject.active == true &&
        subject.local == true) {
            return polkit.Result.YES;
    }

    if ((action.id == "org.projectatomic.rpmostree1.install-uninstall-packages" ||
         action.id == "org.projectatomic.rpmostree1.rollback" ||
         action.id == "org.projectatomic.rpmostree1.reload-daemon" ||
         action.id == "org.projectatomic.rpmostree1.cancel" ||
         action.id == "org.projectatomic.rpmostree1.cleanup" ||
         action.id == "org.projectatomic.rpmostree1.client-management") &&
        subject.active == true &&
        subject.local == true &&
        subject.isInGroup("wheel")) {
            return polkit.Result.YES;
    }

    if ((
         action.id == "org.projectatomic.rpmostree1.install-local-packages" ||
         action.id == "org.projectatomic.rpmostree1.override" ||
         action.id == "org.projectatomic.rpmostree1.deploy" ||
         action.id == "org.projectatomic.rpmostree1.rebase" ||
         action.id == "org.projectatomic.rpmostree1.rollback" ||
         action.id == "org.projectatomic.rpmostree1.bootconfig" ) &&
        subject.active == true &&
        subject.local == true &&
        subject.isInGroup("wheel")) {
            return polkit.Result.AUTH_ADMIN;
    }
});
  • Test that normal / unprivileged users can only do the following operations without a password:
    • Update the system: rpm-ostree update
    • Refresh the metadata: rpm-ostree refresh-md
  • Test that admin / privileged users can do the following operations without a password:
    • Install a package from the official Fedora repos: rpm-ostree install strace
    • Cancel an in-progress transaction: rpm-ostree cancel
    • Rollback to a previous version: rpm-ostree rollback
    • Reload the daemon: rpm-ostree reload
    • Cleanup pending or rollback deployments: rpm-ostree cleanup
  • Test that admin / privileged users are asked a password for the following operations:
    • Install a local RPM package: rpm-ostree install ./foo.rpm
    • Override replace a package: rpm-ostree override replace vim-x.y.z.rpm
    • Deploy a specific version: rpm-ostree deploy 40.20240518.1
    • Rebase to any version: rpm-ostree rebase ... (try with Kinoite on Silverblue, etc.)
    • Change kernel argments: rpm-ostree kargs --append=foo=bar

User Experience

This change should be mostly transparent for users.

If some of the now "password-full" operations were used previously, they will now ask for a password.

Unprivileged users will be able to update the system.

Dependencies

The rules are shipped as part of the fedora-release RPM. There are no other dependencies.

Contingency Plan

  • Contingency mechanism: (What to do? Who will do it?)
    • We can revert the change to the fedora-release package at any time.
    • Will be done by the change owners.
  • Contingency deadline: Beta freeze or final freeze
  • Blocks release? No

Documentation

No additional documentation.

Release Notes

To be written once the change is accepted.