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

Switch from libseccomp to seccompiler #26

Merged
merged 3 commits into from
Oct 21, 2023
Merged

Conversation

boustrophedon
Copy link
Owner

@boustrophedon boustrophedon commented Oct 18, 2023

Using seccompiler has three main advantages:

  • The entire codebase is in Rust
  • We get musl support for free
  • You don't need to have libseccomp installed on the target machine

The biggest disadvantage is that we lose support for various platforms
that libseccomp supports but seccompiler doesn't. However, since
seccompiler supports aarch64 and x86_64 and 99% of software that would
benefit from using seccomp runs on those platforms, I think it's a
worthwile tradeoff.

The other disadvantage is that seccompiler is not quite as mature as
libseccomp and doesn't support all the features libseccomp does. I'm not
currently using those features, several of which are aimed at container
runtimes, so I don't see an issue for now.

@boustrophedon
Copy link
Owner Author

@gotlougit @Kijewski Sorry for the random mention, would either of you like to test this branch with your own code before I merge into master?

@Kijewski
Copy link
Contributor

Kijewski commented Oct 18, 2023

That's great! I was expecting an "Operation not permitted" error for opening files, and I got it, so it works for me.

Using seccompiler has three main advantages:
- The entire codebase is in Rust
- We get musl support for free
- You don't need to have libseccomp installed on the target machine

The biggest disadvantage is that we lose support for various platforms
that libseccomp supports but seccompiler doesn't. However, since
seccompiler supports aarch64 and x86_64 and 99% of software that would
benefit from using seccomp runs on those platforms, I think it's a
worthwile tradeoff.

The other disadvantage is that seccompiler is not quite as mature as
libseccomp and doesn't support all the features libseccomp does. I'm not
currently using those features, several of which are aimed at container
runtimes, so I don't see an issue for now.
@boustrophedon
Copy link
Owner Author

@gotlougit by the way, I'm not sure if this solves your original problem but I ended up having to add pipes to the ForkAndExec ruleset to get subprocesses working on musl. I'm not sure if this was what you needed it for or not but I thought I'd let you know.

I'm going to merge this PR today and release 0.3 to crates.io

@boustrophedon boustrophedon merged commit 3eae12a into master Oct 21, 2023
10 checks passed
@boustrophedon boustrophedon deleted the use_seccompiler branch April 13, 2024 00:13
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.

None yet

2 participants