fix(policy): move .claude.lock to allow_file for least-privilege access - #733
Conversation
Use file-level allow instead of directory-level allow for .claude.lock. Signed-off-by: Christine Le <christine.le@datadoghq.com>
There was a problem hiding this comment.
Code Review
This pull request updates the policy configuration by moving the $HOME/.claude.lock entry from the directory-based allow list to the allow_file list. While this change correctly applies least-privilege principles for a single file, feedback indicates it will cause a failure in the test_embedded_claude_code_profile_uses_platform_groups_for_os_paths unit test, which must be updated to reflect the new configuration.
The preceding commit moved .claude.lock to allow_file for the claude-code profile but left existing tests asserting against .filesystem.allow, and the claude-no-kc profile still had .claude.lock under the directory-level allow list. Update the tests to assert against allow_file and move .claude.lock in claude-no-kc for consistency. Signed-off-by: James Carnegie <me@kipz.org>
Addresses a security advisory flagged by cargo-audit. Signed-off-by: James Carnegie <me@kipz.org>
|
Hi... I was able to solve my Claude Code (CLI) lock problems without any code change in nono. On macOS I was running into problems with files that needed to be recreated, because Seatbelt doesn't play nice with that. And I don't want CC to have direct access to $HOME. I can't find anything that supports the idea that Claude needs to write a export CLAUDE_CONFIG_DIR=${HOME}/.local/claude
nono ... --allow "${CLAUDE_CONFIG_DIR}" --allow "${XDG_STATE_HOME:-${HOME}/.local/state}/claude"This was after a session asking Claude which directories/files I need to allow to sandbox it externally: Claude ResponseThere are actually two different lock-related paths in Claude Code, and it matters which one you're asking about for sandboxing purposes. 1. The installer/auto-update lock —
|
|
@nf-matt is this something we should look at codifying into nono? |
That's a good question. One of my autonomy blockers was Claude Code CLI auth within nono. I've tuned in to all the PRs surrounding It makes me wonder if most of those PRs were of little to no effect, or are maybe obsolete. I did see that some of what Claude Code writes has changed over time, so it's possible we no longer need some of the CC-specific code that's been merged. This could be a possible code simplification opportunity within nono. It's a shame Anthropic doesn't fully adopt the XDG mindset, because they do use it for To directly answer your question, I think a setup guide would help (and I can draft one if you like). And we could potentially add a runtime message if someone uses the claude-code profile but doesn't have I'll play with a branch locally, removing most of the PRs, and see if I'm still able to work with CC. |
Use file-level allow instead of directory-level allow for .claude.lock.