[Feature request]: Use auth_admin_keep for update-related polkit actions in non-local sessions

Open
#6,870 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
c, linux

Research direction

Start by locating the shipped org.freedesktop.Flatpak.rules and the policy defaults for app-update, runtime-update, appstream-update, metadata-update, and modify-repo; the issue does not identify their source files or tests. Check how existing rules distinguish local and remote sessions, then assess the proposed auth_admin_keep behavior and any policy tests. Done means the update actions retain remote admin authentication while allowing it to be reused for a transaction, or the recommended remote-session override is documented.

Written by the indexing model from the issue text.

Description

enhancement needs triage
Checklist
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Suggestion
Environment
  • Fedora 44, flatpak-1.18.4-1.fc44, polkit-127
  • System-wide installation (Flathub), GNOME Software 50.4
  • Session: GNOME Remote Desktop (RDP), user in wheel
Problem

In a non-local session (RDP, SSH, VNC), updating ~19 Flatpaks required 25+ separate password prompts. The shipped org.freedesktop.Flatpak.rules only grants access for subject.local && subject.active, so remote sessions fall back to the action defaults, which use auth_admin (without _keep) for allow_any:

$ pkaction -v -a org.freedesktop.Flatpak.appstream-update
  implicit any:      auth_admin
  implicit inactive: auth_admin
  implicit active:   yes

Every action in a single transaction (modify-repo, app-update, runtime-update, runtime-uninstall, appstream-update, metadata-update) therefore prompts again.

This was discussed in #3001 and closed as a policy decision in 2019. Since then, users have reported the same behaviour over SSH, xrdp, VNC and NoMachine on various distributions. As #3001 is now locked, I'm opening this as a focused proposal to reconsider the defaults.

Security perspective

Requiring authentication for remote sessions is reasonable. Requiring it dozens of times per transaction is counterproductive: it trains users to type their admin password into any dialog without reading it, which makes a malicious prompt much easier to slip in. One authentication per transaction is both more usable and more secure.

Proposal

Change allow_any (and allow_inactive) from auth_admin to auth_admin_keep for the update-related actions (app-update, runtime-update, appstream-update, metadata-update, modify-repo). Remote sessions still require admin authentication, but only once per update run.

If the defaults should stay as they are, documenting a recommended override rule for remote sessions would already help a lot. Currently users have to piece it together from closed issue comments.

Related
Dominant language
C
Stars
5.1k
Forks
526
Avg merge
3d 1h
Merged PRs (30d)
23

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from flatpak/flatpak

All issues in flatpak/flatpak

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.