| [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; | 
|---|
|  | 16 | files_type(afsd_etc_t) | 
|---|
|  | 17 | files_type(afsd_cache_t) | 
|---|
|  | 18 |  | 
|---|
|  | 19 | allow afsd_t { afsd_etc_t afsd_cache_t }:dir manage_dir_perms; | 
|---|
|  | 20 | allow afsd_t { afsd_etc_t afsd_cache_t }:file_class_set manage_file_perms; | 
|---|
|  | 21 | #files_var_lib_filetrans(afsd_t,afsd_cache_t, { file dir sock_file }) | 
|---|
|  | 22 |  | 
|---|
|  | 23 | ######################################## | 
|---|
|  | 24 | # | 
|---|
|  | 25 | # AFS local policy | 
|---|
|  | 26 |  | 
|---|
|  | 27 | files_read_etc_files(afsd_t) | 
|---|
|  | 28 | files_rw_etc_runtime_files(afsd_t) | 
|---|
|  | 29 | libs_use_ld_so(afsd_t) | 
|---|
|  | 30 | libs_use_shared_libs(afsd_t) | 
|---|
|  | 31 | miscfiles_read_localization(afsd_t) | 
|---|
|  | 32 |  | 
|---|
|  | 33 | # Init script handling | 
|---|
|  | 34 | init_use_fds(afsd_t) | 
|---|
|  | 35 | init_use_script_ptys(afsd_t) | 
|---|
|  | 36 | domain_use_interactive_fds(afsd_t) | 
|---|
|  | 37 |  | 
|---|
|  | 38 | files_mounton_default(afsd_t) | 
|---|
|  | 39 | kernel_read_system_state(afsd_t) | 
|---|
|  | 40 | kernel_write_proc_files(afsd_t) | 
|---|
|  | 41 | fs_mount_nfs(afsd_t) | 
|---|
|  | 42 | fs_remount_nfs(afsd_t) | 
|---|
|  | 43 | fs_unmount_nfs(afsd_t) | 
|---|
|  | 44 | fs_manage_nfs_files(afsd_t) | 
|---|
|  | 45 | fs_manage_nfs_symlinks(afsd_t) | 
|---|
|  | 46 | fs_manage_nfs_named_pipes(afsd_t) | 
|---|
|  | 47 | fs_manage_nfs_named_sockets(afsd_t) | 
|---|
|  | 48 |  | 
|---|
|  | 49 | fs_getattr_xattr_fs(afsd_t); | 
|---|
|  | 50 |  | 
|---|
|  | 51 | allow afsd_t self:dir mounton; | 
|---|
|  | 52 | allow afsd_t self:process setsched; | 
|---|
|  | 53 | allow afsd_t self:capability { sys_admin sys_nice sys_tty_config}; | 
|---|
|  | 54 |  | 
|---|
|  | 55 | require { | 
|---|
|  | 56 | 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; | 
|---|
|  | 57 | type netif_t, node_t; | 
|---|
|  | 58 | } | 
|---|
|  | 59 | 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; | 
|---|
|  | 60 | 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; | 
|---|
|  | 61 | allow afsd_t netif_t:netif { udp_recv udp_send }; | 
|---|
|  | 62 | allow afsd_t node_t:node { udp_recv udp_send }; | 
|---|
|  | 63 |  | 
|---|
|  | 64 | require { | 
|---|
|  | 65 | type crond_t, kernel_t, sshd_t, user_t; | 
|---|
|  | 66 | } | 
|---|
|  | 67 | afs_access(afsd_t); | 
|---|
|  | 68 | afs_access(crond_t); | 
|---|
|  | 69 | afs_access(kernel_t); | 
|---|
|  | 70 | afs_access(sshd_t); | 
|---|
|  | 71 | afs_access(user_t); | 
|---|
|  | 72 |  | 
|---|
|  | 73 | require { | 
|---|
|  | 74 | type initrc_t; | 
|---|
|  | 75 | } | 
|---|
|  | 76 | # init.d script sets up cell files: | 
|---|
|  | 77 | allow initrc_t afsd_etc_t:file { setattr write }; | 
|---|
|  | 78 | # permit aklog: | 
|---|
|  | 79 | allow user_t proc_t:file write; | 
|---|