4 ms·
Hi smhenderson! The process so far has basically been some variant of this: 1. Describe the program to myself, and write out the promises/paths I think it wil
by akling 7y ago
Hi smhenderson!
The process so far has basically been some variant of this:
1. Describe the program to myself, and write out the promises/paths I think it will need.
2. Try it out and hit a failure 90% of the time.
3. Add the promises/paths I didn't think of.
4. Stare at it a bit.
5. Reorganize the code so I can drop more promises/paths and end up with a smaller final set.
It's obviously a lot easier if you're intimately familiar with the programs you're pledging.
pledge() needs are a bit easier to discover, since you can tell immediately when one is missing.
unveil() needs can be trickier, since many programs handle failure to open a file and try to carry on anyway. So it takes more effort and attention to understanding file system needs.
I'm still figuring this out as I go obviously. I've also gotten some good tips from brynet@ and jcs@ of OpenBSD along the way :)
- smhenderson 7y agoHi Andreas, thanks! Sounds both fun and infuriating at the same time, like a lot of low level programming I guess! :-) Thanks for the feedback, I am now looking forward to my first arrival at step 4 which is probably where I'll end up spending the bulk of my time. I appreciate the work you're doing, looks very intense and rewarding!
- yjftsjthsd-h 7y ago> unveil() needs can be trickier, since many programs handle failure to open a file and try to carry on anyway. Is it possible to run strace and note failed file opens? There'll be some nice, but you could pretty easily compare against files that do actually exist and use that to make rules almost automatically, I would think?