We investigated the capabilities of GPT-4o and Gemini 2.0 Flash for secure Infrastructure as Code (IaC) development. For security smell detection, on the Stack Overflow dataset, which primarily contains small, simplified code snippets, the models detected at least 71% of security smells when prompted to analyze code from a security perspective (general prompt). With a guided prompt (adding clear, step-by-step instructions), this increased to 78%.In GitHub repositories, which contain complete, real-world project scripts, a general prompt was less effective, leaving more than half of the smells undetected. However, with the guided prompt, the models uncovered at least 67% of the smells. For secure code generation, we prompted LLMs with 89 vulnerable synthetic scenarios and observed that only 7% of the generated scripts were secure. Adding an explicit instruction to generate secure code increased GPT secure output rate to 17%, while Gemini changed little (8%). These results highlight the need for further research to improve LLMs' capabilities in assisting developers with secure IaC development.


翻译:本研究评估了GPT-4o与Gemini 2.0 Flash在安全基础设施即代码(IaC)开发中的能力。在安全异味检测方面,针对主要包含小型简化代码片段的Stack Overflow数据集,当提示模型从安全角度分析代码时(通用提示),模型至少能检测出71%的安全异味;采用引导式提示(添加清晰的分步指令)后,检测率提升至78%。在包含完整实际项目脚本的GitHub仓库中,通用提示效果较差,超过半数的异味未被发现;而引导式提示使模型至少能发现67%的异味。在安全代码生成方面,我们通过89个存在漏洞的合成场景提示大语言模型,发现仅有7%的生成脚本是安全的。添加明确的安全编码指令后,GPT的安全输出率提升至17%,而Gemini改进有限(8%)。这些结果表明,需要进一步研究以提升大语言模型辅助开发者进行安全IaC开发的能力。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
【ICLR2024】能检测到LLM产生的错误信息吗?
专知会员服务
25+阅读 · 2024年1月23日
《人工智能安全测评白皮书》,99页pdf
专知
36+阅读 · 2022年2月26日
外包开发的风险,一半以上的企业都被坑过
DBAplus社群
16+阅读 · 2019年9月1日
通过Termux打造免root安卓渗透工具
黑客技术与网络安全
16+阅读 · 2019年8月16日
论文浅尝 | 学习开发知识图谱中的长期关系依赖 - ICML 2019
AnDOSid - 适用于黑客的Android应用程序
黑白之道
11+阅读 · 2019年3月14日
Fully-Convolutional Siamese Networks for Object Tracking论文笔记
统计学习与视觉计算组
10+阅读 · 2018年10月12日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 2月9日
VIP会员
相关VIP内容
【ICLR2024】能检测到LLM产生的错误信息吗?
专知会员服务
25+阅读 · 2024年1月23日
相关资讯
《人工智能安全测评白皮书》,99页pdf
专知
36+阅读 · 2022年2月26日
外包开发的风险,一半以上的企业都被坑过
DBAplus社群
16+阅读 · 2019年9月1日
通过Termux打造免root安卓渗透工具
黑客技术与网络安全
16+阅读 · 2019年8月16日
论文浅尝 | 学习开发知识图谱中的长期关系依赖 - ICML 2019
AnDOSid - 适用于黑客的Android应用程序
黑白之道
11+阅读 · 2019年3月14日
Fully-Convolutional Siamese Networks for Object Tracking论文笔记
统计学习与视觉计算组
10+阅读 · 2018年10月12日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员