From 6ba7dc8a410a19454d3f96854e9719884c4021a2 Mon Sep 17 00:00:00 2001 From: guochao Date: Thu, 2 Nov 2023 10:05:34 +0800 Subject: [PATCH] update readme --- README.md | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0266363..4a69269 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,6 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh cargo build ``` -### Run - -``` -cargo run -``` ### Generate syscalls with strace @@ -33,13 +28,21 @@ strace -f --output x2t-syscalls.txt /path/to/x2t some.xml cargo 开启 tracing-mode 后,宏找不到环境变量和文件不会失败,可以直接生成一个。 ``` -RUST_LOG=trace cargo run --features tracing-mode -- -l x2t-syscalls.txt /path/to/x2t some.xml +cargo build --features tracing-mode +RUST_LOG=trace ./target/debug/x2t-sandbox -- -l x2t-syscalls.txt /path/to/x2t some.xml cat x2t-syscalls.txt | sort | uniq | sponge x2t-syscalls.txt cargo build ``` 更新 syscall 列表后重新构建二进制会生成新的 sandbox。 + +### Run + +``` +./target/debug/x2t-sandbox /path/to/x2t some.xml +``` + ## 项目结构 - [项目](/) @@ -51,12 +54,6 @@ cargo build - .envrc: 如果不适用nix,注释掉,或者 direnv block 一下不加载就行 - .gitignore -## TODOs - -- 看看怎么样对特定的 syscall 限制参数,尤其是 - - execve - - prctl - ## 比较相近的项目 - [cloudflare/sandbox](https://github.com/cloudflare/sandbox): cloudflare/sandbox 在运行时配置规则,我们是在构建时配置规则