包阅导读总结
1. 关键词:Copilot Autofix、代码漏洞、AI、GitHub、安全修复
2. 总结:GitHub 本周推出 Copilot Autofix,利用 AI 扫描和修复代码漏洞,在公共测试中显著提高修复效率,减少安全工具摩擦,专家认为其虽有进步但仍需严格审查。
3. 主要内容:
– GitHub 本周推出 Copilot Autofix 产品,可在 GitHub Advanced Security 中使用
– 利用 AI 发现代码漏洞,解释重要性并提供修复建议
– 能实时决策、规划和适应新信息
– 解决了长期以来开发者使用 AST 工具的困难
– 传统工具慢且易误报
– 帮助开发者更早发现并修复漏洞,提高效率
– 测试期间效果显著
– 修复速度大幅提升
– 减少安全相关代码审查时间,提高开发生产力
– 存在有趣的二分现象
– 开发者缺乏修复漏洞的时间和培训
– 通用建议不适合开发者
– 介绍其工作原理
– 按按钮生成修复建议,创建新的拉取请求
– 九月起将为开源项目提供更多工具,包括 Copilot Autofix
思维导图:
文章地址:https://thenewstack.io/copilot-autofix-ais-answer-to-code-vulnerability-woes/
文章来源:thenewstack.io
作者:Darryl K. Taft
发布时间:2024/8/16 22:35
语言:英文
总字数:946字
预计阅读时间:4分钟
评分:82分
标签:人工智能在代码安全中的应用,GitHub Copilot,代码漏洞修复,应用安全测试,开发者生产力
以下为原文内容
本内容来源于用户推荐转载,旨在分享知识与观点,如有侵权请联系删除 联系邮箱 media@ilingban.com
GitHub this week made its Copilot Autofix advanced AI code scanning and remediation product generally available in GitHub Advanced Security (GHAS).
Copilot Autofix uses AI to find vulnerabilities in code, explain their importance and offer code suggestions to fix them, wrote Mike Hanley, chief security officer and senior vice president of engineering at GitHub, in a post on the company’s blog.
“Code scanning tools detect vulnerabilities, but they don’t address the fundamental problem: remediation takes security expertise and time, two valuable resources in critically short supply,” Hanley wrote in the post. “In other words, finding vulnerabilities isn’t the problem. Fixing them is.”
Copilot Autofix uses AI agents that are capable of making decisions, planning and adapting to new information in real time. In fact, during the public beta for the product, launched in March, Hanley wrote, GitHub learned that developers were fixing code vulnerabilities more than three times faster than those who do so manually.
Overcoming Longtime Struggles
Developers have long struggled with using Application Security Testing (AST) tools to find security vulnerabilities in application source code, David Vance, an analyst at Enterprise Strategy Group, told The New Stack. Legacy AST tools are notoriously slow and prone to false positives. With GitHub’s massive developer community, he said, it’s a natural fit for them to introduce application security features into their platform.
GitHub’s Copilot Autofix is the most recent example of the next wave of application security innovation that also helps reduce security tool friction for developers.
During the beta, developers used Copilot Autofix in their pull requests to quickly fix vulnerabilities in new code before they could get merged into production where they could impact customers.
“By allowing developers to identify security vulnerabilities in their source code as early as possible, it greatly reduces the time and effort required to remediate vulnerabilities after coding has been completed,” Vance said.
The median time for developers to use Copilot Autofix to automatically commit the fix for a pull request-time alert was 28 minutes, compared to 1.5 hours to resolve the same alerts manually, Hanley wrote in his blog post.
“Fixes can be generated for dozens of classes of code vulnerabilities, such as SQL injection and cross-site scripting, which developers can dismiss, edit or commit in their pull request,” he wrote.
Indeed, Copilot Autofix was seven times faster finding and fixing cross-site scripting vulnerabilities — 22 minutes, compared to almost three hours. And it was 12 times faster finding and fixing SQL injection vulnerabilities — 18 minutes, compared to 3.7 hours, the company said.
“Since implementing Copilot Autofix, we’ve observed a 60% reduction in the time spent on security-related code reviews and a 25% increase in overall development productivity,” said Kevin Cooper, a principal engineer at Optum, in a statement.
Moreover, “in the health care space, where security is critical, it helps us act on proven industry solutions quickly. This proactive approach to security helps us prevent potential issues, saving thousands of hours per month that would otherwise be spent on remediation,” Cooper added.
An ‘Intriguing Dichotomy’
“Securing code has always presented an intriguing dichotomy: the individuals responsible for remedying security vulnerabilities—software developers—often lack both the time and the training necessary for this task,” Janet Worthington, an analyst at Forrester Research, told The New Stack.
Static Application Security Testing (SAST) tools, which scan the codebase, provide remediation guidance to developers based on the security flaw and the programming language. However, the advice can be too generic or better suited for security professionals already familiar with security terminology, Worthington said.
Behind the scenes, Copilot Autofix leverages theCodeQLengine, GPT-4o, and acombination of heuristics and GitHub Copilot APIsto generate code suggestions, Hanley said.
“Security tools, such as GitHub’s CodeQL, areleveraging generative AI to alleviate the burden on software developers to fix security defects, while simultaneously reducing risk,” Worthington said.
With innovations like GitHub CopilotAutofix, developers are shown the security flaw alongside anauto-generatedfixspecific to their code, which the developer can then review and either accept or modify as needed. This not only boosts developer productivity but also improves the likelihood of the issue being effectively resolved.
“While this advancement marks significant progress in code security, it’s important to recognize that generative AI is not flawless,” Worthington said. “Anyfixprovided by an automated tool must be scrutinized with the same rigor as any other code change, undergoing both SAST,software composition analysis, and peer code reviews before being integrated into the main branch.”
How Copilot Autofix Works
To initiate Copilot Autofix for vulnerabilities in existing code, according to Hanley, simply press the “Generate fix” button on an alert in the GHAS code scanning alert. Copilot Autofix assesses the code and the vulnerability and returns an explanation and code suggestion for review. The developer can then press the “Create PR with fix” button to create a new pull request, which includes code changes to fix the alert.
“Copilot Autofix takes care of cumbersome security tasks, ensuring our existing and new code is always as secure as possible, said Mario Landgraf, community manager for security at Otto (GmbH & Co KG), in a statement. “Vulnerabilities are flagged immediately, and code changes are recommended automatically. It helps our teams to free up time, so they can focus on more strategic initiatives.”
Meanwhile, starting in September, GitHub will add Copilot Autofix in pull requests to the list of tools it offers for all open source projects. That list already includes GitHub’scode scanning,secret scanning,dependency management, andprivate vulnerability reportingtools at no cost.
YOUTUBE.COM/THENEWSTACK
Tech moves fast, don’t miss an episode. Subscribe to our YouTubechannel to stream all our podcasts, interviews, demos, and more.