Open l0kod opened 5 months ago
Just a note on the side, I think this bug would be very useful, because there is a whole bouquet of socket types and associated network protocols which are permitted by default right now. Restricting the call to socket(2)
would make it very simple to deny access to the bulk of these protocols for many common use cases.
Hi everyone. Thanks to @sm1ling-knight for this patch!!
Being able to restrict any kind of socket would definitely be useful for a sandbox.
We could add a new
handled_access_socket
field to thelandlock_ruleset
struct, which would containLANDLOCK_ACCESS_SOCKET_*
flags. If this field is set, users could add a new type of rule:The
allowed_access
field could contain:LANDLOCK_ACCESS_SOCKET_CREATE
to control socket creation with socket(2) or,LANDLOCK_ACCESS_SOCKET_LISTEN
to control listen(2) or,LANDLOCK_ACCESS_SOCKET_ACCEPT
to control accept(2) could make sense but we need to align with #15See thread: https://lore.kernel.org/all/b8a2045a-e7e8-d141-7c01-bf47874c7930@digikod.net/
Related to #15
Cc @BoardzMaster