解决开源软件中的网络安全挑战
解决开源软件中的网络安全挑战
The current state of open source software security and methods to address and improve your cybersecurity posture
开源软件安全和方法的现状以及解决并改善您的网络安全状况的方法
In Partnership With:
联合出品:
Open source software (OSS) has become an integral part of the technology landscape, as inseparable from the digital machinery of modern society as bridges and highways are from global transportation infrastructure. According to one report, typically 70% to 90% of a modern application stack consists of pre-existing OSS, from the operating system to the cloud container to the cryptography and networking functions, sometimes up to the very application running your enterprise or website. Thanks to copyright licenses that encourage no-charge re-use, remixing, and redistribution, OSS encourages even the most dogged of competitors to work together to address common challenges, saving money by avoiding duplication of effort, moving faster to innovate upon new ideas and adopt emerging standards.
开源软件(OSS)已成为技术领域不可或缺的一部分,就像桥梁和高速公路是全球交通基础设施施密不可分一样,已经和现代社会的数字机器紧密结合在一起。据报告显示,现代应用程序栈通常由 70% 至 90% 的现有开源软件组成,从操作系统到云容器,再到加密和网络功能,甚至是支撑企业或网站运行的应用程序本身。由于版权许可证鼓励免费重复使用、重新混合和重新分发,开源软件鼓励企业合作共同解决共同的挑战,即使是最激烈的竞争对手,也可通过避免重复工作来节省资金,并更快地创新和采用新兴标准。
However, this ubiquity and flexibility can come at a price. While OSS generally has an excellent reputation for security, the communities behind those works can vary significantly in their application of development practices and techniques to reduce the risk of defects in the code, or to respond quickly and safely when one is discovered by others. Often, developers trying to decide what OSS to use have difficulty determining which ones are more likely to be secure than others based on objective criteria. Enterprises often don't have a well-managed inventory of the software assets they use, with enough granular detail, to know when or if they're vulnerable to known defects, and when or how to upgrade. Even those enterprises willing to invest in increasing the security of the OSS they use often don't know where to make those investments, nor their urgency relative to other priorities.
然而,这种普遍性和灵活性是有代价的。 虽然 开源软件通常在安全方面享有盛誉,但这些作品背后的社区在降低代码缺陷风险中的应用开发实践和技术,或在他人发现缺陷时快速安全响应方面可能存在很大差异。 通常情况下,试图决定使用哪种 开源软件的开发人员很难根据客观标准确定哪些 开源软件比其他 开源软件更安全。 企业通常没有对其使用的软件资产进行良好管理的清单,没有足够详细的细节来了解它们何时或是否易受已知缺陷的影响,以及何时或如何升级。 即使那些愿意投资增强其使用的开源软件安全性的企业,也经常不知道在哪些方面进行投资,以及这相对于其他优先事项的紧迫性。
However, fighting security issues at their upstream source - trying to catch them earlier in the development process, or even reduce the chances of their occurrence at all - remains a critical need. We are also seeing new attacks that focus less on vulnerabilities in code, and more on the supply chain itself - from rogue software that uses "typosquatting on package names to insert itself unexpectedly into a developer's dependency tree, to attacks on software build and distribution services, to developers turning their one-person projects into "protest-ware" with likely unintended consequences.
然而,在上游源头上解决安全问题 - 试图在开发过程的早期发现它们,甚至减少它们发生的机会 - 仍然是一个关键的需求。我们也看到了新的攻击,它们较少关注代码中的漏洞,而更多地关注供应链本身 - 从使用“包名称上的域名仿冒将自己意外插入开发人员的依赖树”的流氓软件,到对软件构建和分发服务的攻击,再到开发人员将他们的单人项目变成可能会产生意想不到的后果“抗议软件”。
To address the urgent need for better security practices, tools, and techniques in the open source software ecosystem, a collection of deeply invested organizations came together in 2020 to form the Open Source Security Foundation (OpenSSF), and chose to house that effort at the Linux Foundation. This public effort has grown to include hundreds of active participants across dozens of different public initiatives housed under 7 working groups, with funding and partnership from over 75 different organizations, and reaching millions of OSS developers. This report presents analysis that we intend to use to help support that effort. You can see a complete copy of my prepared testimony at: Testimony to the US House Committee on Science and Technology - Open Source Security Foundation (openssf.org).
为了满足开源软件生态系统中对更好的安全实践、工具和技术的迫切需求,一系列深度投资的组织在 2020 年聚集在一起,成立了开源安全基金会 (OpenSSF),并选择将这项工作设在 Linux 基金会。这项公共努力已经发展到包括数十个不同公共计划的数百名积极参与者,这些计划位于7个工作组下,来自超过75个不同组织的资金和合作伙伴关系,并覆盖了数百万个开源软件开发者。本报告介绍了我们打算用来帮助支持这项工作的分析。您可以在以下位置查看我准备的证词的完整副本:美国众议院科学和技术委员会的证词 - 开源安全基金会(openssf.org)。
Brian Behlendorf
布赖恩·贝伦多夫
General Manager, Open Source Security Foundation
总经理,开源安全基金会
The Linux Foundation
Linux 基金会
5.1 Average number of outstanding, critical vulnerabilities in an application. Ranges between 2.6 and 9.5 based on programming language. | 24% of organizations are confident in the security of their direct dependencies. | 59% of organizations report their OSS is somewhat or highly secure. |
5.1 平均每个应用程序存在的重要漏洞数量。 根据编程语言的不同,重要漏洞数量的范围在 2.6 到 9.5 之间。 | 24% 的组织对它们的直接依赖的安全性感到有信心。 | 59% 的组织报告称,他们的开源软件在一定程度上或高度安全。 |
68.8 Average dependencies per project. Ranges between 25 and 174 based on programming language. | 18% of organizations are confident in the security of their transitive dependencies. | SCA and SAST tools are the #1 and #2 tools used to address security concerns. |
68.8 每个项目的平均依赖项。 根据编程语言的不同,依赖项的数量在25到174之间变化。 | 18% 的企业对其传递依赖项的安全性感到有信心。 | 软件组成分析(SCA)和 静态应用程序安全测试(SAST)工具是解决安全顾虑使用的排名第一和第二的工具。 |
97.8 Average number of days it takes to fix a vulnerability. | 49% of organizations have a security policy that addresses OSS. | 73% of organizations are searching for best practices to improve their software security. |
97.8 平均修复漏洞所需的天数。 | 49% 的组织拥有涵盖开源软件安全的安全策略。 | 73% 的组织正在寻找提高软件安全性的最佳实践。 |
Increased incentives by employer is the #1 approach to improving OSS resourcing. | More intelligent tools are the #1 way organizations intend to improve supply chain security. | 11% Average increase to an organization’s security |
score in 2022. | ||
雇主提供更多的激励措施是改善开源软件资源配置的第一途径。 | 更加智能的工具是组织机构试图提高供应链安全性的第一选择。 | 11% 组织在2022年的安全分数平均提高百分比 |
Introduction
介绍
Open source software (OSS) has had a tremendous impact on the development and distribution of the software we depend on today. Through its collaborative and open way of both developing and sharing software components, OSS has served as a key engine for innovation and encouraged the widespread reuse and sharing of core software components. Today, nearly all applications are composed of components dependent upon other components, creating a supply chain that involves hundreds of components and multitiered dependencies.
开源软件 (OSS) 对我们今天所依赖的软件的开发和分发产生了巨大影响。通过其开发和共享软件组件的协作和开放方式,开源软件已成为创新的关键引擎,并鼓励核心软件组件的广泛重用和共享。 如今,几乎所有应用程序都由依赖于其他组件的组件组成,从而形成了一个涉及数百个组件和多层依赖项的供应链。
Organizations of all sizes are heavily reliant on software, and much of that software supply chain consists of open source software components. Because of this, open source software has cybersecurity implications: the software supply chain is an attractive entry point for people and organizations interested in theft, disruption, or exploitation for economic or political gain. The attack surface today is changing from those in traditional cybersecurity threat models. Defects in small libraries that are widely used across the software ecosystem can cause systemic risk, as we've seen with incidents such as Log4shell.
各种规模的组织都严重依赖软件,其中大部分的软件供应链包含开源软件组件。正因为如此,开源软件具有网络安全的影响:软件供应链是入侵者利用进行盗窃、破坏或为了经济或政治利益而开发的一个有吸引力的入口点。如今,攻击面正在从传统的网络安全威胁模型中改变。在整个软件生态系统中广泛使用的小型库中的缺陷可能会导致系统性风险,正如我们在 Log4shell 等事件中所见到的那样。
Security challenges
安全挑战
Addressing the security of open source software components requires a different approach from traditional approaches of securing proprietary, vendor-supported software. The more loosely structured and community focused nature of OSS development presents a more challenging environment for addressing software security. The distribution of OSS projects is bookended by a small number of large visible projects (like the Linux kernel and Kubernetes) to a very large number of small projects. Smaller projects typically have fewer contributors and resources, and are therefore more likely to adopt a minimalist approach to development and security.
解决开源软件组件的安全问题需要与保护专有、供应商支持软件的传统方法不同的方法。开源软件的开发结构更加松散和以社区为重心,这种性质使得解决软件安全问题变得更具挑战性。开源软件项目的发布范围从少数几个大型可见项目(如Linux内核和Kubernetes)到非常多的小型项目。小型项目通常具有更少的贡献者和资源,因此更有可能采用简单的方法来对待开发和安全。
The tremendous benefits and prevalence of OSS in organizational software, combined with the vulnerability of the OSS software supply chain, puts us at a crossroads. Organizations and companies that use open source software need to become more aware of what dependencies they are using, proactively and regularly monitoring all components for usability, trustworthiness, and vulnerabilities. Ultimately, open source software is a two-way street: consumers of open source software must contribute back to the OSS communities to ensure the health and viability of the dependencies they rely on. Merely using open source software, without contributing back, is not enough. What is required is both to 1) incorporate the nature of OSS dependencies into standard cybersecurity and development practices and 2) contribute back to the OSS communities that organizations rely on.
开源软件在组织软件中所带来的巨大好处和普及性,加上开源软件供应链的脆弱性,让我们处于一个十字路口。使用开源软件的组织和公司需要更加了解它们所使用的依赖项,积极地和定期地监控所有组件的可用性、可信性和漏洞。最终,使用开源软件与回馈开源社区应该是一种互惠互利的关系:开源软件的消费者必须向开源软件社区做出贡献,以确保他们依赖的依赖项的健康和可行性。仅仅使用开源软件而不进行贡献是不够的。需要的是将开源软件依赖项的性质纳入标准的网络安全和开发实践中,并向组织依赖的开源软件社区做出贡献。
Research approach
研究方法
This report focuses on OSS security perspectives and how to improve OSS security and sustainability.
本报告的关注点在开源软件安全,以及如何改善开源软件的安全性和可持续性。
Research began in March 2022 with fifteen interviews of open source software maintainers and cybersecurity experts. These qualitative interviews helped to shape the scope of the research and the design of the quantitative survey instrument.
研究始于 2022 年 3 月,进行了 15 次开源软件维护者和网络安全专家的访谈。这些定性访谈有助于塑造研究范围和设计定量调查工具。
A worldwide survey was fielded in April 2022, targeting the following roles:
- Individuals who contribute to, use, or administer Oss
- Maintainers, core contributors, and occasional contributors to OSS
- Developers of proprietary software to use OSS
- Individuals with a strong focus on software supply chain security
2022 年 4 月,针对以下角色进行了一次全球调查:
- 贡献、使用或管理开源软件的个人
- 开源软件的维护者、核心贡献者和偶尔的贡献者
- 使用开源软件的专有软件开发人员
- 强烈关注软件供应链安全的个人
The survey included four sections:
- Screening questions and demographics
- OSS security perspectives. Sample size is 539 and margin of error (MoE) is +/- 3.6% at a 90% confidence level.
- OSS best practices for secure software development. Sample size is 72. Only OSS maintainer and core contributors were invited to complete this section of the survey. Because of the technical detail that was characteristic of this section, it was not addressed as part of this report and instead will be discussed in a separate report to be published in 2022 Q3.
- Improving OSS security. Sample size is 433 and margin of err (MoE) is +/-4.0% at a 90% confidence level.
该调查包括四个部分:
- 筛选问题和人口统计学信息
- 开源软件安全视角。样本量为 539,置信度水平为 90%,误差率(MoE)为 +/- 3.6%
- 为安全软件开发提供最佳实践。样本量为 72,只邀请了开源软件维护者和核心贡献者完成本部分的调查。由于这一部分的技术细节较多,本报告没有对其进行讨论,将在2022年三季度发表的另一份报告中进行讨论。
- 改进开源软件安全。样本量为 433,置信度水平为 90%,误差率(MoE)为 +/- 4.0%。
For more information about this research approach and sample demographics, see the methodology section of this paper. The data provided by Snyk is based on over 1.3 million projects and was collected from April 1, 2021 until March 31, 2022. Snyk's efforts were primarily focused on understanding how five key languages/ecosystems (.Net, Go, Java, JavaScript, and Python) are influencing the complexity of the software supply chain. This data was gathered from the use of Snyk Open Source, a static code analysis (SCA) tool free to use for individuals and open source maintainers.
更多有关此研究方法和样本统计信息的信息,请参阅本文的方法部分。 Snyk 提供的数据基于超过 130 万个项目,采集周期为 2021 年 4 月 1 日至 2022 年 3 月 31 日。Snyk 的工作主要集中在了解五种关键语言 / 生态系统(.Net、Go、Java、JavaScript 和 Python)如何影响软件供应链的复杂性上。这些数据是通过使用 Snyk 开源工具收集的,该工具是一个静态代码分析(SCA)工具,供个人和开源维护人员免费使用。
Open source software security perspectives
开源软件安全观点
Initial questions in this survey were designed to understand organizational commitment to security that covers OSS development and use and beliefs about the security of the OSS and its dependencies in use. Responses to these questions suggest that organizations collectively have been slow to make software security a priority.
该调查的初始问题旨在了解组织在涵盖开源软件开发和使用方面的安全承诺以及对正在使用的开源软件及其依赖性安全性的信念。对这些问题的回答表明,组织在使软件安全成为优先事项方面进展缓慢。
Many organizations do not have a security policy that covers OSS
许多组织没有涵盖开源软件的安全政策
One of the most startling findings of this research, as shown in Figure 1, is that only 49% of organizations have a security policy that covers OSS development or use. 34% of organizations indicate that they do not have a security policy for OSS development and usage, and 17% of respondents were not sure if their organization had a plan or not. If we prorate this 17% based on the existing distribution of responses, the number of organizations with a security policy covering OSS rises from 49% to 59%, and those without a policy rise from 34% to 41%.
这项研究最惊人的发现之一是,如图 1 所示,只有 49% 的组织拥有涵盖开源软件开发或使用的安全策略。34%的组织表示,他们没有开源软件开发和使用的安全策略,17%的受访者不确定他们的组织是否有计划。如果将这17%根据现有的回答分布来按比例分配,则拥有涵盖开源软件的安全策略的组织数量从49%上升到59%,而没有策略的组织则从34%上升到41%。
Figure 1: Organizations with a security policy covering OSS
图1:有涵盖开源软件的安全政策的组织
Do you have an open source security policy in place for open source development or usage? (select one)
您是否已为开源软件的开发或使用制定了开源安全政策?(请选择一项)
Yes:
是
No:
否
Total:
不知道(英文应该是错了,坐标轴上是Don't know)
Having a security policy covering OSS indicates that you have a security action plan that includes the many OSS components in use. Without a software security policy, organizations may expose themselves to a significant amount of financial and reputational risk because they may not be evaluating software before its inclusion and/or may not be prepared for the inevitable updates due to software vulnerabilities (OSS or not).
拥有涵盖开源软件的安全策略表示您拥有包含许多使用的开源软件组件的安全行动计划。如果没有软件安全策略,组织可能会面临相当大的财务和声誉风险,因为他们可能没有在将软件包含进项目之前进行评估,或者可能没有为由于软件漏洞(无论是开源软件还是其他软件)而不可避免的更新做好准备。
Note that we intentionally did not have any special requirements on how the security policy covering OSS was stated. Some organizations have a single policy on software, and then only have specific statements for OSS in the relatively few cases where OSS would be sensibly different. This would be an application of the so-called "Hellekson's Law" ("a more specific policy can be improved for the general case by removing delimiters that narrow the policy scope, "e.g., deleting "open source" from an "open source software" policy typically improves it). For our purposes this is fine. We simply let the respondents identify whatever applied to their organization.
请注意,我们有意没有对涵盖开源软件的安全策略有任何特殊要求。一些组织只有一个关于软件的策略,然后仅在开源软件有相对少的情况下才有特定的声明。这是所谓的“Hellekson 定律”的应用(“通过删除缩小策略范围的分隔符,例如,从“开源软件”策略中删除“开源”,可以改进通用情况下的更具体策略)。对于我们的研究目的来说,这是可以接受的。我们只是让受访者确定他们所在组织适用的情况。
The one benefit of the distribution shown in Figure 1 is that we can statistically compare and contrast the characteristics of organizations with a security policy against those without one. Understanding these comparative differences helps us describe the OSS security journey that organizations are on.
图 1 所示的分布的一个好处是,我们可以对拥有安全策略的组织与没有安全策略的组织进行统计学比较和对比。了解这些比较差异有助于我们描述组织在开源软件安全方面的旅程。
Small organizations shoulder disproportionate OSS security risk
小型组织承担着不成比例的开源软件安全风险
This survey included organizations of various sizes (based on the number of worldwide employees). The survey sample was distributed by organization size as follows: small organizations (44%, 1-499 employees), medium organizations (20%, 500-4,000 employees), large organizations (35%, 5,000+ employees), and 1% don’t know or are not sure.
本次调查涵盖了各种规模的组织(根据全球员工人数划分)。调查样本按组织规模分布如下:小型组织(44%,1-499 名员工),中型组织(20%,500-4,000 名员工),大型组织(35%,5,000 名及以上员工),1% 不知道或不确定。
The measure of security policy covering OSS by organizational size is shown in Figure 2. Immediately noticeable is the difference in distributions between organizations with 1-499 employees and those with 500 employees or more. Just 41% of small organizations have an OSS security policy, compared to 56%-57% of larger organizations. This significant difference indicates that small organizations behave differently than larger organizations when it comes to OSS security policy adoption.
按组织规模衡量涵盖开源软件的安全政策的情况如图 2 所示。立即显着的是,1-499 名员工的小型组织和 500 名员工以上的组织之间的分布差异。只有 41% 的小型组织拥有开源软件安全政策,而大型组织的开源软件安全政策采用率在 56%-57% 之间。这个显著的差异表明,小型组织在开源软件安全政策采用方面的行为与大型组织不同。
Figure 2: A distribution of OSS security policy by organization size
图 2:按组织规模分布的开源软件安全策略
Do you have an open source security policy in place for open source development or usage? (select one) by Enterprise size
您是否有针对开源软件开发或使用的开源安全策略?按企业规模(选择一项)
Yes:
是
No:
否
Don't know:
不知道
1 to 499 Emp:
员工数 1~499
500 to 4999 Emp:
员工数 500~4999
5000+ Emp:
员工数 5000+
Source: 2022 Open Source Supply Chain Security Survey.
来源:2022年开源供应链安全调查。
One reason that small organizations are OSS security challenged is economies of size. Small organizations have small IT staff and budgets, and the functional needs of the business often take precedence so that the business can remain competitive. Lack of resources and time were the leading reasons why organizations were not addressing OSS security best practices.
小型组织开源软件安全面临挑战的原因之一是规模经济。小型组织拥有较少的 IT 人员和预算,业务的功能需求通常具有优先性,以使业务能够保持竞争力。缺乏资源和时间是组织未能解决开源软件安全最佳实践的主要原因。
While it is disappointing that 44% of small organizations do not have an OSS security policy, an additional concern is that close to 30% of larger organizations also do not have an OSS security policy. Small organizations can rationalize increased financial, reputational, and legal risk, but this becomes tenuous for medium organizations and insupportable for large organizations with 5000+ employees. Medium and large organizations likewise complain about not enough having resources or time to address OSS security needs. Surprisingly, a lack of awareness about security best practices is more often identified by large organizations as a reason for not attending to OSS security needs than lack of time.
虽然令人失望的是,44% 的小型组织没有开源软件安全策略,但更令人担忧的是,接近 30% 的大型组织也没有开源软件安全策略。小型组织可以理性地解释为增加财务、声誉和法律风险,但对于 5000 多名员工的中型和大型组织来说,这变得岌岌可危。中型和大型组织同样抱怨没有足够的资源或时间来应对开源软件安全需求。令人惊讶的是,大型组织更常常将缺乏安全最佳实践的意识视为不关注开源软件安全需求的原因,而不是时间不足。
Many Organizations score poorly on OSS security
许多组织在开源软件安全方面得分低
We asked organizations how secure their open source software is today. Responses to this question are shown in Figure 3. Overall, 59% of organizations feel their OSS is either somewhat secure or highly secure. For organizations with an OSS security policy, this value rises to 70%. It falls to 45% for organizations without a security policy.
我们询问了组织关于他们的开源软件安全性的评估。这个问题的回答如图 3 所示。总体而言,59% 的组织认为他们的开源软件在某种程度上是安全的或者非常安全的。对于有开源软件安全策略的组织,这个比例上升到了 70%。而对于没有安全策略的组织 ,这个比例则下降到了 45%。
Figure 3: OSS security today
图 3:当今的开源软件安全情况
How secure is your open source software today? (select one) by Do you have an open source security policy in place for open source development or usage?
您的开源软件今天有多安全?按您是否有一个用于开源开发或使用的开源安全策略进行分组(选择一项)
65
Weighted Avg of responses
Score range: 0 -100
65
回答的加权平均分
分数范围:0~100
Yes:
是
No:
否
Total:
综合
Highly Insecure:
非常不安全
Somewhat Insecure:
有些不安全
Neither Insecure or Secure:
中性
Somewhat Secure:
有些安全
Highly Secure:
非常安全
Don’t Know:
不知道
Source: 2022 Open Source Supply Chain Security Survey.
来源:2022年开源供应链安全调查。
A simple weighted average of all responses shows a composite score of 65 for all organizations, which is a poor grade. Organizations with an OSS security policy score a 70, and organizations without a policy score a 58.
简单的加权平均所有回答的分数显示,所有组织的综合分数为 65 分,这是一个不好的分数。拥有开源软件安全策略的组织得分为 70 分,而没有策略的组织得分为 58 分。
The secure development of OSs is also at risk
开发或使用开源软件的安全问题同样存在风险
Similarly, Figure 4 shows how secure the process for developing or using OSS is today. Using the same responses shown in Figure 3, the results are nearly identical. Across all organizations, 59% believe that their development processes are somewhat secure or highly secure. This value rises to 73% for organizations with an OSS security policy and falls to 47% for organizations without.
同样,图 4 展示了开发或使用开源软件的过程的安全性。使用图 3 中展示的相同回答,结果几乎相同。在所有组织中,59% 的人认为他们的开发过程是相对安全或高度安全的。对于拥有 OSS 安全策略的组织,这个值升至 73%,而对于没有安全策略的组织,则下降至 47%。
Figure 4: Security of OSS development and use today
图 4:如今的开源软件开发和使用的安全性
How secure is your process for developing or using open source software today? (select one) by Do you have an open source security policy in place for open source development or usage?
您是否已经针对开源开发或使用实施了开源安全策略?(选择一项)按照您是否对开源开发或使用实施了安全策略,您认为您目前的开源软件开发或使用流程有多安全?(选择一项)
65
Weighted Avg of responses
Score range: 0 -100
65
回答的加权平均分
分数范围:0~100
Yes:
是
No:
否
Total:
综合
Highly Insecure:
非常不安全
Somewhat Insecure:
有些不安全
Neither Insecure or Secure:
中性
Somewhat Secure:
有些安全
Highly Secure:
非常安全
Don’t Know:
不知道
Source: 2022 Open Source Supply Chain Security Survey.
来源:2022年开源供应链安全调查。
The similarity of this distribution when compared to Figure 4 also yields a weighted average of 65 and organizations with the security policy score 71 and organizations without a policy 58.
与图 4 相比,这个分布的相似性也产生了一个加权平均值为 65,安全策略得分为 71,没有策略的组织得分为 58。
Across organizations, there is a belief that the security of OSS development and use will improve to a weighted average score of 72 by the end of 2022 and 77 by the end of 2023. Later in this report, you will see that an organizational cornerstone of their OSS security strategy is for the vendor community to provide security tools with greater intelligence. Other key elements of their OSS security strategy include a more complete understanding of best practices for secure software development and greater CI/ CD automation to eliminate manual actions and opportunities that expose the pipeline to security risks.
跨组织而言,人们认为到 2022 年底,OSS 开发和使用的安全性将提高到加权平均分数为 72,到 2023 年底将提高到 77。在本报告的后面部分,您将看到,组织制定的 OSS 安全策略的基石是让供应商社区提供更具智能的安全工具。他们的 OSS 安全策略的其他关键要素包括更全面地了解安全软件开发的最佳实践,并实现更多的 CI / CD 自动化以消除手动操作和可能导致安全风险的机会。
Who drives OSS security policies?
谁推动了开源软件安全策略?
Figure 5 superficially creates a conundrum: how do organizations without a top-down OSS security policy have people responsible for defining OSS security policy? Additionally. not having an OSS security policy doesn't mean that groups aren't addressing OSS security in ad hoe ways.
图 5 表面上制造了一个难题:没有由上而下的开源软件安全策略的组织如何有负责定义开源软件安全策略的人?此外,没有开源软件安全策略并不意味着各组没有以临时方式解决开源软件安全问题。
Across organizations, just 31% vest responsibility for defining an OSS security policy in the hands of a CIS and/or security team. The second leading choice of multiple teams at 16% suggests that instead of policy being established by a CIS, it evolves across the Software Development Life Cycle (SDLC) based on the focus of the team. Because a security focus should exist across the CI/CD pipeline, multiple teams are needed to implement OSS security policy. Reliance on open source maintainers at 13% overall can be workable 1f the maintainers are either part of the organization or known to the organization - but it sdems recklessly optimistic to put trust in OSS projects with unknon provenance.
跨组织而言,仅有 31% 的组织将定义 OSS 安全策略的责任归属于 CIS(计算机信息安全)和 / 或安全团队。16% 的多个团队作为第二选择表明,政策的制定不是由 CIS 确定的,而是根据团队的重点在软件开发生命周期 (SDLC) 中逐步形成。由于在 CI/CD 管道中应存在安全重点,因此需要多个团队来实施 OSS 安全策略。总体上依赖于开源维护者的 13% 可能是可行的,前提是维护者要么是组织的一部分,要么已知于组织,但是如果信任来源未知的 OSS 项目,这种做法似乎过于乐观。
Figure 5: Responsibility for OSS security policies
Who is responsible for defining your open source security policy? (select one) by Do you have an open source security policy in place for open source development or usage?
图5:开源安全策略的责任
谁负责制定您的开源安全策略?(选择一项)按您是否有适用于开源开发或使用的开源安全策略?
Yes:
是
No:
否
Total:
综合
Security team and /or CISO:
安全团队/CISO
Multiple teams:
多个团队
Open source maintainers:
开源维护者
No one:
没有人
Developer or care contributor:
开发人员或贡献者
Operations or Bite Reliability Engineers (SREs):
运维或可靠性工程师(SREs)
Contributors from other teams:
其他团队的贡献者
Don’t Know:
不知道
Source: 2022 Open Source Supply Chain Security Survey.
来源:2022年开源供应链安全调查 。
The percentages in Figure 5 are especially revealing. Across organizations with an OSS security policy, 80% vest the definition of an OSS security policy with the CISO/security team, multiple teams, or open source maintainers. This contrasts with organizations without an OSS security policy where 40% of these same groups are involved with OSS security in some capacity.
在图 5 中的百分比特别说明了问题。在有开源安全策略的组织中,80%的组织将开源安全策略的定义授予CISO/安全团队、多个团队或开源维护人员。这与没有开源安全策略的组织形成对比, 在没有开源安全策略的组织中,同样的团队有40%以某种方式参与开源安全。
Perhaps one positive indicator in Figure 5 is that only 30% of organizations without an OSS security policy admit that no one is addressing OSS security. This means that 70% of these organizations are addressing OSS security in part through ad hoc means, suggesting that organizations without an OSS security policy are not completely adrift and have some grassroots activities to address OSS security needs.
或许在图 5 中令人欣慰的一个指标是,仅有 30% 的没有开源安全策略的组织承认没有人在处理开源安全。这意味着 70% 的这些组织通过一些临时手段部分地解决了开源安全问题,表明没有开源安全策略的组织并非完全漂泊无助,有一些基层活动来解决开源安全需求。
Organizations are not effectively managing the security of their dependencies
组织未能有效地管理其依赖项的安全性
Dependencies are a characteristic of modern development. Direct dependencies are typically components or services called directly by your code. Indirect or transitive dependencies are essentially dependencies of your dependencies (in typically many tiers).
依赖项是现代开发的一个特征。直接依赖通常是被你的代码直接调用的组件或服务。间接或传递依赖实际上是您依赖的依赖(通常是多个层次)的依赖。
Vulnerabilities exist in component code for many reasons. Contributing factors include the programming language used, the CI/CD process in use, the education and skill of the developer in developing secure software, and the scope of testing. Complicating matters is that vulnerability management is not a perfect science. Vulnerability scanning normally identifies many false positives based on the information available to the scanning tool. Conversely, an actual vulnerability in a component may not matter if the code linked to the vulnerability is never executed and/or will only provide trusted data to the vulnerable code.
组件代码存在漏洞的原因有很多。其中的因素包括使用的编程语言、使用的 CI/CD 过程、开发人员在开发安全软件方面的教育和技能以及测试的范围。复杂化问题的是,漏洞管理并不是一门完美的科学。漏洞扫描通常会基于扫描工具可用的信息识别出很多误报。相反,如果与漏洞相关的代码从未被执行,或者只会向漏洞代码提供可信数据,那么组件中的实际漏洞可能就不重要了。
What is known is that organizations are not well-positioned to manage their vulnerabilities. Only one response in Figure 6 indicates that organizations are confident in the security of their direct dependencies.
已知的是,组织机构无法很好地管理它们的漏洞。在图6中,只有一个回答表明组织机构对其直接依赖项的安全性感到有信心。
Figure 6: Vulnerability concerns across direct dependencies
图 6:对直接依赖项的漏洞担忧
How concerned are you that the direct dependencies your software relies on might be malicious or compromised? (select one) by Do you have an open source security policy in place for open source development or usage?
你对软件所依赖的直接依赖项可能是恶意或受到攻击有多担忧?(选择一个)你是否已经为开源开发或使用制定了开源安全策略?
Yes:
是
No:
否
Total:
综合
Source: 2022 Open Source Supply Chain Security Survey.
来源:2022年开源供应链安全调查。
Direct dependencies are easy to track but we struggle with indirect dependencies
直接依赖项易于跟踪,但我们难以处理间接依赖项
We don’t have good controls to address this & it concerns me
我们没有好的控制措施来解决这个问题,这让我感到担忧
We have strong controls & I’m confident in the security of our direct dependencies
我们有强有力的控制措施,我对我们的直接依赖关系的安全性感到有信心
We don’t have good controls to address this but it doesn’t concern me
我们没有好的控制措施来解决这个问题,但我并不担心
Don’t Know:
不知道
Across all organizations, only 24% have confidence in the security of their direct dependencies. This value rises to 36% for organizations that have an OSS security policy but falls to just 9% of organizations without such a security policy. Organizations reporting that dependencies are easy to track (37%) may be correct in understanding their dependencies, but this doesn't mean that these dependencies are collectively secure.
所有组织中,只有 24% 的组织对其直接依赖项的安全性感到有信心。对于有开源安全策略的组织,这个值上升到 36%,但对于没有安全策略的组织,这个值只有 9%。 报告依赖项项易于跟踪的组织(37%)可能正确地理解了它们的依赖项,但这并不意味着这些依赖项总体上是安全的。
Snyk - Dependencies drive complexity
Snyk - 依赖关系驱动复杂性
Dependencies are one of the key components driving much of the conversation about the software supply chain. Professionals in both development and security teams are increasingly aware that securing their enterprise does not depend entirely on their organization. Instead, we are having to look further and further, down the rabbit hole of "Where did this code come from?" It's hard enough to understand where everything originated when you're trying to test code written in-house. When you add dependencies two, three, or more levels deep, it becomes daunting to even consider the problem.
依赖项是推动软件供应链讨论的关键组成部分之一。开发和安全团队的专业人员越来越意识到,保护他们的企业并不完全依赖于他们的组织。相反,我们不得不越来越深入地查看“这段代码来自哪里?”的问题。当您尝试测试内部编写的代码时,了解所有 代码的起源已经很难了。当您添加两个、三个或更深层次的依赖项时,甚至考虑这个问题都变得令人生畏。
The libraries we call in our code, the code snippets we pull from the internet, and the tools we include in container configurations are all examples of direct dependencies. In each of these cases we are relying on third-party code explicitly to fulfill a specific need or purpose.
直接依赖项是我们在代码中调用的库、从互联网获取的代码片段以及包含在容器配置中的工具等。在这些情况下,我们明确地依赖第三方代码来满足特定的需求或目的。
Measuring the number of dependencies per project, therefore, makes a good starting point for understanding how complex the problem of tracking dependencies really is. As shown in Figure 7, the average number of dependencies per project stretches from Python, with 25 dependencies per project, to JavaScript's 173 per project.
因此,衡量每个项目的依赖关系数量是了解跟踪依赖关系问题的复杂性的好起点。如图 7 所示,每个项目的平均项数量从 Python 的 25 个到 JavaScript 的 173 个不等。
Does that mean JavaScript is inherently more complex than .Net (49 dependencies), Go (56 dependencies), or Java (40 dependencies)? Not necessarily. In the case of JavaScript, each dependency often has a single purpose and small scope, rather than a library that fulfills multiple purposes with a large scope.
这是否意味着 JavaScript 本质上比 .Net(49 个依赖项)、Go(56 个依赖项)或 Java(40 个依赖项)更复杂?不一定。在 JavaScript 的情况下,每个依赖项通常只有一个目的和小的范围,而不是一个具有大范围的多个目的的库。
Neither approach is more or less secure than the other but knowing which dependencies you rely on (and how trustworthy they are) is an important part of vulnerability management. Sadly, only 24% of the respondents in this survey felt they had strong controls in place to handle the security of their dependencies.
这两种方法都不比另一种更安全,但了解你依赖的依赖项(以及它们的可信度)是漏洞管理的重要组成部分。不幸的是,在此次调查中,只有 24% 的受访者认为他们已经采取了强有力的措施来处理其依赖项的安全性。
Figure 7: Average dependency count per project by language
图 7:按语言每个项目的平均依赖项数量
(下面几个编程语言不翻译)
.Net
Go
Java
JavaScript
Python
Source: 2022 Open Source Supply Chain Security Survey.
来源:2022年开源供应链安全调查。
Average dependencies per project
平均每个项目的依赖项数量
Recent efforts by the US Government to encourage, and even mandate, organizations to create a Software Bill of Materials (SBOM) is evidence of how important it is to have a handle on dependencies. Tracking direct dependencies is a significant issue by itself. Indirect, or transitive, dependencies mark the real start of complexity. Each of the libraries referenced in a project incorporates additional code to perform its own function, and each of those third-party libraries may rely on other libraries as well. Organizations who want a complete accounting of their transitive dependencies should be requiring SBOMs from their suppliers and investing in tools to consume these SBOMs.
美国政府最近鼓励甚至强制要求组织创建软件清单(SBOM)的努力,证明了掌握依赖项关系的重要性。追踪直接依赖项本身就是一个重大问题。而间接或传递性依赖项才是复杂性的真正开始。每个在项目中引用的库都会包含额外的代码来执行其自身的功能,而每个这样的第三方库可能也依赖于其他库。想要完整记录传递依赖关系的组织应该要求其供应商提供 SBOM,并投资于消费这些 SBOM 的工具。
Figure 8 is patterned directly after Figure 6, except that it focuses on transitive dependencies. Transitive dependencies are objectively more difficult to evaluate as the level of dependency increases. The result is that fewer organizations believe that their transitive dependencies are secure
图 8 直接复制了图 6 的结构,不过它专注于间接依赖项。随着依赖程度的增加,间接依赖项的评估变得更加困难,因此,越来越少的组织认为它们的间接依赖项是安全的。
Figure 8: Vulnerability concerns across transitive dependencie
图 8:跨传递依赖项的漏洞问题
How concerned are you that the indirect (transitive) dependencies your software relies on might be malicious or compromised? (select one) by Do you have an open source security policy in place for open source development or usage?
您担心您的软件间接(传递)依赖项可能存在恶意或被攻击的风险吗? (选择一项) 您是否为开源开发或使用制定了开源安全策略?
Figure 8 shows that just 18% of organizations are confident in the security of their transitive dependencies. Once again, this value rises to 27% for organizations that have an OSS security policy but plummets to just 5% for organizations without a security policy.
图 8 显示,只有18%的组织对其传递依赖项的安全性有信心。同样,这个值对于制定了开源安全策略的组织上升至27%,但对于没有安全策略的组织则下降至5%。
A recent discussion with David A. Wheeler, a leading authority on OSS security, yielded this insight, "I think many organizations often don't update their OSS software, even when the older version of the OSS has widely-known vulnerabilities. That's not unique to OSS, many organizations also often don't update old versions of proprietary software with widely-known vulnerabilities
与开源软 件(OSS)安全方面的权威专家大卫·A·惠勒(David A. Wheeler)的最近一次讨论得出了这样的见解:“我认为许多组织经常不更新他们的开源软件,即使旧版本的开源已经被广泛知晓的漏洞所影响。这不仅仅是开源的问题,许多组织也经常不更新旧版本的专有软件,而这些软件也有广泛已知的漏洞。”
Snyk - Dependency creates vulnerability
Snyk - 依赖关系创建了漏洞
How many vulnerabilities are there in my project? We estimated this by totaling known vulnerabilities in a particular project combined with the known vulnerabilities of its dependencies (presuming that the vulnerabilities in the dependencies were exploitable). The Net projects in our data had 23 vulnerabilities per project on average, with Go at 34, Java at 90, JavaScript having 47, and Python at 36. This covers both errors introduced in development and vulnerabilities in transitive dependencies. According to Snyk's data, approximately 40% of all vulnerabilities are from these transitive dependencies. We further broke down the count of vulnerabilities per project in Figure 9 to highlight the effect of severity by language.
我的项目中有多少漏洞?我们通过汇总一个特定项目中已知的漏洞以及其依赖项的已知漏洞数量来估计。假设依赖项中的漏洞是可利用的。我们的数据中,.Net 项目平均有 23 个漏洞,Go 项目有 34 个漏洞,Java 项目有 90 个漏洞,JavaScript 项目有 47 个漏洞,Python 项目有 36 个漏洞。 这包括开发中引入的错误和传递依赖项中的漏洞。根据 Snyk 的数据,大约 40% 的漏洞来自这些传递依赖项。我们在图 9 中进一步分解了每个语言的漏洞计数,以凸显严重性的影响。
A large part of the value of SCA tools is finding where vulnerabilities are being introduced by the use of known bad libraries. Is your code incorporating an older version of a library with known vulnerabilities? Is the package still maintained or is it abandoned? Did you accidentally get a library pretending to be the one you actually wanted? These are just a few of the potential issues that could get a package flagged.
SCA 工具的很大一部分价值在于发现由于使用已知存在漏洞的库所引入的漏洞。您的代码是否正在使用一个存在已知漏洞的旧版库?该软件包是否仍在维护中或已被放弃?您是否意外获取了一个假冒您实际需要的库?这些也只是可能会导致软件包被标记的一些潜在问题。
Knowing the number of vulnerabilities in your own project helps you understand how your efforts compare to global numbers. Organizations that see data far different from the baseline number of vulnerabilities in a project can investigate the causes of a disparity. It could be as simple as different ways of measuring the same metric. On the other hand, the difference in numbers could indicate poor coding practices or a large number of old libraries being part of a standard. Without policies and standards that require vulnerability tracking, you may never know.
了解自己项目中漏洞的数量有助于了解自己的 努力与全球数据相比的情况。看到与项目中基线漏洞数量迥然不同的数据的组织可以调查差异的原因。这可能只是衡量同一指标的不同方法。另一方面,数字的差异可能表明糟糕的编程实践或大量的旧库作为标准的一部分。如果没有要求跟踪漏洞的政策和标准,您可能永远不会知道。
Figure 9: Average count of vulnerabilities by language and severity
图 9:按语言和严重程度划分的平均漏洞数量
Vulnerability Severity
漏洞严重程度
Critical:
严重
High:
高危
Medium:
中危
Low:
低危
(编程语言不翻译)
.Net
Go
Java
JavaScript
Python
Source: 2022 Snyk user data.
来源:2022年 Snyk 用户数据。
Tracking vulnerabilities introduced by transitive dependencies is one of the hardest challenges in DevOps today. Think about a project that has fifty dependencies; if the average project has five critical vulnerabilities, just the first level of dependencies could lead to 200+ critical vulnerabilities. Each layer down expands the problem dramatically. Luckily, most vulnerabilities are tightly constrained by the factors needed to exploit them.
跟踪由传递依赖引入的漏洞是当今 DevOps 面临的最大挑战之一。考虑一个有 50 个依赖项的项目;如果平均每个项目有 5 个严重漏洞,那么仅第一级依赖关系就可能导致 200 多个严重漏洞。每一层依赖都会大大扩大问题的规模。幸运的是,大多数漏洞都受到利用所需因素的严格限制。
How organizations are addressing and prioritizing their cybersecurity needs
组织如何解决和优先考虑其网络安全需求
A key finding of this research is that security, as it applies to OSS, is a rapidly evolving domain. Each of the primary threat vectors (source threats, build threats, and dependency threats) identified in the SLSA (Supply Chain Levels for Software Artifacts) model will require multiple actions on the part of most organizations to address. However, because OSS security is also rapidly evolving, increased functionality and tool consolidation should help reduce the complexity that organizations face in addressing software supply chain security needs.
该研究的一个关键发现是,与开源软件(OSS)相关的安全性是一个快速发展的领域。SLSA(软件工件供应链级别)模型中确定的每个主要威胁向量(源威胁、构建威胁和依赖威胁)都需要大多数组织采取多个行动来应对。然而,由于开源软件的安全性也在快速发展,增加功能和工具整合应该有助于减少组织在应对软件供应链安全需求方面面临的复杂性。
This section of the report describes how organizations are addressing how vulnerabilities in code are found, how security of OSS components is evaluated, what security-focused tools are being used, and what security-related activities are most important.
本报告的这一部分描述了组织如何解决代码中的漏洞如何被发现,如何评估开源组件的安全性,使用了哪些专注于安全的工具,以及哪些与安全相关的活动最为重要。
Figure 10: Finding vulnerabilities in your dependencies
How do you find out about vulnerabilities in your dependencies? (select all that apply) by Do you have an open source security policy in place for open source development or usage?
图表 10:发现依赖项中的漏洞
您如何了解依赖项中的漏洞?(选择所有适用项)按照您是否有针对开放源代码开发或使用的安全策略进行筛选。
Source: 2022 Open Source Supply Chain Security Survey.
来源:2022 年开源供应链安全调查。
Industry vulnerability notifications
行业漏洞通知
Automated monitoring of packages for known vulnerabilites
自动监测已知漏洞的软件包
Notifications form package maintainers
来自软件包维护者的通知
Industy blogs and news site
行业博客和新闻网站
Through an external security audit
通过外部安全审计
We find out when they are exploited in the wild
我们发现了漏洞当它们在外面被利用了
Trust groups
信任的群体
Hackers
黑客
Don’t Know
不知道
Organizational approaches to identifying vulnerabilities in dependencies
组织内识别依赖漏洞的方法
A common question in addressing OSS security is how to comprehensively identify vulnerabilities across your dependencies. Figure 10 shows that there are four commonly used techniques to identify vulnerabilities. The leading approach practiced by 53% of organizations is to subscribe to one or more vulnerability catalogs from CISA (US-CERT), NIST (NVD), MITRE (CVE), security product & service vendors, and/or catalog aggregators (like FIRST) that aggregate content from leading worldwide sources. These subscriptions have the advantage of pushing vulnerability notifications to their subscribers.
在处理开放源代码软件(OSS)安全问题时,一个常见的问题是如何全面地识别依赖关系中的漏洞。图10显示了四种常用的识别漏洞的技术。53%的组织采用的主要方法是订阅来自CISA(美国国家信息安全局),NIST(美国国家标准与技术研究所),MITRE(通用漏洞披露系统)以及安全产品和服务供应商和/或目录聚合器(例如FIRST)的一个或多个漏洞目录,这些目录汇集了来自全球领先的信息源的内容。这些订阅的优点是向其订阅者推送漏洞通知。
The second leading approach is automated monitoring — or scanning of packages for known vulnerabilities — and is practiced by 49% of organizations. One challenge with this approach is that it’s often difficult to map vulnerability reports to the component(s) containing the vulnerabilities. For example, there may be a vulnerability reported in some component foo, but often there are many components and forks named foo so users often can’t be confident when a report is relevant. While it’s a best practice to scan code formulaically based on time, changes to the code base and the identification of relevant vulnerabilities, a comprehensive approach to this technique is still on the horizon.
第二个主要方法是自动化监控或扫描已知漏洞的软件包。这种方法被49%的组织所采用。这种方法的一个挑战是,往往很难将漏洞报告映射到包含漏洞的组件上。例如,可能会报告某个组件foo中存在漏洞,但通常有许多命名为foo的组件和分支,因此用户经常无法确定报告的相关性。虽然根据时间、代码库的更改和相关漏洞的识别来公式化地扫描代码是最佳实践,但是这种技术的全面方法仍然需要探索。
Notifications from package maintainers are leveraged by 47% of organizations and can provide a conduit to keep packages updated when supported by maintainers. Industry blogs and news sites are used by 43% of organizations and can facilitate the timely delivery of information for a better sense of importance.
软件包维护者的通知被47%的组织所利用,当维护者支持时,可以提供更新软件包的渠道。行业博客和新闻网站被43%的组织使用,可以促进及时传递信息,以获得更好的重要性感知。
Snyk - How long will it take to fix?
Snyk - 需要多长时间来修复?
Once a vulnerability has been identified, the next logical question is “How long is this going to take to fix?” The answer is all too often, “I don’t know. It’s complicated.” Unsurprisingly, the question becomes even more complex when we apply it to the software supply chain. Our dependence on third-party code, especially transitive dependencies, often make that question difficult or impossible to answer.
一旦发现漏洞,下一个合理的问题是“修复需要多长时间?” 答案往往是:“我不知道。这很复杂。” 不出所料,当我们将其应用于软件供应链时,这个问题变得更加复杂。我们对第三方代码的依赖,尤其是传递依赖,经常使得这个问题难以或不可能回答。
Looking at the average time to fix by language in Figure 11, we see that Snyk’s data shows that Go has the best time to fix at 49 days, while .Net is the obvious laggard at 148 days to fix a vulnerability. While some maintainers might be able to fix vulnerabilities in days or hours, there have been a few vulnerabilities that took years to remediate.
观察图 11 中按语言分组的平均修复时间,我们可以看到 Snyk 的数据显示 Go 语言具有最佳的修复时间,为 49 天,而 .Net 则是明显的落后者,需要 148 天来修复漏洞。虽然一些维护者可能能够在几天或几小时内修复漏洞,但也有一些漏洞需要数年时间才能修复。
Figure 11:
Average time to fix by language
图 11:
按语言修复漏洞的平均时间
(坐标轴编程语言不翻译)
Source: 2022 Snyk user data.
来源:2022 年 Snyk 用户数据。
We expect that popularity and awareness influence the time to fix. A popular project is more likely to attract other collaborators, and additional collaborators can speed up incident response time. In addition, if a project is popular, awareness by users (including via technical press news) is likely to be larger.
我们预计受欢迎程度和意识会影响修复时间。一个受欢迎的项目更有可能吸引其他协作者,而额外的协作者可以加快事件响应时间。此外,如果一个项目很受欢迎,用户(包括通过技术新闻媒体)的关 注度可能会更高。
A popular project can affect a significant portion of all projects. As an example, the Spring Framework library is found in 9% of all Java projects. The team responsible for Spring Framework responded quickly to fix the Spring4Shell remote code execution vulnerability when it was identified in the spring of 2022. But what if that vulnerability had existed in a less responsive yet popular package?
一个受欢迎的项目可能影响所有项目的重要部分。例如,Spring 框架库在所有 Java 项目中都有 9%的使用率。当在 2022 年春季发现 Spring4Shell 远程代码执行漏洞时,负责 Spring 框架的团队迅速做出了修复。但如果该漏洞存在于一个反应较慢但受欢迎的软件包中会怎样呢?
Figure 12: Finding vulnerabilities in your code
How do you find out about security vulnerabilities in your code? (select all that apply) by Do you have an open source security policy in place for open source development or usage?
图 12:发现代码中的安全漏洞