|
Chris PeBenito |
ab58ad |
#DESC DHCPD - DHCP server
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
# Author: Russell Coker <russell@coker.com.au>
|
|
Chris PeBenito |
ab58ad |
# based on the dhcpc_t policy from:
|
|
Chris PeBenito |
ab58ad |
# Wayne Salamon (NAI Labs) <wsalamon@tislabs.com>
|
|
Chris PeBenito |
ab58ad |
# X-Debian-Packages: dhcp dhcp3-server
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
#################################
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
# Rules for the dhcpd_t domain.
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
# dhcpd_t is the domain for the server side of DHCP. dhcpd, the DHCP
|
|
Chris PeBenito |
ab58ad |
# server daemon rc scripts, runs in this domain.
|
|
Chris PeBenito |
ab58ad |
# dhcpd_exec_t is the type of the dhcpdd executable.
|
|
Chris PeBenito |
ab58ad |
# The dhcpd_t can be used for other DHCPC related files as well.
|
|
Chris PeBenito |
ab58ad |
#
|
|
Chris PeBenito |
ab58ad |
daemon_domain(dhcpd, `, nscd_client_domain')
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# for UDP port 4011
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t pxe_port_t:udp_socket name_bind;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
type dhcp_etc_t, file_type, sysadmfile, usercanread;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Use the network.
|
|
Chris PeBenito |
ab58ad |
can_network(dhcpd_t)
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t port_type:tcp_socket name_connect;
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t dhcpd_port_t:{ tcp_socket udp_socket } name_bind;
|
|
Chris PeBenito |
ab58ad |
can_ypbind(dhcpd_t)
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t self:unix_dgram_socket create_socket_perms;
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t self:unix_stream_socket create_socket_perms;
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t self:netlink_route_socket r_netlink_socket_perms;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t var_lib_t:dir search;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t devtty_t:chr_file { read write };
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Use capabilities
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t self:capability { net_raw net_bind_service };
|
|
Chris PeBenito |
ab58ad |
dontaudit dhcpd_t self:capability net_admin;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Allow access to the dhcpd file types
|
|
Chris PeBenito |
ab58ad |
type dhcp_state_t, file_type, sysadmfile;
|
|
Chris PeBenito |
ab58ad |
type dhcpd_state_t, file_type, sysadmfile;
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t dhcp_etc_t:file { read getattr };
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t dhcp_etc_t:dir search;
|
|
Chris PeBenito |
ab58ad |
file_type_auto_trans(dhcpd_t, dhcp_state_t, dhcpd_state_t, file)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t etc_t:lnk_file read;
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t { etc_t etc_runtime_t }:file r_file_perms;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Allow dhcpd_t programs to execute themselves and bin_t (uname etc)
|
|
Chris PeBenito |
ab58ad |
can_exec(dhcpd_t, { dhcpd_exec_t bin_t })
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# Allow dhcpd_t to use packet sockets
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t self:packet_socket create_socket_perms;
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t self:rawip_socket create_socket_perms;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# allow to run utilities and scripts
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t { bin_t sbin_t }:dir r_dir_perms;
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t { bin_t sbin_t }:{ file lnk_file } rx_file_perms;
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t self:fifo_file { read write getattr };
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
# allow reading /proc
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t proc_t:{ file lnk_file } r_file_perms;
|
|
Chris PeBenito |
ab58ad |
tmp_domain(dhcpd)
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
ifdef(`distro_gentoo', `
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t self:capability { chown dac_override setgid setuid sys_chroot };
|
|
Chris PeBenito |
ab58ad |
allow initrc_t dhcpd_state_t:file setattr;
|
|
Chris PeBenito |
ab58ad |
')
|
|
Chris PeBenito |
ab58ad |
r_dir_file(dhcpd_t, usr_t)
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t { urandom_device_t random_device_t }:chr_file r_file_perms;
|
|
Chris PeBenito |
ab58ad |
|
|
Chris PeBenito |
ab58ad |
ifdef(`named.te', `
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t { named_conf_t named_zone_t }:dir search;
|
|
Chris PeBenito |
ab58ad |
allow dhcpd_t dnssec_t:file { getattr read };
|
|
Chris PeBenito |
ab58ad |
')
|