2018-06-23 13:00:56 +00:00
|
|
|
## <summary>Pulseaudio network sound server.</summary>
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Role access for pulseaudio.
|
|
|
|
## </summary>
|
2021-08-08 16:16:19 +00:00
|
|
|
## <param name="role_prefix">
|
2018-06-23 13:00:56 +00:00
|
|
|
## <summary>
|
2021-08-08 16:16:19 +00:00
|
|
|
## The prefix of the user role (e.g., user
|
|
|
|
## is the prefix for user_r).
|
2018-06-23 13:00:56 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
2021-08-08 16:16:19 +00:00
|
|
|
## <param name="user_domain">
|
2018-06-23 13:00:56 +00:00
|
|
|
## <summary>
|
|
|
|
## User domain for the role.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2021-08-08 16:16:19 +00:00
|
|
|
## <param name="user_exec_domain">
|
|
|
|
## <summary>
|
|
|
|
## User exec domain for execute and transition access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## <summary>
|
|
|
|
## Role allowed access
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2018-06-23 13:00:56 +00:00
|
|
|
#
|
2021-08-08 16:16:19 +00:00
|
|
|
template(`pulseaudio_role',`
|
2018-06-23 13:00:56 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute pulseaudio_tmpfsfile;
|
|
|
|
type pulseaudio_t, pulseaudio_home_t, pulseaudio_tmpfs_t;
|
|
|
|
type pulseaudio_tmp_t;
|
|
|
|
')
|
|
|
|
|
2021-08-08 16:16:19 +00:00
|
|
|
pulseaudio_run($2, $4)
|
|
|
|
pulseaudio_domtrans($3)
|
2018-06-23 13:00:56 +00:00
|
|
|
|
2021-08-08 16:16:19 +00:00
|
|
|
allow $3 pulseaudio_t:process { ptrace signal_perms };
|
|
|
|
allow $3 pulseaudio_t:fd use;
|
|
|
|
ps_process_pattern($3, pulseaudio_t)
|
2018-06-23 13:00:56 +00:00
|
|
|
|
|
|
|
allow $2 pulseaudio_home_t:dir { manage_dir_perms relabel_dir_perms };
|
|
|
|
allow $2 pulseaudio_home_t:file { manage_file_perms relabel_file_perms };
|
|
|
|
allow $2 pulseaudio_home_t:lnk_file { manage_lnk_file_perms relabel_lnk_file_perms };
|
|
|
|
|
|
|
|
allow $2 { pulseaudio_tmpfs_t pulseaudio_tmpfsfile }:dir { manage_dir_perms relabel_dir_perms };
|
|
|
|
allow $2 { pulseaudio_tmpfs_t pulseaudio_tmpfsfile }:file { manage_file_perms relabel_file_perms map };
|
|
|
|
|
|
|
|
allow $2 pulseaudio_tmp_t:dir { manage_dir_perms relabel_dir_perms };
|
|
|
|
allow $2 pulseaudio_tmp_t:file { manage_file_perms relabel_file_perms };
|
|
|
|
allow $2 pulseaudio_tmp_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
|
|
|
|
|
2021-08-08 16:16:19 +00:00
|
|
|
allow pulseaudio_t $3:unix_stream_socket connectto;
|
|
|
|
allow pulseaudio_t $3:process signull;
|
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
systemd_user_app_status($1, pulseaudio_t)
|
|
|
|
')
|
2018-06-23 13:00:56 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute a domain transition to run pulseaudio.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2021-06-30 08:03:44 +00:00
|
|
|
## <summary>
|
2018-06-23 13:00:56 +00:00
|
|
|
## Domain allowed to transition.
|
2021-06-30 08:03:44 +00:00
|
|
|
## </summary>
|
2018-06-23 13:00:56 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_domtrans',`
|
|
|
|
gen_require(`
|
|
|
|
attribute pulseaudio_client;
|
|
|
|
type pulseaudio_t, pulseaudio_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
typeattribute $1 pulseaudio_client;
|
|
|
|
|
|
|
|
corecmd_search_bin($1)
|
|
|
|
domtrans_pattern($1, pulseaudio_exec_t, pulseaudio_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute pulseaudio in the pulseaudio
|
|
|
|
## domain, and allow the specified role
|
|
|
|
## the pulseaudio domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed to transition.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## <summary>
|
|
|
|
## Role allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_run',`
|
|
|
|
gen_require(`
|
2021-08-08 16:16:19 +00:00
|
|
|
attribute pulseaudio_client;
|
2018-06-23 13:00:56 +00:00
|
|
|
attribute_role pulseaudio_roles;
|
|
|
|
')
|
|
|
|
|
2021-08-08 16:16:19 +00:00
|
|
|
typeattribute $1 pulseaudio_client;
|
|
|
|
|
2018-06-23 13:00:56 +00:00
|
|
|
pulseaudio_domtrans($1)
|
|
|
|
roleattribute $2 pulseaudio_roles;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute pulseaudio in the caller domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2021-06-30 08:03:44 +00:00
|
|
|
## <summary>
|
2018-06-23 13:00:56 +00:00
|
|
|
## Domain allowed access.
|
2021-06-30 08:03:44 +00:00
|
|
|
## </summary>
|
2018-06-23 13:00:56 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_exec',`
|
|
|
|
gen_require(`
|
|
|
|
type pulseaudio_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
corecmd_search_bin($1)
|
|
|
|
can_exec($1, pulseaudio_exec_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to execute pulseaudio.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2021-06-30 08:03:44 +00:00
|
|
|
## <summary>
|
2018-06-23 13:00:56 +00:00
|
|
|
## Domain to not audit.
|
2021-06-30 08:03:44 +00:00
|
|
|
## </summary>
|
2018-06-23 13:00:56 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_dontaudit_exec',`
|
|
|
|
gen_require(`
|
|
|
|
type pulseaudio_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 pulseaudio_exec_t:file exec_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Send null signals to pulseaudio.
|
|
|
|
## processes.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_signull',`
|
|
|
|
gen_require(`
|
|
|
|
type pulseaudio_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 pulseaudio_t:process signull;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Use file descriptors for
|
|
|
|
## pulseaudio.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_use_fds',`
|
|
|
|
gen_require(`
|
|
|
|
type pulseaudio_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 pulseaudio_t:fd use;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to use the
|
|
|
|
## file descriptors for pulseaudio.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2021-06-30 08:03:44 +00:00
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
2018-06-23 13:00:56 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_dontaudit_use_fds',`
|
|
|
|
gen_require(`
|
|
|
|
type pulseaudio_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 pulseaudio_t:fd use;
|
|
|
|
')
|
|
|
|
|
|
|
|
#####################################
|
|
|
|
## <summary>
|
|
|
|
## Connect to pulseaudio with a unix
|
|
|
|
## domain stream socket.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_stream_connect',`
|
|
|
|
gen_require(`
|
2019-09-08 20:55:02 +00:00
|
|
|
type pulseaudio_t, pulseaudio_runtime_t, pulseaudio_tmp_t;
|
2018-06-23 13:00:56 +00:00
|
|
|
')
|
|
|
|
|
2020-06-27 21:11:48 +00:00
|
|
|
files_search_runtime($1)
|
2019-09-08 20:55:02 +00:00
|
|
|
stream_connect_pattern($1, { pulseaudio_tmp_t pulseaudio_runtime_t }, { pulseaudio_tmp_t pulseaudio_runtime_t }, pulseaudio_t)
|
2018-06-23 13:00:56 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Send and receive messages from
|
|
|
|
## pulseaudio over dbus.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_dbus_chat',`
|
|
|
|
gen_require(`
|
|
|
|
type pulseaudio_t;
|
|
|
|
class dbus send_msg;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 pulseaudio_t:dbus send_msg;
|
|
|
|
allow pulseaudio_t $1:dbus send_msg;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Set attributes of pulseaudio home directories.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_setattr_home_dir',`
|
|
|
|
gen_require(`
|
|
|
|
type pulseaudio_home_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 pulseaudio_home_t:dir setattr_dir_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read pulseaudio home content.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_read_home',`
|
|
|
|
gen_require(`
|
|
|
|
type pulseaudio_home_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
userdom_search_user_home_dirs($1)
|
|
|
|
allow $1 pulseaudio_home_t:dir list_dir_perms;
|
|
|
|
allow $1 pulseaudio_home_t:file read_file_perms;
|
|
|
|
allow $1 pulseaudio_home_t:lnk_file read_lnk_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read and write Pulse Audio files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_rw_home_files',`
|
|
|
|
gen_require(`
|
|
|
|
type pulseaudio_home_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
userdom_search_user_home_dirs($1)
|
|
|
|
rw_files_pattern($1, pulseaudio_home_t, pulseaudio_home_t)
|
|
|
|
read_lnk_files_pattern($1, pulseaudio_home_t, pulseaudio_home_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Create, read, write, and delete
|
|
|
|
## pulseaudio home content.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_manage_home',`
|
|
|
|
gen_require(`
|
|
|
|
type pulseaudio_home_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
userdom_search_user_home_dirs($1)
|
|
|
|
allow $1 pulseaudio_home_t:dir manage_dir_perms;
|
|
|
|
allow $1 pulseaudio_home_t:file manage_file_perms;
|
|
|
|
allow $1 pulseaudio_home_t:lnk_file manage_lnk_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Create objects in user home
|
|
|
|
## directories with the pulseaudio
|
|
|
|
## home type.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="object_class">
|
|
|
|
## <summary>
|
|
|
|
## Class of the object being created.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="name" optional="true">
|
|
|
|
## <summary>
|
|
|
|
## The name of the object being created.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_home_filetrans_pulseaudio_home',`
|
|
|
|
gen_require(`
|
|
|
|
type pulseaudio_home_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
userdom_user_home_dir_filetrans($1, pulseaudio_home_t, $2, $3)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Make the specified tmpfs file type
|
|
|
|
## pulseaudio tmpfs content.
|
|
|
|
## </summary>
|
|
|
|
## <param name="file_type">
|
|
|
|
## <summary>
|
|
|
|
## File type to make pulseaudio tmpfs content.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_tmpfs_content',`
|
|
|
|
gen_require(`
|
|
|
|
attribute pulseaudio_tmpfsfile;
|
|
|
|
')
|
|
|
|
|
|
|
|
typeattribute $1 pulseaudio_tmpfsfile;
|
|
|
|
')
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
## <summary>
|
|
|
|
## Read pulseaudio tmpfs files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_read_tmpfs_files',`
|
|
|
|
gen_require(`
|
|
|
|
type pulseaudio_tmpfs_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
fs_search_tmpfs($1)
|
|
|
|
read_files_pattern($1, pulseaudio_tmpfs_t, pulseaudio_tmpfs_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
## <summary>
|
|
|
|
## Read and write pulseaudio tmpfs
|
|
|
|
## files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`pulseaudio_rw_tmpfs_files',`
|
|
|
|
gen_require(`
|
|
|
|
type pulseaudio_tmpfs_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
fs_search_tmpfs($1)
|
|
|
|
rw_files_pattern($1, pulseaudio_tmpfs_t, pulseaudio_tmpfs_t)
|
|
|
|
')
|