arXiv:2411.11567cs.CRcs.LG2024-11被引 1

用图神经网络自动识别C代码中应放入安全区的敏感模块。

GNN-Based Code Annotation Logic for Establishing Security Boundaries in C Code

  • 构建基于图的代码特征,用自定义GNN模型判断安全敏感部分。
  • 在测试中识别出91.59%的安全敏感函数,召回率达86.05%。
  • 适合开发人员快速定位需隔离的代码,提升TEE使用效率。

在当今互联软件环境中,保护敏感操作至关重要但极具挑战性。现代平台依赖可信执行环境(TEEs),如Intel SGX和ARM TrustZone,将安全敏感代码与主系统隔离,从而缩小可信计算基(TCB)并提供更强保障。然而,确定哪些代码应置于TEEs中复杂且需专业经验,当前自动化工具难以支持。现有方案常将整个应用迁移至TEEs,导致资源浪费并扩大TCB。为此,我们提出代码注释逻辑(CAL),一种开创性工具,可自动识别适用于TEEs隔离的安全敏感组件。CAL分析代码库,采用基于图的方法,结合创新特征构造,并使用定制图神经网络模型准确判定代码中应隔离的部分。该方法有效优化了TCB,减轻人工分析负担,提升整体安全性。贡献包括定义安全敏感代码、构建并标注全面的源文件数据集、设计丰富的图结构数据预处理流程,以及用于TEEs集成的CAL模型。评估结果显示,CAL在识别敏感代码方面表现出色,召回率为86.05%,F1得分为81.56%,对安全敏感函数的识别率达到91.59%。通过实现高效代码隔离,CAL推动了基于TEEs的应用安全开发,为开发者提供实用解决方案以减少攻击面。

原文摘要 · Abstract (English)

Securing sensitive operations in today's interconnected software landscape is crucial yet challenging. Modern platforms rely on Trusted Execution Environments (TEEs), such as Intel SGX and ARM TrustZone, to isolate security sensitive code from the main system, reducing the Trusted Computing Base (TCB) and providing stronger assurances. However, identifying which code should reside in TEEs is complex and requires specialized expertise, which is not supported by current automated tools. Existing solutions often migrate entire applications to TEEs, leading to suboptimal use and an increased TCB. To address this gap, we propose Code Annotation Logic (CAL), a pioneering tool that automatically identifies security sensitive components for TEE isolation. CAL analyzes codebases, leveraging a graph-based approach with novel feature construction and employing a custom graph neural network model to accurately determine which parts of the code should be isolated. CAL effectively optimizes TCB, reducing the burden of manual analysis and enhancing overall security. Our contributions include the definition of security sensitive code, the construction and labeling of a comprehensive dataset of source files, a feature rich graph based data preparation pipeline, and the CAL model for TEE integration. Evaluation results demonstrate CAL's efficacy in identifying sensitive code with a recall of 86.05%, an F1 score of 81.56%, and an identification rate of 91.59% for security sensitive functions. By enabling efficient code isolation, CAL advances the secure development of applications using TEEs, offering a practical solution for developers to reduce attack vectors.

代码安全图神经网络TEE自动分析

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。