arXiv:2601.14595cs.CRcs.AI2026-01中稿 · MSR 2026

用符号规则加神经模型,精准识别IaC代码中的安全缺陷,误报少、成本低。

IntelliSA: An Intelligent Static Analyzer for IaC Security Smell Detection Using Symbolic Rules and Neural Inference

  • 先用符号规则全覆盖扫描,再用轻量神经模型过滤误报
  • 在11,814行真实代码上检测出241个安全缺陷,F1达83%
  • 模型比大模型小500倍,适合离线部署,检测仅需2%代码量

基础设施即代码(IaC)可自动化配置大规模云与本地环境,但单一配置错误可能引发严重宕机和安全风险。现有研究通过符号规则检测IaC中的安全气味(不良编码模式),但易产生大量误报,增加人工审查负担。本文提出IntelliSA,一种融合符号规则与神经推理的智能静态分析工具:先以符号规则广覆盖地识别潜在问题,再利用知识蒸馏训练的紧凑学生模型高效过滤误报。该学生模型由大语言模型(LLM)教师生成伪标签训练而成,体积小于原模型500倍,兼具高精度与低成本。在包含241个安全缺陷、共11,814行真实IaC代码的人工标注数据集上,IntelliSA的F1分数达到83%,优于三种主流大模型(Claude-4、Grok-4、GPT-5)及两个基准静态分析器7%-42%;同时仅需分析不足2%代码即可发现60%的安全缺陷,具备最佳成本效益。

原文摘要 · Abstract (English)

Infrastructure as Code (IaC) enables automated provisioning of large-scale cloud and on-premise environments, reducing the need for repetitive manual setup. However, this automation is a double-edged sword: a single misconfiguration in IaC scripts can propagate widely, leading to severe system downtime and security risks. Prior studies have shown that IaC scripts often contain security smells--bad coding patterns that may introduce vulnerabilities--and have proposed static analyzers based on symbolic rules to detect them. Yet, our preliminary analysis reveals that rule-based detection alone tends to over-approximate, producing excessive false positives and increasing the burden of manual inspection. In this paper, we present IntelliSA, an intelligent static analyzer for IaC security smell detection that integrates symbolic rules with neural inference. IntelliSA applies symbolic rules to over-approximate potential smells for broad coverage, then employs neural inference to filter false positives. While an LLM can effectively perform this filtering, reliance on LLM APIs introduces high cost and latency, raises data governance concerns, and limits reproducibility and offline deployment. To address the challenges, we adopt a knowledge distillation approach: an LLM teacher generates pseudo-labels to train a compact student model--over 500x smaller--that learns from the teacher's knowledge and efficiently classifies false positives. We evaluate IntelliSA against two static analyzers and three LLM baselines (Claude-4, Grok-4, and GPT-5) using a human-labeled dataset including 241 security smells across 11,814 lines of real-world IaC code. Experimental results show that IntelliSA achieves the highest F1 score (83%), outperforming baselines by 7-42%. Moreover, IntelliSA demonstrates the best cost-effectiveness, detecting 60% of security smells while inspecting less than 2% of the codebase.

安全检测静态分析知识蒸馏IaC

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