Bytecode Alliance, WebAssembly ecology will improve network security

Recently, Mozilla, Fastly, Intel and Red Hat announced the establishment of a joint organization  Bytecode Alliance (bytecode Union) , the alliance aims through collaborative implementation of standards and proposed new standards to improve the ecological WebAssembly outside the browser.

WebAssembly also called Wasm, it is stack-based virtual machine designed for binary instruction format, Wasm as a portable target, used to compile high-level languages ​​(such as C / C ++ / Rust), which can deploy client and server applications on the Web .

WebAssembly describes a type of memory sandbox execution environment of safety, the environment can be achieved even within the existing JavaScript virtual machine. When embedded in a Web when, WebAssembly browser will enforce security policies and permissions homology.

The current 1.0 version of Wasm has support Chrome, Firefox, Safari and Edge browser.

Why the four companies formed Bytecode Alliance do? Mozilla blog on the official website of  Lin Clark  introduced.

Lin said that the current network users living in increasing risk, we are currently in the construction of large-scale modular applications, of which 80% of the code base from the package registry, for example npm, PyPI and crates.io. Of course, in such a way so that ecological prosperity, but security issues are also speed increase.

Undermine the security of these people is the use of the trust of users, when users use the application, they do not know behind these software dependencies, among them there is no malicious code users simply do not know, could not clear whether trusted.

所以联盟想通过 WebAssembly 技术来推动这一个领域的安全性。Bytecode Alliance 将建立起可靠安全的基础,无论在云中、本地桌面,还是小型 IoT 设备上,都可以安全地使用不受信任的代码。开发人员可以以相同的方式使用开源代码,而不会给用户带来风险,而这些通用的可重用基础集可以单独使用,也可以嵌入其它库和应用中。

 

 具体来说,所有这些因为依赖项而产生的安全问题都是因为不同软件/模块/文件有权限访问到其它内容,而基于 WebAssembly 可以提供某种隔离,这样就可以安全地运行不受信任的代码。

可以设计一个类似于 Unix 的小型进程或容器和微服务的架构,但是这种隔离十分轻量,它们之间的通信也不会比常规函数调用慢很多。

使用这样的模式,可以封装单个 WebAssembly 模块实例,或者封装一小部分想要在它们之间共享内存之类的模块实例。同时也不必放弃强大的编程语言特性,例如函数签名和静态类型检查。

Lin 介绍了目前 WebAssembly 的一些技术方案,包括几个要点:

  • 每个 WebAssembly 模块默认都被沙箱化,默认情况下,模块无权访问 API 和系统调用。
  • 内存模型,与直接编译为 x86 之类的普通二进制文件不同,WebAssembly 模块在其进程中无法访问所有内存,而是只能访问已分配给它的内存块。

  • 接口类型,模块可以使用更复杂的值进行通信,比如 strings、sequences、records、variants,以及它们的嵌套组合。这使得两个模块可以轻松地交换数据,并且这种方式安全且快速。

  • 具有权限概念的 API 和系统调用,以便它们可以为不同的模块赋予对不同资源的不同权限,也就是 WASI,WebAssembly 系统接口。它提供了一种方法,可以将不同的模块彼此隔离,并赋予它们对文件系统特定部分和其它资源的细粒度权限,以及对不同系统调用的细粒度权限。

这些是目前已经存在于 WebAssembly 技术中的技术,但目前还没有办法将这些安全控制向下传递给依赖树,这需要一种让父模块有赋予其依赖关系同样的安全控制的方法。

这也就是 Bytecode Alliance 目前在进行的工作,计划采用各个模块虚拟化的细粒度形式,研究人员已经在研究环境中验证了这一想法,目前正在努力将其引入 WebAssembly。

详细技术细节查看原博客:

https://hacks.mozilla.org/2019/11/announcing-the-bytecode-alliance

Guess you like

Origin www.oschina.net/news/111316/announcing-the-bytecode-alliance