Is your feature request related to a problem? Please describe.
Hello everyone! I've been using Firejail for a long time. I like it sandboxing features that use namespaces, seccomp and AppArmor policies. However, as far as I understand, Firejail doesn't construct a file hierarchy for a mount namespace -- it uses the host FS instead, remounting protected directories with tmpfs or empty/inaccessible directories. It also has limited support for AppArmor, because it can only transition to a pre-defined profile.
Describe the solution you'd like
I propose adding Landlock support to enhance security of the sandbox. Landlock is a Linux security module that implements file access self-restriction in the way that seccomp implements syscall access self-restriction. It can be used to restrict access to sensitive paths. I'm thinking of implementing it for Firejail, however, currently I don't know how to do it better in order not to interfere with normal operation.
Describe alternatives you've considered
One of the alternatives is to reconstruct the filesystem hierarchy in the new namespace "from scratch" -- however, that would require serious changes in Firejail source code that would need to be thoroughly tested. Another alternative is to use AppArmor -- however, loading AppArmor requires superuser privileges, and it can lead to vulnerabilities.
Additional context
I've created an experimental patch for Bubblewrap that implements Landlock self-restriction in order to enhance sandbox security.
Is your feature request related to a problem? Please describe.
Hello everyone! I've been using Firejail for a long time. I like it sandboxing features that use namespaces, seccomp and AppArmor policies. However, as far as I understand, Firejail doesn't construct a file hierarchy for a mount namespace -- it uses the host FS instead, remounting protected directories with tmpfs or empty/inaccessible directories. It also has limited support for AppArmor, because it can only transition to a pre-defined profile.
Describe the solution you'd like
I propose adding Landlock support to enhance security of the sandbox. Landlock is a Linux security module that implements file access self-restriction in the way that seccomp implements syscall access self-restriction. It can be used to restrict access to sensitive paths. I'm thinking of implementing it for Firejail, however, currently I don't know how to do it better in order not to interfere with normal operation.
Describe alternatives you've considered
One of the alternatives is to reconstruct the filesystem hierarchy in the new namespace "from scratch" -- however, that would require serious changes in Firejail source code that would need to be thoroughly tested. Another alternative is to use AppArmor -- however, loading AppArmor requires superuser privileges, and it can lead to vulnerabilities.
Additional context
I've created an experimental patch for Bubblewrap that implements Landlock self-restriction in order to enhance sandbox security.