]> git.ipfire.org Git - people/stevee/selinux-policy.git/blob - policy/modules/services/rpc.te
Bump module versions for release.
[people/stevee/selinux-policy.git] / policy / modules / services / rpc.te
1
2 policy_module(rpc, 1.12.0)
3
4 ########################################
5 #
6 # Declarations
7 #
8
9 ## <desc>
10 ## <p>
11 ## Allow gssd to read temp directory. For access to kerberos tgt.
12 ## </p>
13 ## </desc>
14 gen_tunable(allow_gssd_read_tmp, true)
15
16 ## <desc>
17 ## <p>
18 ## Allow nfs servers to modify public files
19 ## used for public file transfer services. Files/Directories must be
20 ## labeled public_content_rw_t.
21 ## </p>
22 ## </desc>
23 gen_tunable(allow_nfsd_anon_write, false)
24
25 type exports_t;
26 files_config_file(exports_t)
27
28 rpc_domain_template(gssd)
29
30 type gssd_tmp_t;
31 files_tmp_file(gssd_tmp_t)
32
33 type rpcd_var_run_t;
34 files_pid_file(rpcd_var_run_t)
35
36 # rpcd_t is the domain of rpc daemons.
37 # rpc_exec_t is the type of rpc daemon programs.
38 rpc_domain_template(rpcd)
39
40 type rpcd_initrc_exec_t;
41 init_script_file(rpcd_initrc_exec_t);
42
43 rpc_domain_template(nfsd)
44
45 type nfsd_initrc_exec_t;
46 init_script_file(nfsd_initrc_exec_t);
47
48 type nfsd_rw_t;
49 files_type(nfsd_rw_t)
50
51 type nfsd_ro_t;
52 files_type(nfsd_ro_t)
53
54 type var_lib_nfs_t;
55 files_mountpoint(var_lib_nfs_t)
56
57 ########################################
58 #
59 # RPC local policy
60 #
61
62 allow rpcd_t self:capability { sys_admin chown dac_override setgid setuid };
63 allow rpcd_t self:process { getcap setcap };
64 allow rpcd_t self:fifo_file rw_fifo_file_perms;
65
66 allow rpcd_t rpcd_var_run_t:dir setattr;
67 manage_files_pattern(rpcd_t, rpcd_var_run_t, rpcd_var_run_t)
68 files_pid_filetrans(rpcd_t, rpcd_var_run_t, file)
69
70 # rpc.statd executes sm-notify
71 can_exec(rpcd_t, rpcd_exec_t)
72
73 kernel_read_system_state(rpcd_t)
74 kernel_read_network_state(rpcd_t)
75 # for rpc.rquotad
76 kernel_read_sysctl(rpcd_t)
77 kernel_rw_fs_sysctls(rpcd_t)
78 kernel_dontaudit_getattr_core_if(rpcd_t)
79 kernel_signal(rpcd_t)
80
81 corecmd_exec_bin(rpcd_t)
82
83 files_manage_mounttab(rpcd_t)
84 files_getattr_all_dirs(rpcd_t)
85
86 fs_list_rpc(rpcd_t)
87 fs_read_rpc_files(rpcd_t)
88 fs_read_rpc_symlinks(rpcd_t)
89 fs_rw_rpc_sockets(rpcd_t)
90 fs_get_all_fs_quotas(rpcd_t)
91 fs_getattr_all_fs(rpcd_t)
92
93 storage_getattr_fixed_disk_dev(rpcd_t)
94
95 selinux_dontaudit_read_fs(rpcd_t)
96
97 miscfiles_read_certs(rpcd_t)
98
99 seutil_dontaudit_search_config(rpcd_t)
100
101 optional_policy(`
102 automount_signal(rpcd_t)
103 automount_dontaudit_write_pipes(rpcd_t)
104 ')
105
106 optional_policy(`
107 nis_read_ypserv_config(rpcd_t)
108 ')
109
110 ########################################
111 #
112 # NFSD local policy
113 #
114
115 allow nfsd_t self:capability { dac_override dac_read_search sys_admin sys_resource };
116
117 allow nfsd_t exports_t:file read_file_perms;
118 allow nfsd_t { nfsd_rw_t nfsd_ro_t }:dir list_dir_perms;
119
120 # for /proc/fs/nfs/exports - should we have a new type?
121 kernel_read_system_state(nfsd_t)
122 kernel_read_network_state(nfsd_t)
123 kernel_dontaudit_getattr_core_if(nfsd_t)
124
125 corenet_tcp_bind_all_rpc_ports(nfsd_t)
126 corenet_udp_bind_all_rpc_ports(nfsd_t)
127
128 dev_dontaudit_getattr_all_blk_files(nfsd_t)
129 dev_dontaudit_getattr_all_chr_files(nfsd_t)
130 dev_rw_lvm_control(nfsd_t)
131
132 # does not really need this, but it is easier to just allow it
133 files_search_pids(nfsd_t)
134 # for exportfs and rpc.mountd
135 files_getattr_tmp_dirs(nfsd_t)
136 # cjp: this should really have its own type
137 files_manage_mounttab(nfsd_t)
138 files_read_etc_runtime_files(nfsd_t)
139
140 fs_mount_nfsd_fs(nfsd_t)
141 fs_search_nfsd_fs(nfsd_t)
142 fs_getattr_all_fs(nfsd_t)
143 fs_getattr_all_dirs(nfsd_t)
144 fs_rw_nfsd_fs(nfsd_t)
145
146 storage_dontaudit_read_fixed_disk(nfsd_t)
147 storage_raw_read_removable_device(nfsd_t)
148
149 # Read access to public_content_t and public_content_rw_t
150 miscfiles_read_public_files(nfsd_t)
151
152 # Write access to public_content_t and public_content_rw_t
153 tunable_policy(`allow_nfsd_anon_write',`
154 miscfiles_manage_public_files(nfsd_t)
155 ')
156
157 tunable_policy(`nfs_export_all_rw',`
158 dev_getattr_all_blk_files(nfsd_t)
159 dev_getattr_all_chr_files(nfsd_t)
160
161 fs_read_noxattr_fs_files(nfsd_t)
162 auth_manage_all_files_except_shadow(nfsd_t)
163 ')
164
165 tunable_policy(`nfs_export_all_ro',`
166 dev_getattr_all_blk_files(nfsd_t)
167 dev_getattr_all_chr_files(nfsd_t)
168
169 files_getattr_all_pipes(nfsd_t)
170 files_getattr_all_sockets(nfsd_t)
171
172 fs_read_noxattr_fs_files(nfsd_t)
173
174 auth_read_all_dirs_except_shadow(nfsd_t)
175 auth_read_all_files_except_shadow(nfsd_t)
176 ')
177
178 ########################################
179 #
180 # GSSD local policy
181 #
182
183 allow gssd_t self:capability { dac_override dac_read_search setuid sys_nice };
184 allow gssd_t self:process { getsched setsched };
185 allow gssd_t self:fifo_file rw_file_perms;
186
187 manage_dirs_pattern(gssd_t, gssd_tmp_t, gssd_tmp_t)
188 manage_files_pattern(gssd_t, gssd_tmp_t, gssd_tmp_t)
189 files_tmp_filetrans(gssd_t, gssd_tmp_t, { file dir })
190
191 kernel_read_system_state(gssd_t)
192 kernel_read_network_state(gssd_t)
193 kernel_read_network_state_symlinks(gssd_t)
194 kernel_request_load_module(gssd_t)
195 kernel_search_network_sysctl(gssd_t)
196 kernel_signal(gssd_t)
197
198 corecmd_exec_bin(gssd_t)
199
200 fs_list_rpc(gssd_t)
201 fs_rw_rpc_sockets(gssd_t)
202 fs_read_rpc_files(gssd_t)
203
204 fs_list_inotifyfs(gssd_t)
205 files_list_tmp(gssd_t)
206 files_read_usr_symlinks(gssd_t)
207 files_dontaudit_write_var_dirs(gssd_t)
208
209 auth_use_nsswitch(gssd_t)
210 auth_manage_cache(gssd_t)
211
212 miscfiles_read_certs(gssd_t)
213
214 mount_signal(gssd_t)
215
216 userdom_signal_all_users(gssd_t)
217
218 tunable_policy(`allow_gssd_read_tmp',`
219 userdom_list_user_tmp(gssd_t)
220 userdom_read_user_tmp_files(gssd_t)
221 userdom_read_user_tmp_symlinks(gssd_t)
222 ')
223
224 optional_policy(`
225 automount_signal(gssd_t)
226 ')
227
228 optional_policy(`
229 kerberos_keytab_template(gssd, gssd_t)
230 ')
231
232 optional_policy(`
233 pcscd_read_pub_files(gssd_t)
234 ')
235
236 optional_policy(`
237 xserver_rw_xdm_tmp_files(gssd_t)
238 ')