移动端 | 加入收藏 | 设为首页 | 最新ss | 赞助本站 | RSS
 

freefq.comfree——免费、自由fq——翻墙

困在墙内,请发邮件到freefqcom#gmail.com获得最新免费翻墙方法!
您当前的位置:首页 > 网络翻墙技巧

会遗忘的服务器:探索无状态中继

时间:2026-04-09  来源:torproject  作者:Osservatorio Nessuno 条评论
原题:一个会遗忘的服务器:探索无状态中继

运行 Tor 中继服务器需要不断应对来自私人和国家支持的敌对势力,他们会攻击组成网络的节点,试图破坏网络。此外,一些运营商还必须应对查封、突袭以及对硬件的直接物理访问。奥地利、德国、美国、俄罗斯以及其他许多国家都有过类似案例这些情况服务器可能会成为潜在的风险。BTx免费翻墙网

Tor 的存在是为了保护互联网用户免受不必要的监视。该网络的设计使得任何单个运营商或服务器都无法还原通信双方的身份。记者、活动人士和举报人都依赖于这一机制的稳定运行。如果一个中继服务器可以被查封,其内容也会被泄露,这将彻底破坏系统赖以生存的信任。而这正是我们想要解决的问题。BTx免费翻墙网

本文探讨了无状态、无盘操作系统如何从固件到用户空间提升中继服务器的安全性,重点关注软件完整性和抵御物理攻击的能力。这项工作源于意大利Osservatorio Nessuno运行出口中继服务器的经验。中继服务器的管理因具体情况、技术能力、预算和管辖范围而异。我们希望引发讨论,而非提出单一模型。BTx免费翻墙网

无国籍的含义

无状态系统在重启之间不会存储任何数据。每次启动时,它都会从一个已知的、固定的镜像开始,就像Tails 系统一样。完全在 RAM 中运行 Tor 中继的想法并不新鲜。Tor -ramdisk就是一个基于 uClibc 的微型 Linux 发行版,正是为此目的而构建的,其历史至少可以追溯到 2015 年。BTx免费翻墙网

对于中继运营商而言,这种方法通过设计强制执行更好的行为,从而提高了安全标准:BTx免费翻墙网

物理攻击抵抗能力强。如果机器被查封或克隆,则无法进行任何分析。根据配置的不同,提取中继密钥可能变得不可行。BTx免费翻墙网

声明式配置。系统采用版本控制。无状态系统不会偏离其声明的配置,因为每次启动都会应用新的配置。BTx免费翻墙网

运行时环境不可变。文件系统是只读的。即使攻击者获得了代码执行权限,也无法在重启后保留任何内容。BTx免费翻墙网

可复现性。重启后保持不变的系统更容易验证,最终也更容易复现和审核。BTx免费翻墙网

为什么 Tor 中继很难实现无状态

Tor 中继会随着时间的推移积累信誉:运行数月的中继会获得带宽标志,从而提升其在网络中的价值。这种信誉与长期加密身份密钥绑定。一旦丢失这些密钥,中继就会失去其身份,并失去在网络中的信誉,一切从零开始。BTx免费翻墙网

因此,中继器的身份信息必须在重启后仍然有效且不可提取。存储在磁盘上的密钥可以被获取和复制;而存储在安全芯片(例如TPM)中的密钥则更难被攻击者获取。BTx免费翻墙网

除了身份密钥之外,中继节点还会积累一个状态文件,其中包含带宽历史记录和其他临时信息。每次重启都丢弃该文件会降低性能,而且由于操作系统完全运行在内存中,因此必须将其全部加载到内存中,无法使用磁盘交换。一旦进程超出可用内存,内核的 OOM killer 机制就会直接终止它们。实际上,将 glibc 的内存分配器替换为 jemalloc 或 mimalloc 可以显著降低 Tor 的内存占用,在繁忙的保护中继节点上,内存占用从大约 5.7 GB 降至 1.2 GB 以下,这主要是通过避免高周转率目录缓存对象造成的碎片化来实现的。BTx免费翻墙网

TPM 作为主要工具

TPM(可信平台模块)是主板上的专用硬件芯片,用于存储加密密钥并执行相关操作,而无需将私钥暴露给操作系统。它可以密封密钥:将其与机器的特定状态绑定,因此只有当 TPM 检测到与创建密钥时完全相同的软件堆栈时,该密钥才能使用。BTx免费翻墙网

对于无状态中继而言,这意味着身份密钥在重启后仍然存在,因为它存储在硬件中,即使通过物理访问也无法按常规方式提取。TPM 还支持远程认证:芯片可以向外部系统证明机器启动时运行的软件,并由硬件根签名提供支持。这使得无需信任运营商即可验证节点正在运行的软件。BTx免费翻墙网

TPM 并不能解决所有问题。Tor 使用的基于 ed25519 的密钥不受 TPM 芯片支持,因此密钥虽然由 TPM 加密,但仍然以字节串的形式存储在非易失性存储器中,这意味着理论上仍然可以将其导出。BTx免费翻墙网

密封还需要预先决定TPM信任的软件状态。当您更新内核或引导加载程序时,所测量的状态会发生变化,因此您必须通过预测下次启动时的状态来重新密封TPM。BTx免费翻墙网

现有方法

不同的运营商在权衡简易性和安全性深度之间的平衡曲线上,从不同的角度着手解决这个问题。BTx免费翻墙网

极简内存盘。最简单的方案:所有程序都在内存中运行,密钥手动管理。Tor -ramdisk自 2015 年以来一直采用这种方式。身份密钥通过 SCP 协议导出和导入;如果重启时未进行密钥导出和导入,则意味着一切重来。没有 TPM,没有认证,没有验证启动——唯一的保证就是断电后内存数据会丢失。即便如此,它仍然比传统的基于磁盘的方案有了显著的改进。BTx免费翻墙网

基于虚拟机的内存盘。Emerald Onion在 Proxmox 虚拟机管理程序上运行每个中继节点独立的 Alpine Linux 镜像(每个镜像 66 MB)。虚拟机完全启动到内存中,不连接任何持久存储。身份管理采用 Tor 的 OfflineMasterKey 功能:长期主密钥在离线状态下生成,不会经过中继节点。更新只需重建镜像,回滚非常简单,无需任何特殊硬件。BTx免费翻墙网

裸机架构,采用TPM身份验证。我们的工具 Patela采用了一种更侧重硬件的方法。中继节点通过stboot启动,stboot是一个引导加载程序,它会获取并加密验证已签名的操作系统镜像,然后再将控制权移交给节点。节点运行后,会通过mTLS从中央服务器拉取配置信息。即使服务器可能已被攻破,它也可以拒绝服务,但无法推送凭据或从节点提取密钥。中继节点的身份密钥存储在TPM非易失性存储器中,并与测得的启动状态绑定。即使重启后密钥仍然存在,但即使物理访问也无法提取。这种方法的缺点是操作复杂:需要裸机架构,并且在更新后需要重新密封。BTx免费翻墙网

未解决的问题

有些问题是我们特有的;另一些问题则会影响任何无状态中继部署。BTx免费翻墙网

更新后重新密封。当软件栈发生变化时,TPM 的测量状态也会随之改变。自动执行此操作(即预测更新后启动测量结果)是尚未解决的难题之一。像 systemd-pcrlock 这样的工具正在朝着这个方向努力,但尚未完全实现。BTx免费翻墙网

无状态重启与升级。我们对 Tor 二进制文件使用标准的无人值守升级。但重启会将操作系统镜像恢复到之前的版本,从而导致非自愿降级。如何协调自动安全更新与无状态镜像之间的关系,是我们尚未完全解决的问题。BTx免费翻墙网

内存限制。不使用交换空间意味着超出可用内存的进程会被立即终止,且不会发出任何警告。Tor 的内存使用情况在运行时难以预测。虽然上文所述的内存分配器替换方案极大地改善了这一状况,但根本的限制依然存在。BTx免费翻墙网

网络稳定性。持久性更新只能通过重建镜像并重新启动来应用。频繁重启的中继服务器可能会失去其“稳定”标志,这会影响网络发送给它的流量。BTx免费翻墙网

未来方向

远程认证。密封将密钥绑定到机器状态。认证允许节点向外部方证明该状态。验证者(例如配置服务器或最终的 Tor 目录管理机构)可以发出加密挑战,只有运行预期软件栈的节点才能正确回答。这使得启动完整性从本地属性转变为可远程验证的属性,从而降低了对运营商的信任。BTx免费翻墙网

透明日志。一旦有了经过验证的启动链,就可以将其发布。中继运营商提供可复现构建的方案;任何人都可以重新计算预期哈希值,并验证其是否与 TPM 报告的值一致。仅追加的透明日志可以使这些验证过程公开可审计。Tor 社区可以运行一个独立的监控程序来跟踪整个中继集群的情况。BTx免费翻墙网

机密计算。基于虚拟机的方案可以借助 AMD SEV-SNP 等技术进行扩展,这些技术能够将客户虚拟机的内存与虚拟机管理程序本身隔离。这也有助于降低对运维人员的信任度,并缩小虚拟机方案与裸机方案之间的安全差距。BTx免费翻墙网

更小的硬件。 “行走的洋葱”(Walking Onions)是 Tor 协议的一项扩展提议,它将使节点无需在本地保存整个网络的视图。如果 arti 和相关工具能够在更小的硬件上运行,将为目前资源成本过高的设备带来新的可能。BTx免费翻墙网

结论

对于像 Tor 这样的应用来说,无状态性可以带来多重好处:既有助于防止攻击和操作员错误,而且通过进一步的研究和工作,还可以提高整个网络的可信度。BTx免费翻墙网

即使对于资源更丰富的项目和组织而言,无状态系统也会带来实际的运营成本和一些真正棘手的未解难题。但它们可以作为改进隐私基础设施的基础,类似的概念和框架也可以应用于技术栈的其他部分。BTx免费翻墙网

这项工作始于2025年的Tor社区大会,目前仍在进行中。如果您运行中继服务器、参与Tor工具的开发,或者思考过任何这些未解决的问题,我们都非常希望听到您的意见BTx免费翻墙网

参考

BTx免费翻墙网
BTx免费翻墙网
 A Server That Forgets: Exploring Stateless RelaysBTx免费翻墙网
BTx免费翻墙网
by Osservatorio Nessuno

Running Tor relays requires constant work against adversaries, private and state-backed, who try to undermine the network by attacking the nodes that make it up. On top of that, some operators have to deal with seizures, raids, and direct physical access to hardware. There are precedents in Austria, Germany, the United States, Russia, and likely many others. In those instances, the server can become a liability.BTx免费翻墙网

Tor exists because we want to shield internet users from unwanted surveillance. The network is designed so that no single operator or server can reconstruct who is talking to whom. Journalists, activists, and whistleblowers depend on that holding up. A relay that can be seized and its contents handed over erodes the very trust the system depends on. And that's a problem we want to solve.BTx免费翻墙网

In this post we explore how a stateless, diskless operating system can improve relay security, from firmware to user space, with a focus on software integrity and physical attack resistance. This work comes from the experience of Osservatorio Nessuno running exit relays in Italy. Managing relays varies greatly depending on context, technical capability, budget, and jurisdiction. We hope to stimulate discussion rather than propose a single model.BTx免费翻墙网

What stateless means

A stateless system doesn't store anything between reboots. Every time it starts, it begins from a known, fixed image, just like Tails does. The idea of running a Tor relay entirely in RAM isn't new. Tor-ramdisk, a uClibc-based micro Linux distribution built for exactly this purpose, dates back to at least 2015.BTx免费翻墙网

For relay operators, this approach raises the security bar by enforcing better behaviors by design:BTx免费翻墙网

Physical attack resistance. If the machine is seized or cloned, there is nothing to analyze. Depending on the setup, the extraction of relay keys might become infeasible.BTx免费翻墙网

Declarative configuration. The system is version controlled. A stateless system cannot drift from its declared configuration, since every boot is a fresh apply.BTx免费翻墙网

Immutable runtime. The filesystem is read-only. Even if an attacker gains code execution, they cannot persist anything across a reboot.BTx免费翻墙网

Reproducibility. A system that doesn't change between reboots is easier to verify and, eventually, to reproduce and audit.BTx免费翻墙网

Why Tor relays are hard to make stateless

Tor relays build reputation over time: a relay that has been running for months earns bandwidth flags that make it more useful to the network. That reputation is tied to a long-term cryptographic identity key. Lose those keys and the relay loses its identity, and as such is reputation in the network, starting from scratch.BTx免费翻墙网

Thus, the relay's identity must survive reboots without being extractable. A key stored on disk can be seized and copied; a key stored in a security chip such as the TPM might be more challenging for attackers.BTx免费翻墙网

Beyond the identity key, a relay accumulates a state file containing bandwidth history and other temporary information. Discarding it on every reboot degrades performance, and running entirely in RAM means the OS has to fit in memory, with no possibility of swapping to disk. Whenever processes exceed available memory, the kernel's OOM killer terminates them outright. In practice, replacing glibc's allocator with jemalloc or mimalloc reduces Tor's memory footprint significantly, from around 5.7 GB to under 1.2 GB on a busy guard relay, largely by avoiding fragmentation from high-churn directory cache objects.BTx免费翻墙网

The TPM as the primary tool

A TPM (Trusted Platform Module) is a dedicated hardware chip on the motherboard that stores cryptographic keys and performs operations with them without ever exposing the private key to the operating system. It can seal a secret: bind it to a specific measured state of the machine, so the key can only be used if the TPM sees the exact same software stack it saw when the key was created.BTx免费翻墙网

For a stateless relay, this means the identity key survives reboots, as it lives in the hardware, but can't be conventionally extracted even with physical access. TPMs also support remote attestation: the chip can prove to an external system what software the machine was started with, backed by a hardware-rooted signature. This makes it possible to verify what a node is running without trusting the operator.BTx免费翻墙网

The TPM doesn't solve everything. Tor's usage of ed25519-based keys are not supported by the TPM chips, so the key is encrypted by the TPM but still stored as a byte string in non-volatile memory, meaning it is still technically possible to export it.BTx免费翻墙网

Sealing also requires deciding upfront what software state the TPM will trust. When you update the kernel or bootloader, the measured state changes, and you have to re-seal the TPM by predicting what the next boot will look like.BTx免费翻墙网

Existing approaches

Different operators have tackled this problem at different points on the trade-off curve between simplicity and depth of security.BTx免费翻墙网

Minimal ramdisk. The simplest approach: run everything in RAM, manage keys manually. Tor-ramdisk has done this since 2015. Identity keys are exported and imported over SCP; rebooting without doing so means starting over. No TPM, no attestation, no verified boot — just the guarantee that RAM doesn't survive a power cut. It remains a meaningful improvement over a conventional disk-based setup.BTx免费翻墙网

VM-based ramdisk. Emerald Onion runs per-relay Alpine Linux images (66 MB each) on a Proxmox hypervisor. The VMs boot entirely into RAM with no persistent storage attached. Identity is managed with Tor's OfflineMasterKey feature: the long-term master key is generated offline and never touches the relay. Updates are image rebuilds, rollback is trivial, and no special hardware is required.BTx免费翻墙网

Bare metal with TPM-backed identity. Patela, our tool, takes a more hardware-focused approach. The relay boots via stboot, a bootloader that fetches and cryptographically verifies a signed OS image before handing off control. Once running, the node pulls its configuration from a central server over mTLS, though a potentially compromised server can deny service but cannot push credentials or extract keys from the node. The relay's identity key lives in TPM non-volatile memory, bound to the measured boot state. It survives reboots but can't be extracted even with physical access. The trade-off is operational complexity: bare metal is required and re-sealing is needed after updates.BTx免费翻墙网

Open problems

Some of these problems are specific to our setup; others affect any stateless relay deployment.BTx免费翻墙网

Re-sealing after updates. When the software stack changes, the TPM's measured state changes too. Automating this, which implies predicting what the boot measurements will look like after an update, is one of the harder unsolved problems. Tooling like systemd-pcrlock is moving in this direction, but it's not turnkey yet.BTx免费翻墙网

Stateless reboots versus upgrades. We use standard unattended upgrades for the Tor binary. But a reboot reverts to the OS image, which contains the previous version, a causing an involuntary downgrade. Reconciling automatic security updates with stateless images is something we haven't fully solved.BTx免费翻墙网

Memory constraints. No swap means processes that exceed available memory are killed without warning. Tor's memory usage is hard to predict at runtime. The allocator replacement described above helps enormously, but the fundamental constraint remains.BTx免费翻墙网

Network stability. Persistent updates can only be applied rebuilding the images and booting it again. A relay that restarts frequently risks losing its Stable flag, which affects how much traffic the network sends to it.BTx免费翻墙网

Future directions

Remote attestation. Sealing binds a key to a machine state. Attestation lets the node prove that state to an external party. A verifier, suach as a configuration server or eventually the Tor directory authorities, can issue a cryptographic challenge that only a node running the expected software stack can answer correctly. This turns boot integrity from a local property into something verifiable remotely, reducing operator trust.BTx免费翻墙网

Transparency logs. Once you have a measured boot chain, you can publish it. A relay operator provides a recipe for a reproducible build; anyone can recompute the expected hash and verify it matches what the TPM reports. An append-only transparency log can make these attestations publicly auditable. The Tor community could run an independent monitor to track this across the relay fleet.BTx免费翻墙网

Confidential computing. The VM-based approach can be extended with technologies like AMD SEV-SNP, which isolate a guest VM's memory from the hypervisor itself. This too, is useful to reduce operator trust, and can reduce the security gap between the VM and bare-metal approaches.BTx免费翻墙网

Smaller hardware. Walking onions, a proposed Tor protocol extension, would remove the need for nodes to hold an entire view of the network locally. Getting arti and related tools to run on smaller hardware would open up possibilities for devices that currently can't afford the resource cost.BTx免费翻墙网

Conclusion

For applications like Tor, being stateless can bring multiple benefits: helps both prevent attacks and operator errors, and with further research and work could improve the overall network trustworthiness.BTx免费翻墙网

Stateless systems come with real operational costs and genuinely hard unsolved problems, even for project and organizations with more resources. But they can serve as a foundation for improving privacy infrastructure, and similar concepts and frameworks could be applied to other parts of the stack.BTx免费翻墙网

This work started at the Tor Community Gathering in 2025, and it's ongoing. If you run relays, work on Tor tooling, or have thought about any of these open problems, we'd like to hear from you.BTx免费翻墙网

References

来顶一下
返回首页
返回首页
欢迎评论:免登录,输入验证码即可匿名评论 共有条评论
用户名: 密码:
验证码: 匿名发表

推荐资讯

V2VPN - 高速、可靠的免费VPN下载地址
V2VPN - 高速、可靠的
Octohide VPN:快如闪电的免费VPN
Octohide VPN:快如闪
原子网络加速器 - 免费高速VPN 一键链接 方便快捷
原子网络加速器 - 免费
foxovpn绿狐VPN——即连即用、快速、安全
foxovpn绿狐VPN——即
相关文章
栏目更新
栏目热门
墙外新闻
读者文摘

你可以访问真正的互联网了。You can access the real Internet.

管理员精中特别提醒:本网站域名、主机和管理员都在美国,且本站内容仅为非中国大陆网友服务。禁止中国大陆网友浏览本站!若中国大陆网友因错误操作打开本站网页,请立即关闭!中国大陆网友浏览本站存在法律风险,恳请立即关闭本站所有页面!对于您因浏览本站所遭遇的法律问题、安全问题和其他所有问题,本站均无法负责也概不负责。

特别警告:本站推荐各种免费科学上网软件、app和方法,不建议各位网友购买收费账号或服务。若您因付费购买而遭遇骗局,没有得到想要的服务,请把苦水往自己肚子里咽,本站无法承担也概不承担任何责任!

本站严正声明:各位翻墙的网友切勿将本站介绍的翻墙方法运用于违反当地法律法规的活动,本站对网友的遵纪守法行为表示支持,对网友的违法犯罪行为表示反对!

网站管理员定居美国,因此本站所推荐的翻墙软件及翻墙方法都未经测试,发布仅供网友测试和参考,但你懂的——翻墙软件或方法随时有可能失效,因此本站信息具有极强时效性,想要更多有效免费翻墙方法敬请阅读本站最新信息,建议收藏本站!本站为纯粹技术网站,支持科学与民主,支持宗教信仰自由,反对恐怖主义、邪教、伪科学与专制,不支持或反对任何极端主义的政治观点或宗教信仰。有注明出处的信息均为转载文章,转载信息仅供参考,并不表明本站支持其观点或行为。未注明出处的信息为本站原创,转载时也请注明来自本站。

鉴于各种免费翻墙软件甚至是收费翻墙软件可能存在的安全风险及个人隐私泄漏可能,本站提醒各位网友做好各方面的安全防护措施!本站无法对推荐的翻墙软件、应用或服务等进行全面而严格的安全测试,因此无法对其安全性做保证,无法对您因为安全问题或隐私泄漏等问题造成的任何损失承担任何责任!

S. Grand Ave.,Suite 3910,Los Angeles,CA 90071

知识共享许可协议
本作品采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可。