]>
Commit | Line | Data |
---|---|---|
7c8fc35b CP |
1 | |
2 | policy_module(dhcpd,1.0) | |
3 | ||
4 | ######################################## | |
5 | # | |
6 | # Declarations | |
7 | # | |
8 | ||
9 | type dhcpd_t; | |
10 | type dhcpd_exec_t; | |
11 | init_daemon_domain(dhcpd_t,dhcpd_exec_t) | |
12 | ||
13 | type dhcpd_state_t; | |
14 | files_type(dhcpd_state_t) | |
15 | ||
16 | type dhcpd_tmp_t; | |
17 | files_tmp_file(dhcpd_tmp_t) | |
18 | ||
19 | type dhcpd_var_run_t; | |
20 | files_pid_file(dhcpd_var_run_t) | |
21 | ||
22 | ######################################## | |
23 | # | |
24 | # Local policy | |
25 | # | |
26 | ||
27 | dontaudit dhcpd_t self:capability { net_admin sys_tty_config }; | |
28 | allow dhcpd_t self:fifo_file { read write getattr }; | |
29 | allow dhcpd_t self:unix_dgram_socket create_socket_perms; | |
30 | allow dhcpd_t self:unix_stream_socket create_socket_perms; | |
31 | allow dhcpd_t self:netlink_route_socket r_netlink_socket_perms; | |
32 | allow dhcpd_t self:tcp_socket create_stream_socket_perms; | |
33 | allow dhcpd_t self:udp_socket create_socket_perms; | |
34 | # Allow dhcpd_t to use packet sockets | |
35 | allow dhcpd_t self:packet_socket create_socket_perms; | |
36 | allow dhcpd_t self:rawip_socket create_socket_perms; | |
37 | ||
38 | can_exec(dhcpd_t,dhcpd_exec_t) | |
39 | ||
40 | allow dhcpd_t dhcpd_state_t:file create_file_perms; | |
41 | sysnet_create_dhcp_state(dhcpd_t,dhcpd_state_t) | |
42 | ||
43 | allow dhcpd_t dhcpd_tmp_t:dir create_dir_perms; | |
44 | allow dhcpd_t dhcpd_tmp_t:file create_file_perms; | |
45 | files_create_tmp_files(dhcpd_t, dhcpd_tmp_t, { file dir }) | |
46 | ||
47 | allow dhcpd_t dhcpd_var_run_t:file create_file_perms; | |
48 | files_create_pid(dhcpd_t,dhcpd_var_run_t) | |
49 | ||
50 | kernel_read_system_state(dhcpd_t) | |
51 | kernel_read_kernel_sysctl(dhcpd_t) | |
52 | ||
53 | corenet_tcp_sendrecv_all_if(dhcpd_t) | |
54 | corenet_udp_sendrecv_all_if(dhcpd_t) | |
55 | corenet_raw_sendrecv_all_if(dhcpd_t) | |
56 | corenet_tcp_sendrecv_all_nodes(dhcpd_t) | |
57 | corenet_udp_sendrecv_all_nodes(dhcpd_t) | |
58 | corenet_raw_sendrecv_all_nodes(dhcpd_t) | |
59 | corenet_tcp_sendrecv_all_ports(dhcpd_t) | |
60 | corenet_udp_sendrecv_all_ports(dhcpd_t) | |
61 | corenet_tcp_bind_all_nodes(dhcpd_t) | |
62 | corenet_udp_bind_all_nodes(dhcpd_t) | |
63 | corenet_udp_bind_dhcpd_port(dhcpd_t) | |
64 | corenet_udp_bind_pxe_port(dhcpd_t) | |
65 | ||
66 | dev_read_sysfs(dhcpd_t) | |
67 | dev_read_rand(dhcpd_t) | |
68 | dev_read_urand(dhcpd_t) | |
69 | ||
70 | fs_getattr_all_fs(dhcpd_t) | |
71 | fs_search_auto_mountpoints(dhcpd_t) | |
72 | ||
73 | term_dontaudit_use_console(dhcpd_t) | |
74 | ||
75 | corecmd_exec_bin(dhcpd_t) | |
76 | corecmd_exec_sbin(dhcpd_t) | |
77 | ||
78 | domain_use_wide_inherit_fd(dhcpd_t) | |
79 | ||
80 | files_read_etc_files(dhcpd_t) | |
81 | files_read_usr_files(dhcpd_t) | |
82 | files_read_etc_runtime_files(dhcpd_t) | |
83 | files_search_var_lib(dhcpd_t) | |
84 | ||
85 | init_use_fd(dhcpd_t) | |
86 | init_use_script_pty(dhcpd_t) | |
87 | ||
88 | libs_use_ld_so(dhcpd_t) | |
89 | libs_use_shared_libs(dhcpd_t) | |
90 | ||
91 | logging_send_syslog_msg(dhcpd_t) | |
92 | ||
93 | miscfiles_read_localization(dhcpd_t) | |
94 | ||
95 | sysnet_read_config(dhcpd_t) | |
96 | sysnet_read_dhcp_config(dhcpd_t) | |
97 | ||
98 | userdom_dontaudit_use_unpriv_user_fd(dhcpd_t) | |
99 | userdom_dontaudit_search_sysadm_home_dir(dhcpd_t) | |
100 | ||
101 | ifdef(`distro_gentoo',` | |
102 | allow dhcpd_t self:capability { chown dac_override setgid setuid sys_chroot }; | |
103 | ') | |
104 | ||
105 | ifdef(`targeted_policy',` | |
106 | term_dontaudit_use_unallocated_tty(dhcpd_t) | |
107 | term_dontaudit_use_generic_pty(dhcpd_t) | |
108 | files_dontaudit_read_root_file(dhcpd_t) | |
109 | ') | |
110 | ||
111 | optional_policy(`bind.te',` | |
112 | # used for dynamic DNS | |
113 | bind_read_dnssec_keys(dhcpd_t) | |
114 | ') | |
115 | ||
116 | optional_policy(`mount.te',` | |
117 | mount_send_nfs_client_request(dhcpd_t) | |
118 | ') | |
119 | ||
120 | optional_policy(`nis.te',` | |
121 | nis_use_ypbind(dhcpd_t) | |
122 | ') | |
123 | ||
124 | optional_policy(`selinuxutil.te',` | |
125 | seutil_sigchld_newrole(dhcpd_t) | |
126 | ') | |
127 | ||
128 | optional_policy(`udev.te',` | |
129 | udev_read_db(dhcpd_t) | |
130 | ') | |
131 | ||
132 | ifdef(`TODO',` | |
133 | optional_policy(`rhgb.te',` | |
134 | rhgb_domain(dhcpd_t) | |
135 | ') | |
136 | ') dnl end TODO |