Landlock for sandboxing containers
Gerhard de Clercq <[email protected]> Thu, 15 Jan 2026 21:39:49 +0000
| Newsgroups | dev.linux.lists.landlock |
|---|---|
| Message-ID | <MM0P280MB0897D3124F7B068D6DAF459CB88CA@MM0P280MB0897.SWEP280.PROD.OUTLOOK.COM> |
Good day,=0A= =0A= I am investigating the feasibility of integrating Landlock into a container= sandboxing utility that I am developing (https://github.com/Gerharddc/litt= erbox). Essentially Litterbox just makes it easier to setup sandboxed conta= iners for use as reproducible development environments. The idea here is to= shield a host system from anything malicious that might show up inside a d= evelopment environment.=0A= =0A= Since Litterbox is built on Podman, my original plan was to use it's built-= in support for SELinux policies in conjunction with Udica for policy genera= tion. However, since learning about Landlock, it seems that it would be muc= h easier to integrate and also more cross-platform (given that SELinux supp= ort is rare amongst distros). =A0=0A= =0A= After reading https://landlock.io/talks/2024-06-06_landlock-article.pdf, La= ndlock seems very well suited for this purpose. The only thing I am still s= truggling to wrap my head around is how Landlock integrates with mount name= spaces and the implication of that for containers. If I understand correctl= y, it is currently not possible to enter a mount namespace after entering a= sandbox. Hence, I would somehow enter the sandbox only after entering the = container. Is this understanding correct? If so, I suspect I would need to = extend Podman itself to do so properly since relying on code inside the con= tainer to enter the sandbox on startup seems like something that could easi= ly be attacked.=0A= =0A= Any additional thoughts or suggestions on this endeavour would be greatly a= ppreciated!=0A= =0A= Kind regards,=0A= Gerhard de Clercq=