谷歌trillian——可验证数据存储

1. 引言

trillian白皮书 Verifiable Data Structures 中指出:
生活中需大量依赖对权威机构的信任。
在网络领域,网站所有者需信任证书颁发机构办法的证书;邮件客户端需信任密钥服务器返回的目标邮件收件人的公钥是正确的;服务器管理员下需信任包分销商发送的软件二进制文件。
在现实世界,公民需信任房产局可准确记录土地所有权。

对应的代码实现为:【go语言,基于Merkle Tree,以gRPC服务形式构建。】

2. trillian数据结构

基于trust but verify原则,构建了如下数据结构,使得整个信任模型是透明的:

  • Verifiable logs:仅支持append-only log。一旦an entry has been accpted by the log,将永远都不可删除或改变。
    在这里插入图片描述
  • Verifiable Maps:为a map from a set of keys to a corresponding set of values。周期性地,该map会发布a signed tree head which includes a root hash of all 2 256 2^{256} 2256 entries。
    在这里插入图片描述
  • Verifiable Log-Backed Map:为a Verifiable Map backed by a Verifiable Log,用于描述an ordered set of operations that result in predictable mutations to the map。
    在这里插入图片描述

这三种数据结构的特性为:
在这里插入图片描述

3. trillian应用案例

具体可参见 trillian 应用案例

3.1 用于certificate transparency

2013年 Certificate Transparency (CT) rfc6962 备忘录 中提出了一种实验性的协议,用于公开记录现有的 Transport Layer Security (TLS) 证书,使得任何人都可审计证书颁发机构的活动,并通过审计证书日志及时发现可以证书,使得终端用户可拒绝未在日志中记录的证书,从而有效促进证书颁发机构将其所颁发的证书及时添加到日志中。

基于该备忘录, Certificate Transparency 愿景 中指出,主要用于检测发现恶意或错误颁发的证书,以构建an ecosystem that makes the issuance of website certificates transparent and verifiable。
主要参与企业有:

  • 苹果
  • 谷歌
  • Censys
  • Cloudflare
  • digicert
  • facebook
  • Let’s Encrypt
  • SECTIGO
  • sslmate

其对应的代码实现为:【go语言实现】
tls证书审计——certificate transparency代码库

3.2 Firmware Transparency机制 for 设备固件更新

相应代码实现demo见:

  • https://github.com/google/trillian-examples/tree/master/binary_transparency/firmware

设备固件无处不在,如:

  • 手机
  • 手表
  • 电视
  • 闹钟
  • 婴儿监视器
  • WiFi设备

对于任何台式机,人们熟知的有BIOS/UEFI类型的固件,但也有许多其他隐藏的固件blob运行在小型控制器上,这些控制器为管理引擎、键盘、网卡、硬盘/ssd等设备供电。

固件功能强大,通常会要求以最高权限运行,是设备安全的基石。
它也常常几乎完全看不见,难以理解,而且在许多情况下被证明是不安全和脆弱的。如 危险的外围设备:WINDOWS和LINUX计算机内部的隐患 中指出:WIFI适配器、USB集线器、轨迹板、笔记本电脑摄像头和网络接口卡中的未签名固件为恶意攻击者提供了多种途径,使其能够危害笔记本电脑和服务器。

如今,提供固件的一流供应商还提供了一个更新框架,在允许安装固件更新之前,该框架将验证固件更新的完整性和真实性。但是:

  • 即使在这种最好的情况下,我们如何知道签名的固件没有故障,甚至是恶意的?如果用于断言固件真实性的签名标识以某种方式用于签署意外更新(无论是通过与用于签署Stuxnet蠕虫的Realtek标识一样的彻底妥协,还是更微妙地通过某种形式的内部风险(无论是恶意的还是其他的)会怎么样?
  • 出版商自己怎么知道发生了这种事?如果他们已经被泄露,他们能信任他们的密钥保护或审计日志记录吗?
  • 更新的使用者如何知道他们得到的是与所有其他设备相同的更新,还是只为一小部分人特制的更新?

因此,需要引入一种Firmware Transparency机制,来保证所有的固件都是可discoverable的。即相同的published firmware list对发布者是可见的,对即将更新的设备也是可见的,对安全研究人员也是可见的。安全研究人员可使用最先进的静态分析和检测工具对其进行分析。

3.3 同步以太坊交易到Trillian log

相应demo见:

  • https://github.com/google/trillian-examples/tree/master/etherslurp

syncs a popular blockchain into a Trillian Log, and then replays the transactions contained in the blocks into a Trillian Map of SHA256(Account ID) -> Balance.

3.4 构建Trillian apps

详细demo见:

  • https://github.com/google/trillian-examples/tree/master/registers

This tutorial shows how to build a demo application using Trillian that creates a log, and from the log, creates a map, and then serves that map from a webserver.

3.5 具有审计功能的聊天服务Tritter

详细demo见:

  • https://github.com/google/trillian-examples/tree/master/tritter

a deployment which allows authenticated employees at your company to post to a public messaging platform (Tritter) under the company’s shared account. This platform doesn’t support multi-login, so you have created a proxy (TritBot) that takes requests from employees and posts these to Tritter.

TritBot logs each message request with the details of the sender in order to prevent abuse.

3.6 对Go SumDB的审计

详细demo见:

  • https://github.com/google/trillian-examples/tree/master/sumdbaudit

该demo中,包含了tools for verifiably creating a local copy of the Go SumDB into a local SQLite database:

  • cli/clone is a one-shot tool to clone the Log at its current size
  • cli/mirror is a service which continually clones the Log
  • cli/witness is an HTTP service that uses a local clone of the Log to provide checkpoint validation for other clients. This is a very lightweight way of providing some Gossip solution to detect split views.

参考资料

[1] 谷歌trillian github库
[2] trillian对应白皮书 Verifiable Data Structures
[3] trillian 应用案例
[4] Certificate Transparency (CT) rfc6962 备忘录
[5] Certificate Transparency 愿景
[6] tls证书审计——certificate transparency代码库

猜你喜欢

转载自blog.csdn.net/mutourend/article/details/113365448
今日推荐