OpenBSD
2010-01-30 11:38:13 阿炯

OpenBSD 很可能是世界上最安全的操作系统,在其之上的每一步开发过程都重点关注于构建一个安全、开放和免费的平台。很可能在日常工作中已经使用了从该操作系统下所移植的工具,它是一个专注于代码正确和文档准确且关注安全的操作系统,其强调可移植性、标准化、正确性、前卫安全性以及集成的密码技术。该项目还开发广为使用且受欢迎的 OpenSSH(Open Secure Shell) 软件,它利用 SSH 协议为计算机网络提供加密的通信会话。

当安全性作为最重要的考虑因素时,有必要研究使用安全远程访问方面的标准 OpenSSH 的操作系统,尽管它只是 OpenBSD 中的一部分;事实上,OpenBSD 是如此的安全,以至于在 DEF CON 竞赛中曾一度禁止使用它,在这个竞赛中,破解高手们对所有其他的系统进行攻击。OpenBSD 每隔 6 个月发布一次,每次会有插图与配套歌曲。

BSD UNIX 概述
Berkeley Software Distribution (BSD) 是历史最悠久和最流行的 UNIX 版本之一。现在它被分为许多不同的版本,其中有三种比较常见的开放源代码分发版:
FreeBSD
OpenBSD
NetBSD

尽管 FreeBSD 在这三种发布版中使用得最广泛,但每个版本都有其显著的优势,这使得选择正确的解决方案成为一项重要的决策。FreeBSD 是三者中最常见的系统,广泛应用于 x86 环境。当安全性成为最重要的考虑因素时,OpenBSD 则是合适的分发版。NetBSD 提供了一种小规模的、高度可移植的选择,它可以运行于各种各样的体系结构中。

OpenBSD 审核处理
审核处理可能是该分发版中一致安全性的最大因素。一组有经验的开发人员重点对进入源代码树的每段代码进行了审核。分析代码中的安全缺陷和一般性错误(它们可能并不会影响到整体功能,但可能会作为安全缺陷而被利用),对每个错误进行认真和及时的处理。这种积极主动的处理方法使得 OpenBSD 免受各种未知攻击的影响,而其他的分发版则在发现攻击后紧急对系统进行保护。

使用地点与时间
在任何强调安全性的环境中,都可以安装OpenBSD。现在大家的安全意识越来越强,计算机需要全天候连接到 Internet 上,无论是在家庭、政府或企业环境中,很少有人把安全性问题不当回事。与其他的类 UNIX 操作系统相比,OpenBSD 可能并不拥有广泛的用户基础,但是在许多网络中的最关键的地方通常都安装了该操作系统。作为 NetBSD 的近亲,OpenBSD 也可以运行于各种各样的硬件之上。

核心包和特性
既然已经确定了 OpenBSD 是否适合于您的硬件平台,下面来更仔细地了解一下它其中的一些重要部分。

OpenSSH
第一个值得关注的包是 OpenSSH,所有的 UNIX 和 Linux® 用户对它都很熟悉。然而许多人可能并不知道它来自于哪里,OpenSSH 最初用于 OpenBSD,后来成为标准的安全 Shell (SSH) 包,并移植到几乎所有版本的 UNIX、Linux 和 Microsoft® Windows® 操作系统。OpenSSH 包括用于安全登录的 ssh、用于安全复制的 scp 和 sftp,后者是 ftp 的安全替代方法。所有的源代码都符合开放源代码 BSD 许可,必须遵守 OpenBSD 的规程以杜绝在该分发版中出现任何专用代码和限制性许可计划(这是创建新版本的 SSH 的原动力)。OpenBSD 中所包含的每个软件部分都是完全免费的,并且在使用上没有任何限制。

加密
因为 OpenBSD 项目是在加拿大进行的,所以其中应用的加密技术不受美国的出口限制,这使得该分发版可以充分利用各种现代的加密算法。几乎可以在该操作系统的任何地方找到 加密处理,从文件传输到文件系统,乃至网络。OpenBSD 中还包含伪随机数生成器,它可以确保无法根据系统状态预测随机数;其他的特性还包括加密哈希函数、加密转换库和加密硬件支持。另一个主要的部分是 IP 安全协议 (IPSec),该操作系统中没有依赖先天不安全的 TCP/IP Version 4(IPv4),而使用了这个协议(IPv4 选择信任所有的人和所有的事物。)IPSec 对数据包进行加密和验证以保护数据的保密性,并确保在传输过程中不会对数据包进行任何更改。随着 TCP/IP Version 6 (IPv6) 的引入,IPSec 成为标准的 Internet 协议中不可或缺的部分,这使得未来的 Internet 在缺省情况下更加安全。

可以作为防火墙
因为 OpenBSD 很小并且很安全,所以其所实现的最常见目标之一是用作防火墙。防火墙从底层对大多数安全单元进行操作,并且 OpenBSD 的包过滤实现是非常优秀的。Packet Filter (PF),OpenBSD 开发社区设计的开放源代码解决方案,它是 OpenBSD 所选择的方法。与 OpenBSD 软件的其他许多部分一样,这种方法非常成功,以至于其他的 BSD 变种纷纷将其移植到自己的分发版中。OpenBSD 配置为缺省安全,所以在设置坚如磐石的防火墙时,无需关闭过多的服务。当需要启用第二个 Ethernet 接口,并根据需要配置 PF。

加密和随机数
大多数操作系统很少在其关键组成部分中包含加密处理,这使得它们先天就缺乏安全性。导致这种缺陷的一个重要原因是,大多数的操作系统来自美国,不允许开 发人员出口健壮的加密软件。OpenBSD 中的加密哈希库包括 MD5、SHA1 和 RIPEMD160。其中的加密转换库包括 Blowfish、数据加密标准 (DES)、3DES 和 Cast。大部分加密处理都在底层进行,这样一来,用户就不用为了保护系 统安全而必须成为加密方面的专家。OpenBSD 开发团队很清楚,大多数管理员并不是安全方面的专家,并且不应该指望他们煞费周折地加强他们的环境。那些认为 OpenBSD 不是用户友好的操作系统的人,大部分是受到了误导。如果大多数管理员愿意花时间使用 OpenBSD 的缺省安全措施来替代任何其他的分发版,那么他们很可能会改变其思维方式。

随机数是确保安全性的重要组成部分。OpenBSD 内核使用中断信息创建不断变化的熵池,它可以为加密函数提供种子数据,并为事务 ID 提供数值。例如,伪随机数可用于进程 ID 和包 ID,这使得那些想要进行攻击的人很难进行欺骗。OpenBSD 甚至在 bind(2) 系统调用中使用了随机端口分配。大多数源于 UNIX 的操作系统要么创建顺序的 ID,要么使用可预测其结果的简单算法。研发团队仍在进一步广泛地研究文件系统的加密,并且在系统中所有可能的地方都对数据进行了加密。将交换分区分为一些小的区域,每个部分使用单独的密钥进行加密,以便确保不会将敏感数据泄漏到系统中不安全的部分,这是传统的基于 UNIX 或 Linux 的系统中常见的问题。如果希望对用户数据进行加密,那么可以使用 OpenBSD 中的加密文件系统 (CFS)。CFS 工作于用户级,通过网络文件系统 (NFS) 与内核进行通信。该系统允许用户透明地访问经过加密的目录,所以可以选择要对哪些数据进行加密,而不用受加密/解密过程的困扰。

组件计划
尽管团队规模较小及使用率偏低,该计划已成功地将基本系统的许多组件分拆,单独成为有广泛用途的可移植版本,其中包括:
LibreSSL:自由的安全套接层和传输层安全协议实现
OpenBGPD:自由的边界网关协议第4版(BGP-4)实现
OpenOSPFD:自由的开放式最短路径优先路由协议实现
OpenNTPD:ntp.org的网络时间协议守护进程的简单替代
OpenSMTPD:自由的简单邮件传输协议(SMTP)守护进程,支持IPv4/IPv6、PAM,Maildir和虚拟域
OpenSSH:自由的Secure Shell协议实现
OpenIKED:自由的因特网密钥交换协议实现
CARP(通用地址冗余协议):自由的思科专利HSRP/VRRP服务器冗余协议替代
PF:IPv4/IPv6双协议有状态防火墙,支持NAT、PAT、QoS、流量整形
pfsync:PF防火墙的防火墙状态同步协议,支持通过CARP提供高可靠性
spamd:支持灰名单的垃圾邮件过滤器,设计与PF防火墙协同工作
tmux:自由、安全、可维护的GNU Screen终端复用器替代
sndio:紧凑的音频和MIDI框架
Xenocara:定制的X.Org编译基础,默认情况下,它使用专用的X11用户来删除特权并根据OpenBSD的“最小特权”策略执行特权分离
cwm:堆叠式窗口管理器

有些子系统已被其他BSD项目纳入其核心中,并且上述所有软件都可在其它类Unix系统中作为软件包获得,甚至是Microsoft Windows。再来看看基本系统中的第三方组件的改造:
X.org:带计划自己的补丁的X窗口环境,用x*.tgz安装文件集安装
GCC:4.2、3.3或2.95(取决于平台),GNU C编译器,作为comp54.tgz文件集的一部分安装
Perl:带OpenBSD团队的补丁和修改
Nginx:网络服务器,带补丁
SQLite:带OpenBSD团队的补丁和修改
Sendmail:邮件服务器,带libmilter
BIND:DNS服务器(带补丁),OpenBSD改进了chroot和其他安全相关的操作
NSD:权威DNS服务器
Doas:使用户可以以其他身份执行单条命令(OpenBSD从5.8起提供)
Ncurses:
Heimdal:Kerberos身份验证协议的实现,带补丁
Binutils:带补丁
gdb:带补丁
Less 444:带补丁
Awk:

即将迎来原生的Hypervisor

2015年9月9日,据 OpenBSD 开发者 Mike Larkin 透露, 他在过去的几个月里一直在致力于实现一个名为“vmm”的 OpenBSD 上的原生的 hypervisor。Larkin 称他采用了一种全新的方法来实现 这个 hypervisor,而不会把它做成现有的 hypervisor 的一份子(如 bhyve、KVM 等)。基于这样的指导思想,在 hypervisor 中加进了那些他觉得重要的功能特性,包括“支持i386、影子分页技术、嵌套虚拟环境技术以及支持遗留外围设备”。重要的一点是,不打算把这做成精简版的 hypervisor。

最初的客户端操作系统支持将包括那些支持基于 virtio 设备的操作系统。等 vmm 完全开发好了,届时 OpenBSD 将附带用于运行和支撑 vmm 的工具。Larkin 说,当前 vmm 运行的目标 CPU 是i386和 amd64。硬件虚拟化支持方面,Intel 系列的 CPU(VT-x)要求支持 vmx extensions,AMD 系列的 CPU 则要求支持 svm extensions。如果i386和amd64的CPU不支持上述extensions,将使用影子分页技术来达成虚拟化。Vmm目前由vmd(8)、vmmctl(8)和vmm(4)这三部分工具组成。尽管还没有给出正式的定义,但vmm在基于其他OpenBSD工具的基础之上,应将还会包含hypervisor自身的部分,而vmd会是它的支持虚拟光驱,vmmctl将被用来控制vmm的操作。

对于x86/x64平台而言,OpenBSD 不像 Virtual Box 或 VMware 那样具备托管虚拟机的原生能力。OpenBSD 通过 QEMU 提供虚拟化功能,从 OpenBSD 5.3开始,还提供了具有逻辑域管理功能的sun4v(基于UltraSPARC)系统(这些附加的方法能在那些支持在非OpenBSD操作系统上托管运行OpenBSD,且OpenBSD是以客户端操作系统的形式出现的情况下使用)。

总体来讲,社区对Larkin新开发的hypervisor保有积极的回应——尤其是那些OpenBSD用户。不过也有一些问题问道了为什么没有用,现有的hypervisor来改进对OpenBSD的支持,而Larkin打算实现的支持遗留特性(i386&遗留外围设备),对眼下的项目来说并不容易做到。目前还没有vmm的正式发布日期,不过Larkin说,vmm最快的对外发布时间可能是2015年10月份。如果是这样的话,那么最早包含该vmm版本的OpenBSD稳定版本将是2016年5月1号发行的版本,但当前OpenBSD版本的分支应可以更早地实现与vmm的合并。

欧盟研究推荐使用 OpenBSD 开源操作系统

欧洲议会的一项研究认为,使用开源计算机操作系统和应用程序能降低大规模监视带来的隐私侵犯风险。开源软件当然不是没有错误,或犯的错误比私有软件少,但私有软件不允许像开源软件那样接受社区的不断检查。研究专家推荐了OpenBSD操作系统,称它的两大特性是加密和主动安全。其中包含了一些在其他操作系统缺少或是选择性的安全功能,此外OpenBSD极度重视源码的品质,任何对核心的修改都需要经过严格的源码审阅。它可以在17种不同的硬件环境下运作。

OpenBSD 将版本开发进度融入歌曲并发布

操作系统 OpenBSD 的开发者除了听歌,还很会玩的每隔 6 个月(同步版本更新节奏)选出一首与软件匹配的歌曲,并作为“主题曲”进行公布。据悉 OpenBSD 的一些开发者会从古典选集、电影或其它地方精选一些音乐,以描述该项目在过去六个月中所经历的一些进步、事件或争议。随着 OpenBSD 6.1 的发布,新的音乐也已公布 —— “Winter of 95”,并大致讲述了背后的故事

因安全担忧,OpenBSD 将禁用英特尔 CPU 的超线程支持

因担忧更多 Spectre 变种漏洞,OpenBSD 项目宣布它计划禁用英特尔 CPU 的超线程支持。超线程是同时多线程技术的英特尔私有实现,允许处理器在 CPU 的不同核心执行并发操作。英特尔处理器从 2002 年起加入了这项功能,并默认启用,芯片巨人称它能提升性能。但现在 OpenBSD 项目的 Mark Kettenis 表示该项目正移除英特尔 CPU 的超线程支持,理由是超线程技术对更多的时序攻击打开了大门。OpenBSD 将提供关闭超线程支持的设置,因为现代机器不再在 BIOS 设置中提供关闭超线程的选项。2018年8月23日,OpenBSD 创始人 Theo de Raadt 在邮件列表上宣布,OpenBSD-current(6.4) 将正式停用英特尔处理器的超线程功能。Theo de Raadt 称,英特尔处理器最近爆出了两个硬件 Bug:TLBleed 和 T1TF(aka Foreshadow),解决这些漏洞需要更新微码,外加软件方面的权益方案,以及关闭超线程。因在两个 CPU 实例之间共享资源和缺乏安全保障,超线程在基础上就存在缺陷。他预计未来会爆出更多与超线程相关的 Bug,所以他决定在 第6.4版本中默认停用超线程,并鼓励 6.2 和 6.3 的用户在机器的 BIOS 中关闭超线程。

小结
OpenBSD 已经成为世界上最安全的 UNIX 派生系统,并且几乎实现了所有相关的内容。其中的一些设计原则,如代码审核、加密处理的广泛使用以及仔细的配置选择,它们组合在一起可以确保实现其缺省安全的思想。尽管其一般用于安全服务器和防火墙,但广泛的硬件和软件支持使得该操作系统适用于各种各样的目的。UNIX 和 Linux 专家都会发现对 OpenBSD 中的许多部分非常熟悉,并且他们很可能会重视其中一些有意偏离的领域。


OpenBSD Security

Goals|目标

OpenBSD believes in strong security. Our aspiration is to be NUMBER ONE in the industry for security (if we are not already there). Our open software development model permits us to take a more uncompromising view towards increased security than most vendors are able to. We can make changes the vendors would not make. Also, since OpenBSD is exported with cryptography, we are able to take cryptographic approaches towards fixing security problems.
OpenBSD能给予相像中的强大安全性,我们的目标是成为安全领域的第一(如果我们还没有做到的话)。我们的开放式软件开发模式允许我们对提高安全性采取比大多数供应商都能做到,且更加坚定,我们可以做出供应商不会做的更改。另外,由于OpenBSD天生具有强大加密技术,所以我们能够采用加密方法来解决安全问题。

Full Disclosure|充分展示

Like many readers of the BUGTRAQ mailing list, we believe in full disclosure of security problems. In the operating system arena, we were probably the first to embrace the concept. Many vendors, even of free software, still try to hide issues from their users.
像BUGTRAQ邮件列表的许多读者一样,我们相信安全问题是完全公开的。在操作系统领域,我们可能是第一个接受这个概念的人。而许多供应商,甚至是自由软件供应商,仍然试图向用户隐瞒此类问题。

Security information moves very fast in cracker circles. On the other hand, our experience is that coding and releasing of proper security fixes typically requires about an hour of work — very fast fix turnaround is possible. Thus we think that full disclosure helps the people who really care about security.
安全信息在黑客圈子里传得非常快。另一方面,我们的经验是,编写和发布适当的安全补丁通常需要大约一个小时的工作-非常快速的修复是可能的。因此,我们认为充分地披露才有助于真正关心安全的人。

Audit Process|审计过程

Our security auditing team typically has between six and twelve members who continue to search for and fix new security holes. We have been auditing since the summer of 1996. The process we follow to increase security is simply a comprehensive file-by-file analysis of every critical software component. We are not so much looking for security holes, as we are looking for basic software bugs, and if years later someone discovers the problem used to be a security issue, and we fixed it because it was just a bug, well, all the better. Flaws have been found in just about every area of the system. Entire new classes of security problems have been found during our audit, and often source code which had been audited earlier needs re-auditing with these new flaws in mind. Code often gets audited multiple times, and by multiple people with different auditing skills.
我们的安全审计团队通常有6到12名成员,他们持续寻找并修复新的安全漏洞。我们从1996年夏天开始对代码进行审计,所遵循的提高安全性的过程只是对每个关键软件组件进行全面的逐个文件分析。我们并不在意寻找安全漏洞,而是在寻找基本的软件漏洞,如果几年后有人发现这个问题曾经是一个安全问题,而我们已经修复了它,因为它只是一个漏洞,那就更好了。几乎在系统的每个方面都发现了缺陷。在我们的审计过程中,我们发现了一系列新的安全问题,并且经常需要在考虑到这些新的缺陷的情况下重新审计先前审计过的源代码。代码经常被多次审核,并且由多个具有不同审核技能的人员进行审核。

Some members of our security auditing team worked for Secure Networks, the company that made the industry's premier network security scanning software package Ballista (Secure Networks got purchased by Network Associates, Ballista got renamed to Cybercop Scanner, and well...) That company did a lot of security research, and thus fit in well with the OpenBSD stance. OpenBSD passed Ballista's tests with flying colours since day 1.
我们的安全审计团队的一些成员为安全网络公司工作,该公司制造了业界首屈一指的网络安全扫描软件包Ballista(安全网络由network Associates购买,Ballista更名为Cybercop Scanner,等等…),该公司做了大量的安全研究,因此很适合OpenBSD的状态。OpenBSD从第一天就通过了Ballista的测试。

Another facet of our security auditing process is its proactiveness. In most cases we have found that the determination of exploitability is not an issue. During our ongoing auditing process we find many bugs, and endeavor to fix them even though exploitability is not proven. We fix the bug, and we move on to find other bugs to fix. We have fixed many simple and obvious careless programming errors in code and only months later discovered that the problems were in fact exploitable. (Or, more likely someone on BUGTRAQ would report that other operating systems were vulnerable to a "newly discovered problem", and then it would be discovered that OpenBSD had been fixed in a previous release). In other cases we have been saved from full exploitability of complex step-by-step attacks because we had fixed one of the intermediate steps. An example of where we managed such a success is the lpd advisory that Secure Networks put out.
我们安全审计过程中的另一个方面就是利用了它的主动性。在大多数情况下,我们发现可利用性的确定不是一个问题。在我们正在进行的审计过程中,我们发现了许多错误,并努力修复它们,即使其尚未得到证实。我们修复了错误,然后继续寻找其他需要修复的bug。我们在代码中修复了许多简单而明显的粗心编程错误,几个月后才发现这些问题实际上是可以利用的。(或者,更有可能的是,BUGTRAQ上的人会报告其他操作系统容易受到“新发现的问题”的影响,然后会发现OpenBSD在以前的版本中已经被修复)。在其他情况下,由于我们修复了其中一个中间步骤,将我们从复杂的逐步攻击中完全可利用性中拯救了出来。一个成功的例子就是安全网络发布的lpd咨询。

New Technologies|新技术

As we audit source code, we often invent new ways of solving problems. Sometimes these ideas have been used before in some random application written somewhere, but perhaps not taken to the degree that we do.
当我们审计源代码时,我们经常发明解决问题的新方法。有时候,这些想法以前曾在某个地方的一些随机应用程序中使用过,但可能没有达到我们所能达到的程度。
strlcpy() and strlcat()
Memory protection purify
    W^X
    .rodata segment
    Guard pages
    Randomized malloc()
    Randomized mmap()
    atexit() and stdio protection
Privilege separation
Privilege revocation
Chroot jailing
New uids
ProPolice
... and others

The Reward|激励

Our proactive auditing process has really paid off. Statements like "This problem was fixed in OpenBSD about 6 months ago" have become commonplace in security forums like BUGTRAQ.
我们积极主动的审计过程确实收到了回报。像“这个问题在大约6个月前在OpenBSD中修复了”这样的语句在BUGTRAQ这样的安全论坛中已经司空见惯了。
The most intense part of our security auditing happened immediately before the OpenBSD 2.0 release and during the 2.0→2.1 transition, over the last third of 1996 and first half of 1997. Thousands (yes, thousands) of security issues were fixed rapidly over this year-long period; bugs like the standard buffer overflows, protocol implementation weaknesses, information gathering, and filesystem races. Hence most of the security problems that we encountered were fixed before our 2.1 release, and then a far smaller number needed fixing for our 2.2 release. We do not find as many problems anymore, it is simply a case of diminishing returns. Recently the security problems we find and fix tend to be significantly more obscure or complicated. Still we will persist for a number of reasons:
我们安全审计中最激烈的部分发生在openbsd2.0发布之前,以及2.0→2.1过渡期间,即1996年下半年和1997年上半年。在这一年漫长的时间里,数千个(是的,数千个)安全问题得到了迅速修复;诸如标准缓冲区溢出、协议实现弱点、信息收集和文件系统竞争等缺陷。因此,我们遇到的大多数安全问题在2.1版本之前就已经解决了,而在2.2版本中需要修复的数量要少得多。我们再也找不到那么多问题了,这只是一个‘收益递减’的例子。最近,我们发现和解决的安全问题往往更加模糊或复杂。我们仍将坚持下去,原因有很多:
Occasionally we find a simple problem we missed earlier. Doh!
Security is like an arms race; the best attackers will continue to search for more complicated exploits, so we will too.
Finding and fixing subtle flaws in complicated software is a lot of fun.
偶尔我们会发现一个我们之前错过的简单问题。哦!
安全就像一场军备竞赛;最好的攻击者会继续寻找更复杂的漏洞,我们也会。
发现并修复复杂软件中的细微缺陷是一件很有趣的事。

The auditing process is not over yet, and as you can see we continue to find and fix new security flaws.
审核过程还没有结束,正如您所看到的,我们将继续查找并修复新的安全缺陷。

"Secure by Default"|默认情况下安全

To ensure that novice users of OpenBSD do not need to become security experts overnight (a viewpoint which other vendors seem to have), we ship the operating system in a Secure by Default mode. All non-essential services are disabled. As the user/administrator becomes more familiar with the system, he will discover that he has to enable daemons and other parts of the system. During the process of learning how to enable a new service, the novice is more likely to learn of security considerations.
为了确保OpenBSD的新手用户不需要一夜之间成为安全专家(其他供应商似乎也有这种观点),我们以默认安全模式发布操作系统。所有非必要服务均被禁用。随着用户/管理员对系统越来越熟悉,他将发现必须启用守护程序和系统的其他部分。在学习如何启用新服务的过程中,新手更有可能了解安全考虑因素。

This is in stark contrast to the increasing number of systems that ship with NFS, mountd, web servers, and various other services enabled by default, creating instantaneous security problems for their users within minutes after their first install.
与此形成鲜明对比的是,越来越多的系统在默认情况下启用了NFS、mountd、web服务器和各种其他服务,在用户第一次安装后几分钟内就为用户带来了即时的安全问题。

Cryptography|密码学

And of course, since the OpenBSD project is based in Canada, it is possible for us to integrate cryptography. For more information, read the page outlining what we have done with cryptography.
当然,由于OpenBSD项目在加拿大,所以我们有可能集成密码技术。如需了解更多信息,请阅读我们使用加密技术所做工作的概述页面。

Advisories|忠告

Please refer to the links at the top of this page.
请参阅本页顶部的链接。

Watching our Changes|观察我们的变化

Since we take a proactive stance with security, we are continually finding and fixing new security problems. Not all of these problems get widely reported because (as stated earlier) many of them are not confirmed to be exploitable; many simple bugs we fix do turn out to have security consequences we could not predict. We do not have the time resources to make these changes available in the above format.
由于我们对安全采取了积极的态度,不断地发现和解决新的安全问题。并不是所有这些问题都得到了广泛的报道,因为(如前所述)其中许多问题并没有被证实是可利用的;我们修复的许多简单的错误确实会产生无法预测的安全后果,我们没有充足的时间资源对上述问题提供这些更改。

Thus there are usually minor security fixes in the current source code beyond the previous major OpenBSD release. We make a limited guarantee that these problems are of minimal impact and unproven exploitability. If we discover that a problem definitely matters for security, patches will show up here VERY quickly.
因此,除了以前的主要OpenBSD版本之外,当前源代码中通常会有一些小的安全性修复。我们有限地保证这些问题的影响是最小的和未经证实的可利用性。如果我们发现某个问题确实关系到安全性,补丁程序将很快出现在这里。

People who are really concerned with security can do a number of things:
真正关心安全的人可以做很多事情:

If you understand security issues, watch our source-changes mailing list and keep an eye out for things which appear security related. Since exploitability is not proven for many of the fixes we make, do not expect the relevant commit message to say "SECURITY FIX!". If a problem is proven and serious, a patch will be available here very shortly after.
如果您了解安全问题,请查看我们的源代码更改邮件列表,并密切关注与安全相关的内容。由于我们所做的许多修复都没有证明可利用性,所以不要期望相关的提交消息显示出“SECURITY FIX!”。如果一个问题被证明是严重的,那么很快就会有补丁。

Track our current source code tree, and teach yourself how to do a complete system build from time to time (read /usr/src/Makefile carefully). Users can make the assumption that the current source tree always has stronger security than the previous release. However, building your own system from source code is not trivial; it is over 850MB of source code, and problems do occur as we transition between major releases.
跟踪我们当前的源代码树,并不时地自学如何构建完整的系统(请仔细阅读/usr/src/Makefile)。用户可以假设当前源代码树始终比以前的版本具有更强的安全性。然而,从源代码构建系统并非易事;它有超过850MB的源代码,并且在主要版本之间转换时确实会出现问题。

Install a binary snapshot for your architecture, which are made available fairly often. For instance, an amd64 snapshot is typically made available daily.
为所用的体系架构安装一个二进制快照,这种快照经常提供。例如,amd64快照通常每天提供。

Reporting problems|报告问题

If you find a new security problem, you can mail it to deraadt\@openbsd.org.
如果发现新的安全问题,可以将其发送到deraadt\@openbsd.org。

If you wish to PGP encode it (but please only do so if privacy is very urgent, since it is inconvenient) use this pgp key.
如果您希望对其进行PGP编码(但请仅在隐私非常紧急的情况下进行编码,因为这不方便),请使用此PGP密钥。

Further Reading|深入阅读

Numerous papers have been written by OpenBSD team members, many dedicated to security.
OpenBSD团队成员已经撰写了许多论文,其中许多都致力于安全性。

Securelevel|安全级别

Securelevel is a security mechanism in *BSD kernels, which can optionally restrict certain capabilities. Securelevel is controlled by a sysctl variable kern.securelevel. This value is an integer, which set to a value > 0 enables certain class of restrictions. Any superuser process can raise securelevel, but only init process (and not even that on FreeBSD) can lower it.
安全级别是*BSD内核中的一种安全机制,可以选择性地限制某些功能。安全级别由sysctl工具来控制kern变量。该值是一个整数,如果设置为值大于0,则会启用特定类别的限制。任何超级用户进程都可以提高安全级别,但只有init进程(甚至FreeBSD上的进程)才可以降低。

When used with FreeBSD jails, each jail maintains its own securelevel in addition to the global securelevel. When evaluated, the higher of the two securelevels will be used. This allows the host environment to run at a lower securelevel than jails, so that it can manipulate file flags that the jails may not be able to.
当与FreeBSD jails一起使用时,除了全局安全级别外,每个jails还可以保持着自己的安全级别,评估后将使用其安全级别中较高者。这允许主机环境以低于jails的安全级别运行,因此可以处理jails可能无法处理的文件标志。

When compiled with options REGRESSION, a new sysctl is added to the FreeBSD kernel that allows the securelevel to be lowered for the purposes of automated regression testing.
当使用REGRESSION选项编译时,会向FreeBSD内核添加一个新的sysctl,来控制内核允许降低安全级别以进行自动回归测试。

Securelevel is not to be confused with runlevel.
安全级别不能与运行级别混淆。

Definitions|定义

On OpenBSD the securelevels are defined as follows|在OpenBSD上,安全级别的定义如下:

-1 (Permanently insecure mode) is functionally identical to securelevel 0 except the Kernel will never attempt to increase the level as it would in level 0. This effectively disables securelevel protections.
-1(永久不安全模式)在功能上与securelevel 0相同,只是内核永远不会像在level 0中那样尝试增加级别。这将有效禁用安全级别的保护。

0 (Insecure mode) all devices can be read or written to (if they have appropriate permissions) and system file flags can be cleared using chflags. This mode is typically used while the system is booting, and once boot is completed and system enters multi-user mode, it is elevated to level 1.
0(不安全模式)可以读取或写入所有设备(如果其具有适当的权限),并且可以使用chflags清除系统文件标志。此模式通常在系统引导时使用,一旦引导完成且系统进入多用户模式,它将提升到级别1。

1 (Secure mode) this is the default mode when the system is booted into multi-user mode. In this mode the securelevel can not be lowered, the raw memory devices can not be written to, the raw devices of mounted file systems can not be written to, important kernel variables (such as fs.posix.setuid, hw.allowpowerdown, net.inet.ip.sourceroute, machdep.kbdreset, ddb.console, ddb.panic and machdep.allowaperture) are locked down and only GPIO pins that were present during boot may be accessed.
1(安全模式)这是系统启动到多用户模式后的默认模式。在此模式下,无法降低安全级别,无法写入原始内存设备,无法写入已安装文件系统的原始设备,重要的内核变量(如fs.posix.setuid、hw.allowpowerdown、net.inet.ip.sourceroute、machdep.kbdreset、ddb.console、ddb.panic和machdep.allowperture)被锁定,只能访问引导期间出现的GPIO引脚。

2 (Highly secure mode) has the same effects are securelevel 1, and in addition raw disk devices can not be written to even if unmounted, certain time related functions are locked down so the time cannot be set in the past (to help ensure the times of actions recorded in the logs are useful) and pf rules may not be altered. This mode is designed to provide some semblance of defence in the event that the root user account is compromised.
2(高度安全模式)具有与securelevel 1相同的效果,此外,即使未安装,也无法写入原始磁盘设备,某些与时间相关的功能被锁定,因此时间不能设置在过去(以帮助确保日志中记录的操作时间是有用的),并且pf规则可能不会更改。这种模式的目的是在根用户帐户被破坏时提供一些防御的假象。

securelevel(7)

继 Linux 之后,OpenBSD 也开始在苹果 M1 硬件上加载启动

OpenBSD 开发者 Mark Kettenis 于2021年2月在邮件列表 openbsd-arm 透露,有人向该团队捐赠了苹果 M1 硬件,使得他们有机会可以尝试在 M1 硬件上以原生模式启动载入 OpenBSD。目前6.9-beta 版已经可以在 M1 硬件上顺利加载,但 Mark Kettenis 表示仍有许多问题需要处理,因此近期内不会有太大进展。根据 Mark Kettenis 提供的启动信息可以得知,本次测试的机型是 M1 版 Mac Mini,而不是 Macbook Air 或 Macbook Pro。启动过程中可以识别出无线网卡 Broadcom BCM4378、有线网卡 Broadcom BCM57762、以及连接着的 USB 外设设备。此外还可以发现该机器以 UEFI 模式启动。

OpenBSD版本更新录(202x)

官方主页:http://openbsd.org/
该文章最后由 阿炯 于 2023-04-16 20:21:12 更新,目前是第 2 版。