devicekit_selinux(8)

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

πŸ’… devicekit_selinux β€” the manual page, but make it cute

Okay bestie, buckle up, because this is the devicekit_selinux(8) manual page and we're about to get into it. This is the Security Enhanced Linux Policy for the devicekit processes, and honestly? It's giving secure. It's giving mandatory access control. It's giving "your fave could never."


✨ NAME ✨

So the name of this whole thing is devicekit_selinux β€” and it's literally the Security Enhanced Linux Policy for the devicekit processes. That's it, that's the name, periodt.


πŸ¦‹ DESCRIPTION πŸ¦‹

Security-Enhanced Linux secures the devicekit processes via flexible mandatory access control. No cap. Like, SELinux is out here protecting these processes with flexible mandatory access control, which is a whole vibe.

The devicekit processes execute with the devicekit_t SELinux type. You can check if you have these processes running by executing the ps command with the -Z qualifier. It's super easy, bestie.

For example:

ps -eZ | grep devicekit_t

See? Iconic. You just ran a command and now you know things. Main character energy.


🌸 ENTRYPOINTS 🌸

So the devicekit_t SELinux type can be entered via the devicekit_exec_t file type. That's the doorway, the entrance, the red carpet moment.

The default entrypoint paths for the devicekit_t domain are literally these:

/usr/bin/udisksctl, /usr/libexec/devkit-daemon

Those two. That's where it all happens. Write it down, screenshot it, whatever you gotta do.


πŸŽ€ PROCESS TYPES πŸŽ€

SELinux defines process types (domains) for each process running on the system. It's a whole thing. Keep up.

You can see the context of a process using the -Z option to ps. Simple. Cute. Useful.

Policy governs the access confined processes have to files. SELinux devicekit policy is very flexible, allowing users to setup their devicekit processes in as secure a method as possible. Like, the most secure. The final boss of secure.

The following process types are defined for devicekit:

devicekit_t, devicekit_power_t, devicekit_disk_t

Three of them. A little trio. A squad, if you will.

Note: semanage permissive -a devicekit_t can be used to make the process type devicekit_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. So like, it's not fully off the hook β€” it's still snitching in the logs. Just so you know.

🧚 BOOLEANS 🧚

SELinux policy is customizable based on least access required. devicekit policy is extremely flexible and has several booleans that allow you to manipulate the policy and run devicekit with the tightest access possible. Tightest access? We love to see it.

Here come the booleans, bestie. Every single one. Let's go.

  • If you want to dontaudit all daemons scheduling requests (setsched, sys_nice), you must turn on the daemons_dontaudit_scheduling boolean. Enabled by default.
setsebool -P daemons_dontaudit_scheduling 1
  • 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
Okay, for real though, that one is dangerous. Like, report-it-in-bugzilla dangerous. Don't be cute with it.
  • 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. This executable should be reported in bugzilla β€” you must turn on the selinuxuser_execheap boolean. Disabled by default.
setsebool -P selinuxuser_execheap 1
Bad idea. Bad. Report it in bugzilla. We said what we said.
  • 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. This executable should be reported in bugzilla β€” you must turn on the selinuxuser_execstack boolean. Disabled by default.
setsebool -P selinuxuser_execstack 1
Never. Ever. Necessary. Like, never ever ever. Keep that in mind.

🫢 MANAGED FILES 🫢

The SELinux process type devicekit_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. And bestie β€” note the processes UID still need to have DAC permissions. Don't forget that part, it's important.

file_type

  • all files on the system

Yes, all of them. That's the whole vibe. That's the whole list. Moving on.


πŸ’– FILE CONTEXTS πŸ’–

SELinux requires files to have an extended attribute to define the file type. It's basically the file's whole identity. Its aesthetic, if you will.

You can see the context of a file using the -Z option to ls. Cute and informative.

Policy governs the access confined processes have to these files. SELinux devicekit policy is very flexible, allowing users to setup their devicekit processes in as secure a method as possible. (Yes, we said that already. It's still true. Repetition is a valid communication strategy.)

🌈 STANDARD FILE CONTEXT 🌈

SELinux defines the file context types for the devicekit, so 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. Like this:

semanage fcontext -a -t devicekit_exec_t '/srv/devicekit/content(/.*)?'
restorecon -R -v /srv/mydevicekit_content

See? You got this. Slay.

Note: SELinux often uses regular expressions to specify labels that match multiple files. So those regex bits? They're doing the most, but like, the most in a good way.

The following file types are defined for devicekit:

devicekit_disk_exec_t

  • Set files with the devicekit_disk_exec_t type, if you want to transition an executable to the devicekit_disk_t domain.

Paths:

/lib/udisks2/udisksd, /lib/udev/udisks-part-id,
/usr/lib/udisks2/udisksd, /usr/libexec/udisks-daemon,
/usr/lib/udev/udisks-part-id, /usr/libexec/udisks2/udisksd,
/usr/lib/udisks/udisks-daemon, /usr/libexec/devkit-disks-daemon

devicekit_exec_t

  • Set files with the devicekit_exec_t type, if you want to transition an executable to the devicekit_t domain.

Paths:

/usr/bin/udisksctl, /usr/libexec/devkit-daemon

devicekit_power_exec_t

  • Set files with the devicekit_power_exec_t type, if you want to transition an executable to the devicekit_power_t domain.

Paths:

/usr/libexec/upowerd, /usr/lib/upower/upowerd, /usr/libexec/devkit-
power-daemon

devicekit_tmp_t

  • Set files with the devicekit_tmp_t type, if you want to store devicekit temporary files in the /tmp directories.

devicekit_var_lib_t

  • Set files with the devicekit_var_lib_t type, if you want to store the devicekit files under the /var/lib directory.

Paths:

/var/lib/udisks.*, /var/lib/upower(/.*)?, /var/lib/DeviceKit-.*

devicekit_var_log_t

  • Set files with the devicekit_var_log_t type, if you want to treat the data as devicekit var log data, usually stored under the /var/log directory.

Paths:

/var/log/pm-suspend.log.*, /var/log/pm-powersave.log.*

devicekit_var_run_t

  • Set files with the devicekit_var_run_t type, if you want to store the devicekit files under the /run or /var/run directory.

Paths:

/run/udisks.*, /run/devkit(/.*)?, /run/upower(/.*)?, /run/pm-
utils(/.*)?, /run/DeviceKit-disks(/.*)?
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 like, chcon is a quick fix, semanage fcontext is the forever fix, and restorecon is the one who actually makes it happen. Teamwork.

πŸ’œ 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. (A GUI! For when you want to point and click instead of type. We respect it.)

πŸ‘‘ AUTHOR πŸ‘‘

This manual page was auto-generated using sepolicy manpage. So like, it wasn't written by a human hand, it was born from the machine. Still iconic though.


⭐ SEE ALSO ⭐

Go read these too, bestie:

selinux(8), devicekit(8), semanage(8), restorecon(8), chcon(1), sepolicy(8), setsebool(8), devicekit_disk_selinux(8), devicekit_disk_selinux(8), devicekit_power_selinux(8), devicekit_power_selinux(8)

(Yes, some of them are listed twice. That's how the original does it. We don't make the rules, we just make them cute.)


And that's the whole page! This one came from devicekit and it's dated 26-10-06 β€” so like, a little vintage, but still slaying. Go forth and be secure. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«ΆπŸ˜­πŸ”₯πŸ‘‘πŸŒˆβ­πŸ’€πŸ™ˆπŸ“πŸ§šπŸ’œ

πŸ“¦ where this page comes from