syncthing, roles: use user exec domain attribute

Signed-off-by: Kenton Groombridge <me@concord.sh>
This commit is contained in:
Kenton Groombridge 2021-08-08 11:14:20 -04:00
parent 3d11a43da1
commit a3f02b2f6c
4 changed files with 26 additions and 11 deletions

View File

@ -4,28 +4,43 @@
## <summary>
## Role access for Syncthing
## </summary>
## <param name="role_prefix">
## <summary>
## The prefix of the user role (e.g., user
## is the prefix for user_r).
## </summary>
## </param>
## <param name="user_domain">
## <summary>
## User domain for the role.
## </summary>
## </param>
## <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>
## <param name="domain">
## <summary>
## User domain for the role
## </summary>
## </param>
#
interface(`syncthing_role', `
template(`syncthing_role', `
gen_require(`
attribute_role syncthing_roles;
type syncthing_t, syncthing_exec_t, syncthing_xdg_config_t;
')
roleattribute $1 syncthing_roles;
roleattribute $4 syncthing_roles;
domtrans_pattern($2, syncthing_exec_t, syncthing_t)
domtrans_pattern($3, syncthing_exec_t, syncthing_t)
allow $2 syncthing_xdg_config_t:file { manage_file_perms relabel_file_perms };
allow $2 syncthing_xdg_config_t:dir { manage_dir_perms relabel_dir_perms };
allow $2 syncthing_xdg_config_t:lnk_file { manage_lnk_file_perms relabel_lnk_file_perms };
optional_policy(`
systemd_user_app_status($1, syncthing_t)
')
')

View File

@ -58,7 +58,7 @@ optional_policy(`
')
optional_policy(`
syncthing_role(staff_r, staff_t)
syncthing_role(staff, staff_t, staff_application_exec_domain, staff_r)
')
optional_policy(`

View File

@ -159,7 +159,7 @@ ifndef(`distro_redhat',`
')
optional_policy(`
syncthing_role(user_r, user_t)
syncthing_role(user, user_t, user_application_exec_domain, user_r)
')
optional_policy(`

View File

@ -191,7 +191,7 @@ optional_policy(`
')
optional_policy(`
syncthing_role(unconfined_r, unconfined_t)
syncthing_role(unconfined, unconfined_t, unconfined_application_exec_domain, unconfined_r)
')
optional_policy(`