dictd and gatekeeper sample policy
Here's the file_contexts data:
/var/lib/dictd(|/.*) system_u:object_r:var_lib_dictd_t /etc/gatekeeper.ini system_u:object_r:etc_gatekeeper_t /etc/dictd.conf system_u:object_r:etc_dictd_t /usr/sbin/gk system_u:object_r:gatekeeper_exec_t /usr/sbin/dictd system_u:object_r:dictd_exec_t
The dictd policy (for the dictionary daemon) is fully tested and works well.
The gatekeeper policy (for the Open H.323 gate keeper) is not complete as I don't have it fully working. I'm including it so that anyone else who wants to play with GK will have half the work done for them.
Signature · 4 lines
If you send email to me or to a mailing list that I use which has >4 lines of legalistic junk at the end then you are specifically authorizing me to do whatever I wish with the message and all other messages from your domain, by posting the message you agree that your long legalistic sig is void.
#
# Authors: Russell Coker <[email protected]>
#
#################################
#
# Rules for the dictd_t domain.
#
# dictd_exec_t is the type of the dictd executable. # type dictd_t, domain, privlog; type dictd_exec_t, file_type, sysadmfile, exec_type; type var_lib_dictd_t, file_type, sysadmfile; type etc_dictd_t, file_type, sysadmfile;
role system_r types dictd_t;
allow dictd_t init_t:process sigchld;
# Type for files created during execution of dictdd. #file_type_auto_trans(dictd_t, var_run_t, dictd_var_run_t)
# Inherit and use descriptors from init.
allow dictd_t init_t:fd inherit_fd_perms;
# get info from /proc #allow dictd_t proc_t:file r_file_perms; #allow dictd_t proc_t:dir r_dir_perms;
# pthreads wants to know the kernel version #allow dictd_t sysctl_kernel_t:dir r_dir_perms; #allow dictd_t sysctl_kernel_t:file r_file_perms;
# read config files
allow dictd_t { etc_t etc_dictd_t }:{ file lnk_file } r_file_perms;domain_auto_trans(initrc_t, dictd_exec_t, dictd_t)
allow dictd_t { root_t etc_t var_lib_dictd_t }:dir r_dir_perms; allow dictd_t var_lib_dictd_t:file r_file_perms;
uses_shlib(dictd_t)
allow dictd_t usr_t:file r_file_perms;
allow dictd_t var_lib_t:dir r_dir_perms;
allow dictd_t self:process { setpgid fork sigchld }; #allow dictd_t self:fifo_file rw_file_perms;
allow dictd_t null_device_t:chr_file rw_file_perms;
allow dictd_t dict_port_t:tcp_socket name_bind;
allow dictd_t devtty_t:chr_file rw_file_perms;
allow dictd_t self:unix_stream_socket create_stream_socket_perms;
can_network(dictd_t)
allow dictd_t fs_t:filesystem getattr;
#
# Authors: Russell Coker <[email protected]>
#
#################################
#
# Rules for the gatekeeper_t domain.
#
# gatekeeper_exec_t is the type of the gk executable. # type gatekeeper_t, domain, privlog; type gatekeeper_exec_t, file_type, sysadmfile, exec_type; type gatekeeper_var_run_t, file_type, sysadmfile; type etc_gatekeeper_t, file_type, sysadmfile;
role system_r types gatekeeper_t;
allow gatekeeper_t init_t:process sigchld;
# Type for files created during execution of gatekeeperd. #type etc_gatekeeper_t, file_type, sysadmfile; file_type_auto_trans(gatekeeper_t, var_run_t, gatekeeper_var_run_t)
# Inherit and use descriptors from init.
allow gatekeeper_t init_t:fd inherit_fd_perms;
# Use the network.can_network(gatekeeper_t)
allow gatekeeper_t self:unix_stream_socket create_socket_perms;
# Use capabilities
#allow gatekeeper_t self:capability { net_raw };
# get info from /proc allow gatekeeper_t proc_t:file r_file_perms; allow gatekeeper_t proc_t:dir r_dir_perms;
# pthreads wants to know the kernel version allow gatekeeper_t sysctl_kernel_t:dir r_dir_perms; allow gatekeeper_t sysctl_kernel_t:file r_file_perms;
# read config files
allow gatekeeper_t { etc_t etc_gatekeeper_t }:{ file lnk_file } r_file_perms;domain_auto_trans(initrc_t, gatekeeper_exec_t, gatekeeper_t)
allow gatekeeper_t { root_t etc_t }:dir r_dir_perms; uses_shlib(gatekeeper_t)
allow gatekeeper_t usr_t:file r_file_perms; allow gatekeeper_t sbin_t:dir r_dir_perms;
allow gatekeeper_t self:process { setsched signal fork }; allow gatekeeper_t self:fifo_file rw_file_perms;
allow gatekeeper_t null_device_t:chr_file rw_file_perms;
# this is crap, gk wants to create symlinks in /etc every time it starts and # remove them when it exits. allow gatekeeper_t etc_t:dir rw_dir_perms; allow gatekeeper_t etc_t:lnk_file create_file_perms;