lockdev_selinux(8)

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

πŸ’… lockdev_selinux β€” the glow-up edition ✨

Okay bestie, so this is the SELinux policy page for the lockdev processes, and I'm gonna walk you through it like we're studying together at 2am. It's giving "niche but important," and honestly? We love that for us.


πŸŽ€ NAME πŸŽ€

lockdev_selinux β€” Security Enhanced Linux Policy for the lockdev processes. That's literally the whole vibe. It's the SELinux glossary entry that tells you how lockdev gets locked down. 🌸


✨ DESCRIPTION ✨

Security-Enhanced Linux secures the lockdev processes via flexible mandatory access control. No cap, that's the whole point. 🫢

The lockdev processes execute with the lockdev_t SELinux type. You can check if you have these processes running by executing the ps command with the -Z qualifier.

For example:

ps -eZ | grep lockdev_t

That's it, that's the check. Run it, see if lockdev_t shows up, and if it does, slay, you've got lockdev processes. πŸ’–


πŸšͺ ENTRYPOINTS πŸšͺ

The lockdev_t SELinux type can be entered via the lockdev_exec_t file type. Think of it like the VIP entrance, but for processes. 🎟️

The default entrypoint paths for the lockdev_t domain are the following:

/usr/bin/lockdev

Iconic, iconic, iconic.


πŸ‘‘ PROCESS TYPES πŸ‘‘

SELinux defines process types (domains) for each process running on the system. It's lowkey the whole system's way of keeping track of who's who.

You can see the context of a process using the -Z option to ps. Yep, same trick as before, -Z is your bestie for context.

Policy governs the access confined processes have to files. SELinux lockdev policy is very flexible allowing users to set up their lockdev processes as secure as possible. Highkey obsessed with how customizable this is.

The following process types are defined for lockdev:

lockdev_t

Note: semanage permissive -a lockdev_t can be used to make the process type lockdev_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. So it's like, "okay, I'll let it slide, but I'm still gonna write it down in my notes." πŸ’€

πŸ”˜ BOOLEANS πŸ”˜

SELinux policy is customizable based on least access required. The lockdev policy is extremely flexible and has several booleans that allow you to manipulate the policy and run lockdev with the tightest access possible. Very "minimum necessary, maximum security" energy. πŸ”’

If you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. Enabled by default. Periodt.

setsebool -P fips_mode 1

That's the command, bestie. Memorize it, love it, use it. πŸ’…


πŸ“ FILE CONTEXTS πŸ“

SELinux requires files to have an extended attribute to define the file type. Like every file has to carry its little ID badge around. πŸͺͺ

You can see the context of a file using the -Z option to ls. Yes, -Z is everywhere, it's the main character of this manpage.

Policy governs the access confined processes have to these files. SELinux lockdev policy is very flexible allowing users to set up their lockdev processes as secure as possible. We love a system that lets you customize.

πŸ“‚ STANDARD FILE CONTEXT πŸ“‚

SELinux defines the file context types for lockdev. 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. It's a two-step slay.

semanage fcontext -a -t lockdev_exec_t '/srv/lockdev/content(/.*)?'
restorecon -R -v /srv/mylockdev_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. Regex my beloved. 🧚

The following file types are defined for lockdev:

  • lockdev_exec_t β€” Set files with the lockdev_exec_t type, if you want to transition an executable to the lockdev_t domain. It's the "who dis" file type. πŸ¦‹
  • lockdev_lock_t β€” Set files with the lockdev_lock_t type, if you want to treat the files as lockdev lock data, stored under the /var/lock directory. It's the locket of file types, keeping things safe. πŸ”
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 for a quick little fling, but semanage fcontext is for the long-term relationship. 😭

πŸ’» COMMANDS πŸ’»

semanage fcontext can also be used to manipulate default file context mappings. She's versatile.

semanage permissive can also be used to manipulate whether or not a process type is permissive. She's flexible.

semanage module can also be used to enable/disable/install/remove policy modules. She contains multitudes.

semanage boolean can also be used to manipulate the booleans. She's a little boolean baddie.

system-config-selinux is a GUI tool available to customize SELinux policy settings. For when you want a more ~visual~ experience, you know? 🌈


✍️ AUTHOR ✍️

This manual page was auto-generated using sepolicy manpage. Not me being auto-generated and still iconic. πŸ’…


πŸ‘€ SEE ALSO πŸ‘€

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

Click through, bestie, there's lore in every one of those. πŸ“š


And that's the whole page, okay? You're welcome.

This little masterpiece is from the lockdev manual source/version 26-10-06. πŸŽ€ Go forth and SELinux responsibly. πŸ’–

πŸ“¦ where this page comes from