Granting aliases requires trust in the snap’s publisher and reasonable names for the aliases (eg, shouldn’t request an alias for something that is a widely known command of other software).
An alias should not be granted for the snap’s name since snapd already grants use of this name to the snap (eg, a snap named ‘foo’ with command ‘foo.foo2’ should not be granted the ‘foo’ alias, instead, the snap can rename the ‘foo2’ command to be ‘foo’ instead (and optionally request an alias for the ‘foo2’ command)).
In the snap ecosystem it is important to remember that there are several voices when considering auto-connection: snapd (base declaration policy), the gadget snap (for device-specific auto-connections, which does not apply to auto-connection requests), the store (snap declaration policy; ie, requests using this process) and the user.
For each snap interface, a determination is made for whether or not the interface should be manual or automatically connected based on a variety of criteria (the rationale is often in the snapd code base or pull requests) and this is codified in the base declaration.
A snap’s publisher may request that a normally manually-connected interface be auto-connected for a particular snap in the global, public store using the process outlined in this topic (brand store owners may grant auto-connections as appropriate for their brand). Granting auto-connection in the global, public store effectually means that the store is vouching for the publisher’s intent (maintenance, security updates, etc) and snap implementation (it does what it advertises, works well, etc) to the degree that the user’s initial choice on connection at install time is removed (the user may of course disconnect the interface after installation).
Reviewers must therefore consider various criteria to inform their vote on whether the request will be granted. Some of this criteria might include:
For some interfaces there are patterns and rationale that can generally be applied. Please note the rationale is subject to change based on security concerns from the community (users, publishers, reviewers, snapd developers, etc), more appropriate technologies becoming available, new information and/or critical thinking, etc. Each request will be reviewed on its own merits and prior granting of auto-connection may be rescinded based on this new information.
audio-playback
(and audio-record
if needed), which grants access to pulseaudiocontent
attribute or interface reference if content
attribute is omitted)name
attribute makes sense for the snap. auto-connection of plugs is typically not auto-connected unless the slot’s publisher also agrees
Rationale: by definition data that is not always present (as is the case with removable-media) is optional access for typical snaps. All snaps with this interface connected have unrestricted access to all data from any plugged media. Considering that removable-media may contain sensitive documents, sensitive pictures/media, encryption keys, etc and that snapd has no insight on the nature of the data, the user’s voice with regard to connection is preserved
Exceptions: the following classes of applications may be considered for removable-media auto-connection:
If the application falls into one of the above categories, then the following criteria will also be considered:
Additional information:
/dev/uinput
may be world read and writable (default udev rules create it as root-owned with only root read and writable). Due to these considerations, publishers requesting use of (and especially auto-connect) should be vetted.If auto-connection is not granted, options for snap publishers are:
snapctl is-connected <iface>
and instruct the user to use the snap connect
CLI command or connect via the snap-store/gnome-software GUI. This could be done on startup or contextually at the time of access. Ideally when instructing the user, the details of the access would be explained so the user can make an informed choice. It is true that there is an extra step for the user, but done well, this need not be onerous and may even provide additional trust that your snap and the system as a whole are working to keep everything secure. Note, if using snapctl is-connected
you should also add a corresponding assumes: 2.43
to your snapcraft.yaml since this is only available in snap since 2.43 to ensure this functions as expected.In the future, the snapd team plans to provide a prompt API for snaps to use that will not only provide appropriate messaging, but also allow the user to choose to connect within the prompt.
Finally, the desktop team has discussed the lack of isolation in secret-service with upstream GNOME and there are plans to improve the service (see ‘Active Attacks’) to provide the necessary isolation for auto-connecting. Hopefully, KDE/Plasma will follow with kwallet or move to the improved service.
There is a simplified process for tracks for snaps with predictable cadence.
Last updated 3 years ago.