2017-03-23 22:27:32 +01:00
|
|
|
typeattribute keystore coredomain;
|
|
|
|
|
2016-07-22 22:13:11 +02:00
|
|
|
init_daemon_domain(keystore)
|
2017-04-14 04:05:27 +02:00
|
|
|
|
|
|
|
# talk to keymaster
|
|
|
|
hal_client_domain(keystore, hal_keymaster)
|
|
|
|
|
2018-01-09 23:42:53 +01:00
|
|
|
# talk to confirmationui
|
|
|
|
hal_client_domain(keystore, hal_confirmationui)
|
|
|
|
|
2020-08-24 16:52:32 +02:00
|
|
|
# talk to keymint
|
|
|
|
hal_client_domain(keystore, hal_keymint)
|
|
|
|
|
2023-11-14 08:38:18 +01:00
|
|
|
# Ignore keystore attempts to access the AVF RKP Hal but keystore is not suppose to
|
|
|
|
# access it.
|
|
|
|
# TODO(b/312427637): Investigate the reason and fix the denial.
|
|
|
|
dontaudit keystore hal_remotelyprovisionedcomponent_avf_service:service_manager { find };
|
|
|
|
|
2018-01-09 23:42:53 +01:00
|
|
|
# This is used for the ConfirmationUI async callback.
|
|
|
|
allow keystore platform_app:binder call;
|
|
|
|
|
2018-01-24 20:49:18 +01:00
|
|
|
# Allow to check whether security logging is enabled.
|
|
|
|
get_prop(keystore, device_logging_prop)
|
2020-07-25 22:02:29 +02:00
|
|
|
|
2022-02-02 06:15:44 +01:00
|
|
|
# Allow keystore to check if the system is rkp only.
|
|
|
|
get_prop(keystore, remote_prov_prop)
|
|
|
|
|
2022-09-29 23:20:22 +02:00
|
|
|
# Allow keystore to check rkpd feature flags
|
|
|
|
get_prop(keystore, device_config_remote_key_provisioning_native_prop)
|
|
|
|
|
2020-06-11 01:34:41 +02:00
|
|
|
# Allow keystore to write to statsd.
|
|
|
|
unix_socket_send(keystore, statsdw, statsd)
|
2020-08-29 10:45:24 +02:00
|
|
|
|
2023-10-16 23:44:26 +02:00
|
|
|
# Keystore need access to the keystore2_key_contexts file to load the keystore key backend.
|
2020-07-25 22:02:29 +02:00
|
|
|
allow keystore keystore2_key_contexts_file:file r_file_perms;
|
2020-06-10 23:10:02 +02:00
|
|
|
|
2022-08-22 18:00:25 +02:00
|
|
|
# Allow keystore to listen to changing boot levels
|
2021-02-23 17:40:05 +01:00
|
|
|
get_prop(keystore, keystore_listen_prop)
|
2021-03-01 11:53:46 +01:00
|
|
|
|
2021-06-13 18:56:33 +02:00
|
|
|
# Keystore needs to transfer binder references to vold so that it
|
2021-03-01 11:53:46 +01:00
|
|
|
# can call keystore methods on those references.
|
|
|
|
allow keystore vold:binder transfer;
|
2021-07-03 01:14:50 +02:00
|
|
|
|
|
|
|
set_prop(keystore, keystore_crash_prop)
|
2022-07-28 18:23:42 +02:00
|
|
|
|
|
|
|
# keystore is using apex_info via libvintf
|
|
|
|
use_apex_info(keystore)
|
2024-03-27 09:18:41 +01:00
|
|
|
|
|
|
|
typeattribute keystore mlstrustedsubject;
|
|
|
|
binder_use(keystore)
|
|
|
|
binder_service(keystore)
|
|
|
|
binder_call(keystore, remote_provisioning_service_server)
|
|
|
|
binder_call(keystore, system_server)
|
|
|
|
binder_call(keystore, wificond)
|
|
|
|
|
|
|
|
allow keystore keystore_data_file:dir create_dir_perms;
|
|
|
|
allow keystore keystore_data_file:notdevfile_class_set create_file_perms;
|
|
|
|
allow keystore keystore_exec:file { getattr };
|
|
|
|
|
|
|
|
add_service(keystore, keystore_service)
|
|
|
|
allow keystore sec_key_att_app_id_provider_service:service_manager find;
|
|
|
|
allow keystore dropbox_service:service_manager find;
|
|
|
|
allow keystore remote_provisioning_service:service_manager find;
|
|
|
|
add_service(keystore, apc_service)
|
|
|
|
add_service(keystore, keystore_compat_hal_service)
|
|
|
|
add_service(keystore, authorization_service)
|
|
|
|
add_service(keystore, keystore_maintenance_service)
|
|
|
|
add_service(keystore, keystore_metrics_service)
|
|
|
|
add_service(keystore, legacykeystore_service)
|
|
|
|
|
|
|
|
# Check SELinux permissions.
|
|
|
|
selinux_check_access(keystore)
|
|
|
|
|
|
|
|
r_dir_file(keystore, cgroup)
|
|
|
|
r_dir_file(keystore, cgroup_v2)
|
|
|
|
|
|
|
|
# The software KeyMint implementation used in km_compat needs
|
|
|
|
# to read the vendor security patch level.
|
|
|
|
get_prop(keystore, vendor_security_patch_level_prop);
|
|
|
|
|
|
|
|
# Allow keystore to read its vendor configuration
|
|
|
|
get_prop(keystore, keystore_config_prop)
|
|
|
|
|
|
|
|
###
|
|
|
|
### Neverallow rules
|
|
|
|
###
|
|
|
|
### Protect ourself from others
|
|
|
|
###
|
|
|
|
|
|
|
|
neverallow { domain -keystore } keystore_data_file:dir ~{ open create read getattr setattr search relabelto ioctl };
|
|
|
|
neverallow { domain -keystore } keystore_data_file:notdevfile_class_set ~{ relabelto getattr };
|
|
|
|
|
|
|
|
neverallow { domain -keystore -init } keystore_data_file:dir *;
|
|
|
|
neverallow { domain -keystore -init } keystore_data_file:notdevfile_class_set *;
|
|
|
|
|
|
|
|
# TODO(b/186868271): Remove the crash dump exception soon-ish (maybe by May 14, 2021?)
|
|
|
|
neverallow { domain userdebug_or_eng(`-crash_dump') } keystore:process ptrace;
|
|
|
|
|
|
|
|
# Only keystore can set keystore.crash_count system property. Since init is allowed to set any
|
|
|
|
# system property, an exception is added for init as well.
|
|
|
|
neverallow { domain -keystore -init } keystore_crash_prop:property_service set;
|