Chris PeBenito ab58ad
#DESC Netutils - Network utilities
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Authors:  Stephen Smalley <sds@epoch.ncsc.mil>
Chris PeBenito ab58ad
# X-Debian-Packages: netbase iputils arping tcpdump 
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Rules for the netutils_t domain.
Chris PeBenito ab58ad
# This domain is for network utilities that require access to
Chris PeBenito ab58ad
# special protocol families.
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
type netutils_t, domain, privlog;
Chris PeBenito ab58ad
type netutils_exec_t, file_type, sysadmfile, exec_type;
Chris PeBenito ab58ad
role system_r types netutils_t;
Chris PeBenito ab58ad
role sysadm_r types netutils_t;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
uses_shlib(netutils_t)
Chris PeBenito ab58ad
can_network(netutils_t)
Chris PeBenito ab58ad
allow netutils_t port_type:tcp_socket name_connect;
Chris PeBenito ab58ad
can_ypbind(netutils_t)
Chris PeBenito ab58ad
tmp_domain(netutils)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
domain_auto_trans(initrc_t, netutils_exec_t, netutils_t)
Chris PeBenito ab58ad
ifdef(`targeted_policy', `', `
Chris PeBenito ab58ad
domain_auto_trans(sysadm_t, netutils_exec_t, netutils_t)
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Inherit and use descriptors from init.
Chris PeBenito ab58ad
allow netutils_t { userdomain init_t }:fd use;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow netutils_t self:process { fork signal_perms };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Perform network administration operations and have raw access to the network.
Chris PeBenito ab58ad
allow netutils_t self:capability { net_admin net_raw setuid setgid };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Create and use netlink sockets.
Chris PeBenito ab58ad
allow netutils_t self:netlink_route_socket { bind create getattr nlmsg_read nlmsg_write read write };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Create and use packet sockets.
Chris PeBenito ab58ad
allow netutils_t self:packet_socket create_socket_perms;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Create and use UDP sockets.
Chris PeBenito ab58ad
allow netutils_t self:udp_socket create_socket_perms;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Create and use TCP sockets.
Chris PeBenito ab58ad
allow netutils_t self:tcp_socket create_socket_perms;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow netutils_t self:unix_stream_socket create_socket_perms;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Read certain files in /etc
Chris PeBenito ab58ad
allow netutils_t etc_t:file r_file_perms;
Chris PeBenito ab58ad
read_locale(netutils_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow netutils_t fs_t:filesystem getattr;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Access terminals.
Chris PeBenito ab58ad
allow netutils_t privfd:fd use;
Chris PeBenito ab58ad
can_access_pty(netutils_t, initrc)
Chris PeBenito ab58ad
allow netutils_t admin_tty_type:chr_file rw_file_perms;
Chris PeBenito ab58ad
ifdef(`gnome-pty-helper.te', `allow netutils_t sysadm_gph_t:fd use;')
Chris PeBenito ab58ad
allow netutils_t proc_t:dir search;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# for nscd
Chris PeBenito ab58ad
dontaudit netutils_t var_t:dir search;