drbd_selinux(8)

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

✨ drbd_selinux(8) ✨

okay so bestie, let me tell you about drbd_selinux β€” it's giving security enhanced Linux policy for the drbd processes and honestly it's lowkey iconic. this is the manpage you need if you're messing with drbd under SELinux, and yes, you're gonna want to read the whole thing because it's packed with deets. πŸ’…


πŸŽ€ NAME πŸŽ€

drbd_selinux β€” Security Enhanced Linux Policy for the drbd processes. periodt. that's the whole vibe.


🌸 DESCRIPTION 🌸

Security-Enhanced Linux secures the drbd processes via flexible mandatory access control. no cap, it's literally that girl β€” keeping your drbd stuff locked down but still flexible with it.

the drbd processes execute with the drbd_t SELinux type. you can check if you have these processes running by executing the ps command with the -Z qualifier. like, literally just run this:

ps -eZ | grep drbd_t

and that's the vibe check for whether drbd is out here living its best SELinux life. πŸ¦‹


πŸšͺ ENTRYPOINTS πŸšͺ

the drbd_t SELinux type can be entered via the drbd_exec_t file type. it's giving main character energy β€” this is the gateway, bestie.

the default entrypoint paths for the drbd_t domain are the following:

  • /usr/bin/drbdadm
  • /usr/bin/drbdsetup
  • /usr/lib/ocf/resource.d/linbit/drbd

these are the spots where drbd executables live and where the domain transition happens. slay. ✨


πŸ‘‘ PROCESS TYPES πŸ‘‘

SELinux defines process types (domains) for each process running on the system. it's a whole system, okay? you can see the context of a process using the -Z option to ps. lowkey iconic.

policy governs the access confined processes have to files. SELinux drbd policy is very flexible allowing users to setup their drbd processes in as secure a method as possible. like, flexible but also secure β€” it's giving balanced queen. πŸ’–

the following process types are defined for drbd:

  • drbd_t
Note: semanage permissive -a drbd_t can be used to make the process type drbd_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so like, it won't block stuff but it'll still snitch in the logs. iykyk. πŸ‘€

🎚️ BOOLEANS 🎚️

SELinux policy is customizable based on least access required. drbd policy is extremely flexible and has several booleans that allow you to manipulate the policy and run drbd with the tightest access possible. it's giving customization queen. πŸ‘‘

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 allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. Enabled by default.

setsebool -P fips_mode 1

if you want to allow system to run with NIS, you must turn on the nis_enabled boolean. Disabled by default.

setsebool -P nis_enabled 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

see? booleans are literally the vibe check for your policy. flip 'em with setsebool -P and you're good to go. πŸŽ€


πŸ“ MANAGED FILES πŸ“

the SELinux process type drbd_t can manage files labeled with the following file types. the paths listed are the default paths for these file types. note the processes UID still need to have DAC permissions. so like, SELinux is doing its thing but you still need regular Unix perms too. no cap.


cluster_conf_t

  • /etc/cluster(/.*)?

cluster_tmpfs_t

(no default paths listed, she's mysterious like that) πŸ™ˆ

cluster_var_lib_t

  • /var/lib/pcsd(/.*)?
  • /var/lib/cluster(/.*)?
  • /var/lib/openais(/.*)?
  • /var/lib/pengine(/.*)?
  • /var/lib/corosync(/.*)?
  • /usr/lib/heartbeat(/.*)?
  • /var/lib/heartbeat(/.*)?
  • /var/lib/pacemaker(/.*)?

cluster_var_run_t

  • /run/crm(/.*)?
  • /run/cman_.*
  • /run/rsctmp(/.*)?
  • /run/aisexec.*
  • /run/heartbeat(/.*)?
  • /run/pcsd-ruby.socket
  • /run/corosync-qnetd(/.*)?
  • /run/corosync-qdevice(/.*)?
  • /run/pcsd.socket
  • /run/corosync.pid
  • /run/cpglockd.pid
  • /run/rgmanager.pid
  • /run/cluster/rgmanager.sk

drbd_lock_t

  • /run/lock/subsys/drbd

drbd_tmp_t

(no default paths listed β€” she's lowkey mysterious too)

drbd_var_lib_t

  • /var/lib/drbd(/.*)?

drbd_var_run_t

  • /run/drbd(/.*)?

krb5_host_rcache_t

  • /var/tmp/krb5_0.rcache2
  • /var/cache/krb5rcache(/.*)?
  • /var/tmp/nfs_0
  • /var/tmp/DNS_25
  • /var/tmp/host_0
  • /var/tmp/imap_0
  • /var/tmp/HTTP_23
  • /var/tmp/HTTP_48
  • /var/tmp/ldap_55
  • /var/tmp/ldap_487
  • /var/tmp/ldapmap1_0

root_t

  • /sysroot/.aleph-version.json
  • /sysroot/ostree/deploy/.*-atomic/deploy(/.*)?
  • /
  • /initrd
  • /var/lib/ntp

like, that's a lot of file types and they all have their own little path lists. but that's the whole point β€” SELinux is very granular and very iconic. πŸ’…


🏷️ FILE CONTEXTS 🏷️

SELinux requires files to have an extended attribute to define the file type. it's literally metadata that says "this file is this kind of girl." you can see the context of a file using the -Z option to ls. so like:

ls -Z

policy governs the access confined processes have to these files. SELinux drbd policy is very flexible allowing users to setup their drbd processes in as secure a method as possible. (yes i said that already but it bears repeating because it's true and also slay.) 🌈


πŸ’… STANDARD FILE CONTEXT πŸ’…

SELinux defines the file context types for the drbd, 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, you're basically telling SELinux "hey bestie, this file over here? she's this type now."

semanage fcontext -a -t drbd_exec_t '/srv/drbd/content(/.*)?'
restorecon -R -v /srv/mydrbd_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. so like, (/.*)? is doing a lot of heavy lifting. respect.

the following file types are defined for drbd:


drbd_exec_t

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

Paths:

  • /usr/bin/drbdadm
  • /usr/bin/drbdsetup
  • /usr/lib/ocf/resource.d/linbit/drbd

drbd_initrc_exec_t

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

drbd_lock_t

  • Set files with the drbd_lock_t type, if you want to treat the files as drbd lock data, stored under the /var/lock directory.

drbd_tmp_t

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

drbd_var_lib_t

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

drbd_var_run_t

  • Set files with the drbd_var_run_t type, if you want to store the drbd files under the /run or /var/run directory.
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 the quick fix and semanage fcontext + restorecon is the real glow-up. don't mix 'em up. πŸ’–

πŸ› οΈ COMMANDS πŸ› οΈ

here's the toolkit, bestie. these commands are the ones you'll actually be using to manage all of this:

  • 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. some people like clicking, and that's valid.)

πŸ’– AUTHOR πŸ’–

This manual page was auto-generated using sepolicy manpage. so like, a script wrote it, but i'm the one giving it the personality it deserves. you're welcome. 🫢


πŸ”— SEE ALSO πŸ”—


okay that's literally the whole page and honestly? it ate. go forth and secure your drbd processes, bestie. you've got this. πŸ’…βœ¨

drbd β€” 26-10-06 β€” drbd_selinux(8) πŸŽ€ mwah β€” thanks for reading, love you, bye! πŸ’–πŸ¦‹πŸŒΈ
πŸ“¦ where this page comes from