Skip to content

Commit

Permalink
cryfs, roles: use user exec domain attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
0xC0ncord committed Aug 8, 2021
1 parent 5544417 commit 28deb83
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
25 changes: 18 additions & 7 deletions policy/modules/apps/cryfs.if
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,27 @@
## <summary>
## Role access for CryFS.
## </summary>
## <param name="role">
## <param name="role_prefix">
## <summary>
## Role allowed access.
## The prefix of the user role (e.g., user
## is the prefix for user_r).
## </summary>
## </param>
## <param name="domain">
## <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>
#
interface(`cryfs_role',`
gen_require(`
Expand All @@ -26,15 +37,15 @@ interface(`cryfs_role',`
# Declarations
#

roleattribute $1 cryfs_roles;
roleattribute $4 cryfs_roles;

########################################
#
# Policy
#

domtrans_pattern($2, cryfs_exec_t, cryfs_t)
domtrans_pattern($3, cryfs_exec_t, cryfs_t)

allow $2 cryfs_t:process signal_perms;
ps_process_pattern($2, cryfs_t)
allow $3 cryfs_t:process signal_perms;
ps_process_pattern($3, cryfs_t)
')
2 changes: 1 addition & 1 deletion policy/modules/roles/sysadm.te
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ ifndef(`distro_redhat',`
')

optional_policy(`
cryfs_role(sysadm_r, sysadm_t)
cryfs_role(sysadm, sysadm_t, sysadm_user_exec_domain, sysadm_r)
')

optional_policy(`
Expand Down

0 comments on commit 28deb83

Please sign in to comment.