-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
harden daemon on OpenBSD #1815
harden daemon on OpenBSD #1815
Conversation
Restrict the available set of system calls to the daemon to the basic network and filesystem operations on OpenBSD. Further reduce potential harm by limiting file system access to the btcd data dir and the rpc files.
Love the idea of taking advantage of pledge! Looks like the tests are failing in the GH actions though (which run on linux). |
Pull Request Test Coverage Report for Build 2140366923
💛 - Coveralls |
This is fixed now. Whether or not we would like to pledge tools like btcctl is something we can decide later and IMHO not as important as seat belting the daemon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great.
OK
@timkuijsten totally agree that daemon is the most important target for pledge. Other tools are less vital but all else being equal, the more things that use pledge, the better. |
I've created a patch to harden the daemon on OpenBSD by using pledge(2) and unveil(2). This way the program gets killed if any syscall is called other than the basic networking or file system ones, preventing further exploitation of a system once a program is compromised. Furthermore, the view of the file system is restricted to only access the files and directories the daemon needs.