1 type keystore, domain; 2 type keystore_exec, exec_type, file_type; 3 4 # keystore daemon 5 typeattribute keystore mlstrustedsubject; 6 binder_use(keystore) 7 binder_service(keystore) 8 binder_call(keystore, system_server) 9 10 allow keystore keystore_data_file:dir create_dir_perms; 11 allow keystore keystore_data_file:notdevfile_class_set create_file_perms; 12 allow keystore keystore_exec:file { getattr }; 13 14 add_service(keystore, keystore_service) 15 allow keystore sec_key_att_app_id_provider_service:service_manager find; 16 17 # Check SELinux permissions. 18 selinux_check_access(keystore) 19 20 r_dir_file(keystore, cgroup) 21 22 ### 23 ### Neverallow rules 24 ### 25 ### Protect ourself from others 26 ### 27 28 neverallow { domain -keystore } keystore_data_file:dir ~{ open create read getattr setattr search relabelto ioctl }; 29 neverallow { domain -keystore } keystore_data_file:notdevfile_class_set ~{ relabelto getattr }; 30 31 neverallow { domain -keystore -init } keystore_data_file:dir *; 32 neverallow { domain -keystore -init } keystore_data_file:notdevfile_class_set *; 33 34 neverallow * keystore:process ptrace; 35