wireguard_selinux(8)

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

πŸ’– wireguard_selinux β€” the manual, but make it make sense πŸ’–

okay so bestie, this is the wireguard_selinux(8) page β€” yes, that's the manual name, it's giving very "SELinux Policy wireguard" energy and honestly? iconic. sit down, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

wireguard_selinux β€” the Security Enhanced Linux Policy for the wireguard processes. that's it. that's the whole name. slay.


πŸ¦‹ SYNOPSIS πŸ¦‹

this page is pure documentation, no cap β€” there's no synopsis line to copy, so just vibe with the sections below.


🌸 DESCRIPTION 🌸

Security-Enhanced Linux secures the wireguard processes via flexible mandatory access control. yes, mandatory. yes, it means it. πŸ’…

The wireguard processes execute with the wireguard_t SELinux type. wanna check if you've got these processes running? just run the ps command with the -Z qualifier.

for example:

ps -eZ | grep wireguard_t

that's it. that's the vibe check. πŸ”₯


πŸŽ€ ENTRYPOINTS πŸŽ€

the wireguard_t SELinux type can be entered via the wireguard_exec_t file type.

the default entrypoint paths for the wireguard_t domain are literally these:

/usr/bin/wg-quick

one path. one icon. main character energy fr fr. πŸ‘‘


πŸ’œ PROCESS TYPES πŸ’œ

SELinux defines process types (domains) for each process running on the system. like, every process gets its own little domain, it's very "everyone gets a personality". 🧚

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

policy governs the access confined processes have to files. the SELinux wireguard policy is very flexible, allowing users to set up their wireguard processes in as secure a method as possible. flexible and secure? we love a multitasker. ✨

the following process types are defined for wireguard:

  • wireguard_t
Note: semanage permissive -a wireguard_t can be used to make the process type wireguard_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so like β€” it stops saying no, but it still keeps receipts. 😭

🌈 BOOLEANS 🌈

SELinux policy is customizable based on least access required. the wireguard policy is extremely flexible and has several booleans that allow you to manipulate the policy and run wireguard with the tightest access possible. tightest access possible = the goal, the dream, the aesthetic. πŸ’–

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 disable kernel module loading, you must turn on the secure_mode_insmod boolean. disabled by default.

setsebool -P secure_mode_insmod 1
three booleans, three little switches, and yes you setsebool -P all of them. the -P is the "make it permanent" one, don't forget it bestie. 🫢

πŸ¦‹ MANAGED FILES πŸ¦‹

the SELinux process type wireguard_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 β€” SELinux isn't out here doing DAC's job, okay? πŸ’€

cluster_conf_t

/etc/cluster(/.*)?

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

mount_var_run_t

/run/mount(/.*)?
/dev/.mount(/.*)?
/run/davfs2(/.*)?
/var/cache/davfs2(/.*)?

net_conf_t

/etc/hosts[^/]*
/etc/yp.conf.*
/etc/denyhosts.*
/run/netconfig(/.*)?
/etc/hosts.deny.*
/run/cloud-init(/.*)?
/etc/resolv.conf.*
/etc/.resolv.conf.*
/etc/resolv-secure.conf.*
/run/systemd/network(/.*)?
/etc/sysconfig/network(/.*)?
/etc/sysconfig/network/.*resolv.conf
/etc/sysconfig/networking(/.*)?
/run/NetworkManager/resolv.conf.*
/run/NetworkManager/no-stub-resolv.conf.*
/etc/sysconfig/network/scripts/functions.netconfig
/etc/ethers
/etc/ntp.conf
/run/systemd/resolve/resolv.conf
/run/systemd/resolve/stub-resolv.conf

root_t

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

tmpfs_t

/dev/shm
/run/shm
/usr/lib/udev/devices/shm

like, look at all those paths. that's a whole mood board. 🌸


πŸŽ€ FILE CONTEXTS πŸŽ€

SELinux requires files to have an extended attribute to define the file type. yes, an extended attribute. it's very "your file has a secret little label". πŸ™ˆ

you can see the context of a file using the -Z option to ls.

policy governs the access confined processes have to these files. the SELinux wireguard policy is very flexible, allowing users to set up their wireguard processes in as secure a method as possible.

⭐ STANDARD FILE CONTEXT ⭐

SELinux defines the file context types for the wireguard. 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.

semanage fcontext -a -t wireguard_exec_t '/srv/wireguard/content(/.*)?'
restorecon -R -v /srv/mywireguard_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. regex girlies rise. πŸ’…

the following file types are defined for wireguard:

wireguard_exec_t

  • set files with the wireguard_exec_t type, if you want to transition an executable to the wireguard_t domain.

wireguard_unit_file_t

  • set files with the wireguard_unit_file_t type, if you want to treat the files as wireguard unit content.
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, choose wisely 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. a GUI!! for when the terminal is doing too much. 🫢


🌟 AUTHOR 🌟

this manual page was auto-generated using sepolicy manpage.


πŸ’– SEE ALSO πŸ’–

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


and that's the whole page!! this was wireguard, dated 26-10-06, filed under wireguard_selinux(8) β€” go forth and label responsibly, bestie πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from