Skip to content
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

Use unveil(2) on OpenBSD #1194

Merged
merged 2 commits into from
Dec 12, 2024
Merged

Conversation

klemensn
Copy link
Contributor

After #1175 removed ioctl(2) fallback code shelling out to ifconfig(8), there is no code left (compiled on OpenBSD) that would fork(2) or execve(2).

Drop the ability to run any executable file to double down on this, thus reducing the attack surface of this this experimental, internet facing daemon running as root.

pledge(2) is doable, but needs more polish.
unveil(2), however, is as simple as it gets.

On other systems, this code is a NOOP, but can still help to implement similar safety belts.

@klemensn
Copy link
Contributor Author

Like #1193, this adds https://pkg.go.dev/suah.dev/protect to go.{mod,sum}, so iff either of the two PRs get merged, the other needs updating.

After yggdrasil-network#1175 removed ioctl(2) fallback code shelling out to ifconfig(8),
there is no code left (compiled on OpenBSD) that would fork(2) or execve(2).

Drop the ability to run any executable file to double down on this, thus
reducing the attack surface of this this experimental, internet facing
daemon running as root.

pledge(2) is doable, but needs more polish.
unveil(2), however, is as simple as it gets.

On other systems, this code is a NOOP, but can still help to implement
similar safety belts.
@klemensn
Copy link
Contributor Author

klemensn commented Nov 3, 2024

@neilalexander Thoughts?

I've been running this together with pledge and privilege drop to a dedicated user for weeks now without issues.

@neilalexander neilalexander merged commit 83ec58a into yggdrasil-network:develop Dec 12, 2024
20 checks passed
@klemensn klemensn deleted the unveil branch December 12, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants