dhcpc_hook_selinux(8)

πŸ“¦
version 44.11 Β· 5 versions
, in fedora 44

✨ dhcpc_hook_selinux β€” the manual page, but make it make sense ✨

okay bestie, welcome to dhcpc_hook_selinux(8) πŸ’– this is the whole vibe of the SELinux policy for your dhcpc_hook processes, and I'm gonna walk you through it like we're texting at 2am. no gatekeeping here. 🫢


πŸ’… NAME πŸ’…

dhcpc_hook_selinux β€” the Security Enhanced Linux Policy for the dhcpc_hook processes. that's it, that's the name, she's simple and she's iconic. πŸ‘‘


🌸 DESCRIPTION 🌸

Security-Enhanced Linux secures the dhcpc_hook processes via flexible mandatory access control. yes, mandatory β€” SELinux is the friend who does not take no for an answer and honestly? we respect her for it. πŸ’€

so here's the tea: the dhcpc_hook processes execute with the dhcpc_hook_t SELinux type. want to check if you've got these processes running? run the ps command with the -Z qualifier. like this:

ps -eZ | grep dhcpc_hook_t

literally that's it. go look. I'll wait. πŸ¦‹


πŸŽ€ ENTRYPOINTS πŸŽ€

you can enter the dhcpc_hook_t SELinux type via the dhcpc_hook_exec_t file type. think of it like the one door into the club. πŸšͺ✨

the default entrypoint paths for the dhcpc_hook_t domain are, and I need you to write this down:

/usr/libexec/dhcpcd-run-hooks

periodt. that's the path. πŸ“


πŸ‘‘ PROCESS TYPES πŸ‘‘

SELinux defines process types (domains) for each process running on the system. every process gets a little name tag, so cute. 🏷️

you can see the context of a process using the -Z option to ps. yes, -Z again, she's everywhere, she's the main character.

policy governs the access confined processes have to files. SELinux dhcpc_hook policy is very flexible, allowing users to setup their dhcpc_hook processes in as secure a method as possible. flexible AND secure? she's doing both, no cap. πŸ’–

the following process types are defined for dhcpc_hook:

  • dhcpc_hook_t
Note: semanage permissive -a dhcpc_hook_t can be used to make the process type dhcpc_hook_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so like... she stops saying no out loud, but she's still side-eyeing you and writing it down. πŸ™ˆ

🌈 BOOLEANS 🌈

SELinux policy is customizable based on least access required. dhcpc_hook policy is extremely flexible and has several booleans that allow you to manipulate the policy and run dhcpc_hook with the tightest access possible. booleans are basically the on/off switches, the light dimmers of the SELinux world. πŸ’‘

if you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. Enabled by default. (she comes switched on, you don't gotta do anything, but here's how if you ever do)

setsebool -P fips_mode 1

πŸ“ MANAGED FILES πŸ“

the SELinux process type dhcpc_hook_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 ain't covering for you on that one, bestie. 🀝

dhcpc_var_run_t

/run/dhcpcd(/.*)?
/run/dhclient.*

net_conf_t

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

look at that list. she's thorough. every single one of those paths matters, so don't skip a line. πŸ‘€


🧚 FILE CONTEXTS 🧚

SELinux requires files to have an extended attribute to define the file type. yes, files have ✨attributes✨ now.

you can see the context of a file using the -Z option to ls. (-Z three times in one manpage, she's the moment.)

policy governs the access confined processes have to these files. SELinux dhcpc_hook policy is very flexible allowing users to setup their dhcpc_hook processes in as secure a method as possible. (same energy, still true.)

πŸ’œ STANDARD FILE CONTEXT πŸ’œ

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

semanage fcontext -a -t dhcpc_hook_exec_t '/srv/dhcpc_hook/content(/.*)?'
restorecon -R -v /srv/mydhcpc_hook_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. regex girlies rise up. πŸ”₯

the following file types are defined for dhcpc_hook:

  • dhcpc_hook_exec_t β€” Set files with the dhcpc_hook_exec_t type, if you want to transition an executable to the dhcpc_hook_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. so chcon is the temporary tattoo and semanage fcontext + restorecon is the real ink. choose wisely. πŸ’…

⭐ COMMANDS ⭐

here's your toolbox, bestie, all the little helpers:

  • 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 the girlies who like a little visual moment πŸŽ€)

πŸ¦‹ AUTHOR πŸ¦‹

This manual page was auto-generated using sepolicy manpage. she wrote herself, honestly iconic behavior. 😌


🌟 SEE ALSO 🌟

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


and that's the whole page, bestie!! you ate. πŸ’–

this little love letter is brought to you by the dhcpc_hook manual, version dated 26-09-29, and it lives under the name dhcpc_hook_selinux(8) β€” go forth and confine your processes responsibly. mwah. πŸ’…βœ¨

πŸ“¦ where this page comes from