Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Only grant permission once for unidentified apps #1600

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aleasto
Copy link

@aleasto aleasto commented Jan 23, 2025

The status-quo is problematic because:

  • It is not comunicated well enough that granting the permission would also grant it for any other unidentified program. That includes all unsandboxed programs started from a terminal, without a systemd scope.
  • It is not true, or not true for all Desktops, that "This permission can be changed at any time from the privacy settings." because the "privacy settings" app would need to have a section dedicated to unidentified apps, which gnome-control-center for example does not have.

Both problems could be addressed differently, but I believe this is a better solution overall:

I propose we don't use the PermissionStore for unidentified apps, at all. It is generally unsensible to grant such a wide permission, and I don't think we should allow it.
Instead, such unidentified apps will always prompt whenever they want to take a privileged action.

@aleasto aleasto marked this pull request as draft January 23, 2025 10:12
@aleasto
Copy link
Author

aleasto commented Jan 23, 2025

I've only made changes to the screenshot portal, but the idea would be to replicate the same changes to other interfaces which involve the PermissionStore

The status-quo is problematic because:
* It is not comunicated well enough that granting the permission would also
  grant it for any other unidentified program. That includes all programs
  started from a terminal, without a systemd scope.
* It is not true, or not true for all Desktops, that
  "This permission can be changed at any time from the privacy settings."
  because the "privacy settings" app would need to have a section dedicated to
  unidentified apps, which gnome-control-center for example does not have.

Both problems could be addressed differently, but I believe this is a better
solution overall:

I propose we don't use the PermissionStore for unidentified apps, at all.
It is generally unsensible to grant such a wide permission, and I don't think
we should allow it.
Instead, such unidentified apps will always prompt whenever they want to take
a privileged action.
if (xdp_dbus_impl_screenshot_get_version (impl) < 2)
goto query_impl;

permission = xdp_get_permission_sync (app_id, PERMISSION_TABLE, PERMISSION_ID);
permission = store_permission ? xdp_get_permission_sync (app_id, PERMISSION_TABLE, PERMISSION_ID) : XDP_PERMISSION_UNSET;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a upgrade path, so that if we previously had stored a permission for app_id="" we will stop honouring it from now on.

@aleasto
Copy link
Author

aleasto commented Jan 23, 2025

As a self-critique to the change: it would get annoying if one or more unidentified apps keep requesting bogus permissions that the user does not intend on granting, because we don't memorize the preference.

It would obviously be the application's fault, and I would say that one should uninstall such application. On the other hand, if we can't identify the app we can't also provide the user with the info about which application to uninstall.

I would appreciate to hear your thoughts and some actionable steps to mitigate this, if you feel that is is necessary.

@aleasto aleasto changed the title Only grant permission once for unidentified apps RFC: Only grant permission once for unidentified apps Jan 23, 2025
@swick
Copy link
Contributor

swick commented Jan 23, 2025

I like the idea that requests from unidentified apps (app_id == "") shall always prompt the user. I do however think that we should only make changes in that direction after #1521 has landed because that gives apps a way to avoid running into this case.

@Mikenux
Copy link

Mikenux commented Jan 23, 2025

I still don't understand why host apps should display a prompt, especially if no permission would be stored, because it is assumed that they are not "safe." Furthermore, what is this proposal to inform about uninstalling an app?

@aleasto
Copy link
Author

aleasto commented Jan 23, 2025

Furthermore, what is this proposal to inform about uninstalling an app?

That is obviously not what I intended. My point is that if an unidentified application keeps asking for some permission but we don't show the name of the app (because we don't know it), then the user wouldn't know how to take action.

@Mikenux
Copy link

Mikenux commented Jan 23, 2025

No need to tell the user to take an action if no permission prompt is shown, at least for Allow/Deny permissions... (and if the unidentified app is an host app)

@Sodivad
Copy link
Contributor

Sodivad commented Jan 24, 2025

I have a draft change locally that would add an "ask always" checkbox to the dialog via the choices feature. Maybe this might be a direction we could pursue?

EDIT patch: Sodivad@795a3a9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants