Go MIT

go-landlock

A Go library for the Linux Landlock sandboxing feature

L

landlock-lsm

Dernière activité 28 sept. 2026
landlock-lsm/go-landlock

360

étoiles

20

forks

7

issues ouvertes

landlocklinuxsandboxingsecurity

Ce README est souvent en anglais.

Go Landlock library

📚 Godoc | 🌍 landlock.io

Go-Landlock is a Go library for the Landlock LSM, an unprivileged sandboxing mechanism on Linux.

What is Landlock?

Landlock is a Linux kernel feature and can restrict the following types of access:

  • Filesystem access
  • Some network operations
  • Some IPC operations

More details and examples in the Go-Landlock documentation and the Linux Userspace API documentation for Landlock. The Landlock LSM was introduced with Linux 5.13 and is today enabled on most major Linux distributions.

TL;DR: Example

In a Go program, after starting up and doing program initialization work, run:

err := landlock.V10.BestEffort().RestrictPaths(
    landlock.RODirs("/usr", "/bin"),
    landlock.RWDirs("/tmp"),
)

After this invocation, your program can only access the specified paths.

Goals

Goals of Go-Landlock are:

  • Make unprivileged sandboxing easy to use and effective.
  • Keep Go-Landlock's implementation at an easily auditable size.

How to...

Projets similaires

A Rust library for the Linux Landlock sandboxing feature

Rustlandlocklinuxsandboxing
Llandlock-lsm
314 étoiles26

Run any Linux process in a secure, unprivileged sandbox using Landlock. Think firejail, but lightweight, user-friendly, and baked into the kernel.

Gocligolangkernel
ZZouuup
2,3 k étoiles54

Software sandbox for storage of sensitive information in memory.

Gocryptocryptographygo
Aawnumar
2,8 k étoiles136