[28] | 1 | policy_module(afsd,1.0.0) |
---|
| 2 | |
---|
| 3 | ######################################## |
---|
| 4 | # |
---|
| 5 | # Declarations |
---|
| 6 | # |
---|
| 7 | |
---|
| 8 | type afsd_t; |
---|
| 9 | type afsd_exec_t; |
---|
| 10 | domain_type(afsd_t) |
---|
| 11 | init_daemon_domain(afsd_t, afsd_exec_t) |
---|
| 12 | |
---|
| 13 | # var/lib files |
---|
| 14 | type afsd_etc_t; |
---|
| 15 | type afsd_cache_t; |
---|
[79] | 16 | #files_type(afsd_etc_t) |
---|
[28] | 17 | files_type(afsd_etc_t) |
---|
| 18 | files_type(afsd_cache_t) |
---|
| 19 | |
---|
| 20 | allow afsd_t { afsd_etc_t afsd_cache_t }:dir manage_dir_perms; |
---|
| 21 | allow afsd_t { afsd_etc_t afsd_cache_t }:file_class_set manage_file_perms; |
---|
| 22 | #files_var_lib_filetrans(afsd_t,afsd_cache_t, { file dir sock_file }) |
---|
| 23 | |
---|
| 24 | ######################################## |
---|
| 25 | # |
---|
| 26 | # AFS local policy |
---|
| 27 | |
---|
| 28 | files_read_etc_files(afsd_t) |
---|
| 29 | files_rw_etc_runtime_files(afsd_t) |
---|
| 30 | libs_use_ld_so(afsd_t) |
---|
| 31 | libs_use_shared_libs(afsd_t) |
---|
| 32 | miscfiles_read_localization(afsd_t) |
---|
| 33 | |
---|
| 34 | # Init script handling |
---|
| 35 | init_use_fds(afsd_t) |
---|
| 36 | init_use_script_ptys(afsd_t) |
---|
| 37 | domain_use_interactive_fds(afsd_t) |
---|
[79] | 38 | term_use_console(afsd_t) |
---|
[28] | 39 | |
---|
| 40 | files_mounton_default(afsd_t) |
---|
| 41 | kernel_read_system_state(afsd_t) |
---|
| 42 | kernel_write_proc_files(afsd_t) |
---|
| 43 | fs_mount_nfs(afsd_t) |
---|
| 44 | fs_remount_nfs(afsd_t) |
---|
| 45 | fs_unmount_nfs(afsd_t) |
---|
| 46 | fs_manage_nfs_files(afsd_t) |
---|
| 47 | fs_manage_nfs_symlinks(afsd_t) |
---|
| 48 | fs_manage_nfs_named_pipes(afsd_t) |
---|
| 49 | fs_manage_nfs_named_sockets(afsd_t) |
---|
| 50 | |
---|
| 51 | fs_getattr_xattr_fs(afsd_t); |
---|
| 52 | |
---|
| 53 | allow afsd_t self:dir mounton; |
---|
| 54 | allow afsd_t self:process setsched; |
---|
| 55 | allow afsd_t self:capability { sys_admin sys_nice sys_tty_config}; |
---|
| 56 | |
---|
[79] | 57 | #allow afsd_t lo_node_t:node all_node_perms; |
---|
| 58 | #allow afsd_t net_conf_t:file read; |
---|
| 59 | sysnet_dns_name_resolve(afsd_t) |
---|
| 60 | corenet_tcp_sendrecv_all_nodes(afsd_t) |
---|
| 61 | corenet_udp_sendrecv_all_nodes(afsd_t) |
---|
| 62 | |
---|
[82] | 63 | afs_access(afsd_t); |
---|
[79] | 64 | |
---|
[28] | 65 | require { |
---|
| 66 | type afs_bos_port_t,afs_fs_port_t,afs_fs_port_t,afs_ka_port_t,afs_pt_port_t,afs_vl_port_t; |
---|
| 67 | type netif_t, node_t; |
---|
[79] | 68 | type kernel_t; |
---|
[28] | 69 | } |
---|
| 70 | allow afsd_t { self afs_bos_port_t afs_fs_port_t afs_fs_port_t afs_ka_port_t afs_pt_port_t afs_vl_port_t }:tcp_socket all_tcp_socket_perms; |
---|
| 71 | allow afsd_t { self afs_bos_port_t afs_fs_port_t afs_fs_port_t afs_ka_port_t afs_pt_port_t afs_vl_port_t }:udp_socket all_udp_socket_perms; |
---|
| 72 | allow afsd_t netif_t:netif { udp_recv udp_send }; |
---|
| 73 | allow afsd_t node_t:node { udp_recv udp_send }; |
---|
| 74 | |
---|
[79] | 75 | allow afsd_t kernel_t:key all_key_perms; |
---|