Add a 'deny-write' option - #51
Conversation
In my applicaiton, I want to run commands without granting write access to the working directory, which there didn't seem to be an option to make that work. I thought about doing a `--dont-auto-allow-cwd` or something like that, but I think `--deny-write` is more generally applicable, as it also works for when you want to exclude writes to a subset of an explicitly allowed file tree.
|
Hi @jaredly, thanks a lot for this PR! 🙏 That said, there is one critical issue we need to fix before merging, plus a few smaller gaps. 1. Rule ordering makes the deny ineffective (blocking)Seatbelt uses last-match-wins semantics: a later
So for both use cases described in the PR:
The only paths where the deny currently "works" are ones that were never write-allowed anyway (the sandbox is deny-by-default), so as written the feature is effectively a no-op. This is exactly the invariant encoded in Fix: move the 2. Tests (blocking)The project follows TDD, and
3.
|
|
@Pierozi thanks for the review! I've made the requested changes |
In my applicaiton, I want to run commands without granting write access to the working directory, which there didn't seem to be an option to make that work. I thought about doing a
--dont-auto-allow-cwdor something like that, but I think--deny-writeis more generally applicable, as it also works for when you want to exclude writes to a subset of an explicitly allowed file tree.