SYD-LOCK(1)
π SYD-LOCK(1) π
okay bestie, this is the SYD-LOCK(1) page from the General Commands Manual. Weβre talking syd-lock, weβre talking landlock(7), and weβre keeping every flag, path, port, default, and warning exactly as written. No cap. π
πΈ NAME πΈ
syd-lock β run a program under landlock(7).
πΈ SYNOPSIS πΈ
bestie, the shape is literally this:
syd-lock [-bchrvwASUV] [-C level] [-E errata] [-F flag]... [-l
category[,category...]{+|-}path|port[-port][,port[-port]...]]...
{command [args...]}
π¦ DESCRIPTION π¦
okay so syd-lock runs a program under landlock(7). The program gets confined by the landlock(7) categories you hand it. The supported categories are read, write, exec, ioctl, create, delete, rename, symlink, truncate, readdir, mkdir, rmdir, mkbdev, mkcdev, mkfifo, bind, and connect.
Categories other than bind and connect must specify paths to be confined. Both absolute and relative paths are permitted. Path must not contain magic symbolic links or parent (..) components. Path is permitted to contain regular symbolic links. These regular symbolic symlinks are permitted to resolve to targets with parent (..) components in them.
bind and connect are the network categories: they must specify a network port, a closed port range separated by dash, or a comma-separated list of ports and ranges. Zero is a valid port number to confine binds and connects to ephemeral ports. The bind category also supports absolute UNIX domain socket paths to confine their creation via mknod(2).
For full details and the specific behavior of each landlock(7) category, refer to the Sandboxing and Lock Sandboxing sections of the syd(7) manual page. π
π OPTIONS π
full flag buffet, no skipping, no merging, no invented options. β¨
-hβ Display help.-vβ Be verbose. Printlandlock(7)status tostderr(3)before running the program.-Vβ Printlandlock(7)ABI version onstdout(3).-Aβ Printlandlock(7)ABI version onstdout(3)and exit with it as exit code. Use for scripting.-l cat[,cat...]{+|-}path|port[-port]β Add or remove alandlock(7)rule with categories and an associated resource (path or port), may be repeated. Join categories and resource by either a+(plus) for add or a-(minus) for remove. Resource must be a path for all categories exceptbindandconnect. Resource must be a port, a dash-delimited closed port range, or a comma-separated list of ports and ranges forbindandconnect. Resource may also be a UNIX domain socket path forbindto confinemknod(2)withS_IFSOCK. Resource may also be a UNIX domain socket path forconnectto confineconnect(2)andsendmsg(2)to sockets created outside the domain. Both absolute and relative paths are permitted for all categories exceptbindandconnectwhich require an absolute path. Paths are stored as hash sets and ports as fixed bit sets to make stacking options simple and predictable.-C levelβ Setlandlock(7)compatibility level. Must be one ofhard-requirement,soft-requirement, andbest-effort. Default ishard-requirementto adhere to the principle of secure defaults. Level can be given shortly ashard(orh),soft(ors) andbest(orb).-E errataβ Query supportedlandlock(7)errata fixes. Use-E listto print list of known erratas. The argument may be a name or number. Use a number to query undefined erratas. Multiple erratas may be specified split by commas.-F flagsβ Setlandlock_restrict_self(2)flags. Use-F listto print a list of flags. See theFLAGSsection for information on flags and their functionality.-Sβ Enable scoped signals introduced withlandlock(7)ABI 6.-Uβ Enable scoped UNIX abstract sockets introduced withlandlock(7)ABI 6.-r pathβ Specify a read-only path, may be repeated. Equivalent to-l read,readdir,exec,ioctl+path.-w pathβ Specify a read-write path, may be repeated. Equivalent to-l all+path.-b port[-port][,port[-port]...]β Specify port(s) forbind(2), may be repeated. Equivalent to-l bind+port.-c port[-port][,port[-port]...]β Specify port(s) forconnect(2), may be repeated. Equivalent to-l connect+port.
πΈ CONFIGURATION πΈ
okay so this is the part where you actually tell syd-lock what to lock down, and honestly it's giving main character energy π
landlock(7) categories and their associated resources (paths or ports) are given with the -l option. That option takes a comma separated list of categories, followed by either a + (plus) or a - (minus) symbol that tells it whether you're adding or removing the given rule. Rulesets store paths as hash sets and ports as fixed bit sets, which is what lets multiple -l options stack in a simple and predictable way π
Use the -V option to check for landlock(7) support in the Linux kernel. The specific support level can be figured out from the exit code. And use the -A option to check for the landlock(7) ABI version β¨
π¦ ABI
landlock(7) ABI versioning is literally what makes it possible to adjust the security policy according to kernel capabilities. syd-lock has support for landlock(7) ABI 10, which is new in Linux-7.2 π
See the HISTORY section for the tea on when each landlock(7) ABI was introduced to the Linux kernel.
π SETS
As of version 3.38.0, multiple categories may be specified split by commas, and these sets are defined to simplify sandbox profile composition. The names are intentionally chosen to be consistent with OpenBSD's pledge(2) β iykyk π
allβ All filesystem access rightsall-xβ All filesystem access rights except execrpathβread,readdirwpathβwrite,truncatecpathβcreate,delete,renamedpathβmkbdev,mkcdevspathβmkfifo,symlinktpathβmkdir,rmdirinetβbind,connect
π§ COMPATIBILITY LEVELS
As of version 3.35.0, the landlock(7) compatibility level may be set using the -C option to one of these levels: hard-requirement, or just hard or h, soft-requirement, or just short or s, and best-effort, or just best or b. Default is hard-requirement, to adhere to the principle of secure defaults π₯
So here's the vibe check on each one:
In hard-requirement level, the requested landlock(7) restrictions are taken into account only if they're supported by the running system. If any requested feature isn't supported, the operation returns a compatibility error and the sandbox is not entered, periodt. File open(2) errors during sandbox setup β including the ENOENT ("No such file or directory") errno(3) β return a fatal error in this level π€
In soft-requirement level, the requested restrictions are taken into account if they're supported by the running system, or the entire sandboxing request is silently ignored otherwise; no compatibility error is returned π
In best-effort level, the requested restrictions are taken into account if they're supported by the running system, and any unsupported restrictions are silently ignored; no compatibility error is returned π«Ά
Also: in soft-requirement and best-effort levels, file open(2) errors with the ENOENT ("No such file or directory") errno(3) are silently ignored. Other file open(2) errors are fatal β οΈ
π FLAGS
As of version 3.38.0, landlock(7) flags may be set using the -F option. Flags may be specified using their names or numerical values. Multiple flags may be set at once by specifying them as a comma-separated list π
Flags are supported beginning with landlock(7) ABI 7, which is new in Linux-6.15. The list of supported flags is given below. Setting a flag on an unsupported ABI is a NO-OP unless otherwise noted π
log_same_exec_off(1) β Disables logging of denied accesses originating from the thread creating thelandlock(7)domain, as well as its children, as long as they continue running the same executable code (i.e., without an interveningexecve(2)call). This is intended for programs that execute unknown code without invokingexecve(2), such as script interpreters. Programs that only sandbox themselves should not set this flag, so users can be notified of unauthorized access attempts via system logs. This flag requireslandlock(7)ABI 7 support which is new in Linux-6.15 π¦log_new_exec_on(2) β Enables logging of denied accesses after anexecve(2)call, providing visibility into unauthorized access attempts by newly executed programs within the createdlandlock(7)domain. This flag is recommended only when all potential executables in the domain are expected to comply with the access restrictions, as excessive audit log entries could make it more difficult to identify critical events. This flag requireslandlock(7)ABI 7 support which is new in Linux-6.15 π₯log_subdomains_off(4) β Disables logging of denied accesses originating from nestedlandlock(7)domains created by the caller or its descendants. This flag should be set according to runtime configuration, not hardcoded, to avoid suppressing important security events. It is useful for container runtimes or sandboxing tools that may launch programs which themselves createlandlock(7)domains and could otherwise generate excessive logs. Unlikelog_same_exec_off, this flag only affects future nested domains, not the one being created. This flag requireslandlock(7)ABI 7 support which is new in Linux-6.15 π
π SECURITY π
bestie this section is important, lean in π«Ά
As of version 3.35.0, the default landlock(7) compatibility level has been changed from best-effort to hard-requirement, and ENOENT (No such file or directory) errors are made fatal unless level is set to best-effort. This adheres to the principle of secure defaults and above all avoids the silent and dangerous trap where a non-existing file or directory which had been denied access (and skipped) at startup is created after, and landlock(7) ends up allowing access to the newly created file or directory π
For more information, see: https://landlock.io/rust-landlock/landlock/trait.Compatible.html
As of version 3.46.0, path must not contain magic symbolic links or parent (..) components. Path is permitted to contain regular symbolic links. These regular symbolic symlinks are permitted to resolve to targets with parent (..) components in them. bind category requires absolute UNIX socket paths. Path may be relative for other categories, in which case it is resolved relative to the directory where syd-lock(1) was executed β¨
Consider combining syd-lock(1) use with syd-mdwe(1) to get W^X memory protections. See syd-mdwe(1) manual page for more information π
π HISTORY π
the landlock(7) ABI lore, chronological:
- 1st
landlock(7)ABI was introduced with Linux-5.13. - 2nd
landlock(7)ABI was introduced with Linux-5.19. - 3rd
landlock(7)ABI was introduced with Linux 6.2. - 4th
landlock(7)ABI was introduced with Linux 6.7. - 5th
landlock(7)ABI was introduced with Linux 6.10. - 6th
landlock(7)ABI was introduced with Linux 6.12. - 7th
landlock(7)ABI was introduced with Linux 6.15. - 8th
landlock(7)ABI was introduced with Linux 7.0. - 9th
landlock(7)ABI was introduced with Linux 7.1. - 10th
landlock(7)ABI was introduced with Linux 7.2.
Refer to following links for more information:
https://git.kernel.org/stable/c/17ae69aba89dbfa2139b7f8024b757ab3cc42f59https://git.kernel.org/stable/c/cb44e4f061e16be65b8a16505e121490c66d30d0https://git.kernel.org/stable/c/299e2b1967578b1442128ba8b3e86ed3427d3651https://git.kernel.org/stable/c/136cc1e1f5be75f57f1e0404b94ee1c8792cb07dhttps://git.kernel.org/stable/c/2fc0e7892c10734c1b7c613ef04836d57d4676d5https://git.kernel.org/stable/c/e1b061b444fb01c237838f0d8238653afe6a8094https://git.kernel.org/stable/c/72885116069abdd05c245707c3989fc605632970https://git.kernel.org/stable/c/42fc7e6543f6d17d2cf9ed3e5021f103a3d11182https://git.kernel.org/stable/c/ae97330d1bd6a97646c2842d117577236cb40913https://git.kernel.org/stable/c/9a8ed15ce22472fe0363e33738b4317d06b13c3a
πͺ EXIT STATUS πͺ
syd-lock exits with the same code as the child process on clean exit. On unclean termination, exit code is set to 128 plus signal number. In case executing the child process fails, syd-lock(1) exits with the errno(3) number. syd-lock -A exits with the landlock(7) ABI version as exit code π
syd-lock -E exits with one of the following exit codes:
0β All erratas are available.1β Some erratas are not available.2β No erratas are available.
syd-lock -V exits with one of the following exit codes based on support for the latest landlock(7) ABI:
0β Fully enforced1β Partially enforced2β Not enforced127β Not supported
And syd-lock exits with 22 (EINVAL) for invalid CLI arguments π
β¨ EXAMPLES β¨
Okay bestie, this is the part where it all clicks, I promise. π«Ά We're gonna watch wget slowly earn its privileges like it's leveling up in a video game, and honestly? It's giving character development. π₯
π Example the First: vibes only, no permissions
$ syd-lock wget -O/dev/null chesswob.org
That's it, that's the whole first one. Nothing to show you yet β keep reading, the drama escalates. π
π Example the Second: the /dev/null jumpscare
So you've got read and execute on / β that's read,exec+/ β and you think you're fine. You are not fine. π
$ syd-lock -l read,exec+/ wget -O/dev/null chesswob.org
/dev/null: Permission denied
Permission denied. On /dev/null. Of all things. The void said no. π
π Example the Third: give it the write, watch it still flop
Bestie said "fine, have /dev/null," and look what happened. π«
$ syd-lock -l read,exec+/ -l write+/dev/null wget -O/dev/null chesswob.org
Prepended http:// to 'chesswob.org'
--2025-04-30 16:24:35-- http://chesswob.org/
Resolving chesswob.org (chesswob.org)... 95.216.39.164, fe80::468a:5bff:fe88:2141
Connecting to chesswob.org (chesswob.org)|95.216.39.164|:80... failed: Permission denied.
Connecting to chesswob.org (chesswob.org)|fe80::468a:5bff:fe88:2141|:80... failed: Permission denied.
Retrying.
^C
$
Look at that. πΈ It wrote to /dev/null just fine, it resolved the name just fine, and then it tried to connect on port 80 and boom β Permission denied, not once but twice (v4 and v6, because it's thorough like that). Then it says Retrying. and you're sitting there like π and you hit Ctrl+C.
The lesson? Every. Little. Thing. Needs its own -l rule. No cap. π
π Example the Fourth: the glow-up, the main character moment
Now we hand it connect on 80 and 443, and bestie β it ate. π
$ syd-lock -l read,exec+/ -l write+/dev/null -l connect+80 -l connect+443 wget -O/dev/null chesswob.org
Prepended http:// to 'chesswob.org'
--2025-04-30 16:25:59-- http://chesswob.org/
Resolving chesswob.org (chesswob.org)... 95.216.39.164, fe80::468a:5bff:fe88:2141
Connecting to chesswob.org (chesswob.org)|95.216.39.164|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://www.chesswob.org/ [following]
--2025-04-30 16:25:59-- https://www.chesswob.org/
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving www.chesswob.org (www.chesswob.org)... 95.216.39.164, fe80::468a:5bff:fe88:2141
Connecting to www.chesswob.org (www.chesswob.org)|95.216.39.164|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 148827 (145K) [text/html]
Saving to: β/dev/nullβ
/dev/null 100%[=============================================================>] 145.34K --.-KB/s in 0.01s
2025-04-30 16:25:59 (11.9 MB/s) - β/dev/nullβ saved [148827/148827]
$
Iconic. π Watch the whole plot: it does plain http on port 80, gets a 302 Moved Temporarily redirect over to https, follows it like the good little user-agent it is, loads the CA cert, connects on 443, gets 200 OK, and yeets 148827 bytes straight into the void. π³οΈβ¨ And it only worked because we told it about both 80 and 443 up front. Foresight is everything, iykyk.
π§ Small but important vibe check: the numbers and outputs above are exactly the ones the original page shows β don't come at me if your IP or your bandwidth looks different, bestie. π
πΈ SEE ALSO πΈ
Everything adjacent that you're gonna want to read next, alphabetized because we're classy:
landlock(7)syd(1)syd(2)syd(5)syd(7)syd-mdwe(1)syd-ofd(1)syd-pds(1)syd-ring(1)syd-sec(1)syd-tsc(1)
And the links, because knowledge is free and slaying is mandatory: π
- syd homepage: https://sydbox.exherbo.org/
- Landlock homepage: https://landlock.io/
- Landlock documentation: https://docs.kernel.org/userspace-api/landlock.html
- Landlock admin guide: https://docs.kernel.org/admin-guide/LSM/landlock.html
π AUTHORS π
Maintained by Ali Polatel. π
Up-to-date sources live at https://gitlab.exherbo.org/sydbox/sydbox.git and on Radicle at rad:z38HCnbmcDegA2BMxuPaPRPMdp6wF.
Got bugs? Got patches? Both go to https://gitlab.exherbo.org/groups/sydbox/-/issues. π
Wanna actually talk to humans about it? Come hang out in #sydbox on Libera Chat, or #sydbox:mailstation.de on Matrix. We don't bite. π«Ά
okay that's the whole page bestie, you made it, I'm so proud of you π₯Ήπ β¨ This was SYD-LOCK(1), dated 2026-09-01, and that date is straight from the source β literally. Now go lock down something cute. ππ¦
π¦ where this page comes from
- arch rolling: syd 3.59.0-1 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms