]>
Commit | Line | Data |
---|---|---|
e3e37e85 CP |
1 | |
2 | policy_module(ntop,1.0.0) | |
3 | ||
4 | ######################################## | |
5 | # | |
6 | # Declarations | |
7 | # | |
8 | ||
9 | type ntop_t; | |
10 | type ntop_exec_t; | |
11 | init_daemon_domain(ntop_t,ntop_exec_t) | |
12 | ||
13 | type ntop_etc_t; | |
14 | files_config_file(ntop_etc_t) | |
15 | ||
16 | type ntop_http_content_t; | |
17 | files_type(ntop_http_content_t) | |
18 | ||
19 | type ntop_tmp_t; | |
20 | files_tmp_file(ntop_tmp_t) | |
21 | ||
22 | type ntop_var_lib_t; | |
23 | files_type(ntop_var_lib_t) | |
24 | ||
25 | type ntop_var_run_t; | |
26 | files_pid_file(ntop_var_run_t) | |
27 | ||
28 | ######################################## | |
29 | # | |
30 | # Local Policy | |
31 | # | |
32 | ||
33 | allow ntop_t self:capability { net_raw setgid setuid sys_admin net_admin }; | |
34 | dontaudit ntop_t self:capability sys_tty_config; | |
35 | allow ntop_t self:process signal_perms; | |
36 | allow ntop_t self:fifo_file { read write }; | |
37 | allow ntop_t self:tcp_socket create_stream_socket_perms; | |
38 | allow ntop_t self:udp_socket create_socket_perms; | |
39 | allow ntop_t self:packet_socket create_socket_perms; | |
40 | ||
41 | allow ntop_t ntop_etc_t:file r_file_perms; | |
42 | allow ntop_t ntop_etc_t:dir r_dir_perms; | |
43 | allow ntop_t ntop_etc_t:lnk_file { getattr read }; | |
44 | ||
45 | allow ntop_t ntop_http_content_t:file r_file_perms; | |
46 | allow ntop_t ntop_http_content_t:dir r_dir_perms; | |
47 | ||
48 | allow ntop_t ntop_tmp_t:dir create_dir_perms; | |
49 | allow ntop_t ntop_tmp_t:file create_file_perms; | |
50 | files_tmp_filetrans(ntop_t, ntop_tmp_t, { file dir }) | |
51 | ||
52 | allow ntop_t ntop_var_lib_t:file create_file_perms; | |
53 | allow ntop_t ntop_var_lib_t:dir { create rw_dir_perms }; | |
54 | files_var_lib_filetrans(ntop_t,ntop_var_lib_t,file) | |
55 | ||
56 | allow ntop_t ntop_var_run_t:file manage_file_perms; | |
57 | allow ntop_t ntop_var_run_t:dir rw_dir_perms; | |
58 | files_pid_filetrans(ntop_t,ntop_var_run_t,file) | |
59 | ||
60 | kernel_read_network_state(ntop_t) | |
61 | kernel_read_kernel_sysctls(ntop_t) | |
62 | kernel_list_proc(ntop_t) | |
63 | kernel_read_proc_symlinks(ntop_t) | |
64 | ||
65 | corenet_tcp_sendrecv_generic_if(ntop_t) | |
66 | corenet_udp_sendrecv_generic_if(ntop_t) | |
67 | corenet_raw_sendrecv_generic_if(ntop_t) | |
68 | corenet_tcp_sendrecv_all_nodes(ntop_t) | |
69 | corenet_udp_sendrecv_all_nodes(ntop_t) | |
70 | corenet_raw_sendrecv_all_nodes(ntop_t) | |
71 | corenet_tcp_sendrecv_all_ports(ntop_t) | |
72 | corenet_udp_sendrecv_all_ports(ntop_t) | |
73 | corenet_non_ipsec_sendrecv(ntop_t) | |
74 | corenet_tcp_bind_all_nodes(ntop_t) | |
75 | corenet_udp_bind_all_nodes(ntop_t) | |
76 | ||
77 | dev_read_sysfs(ntop_t) | |
78 | ||
79 | domain_use_interactive_fds(ntop_t) | |
80 | ||
81 | files_read_etc_files(ntop_t) | |
82 | ||
83 | fs_getattr_all_fs(ntop_t) | |
84 | fs_search_auto_mountpoints(ntop_t) | |
85 | ||
86 | term_dontaudit_use_console(ntop_t) | |
87 | ||
88 | init_use_fds(ntop_t) | |
89 | init_use_script_ptys(ntop_t) | |
90 | ||
91 | libs_use_ld_so(ntop_t) | |
92 | libs_use_shared_libs(ntop_t) | |
93 | ||
94 | logging_send_syslog_msg(ntop_t) | |
95 | ||
96 | miscfiles_read_localization(ntop_t) | |
97 | ||
98 | sysnet_read_config(ntop_t) | |
99 | ||
100 | userdom_dontaudit_use_unpriv_user_fds(ntop_t) | |
101 | userdom_dontaudit_search_sysadm_home_dirs(ntop_t) | |
102 | ||
103 | ifdef(`targeted_policy',` | |
104 | term_dontaudit_use_unallocated_ttys(ntop_t) | |
105 | term_dontaudit_use_generic_ptys(ntop_t) | |
106 | files_dontaudit_read_root_files(ntop_t) | |
107 | ') | |
108 | ||
109 | optional_policy(` | |
110 | seutil_sigchld_newrole(ntop_t) | |
111 | ') | |
112 | ||
113 | optional_policy(` | |
114 | udev_read_db(ntop_t) | |
115 | ') |