1# Copyright (c) 2023 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 14import("//base/security/security_guard/security_guard.gni") 15import("//build/ohos.gni") 16 17ohos_shared_library("security_collector_service") { 18 subsystem_name = "security" 19 part_name = "security_guard" 20 version_script = "security_collector_service.map" 21 include_dirs = [ 22 "${sg_root_dir}/interfaces/inner_api/common/include", 23 "${sg_root_dir}/interfaces/inner_api/collector/include", 24 "${sg_root_dir}/frameworks/common/collector/include", 25 "${sg_root_dir}/services/collector_manager/include", 26 "${sg_root_dir}/services/security_collector/include", 27 "${sg_root_dir}/frameworks/common/log/include", 28 "${sg_root_dir}/frameworks/common/constants/include", 29 "${sg_root_dir}/frameworks/common/task_handler/include", 30 "${sg_root_dir}/frameworks/common/json/include", 31 "${sg_root_dir}/frameworks/common/utils/include", 32 ] 33 34 defines = [] 35 defines += [ 36 "SECURITY_GUARD_EVENT_CFG_SOURCE = \"${security_guard_event_cfg_source}\"", 37 "SECURITY_GUARD_MODEL_CFG_SOURCE = \"${security_guard_model_cfg_source}\"", 38 "SECURITY_GUARD_EVENT_GROUP_CFG_SOURCE = \"${security_guard_event_group_cfg_source}\"", 39 "SECURITY_GUARD_CONFIG_UPDATE_TRUST_LIST_SOURCE = \"${security_guard_config_update_trust_list_source}\"", 40 "SECURITY_GUARD_COLLECTOR_CFG_SOURCE = \"${security_guard_collector_cfg_source}\"", 41 "SECURITY_GUARD_EVENT_FILTER_PATH = \"${security_guard_event_filter_path}\"", 42 "SECURITY_GUARD_EVENT_WRAPPER_PATH = \"${security_guard_event_wrapper_path}\"", 43 ] 44 sources = [ 45 "${sg_root_dir}/frameworks/common/collector/src/security_collector_event_filter.cpp", 46 "${sg_root_dir}/frameworks/common/collector/src/security_collector_subscribe_info.cpp", 47 "${sg_root_dir}/services/security_collector/src/security_collector_manager_callback_proxy.cpp", 48 "${sg_root_dir}/services/security_collector/src/security_collector_manager_service.cpp", 49 "${sg_root_dir}/services/security_collector/src/security_collector_manager_stub.cpp", 50 "${sg_root_dir}/services/security_collector/src/security_collector_run_manager.cpp", 51 "${sg_root_dir}/services/security_collector/src/security_collector_subscriber_manager.cpp", 52 ] 53 54 sanitize = { 55 integer_overflow = true 56 ubsan = true 57 boundary_sanitize = true 58 cfi = true 59 cfi_cross_dso = true 60 debug = false 61 } 62 branch_protector_ret = "pac_ret" 63 64 deps = [ 65 "${sg_root_dir}/frameworks/common/collect:libsg_collect_sdk", 66 "${sg_root_dir}/frameworks/common/collector:libsg_collector_sdk", 67 "${sg_root_dir}/services/collector_manager:security_collector_manager", 68 ] 69 70 external_deps = [ 71 "access_token:libaccesstoken_sdk", 72 "access_token:libtokenid_sdk", 73 "c_utils:utils", 74 "ffrt:libffrt", 75 "hilog:libhilog", 76 "hisysevent:libhisysevent", 77 "hisysevent:libhisyseventmanager", 78 "ipc:ipc_core", 79 "json:nlohmann_json_static", 80 "os_account:os_account_innerkits", 81 "preferences:native_preferences", 82 "safwk:system_ability_fwk", 83 "samgr:samgr_proxy", 84 ] 85} 86