如何在 Debian 中設定 SELinux 沙箱?

如何在 Debian 中設定 SELinux 沙箱?

我在 Debian sid 中​​安裝了 SELinux,以便使用將應用程式鎖定到受限環境的沙箱,但我無法讓它工作。如果我嘗試在寬鬆模式下使用沙箱命令而不使用任何選項,例如sandbox nano,我會收到以下錯誤:

/usr/bin/sandbox: [Errno 22] Invalid argument

如果我嘗試使用臨時主目錄和臨時目錄的選項來運行它,無論是否帶有 -X 選項,都會彈出另一個錯誤訊息:

Could not set exec context to unconfined_u:unconfined_r:sandbox_x_t:s0:c236,c539.
Failed to remove directory /tmp/.sandbox-root-vfZJIt: No such file or directory

我嘗試在強制模式下使用沙箱應用程序,但它抱怨缺少類型強制規則。但我不認為這是問題所在。有誰知道如何解決這個問題?

答案1

不幸的是,Debian 中的 SELinux 支援還遠未完成,存在一些重大差距。看來此特定功能所需的策略模組不可用:

wouter@gangtai:~$ apt-cache show policycoreutils-sandbox
Package: policycoreutils-sandbox
Source: policycoreutils
Version: 2.4-4

[...]

Description-en: SELinux core policy utilities (graphical sandboxes)

[...]

 This package requires an additional custom policy that is not present in
 Debian.

你必須在其他地方找到它。

相關內容