Landlock
open-sourceThe section your link pointed to isn't on Landlock's page any more, so we've brought you to the top.
Landlock is a Linux kernel security module that enables unprivileged users to create sandboxes restricting filesystem and network access.
if (abi > 10) {
// LANDLOCK_RESTRICT_SELF_NO_NEW_PRIVS sets no_new_privs only on success
if (landlock_restrict_self(ruleset_fd, LANDLOCK_RESTRICT_SELF_NO_NEW_PRIVS) != 0)
err(1, "landlock_restrict_self");
} else {
// ABI < 11: must set no_new_privs manually first
if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) != 0)
err(1, "prctl");
if (landlock_restrict_self(ruleset_fd, 0) != 0)
err(1, "landlock_restrict_self");
}
/* ABI >= 11: tie no_new_privs to successful enforcement */
int ret = landlock_restrict_self(ruleset_fd, LANDLOCK_RESTRICT_SELF_NO_NEW_PRIVS);
if (ret) {
perror("landlock_restrict_self");
exit(EXIT_FAILURE);
}
/* no_new_privs is now set; no separate prctl(PR_SET_NO_NEW_PRIVS, ...) needed */
if (abi < 11) {
/* Removes no new privs flag for ABI < 11 */
if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0))
exit(EXIT_FAILURE);
if (landlock_restrict_self(ruleset_fd, 0))
exit(EXIT_FAILURE);
} else {
if (landlock_restrict_self(ruleset_fd, LANDLOCK_RESTRICT_SELF_NO_NEW_PRIVS))
exit(EXIT_FAILURE);
}
Summary
Landlock is an open-source library that enables restriction of ambient rights like global filesystem or network access for processes. Since it is open-source, there is no licensing cost. It operates as a stackable LSM, making it implementable as a new security layer alongside existing system controls. It is aimed at platform engineers who want to contain applications, and its documentation positions it alongside other LSMs. The project has seen 15 releases in the window we track, with the last release occurring 470 days ago.
Landlock is a Linux kernel security module that enables unprivileged users to create sandboxes restricting filesystem and network access.
How Landlock helps
Which files and directories can a process actually reach once it starts making requests it was never meant to make?
checks each open, read, write or execute attempt against the rule set the process enforced on itself, and denies anything outside the allowed file hierarchy, regardless of what the process's own code tries to do
Which network ports can an application reach out to or listen on after it has been compromised?
matches each connect or bind attempt against the TCP and UDP port rights named in the ruleset, and blocks any port not explicitly allowed
Can a compromised process escalate beyond the restrictions its parent set for it?
ties enforcement to the thread and every process it spawns afterward, so children inherit the same denials and cannot widen them
Did a process actually adopt the restrictions I intended, or is it still running with full ambient access?
confirms enforcement through kernel logs and a system call a process can query directly, so the absence of that confirmation means no restriction is in effect
Do I need root or special privileges to contain a risky application on this host?
lets the process apply the ruleset to itself, provided it has cleared the flag that blocks privilege gain, so containment does not depend on elevated rights
Will restricting an application break it in ways I have not accounted for?
requires every category of filesystem or network action to be explicitly listed as handled, so anything left out is denied by default rather than silently allowed
Languages
Release-note detail over time
See how much detail Landlock puts in its release notes, quarter by quarter, and compare it with tracked tools in the same category. This history uses up to ten retained, reviewed notes per tool; sparse or blank older quarters may reflect that limit.
Checking release-note history…
Releases
2 entries
No entries match these filters.
- September 20262
Add the badge to your README
Maintain this project? The badge links readers straight to this page, so they can follow every release here.