Chris PeBenito ab58ad
#DESC Fingerd - Finger daemon
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Author:  Russell Coker <russell@coker.com.au>
Chris PeBenito ab58ad
# X-Debian-Packages: fingerd cfingerd efingerd ffingerd
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#################################
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Rules for the fingerd_t domain.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# fingerd_exec_t is the type of the fingerd executable.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
daemon_domain(fingerd)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
etcdir_domain(fingerd)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow fingerd_t etc_t:lnk_file read;
Chris PeBenito ab58ad
allow fingerd_t { etc_t etc_runtime_t }:file { read getattr };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
log_domain(fingerd)
Chris PeBenito ab58ad
system_crond_entry(fingerd_exec_t, fingerd_t)
Chris PeBenito ab58ad
ifdef(`logrotate.te', `can_exec(fingerd_t, logrotate_exec_t)')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow fingerd_t fingerd_port_t:tcp_socket name_bind;
Chris PeBenito ab58ad
ifdef(`inetd.te', `
Chris PeBenito ab58ad
allow inetd_t fingerd_port_t:tcp_socket name_bind;
Chris PeBenito ab58ad
# can be run from inetd
Chris PeBenito ab58ad
domain_auto_trans(inetd_t, fingerd_exec_t, fingerd_t)
Chris PeBenito ab58ad
allow fingerd_t inetd_t:tcp_socket { read write getattr ioctl };
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
ifdef(`tcpd.te', `
Chris PeBenito ab58ad
domain_auto_trans(tcpd_t, fingerd_exec_t, fingerd_t)
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow fingerd_t self:capability { setgid setuid };
Chris PeBenito ab58ad
# for gzip from logrotate
Chris PeBenito ab58ad
dontaudit fingerd_t self:capability fsetid;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# cfingerd runs shell scripts
Chris PeBenito ab58ad
allow fingerd_t { bin_t sbin_t }:dir search;
Chris PeBenito ab58ad
allow fingerd_t bin_t:lnk_file read;
Chris PeBenito ab58ad
can_exec(fingerd_t, { shell_exec_t bin_t sbin_t })
Chris PeBenito ab58ad
allow fingerd_t devtty_t:chr_file { read write };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow fingerd_t { ttyfile ptyfile }:chr_file getattr;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Use the network.
Chris PeBenito ab58ad
can_network_server(fingerd_t)
Chris PeBenito ab58ad
can_ypbind(fingerd_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow fingerd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito ab58ad
allow fingerd_t self:unix_stream_socket create_socket_perms;
Chris PeBenito ab58ad
allow fingerd_t self:fifo_file { read write getattr };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# allow any user domain to connect to the finger server
Chris PeBenito ab58ad
can_tcp_connect(userdomain, fingerd_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# for .finger, .plan. etc
Chris PeBenito ab58ad
allow fingerd_t { home_root_t user_home_dir_type }:dir search;
Chris PeBenito ab58ad
# should really have a different type for .plan etc
Chris PeBenito ab58ad
allow fingerd_t user_home_type:file { getattr read };
Chris PeBenito ab58ad
# stop it accessing sub-directories, prevents checking a Maildir for new mail,
Chris PeBenito ab58ad
# have to change this when we create a type for Maildir
Chris PeBenito ab58ad
dontaudit fingerd_t user_home_t:dir search;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# for mail
Chris PeBenito ab58ad
allow fingerd_t { var_spool_t mail_spool_t }:dir search;
Chris PeBenito ab58ad
allow fingerd_t mail_spool_t:file getattr;
Chris PeBenito ab58ad
allow fingerd_t mail_spool_t:lnk_file read;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# see who is logged in and when users last logged in
Chris PeBenito ab58ad
allow fingerd_t { initrc_var_run_t lastlog_t }:file { read getattr };
Chris PeBenito ab58ad
dontaudit fingerd_t initrc_var_run_t:file lock;
Chris PeBenito ab58ad
allow fingerd_t devpts_t:dir search;
Chris PeBenito ab58ad
allow fingerd_t ptyfile:chr_file getattr;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow fingerd_t proc_t:file { read getattr };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# for date command
Chris PeBenito ab58ad
read_sysctl(fingerd_t)