sandbox_selinux(8)

πŸ“¦
version 20250627+git412.dbf877ab7 Β· 7 versions
, in opensuse-leap 16.0

✨ sandbox_selinux(8) β€” the sandbox processes glow-up guide ✨

okay so bestie, you already know what sandbox_selinux is giving β€” it's the whole Security Enhanced Linux situation for the sandbox processes, and we're gonna break it down together πŸ’–


πŸ“– NAME

sandbox_selinux β€” the SELinux policy that keeps the sandbox processes in check, fr fr πŸ’…


🌸 DESCRIPTION

Security-Enhanced Linux secures the sandbox processes via flexible mandatory access control. like, it's literally the bodyguard for your sandbox vibes ✨

The sandbox processes execute with the sandbox_t SELinux type. wanna check if you've got these processes running? just run the ps command with the -Z qualifier, no cap πŸ‘‘

For example:

ps -eZ | grep sandbox_t

πŸ‘‘ PROCESS TYPES

SELinux defines process types (aka domains) for every single process running on the system 🫢

You can see the context of a process using the -Z option to ps β€” it's giving main character energy, iykyk πŸ’«

Policy governs the access confined processes have to files. the SELinux sandbox policy is very flexible, allowing users to set up their sandbox processes in as secure a method as possible. slay πŸ”₯

The following process types are defined for sandbox:

  • sandbox_t
  • sandbox_xserver_t
  • sandbox_min_t
  • sandbox_min_client_t
  • sandbox_x_t
  • sandbox_x_client_t
  • sandbox_web_t
  • sandbox_web_client_t
  • sandbox_net_t
  • sandbox_net_client_t
Note: semanage permissive -a sandbox_t can be used to make the process type sandbox_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so like, it's still watching you bestie πŸ‘€

πŸ’œ MCS Constrained

The SELinux process type sandbox_t is an MCS (Multi Category Security) constrained type. sometimes this separation is referred to as sVirt β€” iconic 🌈

These types are usually used for securing multi-tenant environments, such as virtualization, containers or separation of users. the tools used to launch MCS types pick out a different MCS label for each process group 🧚

For example, one process might be launched with sandbox_t:s0:c1,c2, and another process launched with sandbox_t:s0:c3,c4. The SELinux kernel only allows these processes to write to content with a matching MCS label, or an MCS Label of s0. so a process running with the MCS level of s0:c1,c2 is not allowed to write to content with the MCS label of s0:c3,c4 πŸ’€ boundaries, periodt.


πŸŽ€ BOOLEANS

SELinux policy is customizable based on least access required. sandbox policy is extremely flexible and has several booleans that allow you to manipulate the policy and run sandbox with the tightest access possible 🌸

If you want to deny user domains applications to map a memory region as both executable and writable, this is dangerous and the executable should be reported in bugzilla, you must turn on the deny_execmem boolean. Disabled by default. 🚨

setsebool -P deny_execmem 1

πŸ¦‹ FILE CONTEXTS

SELinux requires files to have an extended attribute to define the file type. it's literally the file's whole identity πŸ’…

You can see the context of a file using the -Z option to ls πŸ‘€

Policy governs the access confined processes have to these files. SELinux sandbox policy is very flexible, allowing users to set up their sandbox processes in as secure a method as possible. obsessed 🫢

⭐ STANDARD FILE CONTEXT

SELinux defines the file context types for sandbox. if you wanted to store files with these types in different paths, you need to execute the semanage command to specify alternate labeling and then use restorecon to put the labels on disk ✨

semanage fcontext -a -t sandbox_exec_t '/srv/sandbox/content(/.*)?'
restorecon -R -v /srv/mysandbox_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. regex girlies rise πŸ™ˆ

The following file types are defined for sandbox:

  • sandbox_devpts_t β€” set files with the sandbox_devpts_t type if you want to treat the files as sandbox devpts data πŸ’»
  • sandbox_exec_t β€” set files with the sandbox_exec_t type if you want to transition an executable to the sandbox_t domain πŸƒβ€β™€οΈ
  • sandbox_file_t β€” set files with the sandbox_file_t type if you want to treat the files as sandbox content πŸ“
  • sandbox_min_client_tmpfs_t β€” set files with the sandbox_min_client_tmpfs_t type if you want to store sandbox min client files on a tmpfs file system πŸ“
  • sandbox_net_client_tmpfs_t β€” set files with the sandbox_net_client_tmpfs_t type if you want to store sandbox net client files on a tmpfs file system 🌐
  • sandbox_web_client_tmpfs_t β€” set files with the sandbox_web_client_tmpfs_t type if you want to store sandbox web client files on a tmpfs file system πŸ•ΈοΈ
  • sandbox_x_client_tmpfs_t β€” set files with the sandbox_x_client_tmpfs_t type if you want to store sandbox x client files on a tmpfs file system πŸ–₯️
  • sandbox_xserver_tmpfs_t β€” set files with the sandbox_xserver_tmpfs_t type if you want to store sandbox xserver files on a tmpfs file system 🎨
Note: file context can be temporarily modified with the chcon command. if you want to permanently change the file context you need to use the semanage fcontext command. this will modify the SELinux labeling database. you will need to use restorecon to apply the labels. no shortcuts, bestie 😀

πŸ› οΈ COMMANDS

  • semanage fcontext can also be used to manipulate default file context mappings πŸ—‚οΈ
  • semanage permissive can also be used to manipulate whether or not a process type is permissive πŸ•ŠοΈ
  • semanage module can also be used to enable/disable/install/remove policy modules πŸ“¦
  • semanage boolean can also be used to manipulate the booleans πŸ”˜
  • system-config-selinux is a GUI tool available to customize SELinux policy settings πŸ–±οΈβœ¨

✍️ AUTHOR

This manual page was auto-generated using sepolicy manpage. the robots did this one, not me πŸ’€πŸ€–


πŸ”— SEE ALSO

selinux(8), sandbox(8), semanage(8), restorecon(8), chcon(1), sepolicy(8), setsebool(8), sandbox_min_selinux(8), sandbox_min_selinux(8), sandbox_min_client_selinux(8), sandbox_min_client_selinux(8), sandbox_net_selinux(8), sandbox_net_selinux(8), sandbox_net_client_selinux(8), sandbox_net_client_selinux(8), sandbox_web_selinux(8), sandbox_web_selinux(8), sandbox_web_client_selinux(8), sandbox_web_client_selinux(8), sandbox_x_selinux(8), sandbox_x_selinux(8), sandbox_x_client_selinux(8), sandbox_x_client_selinux(8), sandbox_xserver_selinux(8), sandbox_xserver_selinux(8) 🌈 (yes there are duplicates, and yes that's the vibe, don't @ me)


and that's the whole sandbox_selinux tea, bestie πŸ«–πŸ’–

this little masterpiece is from the sandbox package, version 26-10-06, dated sandbox_selinux(8) β€” catch you in the next manpage, mwah πŸ˜˜πŸ’…

πŸ“¦ where this page comes from