pipewire/src/modules/module-protocol-pulse
Sergio Costas Rodriguez d568dcd64f pipewire-pulse: add snap permissions support
SNAP containers have two main "audio" security rules:

 * audio-playback: the applications inside the container can
   send audio samples into a sink

 * audio-record: the applications inside the container can
   get audio samples from a source

Also, old SNAP containers had the "pulseaudio" rule, which just
exposed the pulseaudio socket directly, without limits. This
is similar to the current Flatpak audio permissions.

In the pulseaudio days, a specific pulseaudio module was used
that checked the permissions given to the application and
allowed or forbade access to the pulseaudio operations.
With the change to pipewire, this functionality must be
implemented in pipewire-pulse to guarantee the sandbox
security.

This patch adds support for sandboxing permissions in the
pulseaudio module, and implements support for the SNAP audio
security model, thus forbiding a SNAP application to record
audio unless it has permissions to do so.

The current code for pipewire-pulseaudio checks the permissions
of the snap and adds three properties to each new client:

 * pipewire.snap.id: contains the Snap ID of the client.

 * pipewire.snap.audio.playback: its value is 'true' if the client
   has permission to play audio, or 'false' if not.

 * pipewire.snap.audio.record: its value is 'true' if the client
   has permission to record audio, or 'false' if not.

These properties must be processed by wireplumber to add or
remove access permissions to the corresponding nodes. That
code is available in a separate patch: https://gitlab.freedesktop.org/pipewire/wireplumber/-/merge_requests/567
2024-01-12 11:35:17 +00:00
..
extensions pulse-server: keep track of sink/monitor changes 2023-07-31 11:23:47 +02:00
modules modules: add reconnect support to module-pulse-tunnel 2024-01-05 13:34:19 +01:00
client.c pulse-server: improve message debug 2024-01-11 12:05:29 +01:00
client.h pulse-server: remove pending_streams list 2023-09-14 12:08:48 +02:00
cmd.c treewide: add some examples for the spa_auto* macros 2023-07-11 14:23:53 +02:00
cmd.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
collect.c pulse-server: fill in active port for monitors 2023-12-20 10:15:06 +01:00
collect.h pulse-server: add stream/device state in dev_info 2023-11-20 11:39:31 +01:00
commands.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
dbus-name.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
dbus-name.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
defs.h pulse-tunnel: translate pulse error to spa error 2023-03-13 12:26:20 +01:00
extension.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
extension.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
format.c pulse-server: add option to disable fix_ flags 2023-07-03 16:39:32 +02:00
format.h pulse-server: format_info_from_spec(): remove redundant decl 2023-07-03 19:40:31 +02:00
internal.h log: add pw_log_topic_custom_enabled() 2024-01-04 17:40:57 +01:00
log.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
manager.c pulse-server: update all params only after enumeration complete 2023-12-09 11:23:25 +00:00
manager.h pulse-server: pass the client to message handlers 2023-10-06 16:16:48 +02:00
message-handler.c pulse-server: add pipewire-pulse:log-level message 2024-01-04 17:43:53 +01:00
message-handler.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
message.c modules: move some spa_debug_mem to the log 2024-01-11 17:49:50 +01:00
message.h pulse-server: improve message debug 2024-01-11 12:05:29 +01:00
module.c pulse-server: add an option to check module arguments 2023-09-13 12:26:57 +02:00
module.h pulse-server: add an option to check module arguments 2023-09-13 12:26:57 +02:00
operation.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
operation.h pulse-server: add operation_free_by_tag() 2023-05-10 18:57:20 +00:00
pending-sample.c pulse-server: pending-sample: handle client disconnection correctly 2023-05-10 18:57:20 +00:00
pending-sample.h pulse-server: pending-sample: handle client disconnection correctly 2023-05-10 18:57:20 +00:00
pulse-server.c log: add pw_log_topic_custom_enabled() 2024-01-04 17:40:57 +01:00
pulse-server.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
quirks.c pulse-server: add 2 quirks to block sink/source updates 2023-06-15 11:45:43 +02:00
quirks.h pulse-server: add 2 quirks to block sink/source updates 2023-06-15 11:45:43 +02:00
remap.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
remap.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
reply.c pulse-server: include "reply.h" in "reply.h" 2023-07-03 19:40:31 +02:00
reply.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
sample-play.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
sample-play.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
sample.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
sample.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
server.c pipewire-pulse: add snap permissions support 2024-01-12 11:35:17 +00:00
server.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
stream.c pulse-server: place stream media.* keys as Tag 2023-10-11 15:17:13 +02:00
stream.h pulse-server: place stream media.* keys as Tag 2023-10-11 15:17:13 +02:00
utils.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
utils.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
volume.c treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00
volume.h treewide: use SPDX tags to specify copyright information 2023-02-16 10:54:48 +00:00