1*e4a36f41SAndroid Build Coastguard Worker### 2*e4a36f41SAndroid Build Coastguard Worker### Untrusted apps. 3*e4a36f41SAndroid Build Coastguard Worker### 4*e4a36f41SAndroid Build Coastguard Worker### This file defines the rules for untrusted apps running with 5*e4a36f41SAndroid Build Coastguard Worker### 31 < targetSdkVersion <= 33. 6*e4a36f41SAndroid Build Coastguard Worker### 7*e4a36f41SAndroid Build Coastguard Worker### See public/untrusted_app.te for more information about which apps are 8*e4a36f41SAndroid Build Coastguard Worker### placed in this selinux domain. 9*e4a36f41SAndroid Build Coastguard Worker### 10*e4a36f41SAndroid Build Coastguard Worker 11*e4a36f41SAndroid Build Coastguard Workertypeattribute untrusted_app_32 coredomain; 12*e4a36f41SAndroid Build Coastguard Worker 13*e4a36f41SAndroid Build Coastguard Workerapp_domain(untrusted_app_32) 14*e4a36f41SAndroid Build Coastguard Workeruntrusted_app_domain(untrusted_app_32) 15*e4a36f41SAndroid Build Coastguard Workernet_domain(untrusted_app_32) 16*e4a36f41SAndroid Build Coastguard Workerbluetooth_domain(untrusted_app_32) 17*e4a36f41SAndroid Build Coastguard Worker 18*e4a36f41SAndroid Build Coastguard Worker# Allow webview to access fd shared by sdksandbox for experiments data 19*e4a36f41SAndroid Build Coastguard Worker# TODO(b/229249719): Will not be supported in Android U 20*e4a36f41SAndroid Build Coastguard Workerallow untrusted_app_32 sdk_sandbox_data_file:fd use; 21*e4a36f41SAndroid Build Coastguard Workerallow untrusted_app_32 sdk_sandbox_data_file:file write; 22*e4a36f41SAndroid Build Coastguard Worker 23*e4a36f41SAndroid Build Coastguard Workerneverallow untrusted_app_32 sdk_sandbox_data_file:file { open create }; 24*e4a36f41SAndroid Build Coastguard Worker 25*e4a36f41SAndroid Build Coastguard Worker# Connect to mdnsd via mdnsd socket. 26*e4a36f41SAndroid Build Coastguard Workerunix_socket_connect(untrusted_app_32, mdnsd, mdnsd) 27*e4a36f41SAndroid Build Coastguard Workeruserdebug_or_eng(` 28*e4a36f41SAndroid Build Coastguard Worker auditallow untrusted_app_32 mdnsd_socket:sock_file write; 29*e4a36f41SAndroid Build Coastguard Worker auditallow untrusted_app_32 mdnsd:unix_stream_socket connectto; 30*e4a36f41SAndroid Build Coastguard Worker') 31*e4a36f41SAndroid Build Coastguard Worker 32*e4a36f41SAndroid Build Coastguard Worker# Allow calling inotify on APKs for backwards compatibility. This is disallowed 33*e4a36f41SAndroid Build Coastguard Worker# for targetSdkVersion>=34 to remove a sidechannel. 34*e4a36f41SAndroid Build Coastguard Workerallow untrusted_app_32 apk_data_file:dir { watch watch_reads }; 35*e4a36f41SAndroid Build Coastguard Workerallow untrusted_app_32 apk_data_file:file { watch watch_reads }; 36*e4a36f41SAndroid Build Coastguard Workeruserdebug_or_eng(` 37*e4a36f41SAndroid Build Coastguard Worker auditallow untrusted_app_32 apk_data_file:dir { watch watch_reads }; 38*e4a36f41SAndroid Build Coastguard Worker auditallow untrusted_app_32 apk_data_file:file { watch watch_reads }; 39*e4a36f41SAndroid Build Coastguard Worker') 40