Safeguard
Developer Tools•

What is Landlock, and how is it different from seccomp?

Landlock lets an unprivileged process restrict its own file and network access. Seccomp filters system calls instead. See how they differ and combine.

Safeguard Security Team
4 min read

Landlock is a Linux security feature that lets any process, including an unprivileged one, restrict its own access to parts of the filesystem and to certain network ports. Seccomp instead filters which system calls a process may make. Landlock limits what a process can touch, and seccomp limits what it can ask the kernel to do.

What the kernel documentation says

The Linux kernel's Landlock documentation states its goal as restricting ambient rights, such as global filesystem or network access, for a set of processes. It is a stackable Linux security module, so it adds a layer on top of the system wide access controls already in place. The aim is to mitigate the impact of bugs or malicious behavior in user space applications.

Two points make it useful for developer tools. First, a process needs no special privilege to apply it to itself. Second, restrictions apply to the thread that enforces them and to its future children, so a launcher can restrict itself and then start the risky program.

How rules work

A rule describes an action on an object. Rules are collected into a ruleset, which then restricts the enforcing thread. The documentation lists two rule types:

  • Filesystem rules, where the object is a file hierarchy and the actions are filesystem access rights such as reading files or writing files.
  • Network rules, where the object is a TCP or UDP port. The page says TCP rules arrived with ABI version 4 and UDP rules with version 10.

The ruleset must declare every kind of access it handles, and anything handled but not explicitly allowed is denied. This is done for compatibility between kernel and user space versions. The documentation recommends a best effort approach: detect the Landlock ABI version at run time and use only the rights the kernel supports.

You can check whether Landlock is active by looking for the message that it is up and running in kernel logs. Support depends on how the kernel was configured.

Landlock and seccomp compared

QuestionSeccompLandlock
What does it restrict?Which system calls can be madeAccess to file hierarchies and network ports
Unit of policyA filter over call numbers and argumentsA ruleset of allowed paths and ports
Needs privilege to apply?Needs no new privileges set, or an admin capabilityUnprivileged processes can apply it to themselves
Typical useRemove dangerous calls from reachConfine a program to the folders and ports it needs

The seccomp column follows the seccomp manual page, which requires either the admin capability or the no new privileges bit before a filter is installed.

Using them together

They guard different surfaces. Seccomp can remove system calls a tool never needs. Landlock can confine the same tool to its working folder and block network access it does not use. Neither is a complete sandbox on its own. The gVisor documentation points out that these kernel primitives still leave the workload talking to one shared kernel and need careful per workload configuration.

For developer tooling, a reasonable pattern is: set no new privileges, apply a Landlock ruleset limited to the project folder, apply a seccomp filter, and run as a non root user. For where a stricter boundary belongs, see which sandbox fits which code.

Safeguard does not enforce Landlock rules. It scans dependencies and images and can enforce policy gates, with a free scan at gold.safeguard.sh/scan.

Quick check

Does Landlock need root?

No. The documentation says it lets any process, including unprivileged ones, restrict itself.

Can Landlock replace seccomp?

They cover different things. Landlock controls access to files and ports, while seccomp controls system calls, so they are complements.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.