preupgrade_selinux(8)

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

πŸ’… preupgrade_selinux β€” the girl's guide to the SELinux policy for preupgrade πŸ’…

okay so bestie, this is a page from the SELinux Policy preupgrade manual β€” section 8, preupgrade_selinux(8), if you're keeping track. it's all about the SELinux policy that wraps around your preupgrade processes. buckle up πŸŽ€


✨ NAME ✨

preupgrade_selinux β€” Security Enhanced Linux Policy for the preupgrade processes. periodt.


🌸 DESCRIPTION 🌸

so. Security-Enhanced Linux secures the preupgrade processes via flexible mandatory access control. that's the whole vibe β€” MAC, mandatory, mandatory, we love a boundary πŸ’…

the preupgrade processes execute with the preupgrade_t SELinux type. wanna check if you've got these processes running? just run the ps command with the -Z qualifier, like this:

ps -eZ | grep preupgrade_t

go off, detective πŸ•΅οΈβ€β™€οΈ


πŸ¦‹ ENTRYPOINTS πŸ¦‹

the preupgrade_t SELinux type can be entered via the preupgrade_exec_t file type β€” that's the doorway, the main character entrance, iykyk.

the default entrypoint paths for the preupgrade_t domain are literally:

/usr/bin/preupg.*


πŸ‘‘ PROCESS TYPES πŸ‘‘

SELinux defines process types (aka domains) for each process running on the system. yes, every single one gets its own little label. organized queen behavior πŸ’…

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

so the tea is: policy governs the access confined processes have to files. and the SELinux preupgrade policy is very flexible, allowing users to setup their preupgrade processes in as secure a method as possible. secure and flexible? we can have both 🫢

the following process types are defined for preupgrade:

  • preupgrade_t
note: semanage permissive -a preupgrade_t can be used to make the process type preupgrade_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so like, it's chill but it's still snitching 😭

⭐ BOOLEANS ⭐

SELinux policy is customizable based on least access required. the preupgrade policy is extremely flexible and has several booleans that allow you to manipulate the policy and run preupgrade with the tightest access possible. love a custom fit πŸ’–

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

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... girl. doing this is a really bad idea. probably indicates a badly coded executable, but could indicate an attack. this executable should be reported in bugzilla. to do it anyway 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 β€” and this should never, ever be necessary, probably indicates a badly coded executable, but could indicate an attack, and this executable should be reported in bugzilla β€” you must turn on the selinuxuser_execstack boolean. Disabled by default.

setsebool -P selinuxuser_execstack 1
🚨 bestie warning: selinuxuser_execheap and selinuxuser_execstack are giving red flags, not main character energy. report those executables to bugzilla, fr fr.

🌈 PORT TYPES 🌈

SELinux defines port types to represent TCP and UDP ports. ports have labels too, they're not just numbers, they're types πŸ’…

you can see the types associated with a port by using the following command:

semanage port -l

policy governs the access confined processes have to these ports. SELinux preupgrade policy is very flexible allowing users to setup their preupgrade processes in as secure a method as possible.

the following port types are defined for preupgrade:

  • preupgrade_port_t

Default Defined Ports:

tcp 8099

she's got one port and it's 8099, iconic πŸŽ€


πŸ“ MANAGED FILES πŸ“

the SELinux process type preupgrade_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 ain't doing DAC's homework for it πŸ™ˆ

  • file_type
    • all files on the system

yes, all files on the system. she's ambitious, okay? πŸ”₯


🧚 FILE CONTEXTS 🧚

SELinux requires files to have an extended attribute to define the file type. every file needs its little name tag ✨

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 preupgrade policy is very flexible allowing users to setup their preupgrade processes in as secure a method as possible.

πŸŽ€ STANDARD FILE CONTEXT πŸŽ€

SELinux defines the file context types for the preupgrade. if you wanted to store files with these types in a different paths, you need to execute the semanage command to specify alternate labeling and then use restorecon to put the labels on disk. relocating, but make it compliance πŸ’…

semanage fcontext -a -t preupgrade_exec_t
'/srv/preupgrade/content(/.*)?'
restorecon -R -v /srv/mypreupgrade_content
note: SELinux often uses regular expressions to specify labels that match multiple files. regex girlies rise πŸ™Œ

the following file types are defined for preupgrade:

  • preupgrade_data_t
    • set files with the preupgrade_data_t type, if you want to treat the files as preupgrade content.

Paths: /var/lib/preupgrade(/.*)?, /var/log/preupgrade(/.*)?

  • preupgrade_exec_t
    • set files with the preupgrade_exec_t type, if you want to transition an executable to the preupgrade_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. temporary vs permanent, 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 port can also be used to manipulate the port definitions.

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 when the terminal isn't the vibe today 🌸


🫢 AUTHOR 🫢

this manual page was auto-generated using sepolicy manpage.


πŸ”₯ SEE ALSO πŸ”₯

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


and that's the whole page, bestie! this one came from preupgrade, dated 26-10-06, and it lives under preupgrade_selinux(8) β€” go forth and label responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from