phylum-dev/birdcage

GitHub: phylum-dev/birdcage

Birdcage 是一个基于 Rust 的跨平台可嵌入沙箱库,利用操作系统原生机制限制应用程序的文件系统和网络访问。

Stars: 219 | Forks: 11

# Birdcage
[![GitHub](https://img.shields.io/github/license/phylum-dev/birdcage)][license] [![GitHub issues](https://img.shields.io/github/issues/phylum-dev/birdcage)][issues] [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)][CoC] [![Crate](https://img.shields.io/crates/v/birdcage)](https://crates.io/crates/birdcage) [![Documentation](https://docs.rs/birdcage/badge.svg)](https://docs.rs/birdcage) [![Birdcage logo](https://static.pigsec.cn/wp-content/uploads/repos/cas/64/642424b4941c3dae93b9ce50fd4ff0bb2dd621cc823646d5264a31242efae7fa.png)][protection]
## 关于 Birdcage 是一个跨平台的可嵌入沙箱库,允许使用操作系统的原生 API 对文件系统和网络操作进行限制。 Birdcage 最初是为 [Phylum CLI] 开发的,作为防范潜在恶意依赖项的额外[保护层][protection](详情请参阅[博客文章][blog post])。为了更好地保护您免受这些安全风险的威胁,请[立即注册][sign up now]! Birdcage **仅**专注于文件系统和网络操作。它**不是**一个能够阻止所有副作用或永久性损坏的完整沙箱。应用程序仍然可以执行大多数系统调用,当以 root 身份执行时,这尤为危险。Birdcage 应该与其他安全机制结合使用,尤其是在您执行已知恶意代码的情况下。 ## 示例 关于如何使用 Birdcage API 的示例可以在 `./examples/sandbox` 中找到,该示例会运行一个应用了可通过 CLI 配置的限制的应用程序。 在没有任何例外的情况下尝试运行会产生错误: ``` $ cargo run --example sandbox -- echo "Hello, Sandbox\!" Error: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } ``` 使用显式权限运行相同的命令则允许执行: ``` $ cargo run --example sandbox -- -e /usr/bin/echo -e /usr/lib echo "Hello, Sandbox\!" Hello, Sandbox! ``` 查看 `cargo run --example sandbox -- --help` 以获取有关如何使用该示例的更多信息。 ## 支持的平台 - Linux 通过 [namespaces] - macOS 通过 `sandbox_init()`(又名 Seatbelt)
标签:Rust, Streamlit, 可视化界面, 安全机制, 沙箱, 系统底层, 网络流量审计, 访问控制, 通知系统