selinux-policy/policy/modules/services/ntop.te
Chris PeBenito 1900668638 trunk: Unified labeled networking policy from Paul Moore.
The latest revision of the labeled policy patches which enable both labeled 
and unlabeled policy support for NetLabel.  This revision takes into account
Chris' feedback from the first version and reduces the number of interface
calls in each domain down to two at present: one for unlabeled access, one for
NetLabel access.  The older, transport layer specific interfaces, are still  
present for use by third-party modules but are not used in the default policy
modules.

trunk: Use netmsg initial SID for MLS-only Netlabel packets, from Paul Moore.

This patch changes the policy to use the netmsg initial SID as the "base"
SID/context for NetLabel packets which only have MLS security attributes.
Currently we use the unlabeled initial SID which makes it very difficult to
distinquish between actual unlabeled packets and those packets which have MLS
security attributes.
2007-06-27 15:23:21 +00:00

109 lines
2.7 KiB
Plaintext

policy_module(ntop,1.2.1)
########################################
#
# Declarations
#
type ntop_t;
type ntop_exec_t;
init_daemon_domain(ntop_t,ntop_exec_t)
type ntop_etc_t;
files_config_file(ntop_etc_t)
type ntop_http_content_t;
files_type(ntop_http_content_t)
type ntop_tmp_t;
files_tmp_file(ntop_tmp_t)
type ntop_var_lib_t;
files_type(ntop_var_lib_t)
type ntop_var_run_t;
files_pid_file(ntop_var_run_t)
########################################
#
# Local Policy
#
allow ntop_t self:capability { net_raw setgid setuid sys_admin net_admin };
dontaudit ntop_t self:capability sys_tty_config;
allow ntop_t self:process signal_perms;
allow ntop_t self:fifo_file { read write };
allow ntop_t self:tcp_socket create_stream_socket_perms;
allow ntop_t self:udp_socket create_socket_perms;
allow ntop_t self:packet_socket create_socket_perms;
allow ntop_t ntop_etc_t:dir list_dir_perms;
read_files_pattern(ntop_t,ntop_etc_t,ntop_etc_t)
read_lnk_files_pattern(ntop_t,ntop_etc_t,ntop_etc_t)
allow ntop_t ntop_http_content_t:dir list_dir_perms;
read_files_pattern(ntop_t,ntop_http_content_t,ntop_http_content_t)
manage_dirs_pattern(ntop_t,ntop_tmp_t,ntop_tmp_t)
manage_files_pattern(ntop_t,ntop_tmp_t,ntop_tmp_t)
files_tmp_filetrans(ntop_t, ntop_tmp_t, { file dir })
create_dirs_pattern(ntop_t,ntop_var_lib_t,ntop_var_lib_t)
manage_files_pattern(ntop_t,ntop_var_lib_t,ntop_var_lib_t)
files_var_lib_filetrans(ntop_t,ntop_var_lib_t,file)
manage_files_pattern(ntop_t,ntop_var_run_t,ntop_var_run_t)
files_pid_filetrans(ntop_t,ntop_var_run_t,file)
kernel_read_network_state(ntop_t)
kernel_read_kernel_sysctls(ntop_t)
kernel_list_proc(ntop_t)
kernel_read_proc_symlinks(ntop_t)
corenet_all_recvfrom_unlabeled(ntop_t)
corenet_all_recvfrom_netlabel(ntop_t)
corenet_tcp_sendrecv_generic_if(ntop_t)
corenet_udp_sendrecv_generic_if(ntop_t)
corenet_raw_sendrecv_generic_if(ntop_t)
corenet_tcp_sendrecv_all_nodes(ntop_t)
corenet_udp_sendrecv_all_nodes(ntop_t)
corenet_raw_sendrecv_all_nodes(ntop_t)
corenet_tcp_sendrecv_all_ports(ntop_t)
corenet_udp_sendrecv_all_ports(ntop_t)
dev_read_sysfs(ntop_t)
domain_use_interactive_fds(ntop_t)
files_read_etc_files(ntop_t)
fs_getattr_all_fs(ntop_t)
fs_search_auto_mountpoints(ntop_t)
libs_use_ld_so(ntop_t)
libs_use_shared_libs(ntop_t)
logging_send_syslog_msg(ntop_t)
miscfiles_read_localization(ntop_t)
sysnet_read_config(ntop_t)
userdom_dontaudit_use_unpriv_user_fds(ntop_t)
userdom_dontaudit_search_sysadm_home_dirs(ntop_t)
ifdef(`targeted_policy',`
term_dontaudit_use_unallocated_ttys(ntop_t)
term_dontaudit_use_generic_ptys(ntop_t)
files_dontaudit_read_root_files(ntop_t)
')
optional_policy(`
seutil_sigchld_newrole(ntop_t)
')
optional_policy(`
udev_read_db(ntop_t)
')