Created
July 10, 2025 10:30
-
-
Save benridane/a26f714a7ca4c91510c28e63106f718c to your computer and use it in GitHub Desktop.
LandLockでClaude CLI をサンドボックス環境で実行
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 0. Rust がない場合はインストール(必要に応じてコメントアウトを外す) | |
# curl https://sh.rustup.rs -sSf | sh | |
# 1. rust-landlock をクローン&ビルド | |
git clone https://github.com/landlock-lsm/rust-landlock && \ | |
cd rust-landlock && cargo build --examples | |
# 2. エイリアス設定:Claude CLI をサンドボックス環境で実行 | |
echo 'alias cs="echo -e \"\033[1;33m🔒 Entering SANDBOX...\033[0m\" && \ | |
LL_FS_RO=/bin:/lib:/usr:/proc:/etc:/dev:/snap/bin:/opt:/var/lib:/run:\ | |
\$HOME/.nvm:\$HOME/.bashrc:\$HOME/.profile:/etc/resolv.conf:/etc/hosts:\ | |
/etc/ssl:/etc/ca-certificates \ | |
LL_FS_RW=/dev/null:/dev/pts:/tmp:\$PWD:\$HOME/.claude:\ | |
\$HOME/.claude.json:\$HOME/.config:\$HOME/.cache:\$HOME/.local \ | |
~/rust-landlock/target/debug/examples/sandboxer bash -i"' \ | |
>> ~/.bashrc | |
# 3. "cs" コマンドでサンドボックス環境を起動し、Claude を実行 | |
source ~/.bashrc && cs && claude |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment