Hacker GitHub

← All repos

landlock-lsm/go-landlock

View on GitHub ↗ ★ 369 Go

A Go library for the Linux Landlock sandboxing feature

12 mentions on Hacker News by 8 people: 1 story, 11 comments · first 2022-03-27 · latest 2025-11-30

Mentions per year 12 mentions · busiest year 2025 (11)
20082026
  1. …to protect the system from bad inputs or compromised dependencies, and it's very easy to use (see https://github.com/landlock-lsm/go-landlock ). As an app developer it's so easy to add landlock to your app. Another benefit is that it makes…
    comment by myaccountonhn · 2025-11-30 · in Landlock-Ing Linux
  2. …it's the former, why the weird formatting etc instead of linking to one of the official examples at https://github.com/landlock-lsm/go-landlock/blob/main/exampl... ?
    comment by Cthulhu_ · 2025-11-29 · in Landlock-Ing Linux
  3. …like rather than downloading stuff from Github. Here's another example in Go: package main import ( "fmt" "github.com/landlock-lsm/go-landlock/landlock" "log" "os" "os/exec" ) func main() { // Define the LandLock policy err :=…
    comment by seethishat · 2025-11-29 · in Landlock-Ing Linux
  4. …to limit where the programs may read/write. Here's a simple Go example: package main import ( "flag" "fmt" "github.com/landlock-lsm/go-landlock/landlock" "io/ioutil" "log" "os" ) // simple program that demonstrates how landlock works in Go…
    comment by seethishat · 2025-11-29 · in Landlock-Ing Linux
  5. It's tracked in https://github.com/landlock-lsm/go-landlock/issues/35 - signals and abstract Unix sockets do unfortunately not interact well with the inherently multithreaded Go runtime. We are working on a fix in…
  6. …with the right supporting library it becomes tolerable. See the example at the top of the Readme at https://github.com/landlock-lsm/go-landlock (Full disclosure, I am the author of that library) FWIW, I do hope that we can motivate people…
  7. (Author of that library here) It is a library, as already linked in the other comment: https://github.com/landlock-lsm/go-landlock The landrun tool is built on the same library. We also provide an official library for Rust, and obviously…
  8. …that re-use file format could a good option. BTW the used landlock go library has sort of example https://github.com/landlock-lsm/go-landlock/blob/main/exampl...
  9. The underlying library that does most of the work is MIT. https://github.com/landlock-lsm/go-landlock
  10. https://pkg.go.dev/github.com/landlock-lsm/go-landlock/landl...
  11. …, and it's easy to play around with it with the landlock-restrict example tool: $ go install github.com/landlock-lsm/go-landlock/cmd/landlock-restrict@latest $ mkdir /tmp/lolcat $ HOME=/tmp/lolcat landlock-restrict -ro /usr /lib /etc -rw…