Firefox 在 GNU/Linux 上的安全功能警告

修订信息
  • 修订编号: 294309
  • 创建于:
  • 创建者: wxie
  • 备注: 初次翻译。
  • 已审阅:
  • 已审阅:
  • 审核人: bingchuanjuzi
  • 已核准?
  • 是否为最新修订?
  • 可进行本地化:
修订原文
修订内容

GNU/Linux 安装 Firefox 时,您可能会看到一条警告:“某些 Firefox 的安全功能在您当前的操作系统上可能提供较少的保护”。

Firefox 的沙箱在创建新进程时使用了非特权用户命名空间,以增强安全性。这可能被视为一种安全风险,因此一些 GNU/Linux 发行版开始限制其使用,并仅允许在存在 AppArmor 配置文件的情况下使用。

这些配置文件只能覆盖有限的安装路径,包括 Snap 和 Debian 包。然而,它们无法覆盖某些其他用例,例如 tarball 安装以及本地开发构建。

要为 Firefox 创建 AppArmor 配置文件:

/etc/apparmor.d/ 目录中,创建一个名为 firefox-local 的文件。

在文件中添加以下内容:
# This profile allows everything and only exists to give the

# application a name instead of having the label "unconfined"
abi <abi/4.0>,
include <tunables/global>
profile firefox-local
/home/<USER>/bin/firefox/{firefox,firefox-bin,updater}
flags=(unconfined) {
	userns,
	# Site-specific additions and overrides. See local/README for details.
	include if exists <local/firefox>
}

<USER> 替换为您的 GNU/Linux 用户名。这里假设 Firefox 安装在 $HOME/bin/ 目录下。

保存文件后,在 GNU/Linux 终端中运行 sudo systemctl restart apparmor.service