Securing the open source supply chain across GitHub
好的,我需要帮用户总结一篇文章,控制在100字以内。首先,我得通读整篇文章,抓住主要内容。文章主要讲的是开源供应链攻击的新模式,攻击者通过窃取API密钥等秘密来发布恶意包,并进一步传播攻击。 接下来,文章提到这些攻击通常从GitHub Actions的工作流入手。作者建议采取的措施包括启用CodeQL审查工作流、遵循安全最佳实践、避免触发特定事件、固定第三方动作的提交哈希等。GitHub方面也在加强安全措施,比如使用OpenID Connect令牌代替密钥,与OpenSSF合作推广可信发布机制。 未来几个月,GitHub计划加速安全功能的推出,并根据反馈调整路线图。最后,文章强调开源的重要性,并呼吁社区共同努力提升安全性。 现在我要把这些要点浓缩到100字以内。确保涵盖攻击模式、防御措施、GitHub的举措以及未来的计划。同时避免使用“这篇文章”或“总结”这样的开头词。 最终的总结应该简洁明了,突出关键信息:攻击者窃取秘密发布恶意包,GitHub提供CodeQL审查和可信发布机制,未来会加强安全功能。 </think> 文章讨论了针对开源供应链的新攻击模式,攻击者通过窃取API密钥等秘密来发布恶意包并传播攻击。GitHub建议启用CodeQL审查工作流、固定第三方动作哈希等措施,并与OpenSSF合作推广可信发布机制以提升安全性。未来将加速安全功能的推出,保障开源生态的安全性。 2026-4-1 19:21:4 Author: github.blog(查看原文) 阅读量:4 收藏

Over the past year, a new pattern has emerged in attacks on the open source supply chain. Attackers are focusing on exfiltrating secrets (like API keys) in order to both publish malicious packages from an attacker-controlled machine as well as gain access to more projects in order to propagate the attack.

These attacks often start by compromising a workflow on GitHub Actions.

Let’s talk through what you can do today to secure your GitHub Actions workflows, what work GitHub has been doing to secure open source, and what to expect in the coming months for further security enhancements.

What you can do today

Many of these attacks start by looking for exploitable GitHub Actions workflows.

The most critical action you can take is to enable CodeQL to review your GitHub Actions workflow implementation (available for free on public repositories) to inspect your workflows for security best practices.

Next, review our detailed actions security guidance. In particular:

When an attack happens, we publish information about compromised dependencies in our Advisory Database. You can get up-to-date information directly from the Advisory Database or use tools like Dependabot (also free for public repositories) to notify you when you have malicious or vulnerable dependencies.

What we’ve done

These attacks follow the same pattern: they focus on exfiltrating secrets to publish malicious packages from an attacker-controlled machine, as well as using those malicious packages to gain access to more projects to propagate the attack.

Instead of using secrets in your workflows, you can use an OpenID Connect token that contains the workload identity of the workflow to authorize activities. We’ve worked with many systems to integrate with Actions this way, including cloud providers, package repositories, and other hosted services.

Specifically, GitHub partners with the OpenSSF to support this security capability, called trusted publishing, in package repositories, which is now supported across npm, PyPI, NuGet, RubyGems, Crates, and other package repositories. Not only does trusted publishing remove secrets from build pipelines, it also provides a valuable signal when a newly published package stops using trusted publishing: the community uses this signal to investigate if the package came from an attacker using exfiltrated credentials.

npm is the largest package repository in the world, with over 30,000 packages published each day. We scan every npm package version for malware, and our detections are constantly updated and improved as attacks evolve. Hundreds of newly published packages contain malicious code daily, so when detected, a human reviews to confirm it’s a true positive before we take action. At this scale, even a 1% false-positive rate would disrupt hundreds of legitimate publishes daily.

What to expect in the coming months

In late 2025 the Shai-Hulud attacks motivated a revamped security roadmap for npm, which we talked about in Our plan for a more secure npm supply chain and Strengthening supply chain security: Preparing for the next malware campaign. In response to Shai-Hulud we accelerated the roll-out of capabilities like npm trusted publishing, continued work on malware detection and removal, and engaged with open source maintainers on what npm security capabilities would have the biggest positive impact. Even when the community agrees a change must be made, those changes can mean that people need to change their workflow, or worse, cause backwards incompatibility. We’re working to provide as smooth a transition as possible.

Similarly, with the most recent round of attacks we are revisiting our security roadmap for GitHub Actions and accelerating actions security capabilities where work was already underway. You can give us feedback on the GitHub Actions security roadmap in the community discussion post.

Where do we go from here?

Open source is a global public good and one of humanity’s greatest collaborative projects. We have not seen the end of attacks on open source, but GitHub is committed to defending it across npm, actions, or whatever comes next. As we work on rolling out these security capabilities, we look forward to your feedback on what’s most impactful and how we manage the transition to a more secure future.


Written by

Zachary Steindler

Principal Software Engineer, GitHub

Related posts

Explore more from GitHub

Docs

Docs

Everything you need to master GitHub, all in one place.

Go to Docs

GitHub

GitHub

Build what’s next on GitHub, the place for anyone from anywhere to build anything.

Start building

Customer stories

Customer stories

Meet the companies and engineering teams that build with GitHub.

Learn more

The GitHub Podcast

The GitHub Podcast

Catch up on the GitHub podcast, a show dedicated to the topics, trends, stories and culture in and around the open source developer community on GitHub.

Listen now


文章来源: https://github.blog/security/supply-chain-security/securing-the-open-source-supply-chain-across-github/
如有侵权请联系:admin#unsafe.sh