kiwi_selinux(8)

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

πŸ’… kiwi_selinux(8) β€” the SELinux policy page for kiwi, bestie

okay so this is kiwi_selinux, the manual page for the SELinux policy that governs the kiwi processes. yes it's a whole policy page. yes it's iconic. let's go ✨


🌸 NAME 🌸

kiwi_selinux β€” Security Enhanced Linux Policy for the kiwi processes 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

Security-Enhanced Linux secures the kiwi processes via flexible mandatory access control. that's the whole vibe β€” SELinux is the main character here and it's not letting kiwi run around doing whatever it wants. no cap.

the kiwi processes execute with the kiwi_t SELinux type. wanna check if you've got these processes running? literally just run the ps command with the -Z qualifier. like so:

ps -eZ | grep kiwi_t

and that's it. that's the vibe check πŸ‘‘

πŸŽ€ ENTRYPOINTS πŸŽ€

so the kiwi_t SELinux type can be entered via the kiwi_exec_t file type. that's the doorway, bestie.

the default entrypoint paths for the kiwi_t domain are:

/usr/bin/kiwi-ng

that's the one. the only one. periodt.

πŸ”₯ PROCESS TYPES πŸ”₯

SELinux defines process types (domains) for each process running on the system. yes, every single one. it's giving organized.

you can see the context of a process using the -Z option to ps ✨

policy governs the access confined processes have to files. SELinux kiwi policy is very flexible β€” it lets users set up their kiwi processes in as secure a method as possible. like, you get the security and the flexibility. obsessed.

the following process types are defined for kiwi:

  • kiwi_t
Note: semanage permissive -a kiwi_t can be used to make the process type kiwi_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so like, it stops blocking things but it's still gonna be posting receipts in the log. iykyk πŸ’€

🌈 BOOLEANS 🌈

SELinux policy is customizable based on least access required. kiwi policy is extremely flexible and has several booleans that let you manipulate the policy and run kiwi with the tightest access possible. tightest access = the goal, fr fr.

if you want to deny user domains applications to map a memory region as both executable and writable β€” which 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

if you want to control the ability to mmap a low area of the address space, as configured by /proc/sys/vm/mmap_min_addr, you must turn on the mmap_low_allowed boolean. disabled by default.

setsebool -P mmap_low_allowed 1

if you want to disable kernel module loading, you must turn on the secure_mode_insmod boolean. disabled by default.

setsebool -P secure_mode_insmod 1

if you want to allow unconfined executables to make their heap memory executable β€” doing this is a really bad idea 😭 probably indicates a badly coded executable, but could indicate an attack, and the executable should be reported in bugzilla β€” you must turn on the selinuxuser_execheap boolean. disabled by default.

setsebool -P selinuxuser_execheap 1

if you want to allow unconfined executables to make their stack executable β€” this should never, ever be necessary, probably indicates a badly coded executable, but could indicate an attack, and the executable should be reported in bugzilla β€” you must turn on the selinuxuser_execstack boolean. disabled by default.

setsebool -P selinuxuser_execstack 1
like bestie i'm begging you, read those warnings before you flip those booleans πŸ™ˆ dangerous stuff is dangerous, that part did not change just because i said it cutely.

πŸ’œ MANAGED FILES πŸ’œ

the SELinux process type kiwi_t can manage files labeled with the following file types. the paths listed are the default paths for these file types. note: the process's UID still needs to have DAC permissions. SELinux don't override that, no ma'am.

  • file_type
    • all files on the system

that's right. all of them. the whole system. iconic scope, honestly 🌈

🧚 FILE CONTEXTS 🧚

SELinux requires files to have an extended attribute to define the file type. that's just how it is.

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 kiwi policy is very flexible, allowing users to set up their kiwi processes in as secure a method as possible. we love a flexible queen πŸ‘‘

⭐ STANDARD FILE CONTEXT ⭐

SELinux defines the file context types for the kiwi. 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. two-step process, both steps mandatory, don't skip πŸ’…

semanage fcontext -a -t kiwi_exec_t '/srv/kiwi/content(/.*)?'
restorecon -R -v /srv/mykiwi_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. regex my beloved πŸŽ€

the following file types are defined for kiwi:

  • kiwi_exec_t β€” set files with the kiwi_exec_t type if you want to transition an executable to the kiwi_t domain.
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. so chcon is the quick fix and semanage fcontext + restorecon is the forever fix. know the difference 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. yes, a GUI. for the girlies who prefer clicking πŸ–±οΈβœ¨

πŸ“ AUTHOR πŸ“

this manual page was auto-generated using sepolicy manpage. shoutout to the robot that wrote it πŸ€–πŸ’–

🌟 SEE ALSO 🌟

selinux(8), kiwi(8), semanage(8), restorecon(8), chcon(1), sepolicy(8), setsebool(8)


and that's the whole page, bestie πŸŽ€ this was kiwi, version 26-10-06, under kiwi_selinux(8). go forth and label responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from