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

Add Landlock support #174

Open
fira959 opened this issue May 14, 2024 · 4 comments
Open

Add Landlock support #174

fira959 opened this issue May 14, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@fira959
Copy link

fira959 commented May 14, 2024

One of the sandboxing features currently missing is landlock, which would allow for easy and comprehensive filesystem isolation.
In many usecases, a combination of seccomp and landlock would make good alternative to the use of namespaces.

@cblichmann cblichmann added the enhancement New feature or request label May 14, 2024
@valoq
Copy link

valoq commented Nov 18, 2024

@l0kod Would this be something you are willing to support? I keep coming back to this project as a good starting point for documentation resulting from this discussion and having landlock here would make for a much simpler approach to new projects.

@l0kod
Copy link

l0kod commented Nov 19, 2024

It would definitely make sense for Sandboxed API to leverage a sandboxing mechanism such as Landlock!

Relying on namespaces (#173) made sense when Sandboxed API started because Landlock didn't exist at that time, but I think it would be good now to provide a safer and more powerful alternative with Landlock.

I'm focusing the kernel development, the Rust library, and new user space tools for now, so I cannot devote more time to patch Sandboxed API, but I'll definitely review proposed changes.

@cblichmann
Copy link
Member

We are currently scoping our work for 2025 and this is a reasonable request. The PolicyBuilder could be extended with the filesystem parts of Landlock at least.

We'll update this bug, once we know more. Happy to discuss concrete design ideas before reviewing actual PRs :)

@l0kod
Copy link

l0kod commented Nov 20, 2024

We are currently scoping our work for 2025 and this is a reasonable request. The PolicyBuilder could be extended with the filesystem parts of Landlock at least.

Sounds good! I guess Sandboxed API and the Landlock Rust libraries use the same builder pattern, so this PolicyBuilder should be fine for all the sandbox configuration.

We'll update this bug, once we know more. Happy to discuss concrete design ideas before reviewing actual PRs :)

I think the main concept which may not be obvious is the default best-effort approach. Because Landlock is gaining new features with new kernel versions, and to protect users as much as possible with the available features, it would be good to make it easy to follow this approach. As a more specific approach for Sandboxed API, I think it would be good to also take into account the potentially already available kernel features (e.g. user namespaces).

One approach would be to first not directly expose Landlock-specific features through the API, but update the implementation to leverage them, especially if required-until-now features are not available (e.g. user namespaces) and Landlock could be used as a fallback. In a second step, because Landlock enables a more fine-grained access control, the Sandboxed API will need to be extended to leverage these extra features.

Following the principle of least privilege (on the long run), it would be nice for Sandboxed API to be usable without requiring user namespaces. That will exclude use cases that require a specific view of the filesystem, but just an access control should be enough for most sandboxing use cases. Anyway, all possible actions may not be controlled by Landlock yet, but we are working to make it possible. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants