Landlock: What Is It?

Landlock is a Linux API that lets applications explicitly declare which resources they are allowed to access. Its philosophy is similar to OpenBSD’s unveil() and (less so) pledge(): programs can make a contract with the kernel stating, “I only need these files or resources — deny me everything else if I’m compromised.”

It provides a simple, developer-friendly way to add defense-in-depth to applications. Compared to traditional Linux security mechanisms, Landlock is vastly easier to understand and integrate.

This post is meant to be an accessible introduction, and hopefully persuade you to give Landlock a try.

  • JakenVeina@midwest.social
    link
    fedilink
    arrow-up
    13
    ·
    14 hours ago

    So, it’s a way for applications to make themselves more hardened against exploitation? Was really confused on first reading the title, but that makes some sense. Applications declare what permissions they need, up-front, so any exploits during normal operation can only operate under that umbrella. Unless the startup processes of the application itself are exploited.

    • The_Decryptor@aussie.zone
      link
      fedilink
      English
      arrow-up
      2
      ·
      8 hours ago

      Landrun as well, takes the restrictions on the command line. Can look messy, but does make it entirely standalone, so you can e.g. drop it into a service file as the readme shows easily enough.

  • sga@piefed.social
    link
    fedilink
    English
    arrow-up
    5
    ·
    14 hours ago

    A nice article. I need to read more about it, but I will likely use it. My guess on the performance is that there is not going to be any major performance drawback, but since it is runtime, I can not say for sure.

  • rycee@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    13 hours ago

    I didn’t know about this API and it seems really cool. Will definitely try it out.