1# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14type appspawn, native_system_domain, domain;
15type appspawn_exec, system_file_attr, exec_attr, file_attr;
16type pid_ns_init, native_system_domain, domain;
17type pid_ns_init_exec, system_file_attr, exec_attr, file_attr;
18## audit: type=1400 audit(1501988181.483:2582): avc:  denied  { use } for  pid=280 comm="appspawn" path="/data/storage/el2/base/haps/entry/files/test.txt"
19## dev="mmcblk0p15"  ino=2554 scontext=u:r:appspawn:s0 tcontext=u:r:system_basic_hap:s0 tclass=fd permissive=0
20allow appspawn hap_domain:fd { use };
21## audit: type=1400 audit(1502003391.146:2748): avc:  denied  { read write } for  pid=275 comm="appspawn" path="/data/storage/el2/base/haps/entry/files/test.txt"
22## dev="mmcblk0p15" ino=2483 scontext=u:r:appspawn:s0 tcontext=u:object_r:system_basic_hap_data_file:s0 tclass=file permissive=1
23allow appspawn hap_file_attr:file { read write } ;
24
25allow appspawn nativespawn:process { dyntransition sigkill };
26neverallow appspawn *:process ptrace;
27
28