ptchown_selinux(8)

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

πŸ’… ptchown_selinux(8) β€” like, the whole manual, but make it make sense

okay so bestie, welcome to ptchown_selinux β€” that's the manpage for the SELinux policy that keeps the ptchown processes in check. It's filed under "SELinux Policy ptchown" in section 8 of your manual, and honestly? She's iconic. Let's get into it. πŸŽ€


✨ NAME ✨

ptchown_selinux β€” the Security Enhanced Linux policy for the ptchown processes. that's the whole vibe. 🫢


🌸 DESCRIPTION 🌸

so, Security-Enhanced Linux secures the ptchown processes via flexible mandatory access control. yes bestie, mandatory. she's not asking, she's telling. πŸ’…

the ptchown processes run with the ptchown_t SELinux type. you wanna check if you've got these processes running? just run the ps command with the -Z qualifier, like this:

ps -eZ | grep ptchown_t

and boom, you'll see who's out there wearing the ptchown_t fit. πŸ”₯


πŸšͺ ENTRYPOINTS πŸšͺ

so how does a process even get into the ptchown_t club? glad you asked, babe. the ptchown_t SELinux type can be entered via the ptchown_exec_t file type. that's the invite-only door. 🎟️

and the default entrypoint paths for the ptchown_t domain are literally these two:

/usr/lib/pt_chown, /usr/libexec/pt_chown

no cap, those are the ones. ✨


πŸ‘‘ PROCESS TYPES πŸ‘‘

SELinux defines process types (aka domains) for each process running on the system. it's giving assigned seating at a very exclusive party. πŸŽ€

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

Policy governs the access that confined processes have to files. the SELinux ptchown policy is very flexible, allowing users to set up their ptchown processes in as secure a method as possible. she's adaptable AND safe. main character energy. πŸ’œ

the following process types are defined for ptchown:

  • ptchown_t
Note: semanage permissive -a ptchown_t can be used to make the process type ptchown_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so like… she won't block you, but she will be watching and taking notes. 😭

πŸ¦‹ BOOLEANS πŸ¦‹

SELinux policy is customizable based on least access required. the ptchown policy is extremely flexible and has several booleans that let you manipulate the policy and run ptchown with the tightest access possible. tightest. access. possible. periodt. πŸ”₯

so if you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. and hey β€” it's Enabled by default, so she's already slaying out of the box:

setsebool -P fips_mode 1

πŸ“ FILE CONTEXTS πŸ“

SELinux requires files to have an extended attribute to define the file type. it's like a name tag but for security. 🏷️

you can see the context of a file using the -Z option to ls. go look, she's labeled.

Policy governs the access confined processes have to these files. the SELinux ptchown policy is very flexible, allowing users to set up their ptchown processes in as secure a method as possible. yes, we're saying it again, because it's true. πŸ’–

🧚 STANDARD FILE CONTEXT 🧚

SELinux defines the file context types for ptchown. so if you wanted to store files with these types in a different path, 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 ptchown_exec_t '/srv/ptchown/content(/.*)?'
restorecon -R -v /srv/myptchown_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. regex girlies rise. 🌈

the following file types are defined for ptchown:

ptchown_exec_t

  • set files with the ptchown_exec_t type if you want to transition an executable to the ptchown_t domain. that's the glow-up pipeline right there. ⭐

Paths:

/usr/lib/pt_chown, /usr/libexec/pt_chown
Note: file context can be temporarily modified with the chcon command. but if you want to permanently change the file context, you need to use the semanage fcontext command. this will modify the SELinux labeling database. and then you'll need to use restorecon to apply the labels. temporary vs permanent, bestie β€” know the difference. πŸ’€

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

here's your toolbox, queen:

  • 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. for when you want to click instead of type. πŸ™ˆ

πŸ’œ AUTHOR πŸ’œ

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


πŸ“ SEE ALSO πŸ“

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

go read those too, iykyk. πŸ“š


and that's the whole thing, bestie β€” ptchown manual page, sourced from the ptchown package, dated 26-10-06, living in ptchown_selinux(8). mwah πŸ’‹ stay labeled, stay slay. πŸŽ€

πŸ“¦ where this page comes from