Skip to content

Commit

Permalink
Add policy for /usr/libexec/samba/samba-bgqd
Browse files Browse the repository at this point in the history
samba-bgqd is an helper program added in samba v4.20.2 to be spawned by
smbd or spoolssd to perform jobs like updating the printer list or other
management tasks asynchronously on demand. It is not intended to be
called by users or administrators.

Resolves: RHEL-53124
  • Loading branch information
zpytela committed Aug 7, 2024
1 parent 7be2299 commit 3e60990
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions policy/modules/contrib/samba.fc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
/usr/lib/systemd/system/winbind.* -- gen_context(system_u:object_r:samba_unit_file_t,s0)

/usr/libexec/samba/rpcd_lsad -- gen_context(system_u:object_r:winbind_rpcd_exec_t,s0)
/usr/libexec/samba/samba-bgqd -- gen_context(system_u:object_r:samba_bgqd_exec_t,s0)
/usr/libexec/samba/samba-dcerpcd -- gen_context(system_u:object_r:winbind_rpcd_exec_t,s0)

/usr/bin/net -- gen_context(system_u:object_r:samba_net_exec_t,s0)
Expand Down
19 changes: 19 additions & 0 deletions policy/modules/contrib/samba.if
Original file line number Diff line number Diff line change
Expand Up @@ -1118,3 +1118,22 @@ interface(`samba_domtrans_winbind_rpcd',`
corecmd_search_bin($1)
domtrans_pattern($1, winbind_rpcd_exec_t, winbind_rpcd_t)
')

########################################
## <summary>
## Execute samba-bgqd in the caller domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed accesss.
## </summary>
## </param>
#
interface(`samba_exec_bgqd',`
gen_require(`
type samba_bgqd_exec_t;
')

corecmd_search_bin($1)
can_exec($1, samba_bgqd_exec_t)
')
14 changes: 14 additions & 0 deletions policy/modules/contrib/samba.te
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ type samba_gpupdate_exec_t;
application_domain(samba_gpupdate_t, samba_gpupdate_exec_t)
role system_r types samba_gpupdate_t;

type samba_bgqd_t;
type samba_bgqd_exec_t;
application_domain(samba_bgqd_t, samba_bgqd_exec_t)
role system_r types samba_bgqd_t;

type smbcontrol_t;
type smbcontrol_exec_t;
application_domain(smbcontrol_t, smbcontrol_exec_t)
Expand Down Expand Up @@ -300,6 +305,15 @@ optional_policy(`
certmonger_domtrans(samba_gpupdate_t)
')

########################################
#
# samba-bgqd Local policy
#

read_files_pattern(samba_bgqd_t, samba_etc_t, samba_etc_t)
manage_files_pattern(samba_bgqd_t, samba_log_t, samba_log_t)


########################################
#
# smbd Local policy
Expand Down

0 comments on commit 3e60990

Please sign in to comment.