gpg_selinux(8)

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

πŸ’… gpg_selinux(8) β€” like, the whole SELinux tea on gpg processes 🫢

okay bestie, welcome to gpg_selinux(8), the manual page for the SELinux policy that governs the gpg processes. it's giving security, it's giving mandatory access control, and honestly? it ate. let's get into it ✨


🌸 NAME 🌸

gpg_selinux β€” Security Enhanced Linux Policy for the gpg processes. periodt.


πŸ¦‹ DESCRIPTION πŸ¦‹

Security-Enhanced Linux secures the gpg processes via flexible mandatory access control. no cap, that's the whole vibe.

The gpg processes execute with the gpg_t SELinux type. wanna check if you've got these processes running? run the ps command with the -Z qualifier, easy.

For example:

ps -eZ | grep gpg_t

see? lowkey iconic. πŸ’–


πŸŽ€ ENTRYPOINTS πŸŽ€

So the gpg_t SELinux type can be entered via the gpg_exec_t file type. that's the door, that's the entrance, that's the main character energy.

The default entrypoint paths for the gpg_t domain are:

/usr/bin/gpg(2)?, /usr/lib/gnupg/.*, /usr/bin/gpgsm

πŸ‘‘ PROCESS TYPES πŸ‘‘

SELinux defines process types (domains) for each process running on the system. yes, every single one gets a little label, we love that for them.

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

Policy governs the access confined processes have to files. SELinux gpg policy is very flexible β€” it allows users to set up their gpg processes in as secure a method as possible. flexible AND responsible? we stan. πŸ’…

The following process types are defined for gpg:

  • gpg_t
  • gpg_agent_t
  • gpg_helper_t
  • gpg_pinentry_t
  • gpg_web_t
Note: semanage permissive -a gpg_t can be used to make the process type gpg_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so like, it's chill but it's still watching πŸ‘€

✨ BOOLEANS ✨

SELinux policy is customizable based on least access required. gpg policy is extremely flexible and has several booleans that allow you to manipulate the policy and run gpg with the tightest access possible. tightest access possible = the vibe check of security, fr fr.

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

πŸ“ MANAGED FILES πŸ“

The SELinux process type gpg_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. and hey β€” the processes UID still need to have DAC permissions, don't forget that part bestie.

  • cifs_t
  • ecryptfs_t
/home/[^/]+/.Private(/.*)?
/home/[^/]+/.ecryptfs(/.*)?
  • etc_mail_t
/etc/mail(/.*)?
  • fusefs_t
/run/user/[0-9]+/gvfs
  • gnome_home_type
  • gpg_agent_tmp_t
/home/[^/]+/.gnupg/log-socket
  • gpg_secret_t
/root/.gnupg(/.+)?
/etc/mail/spamassassin/sa-update-keys(/.*)?
/home/[^/]+/.gnupg(/.+)?
  • insights_client_var_lib_t
/var/lib/insights(/.*)?
  • 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
  • mozilla_home_t
/home/[^/]+/.lyx(/.*)?
/home/[^/]+/.java(/.*)?
/home/[^/]+/.adobe(/.*)?
/home/[^/]+/.gnash(/.*)?
/home/[^/]+/.webex(/.*)?
/home/[^/]+/.IBMERS(/.*)?
/home/[^/]+/.galeon(/.*)?
/home/[^/]+/.spicec(/.*)?
/home/[^/]+/POkemon.*(/.*)?
/home/[^/]+/.icedtea(/.*)?
/home/[^/]+/.mozilla(/.*)?
/home/[^/]+/.phoenix(/.*)?
/home/[^/]+/.netscape(/.*)?
/home/[^/]+/.ICAClient(/.*)?
/home/[^/]+/.quakelive(/.*)?
/home/[^/]+/.macromedia(/.*)?
/home/[^/]+/.thunderbird(/.*)?
/home/[^/]+/.gcjwebplugin(/.*)?
/home/[^/]+/.grl-podcasts(/.*)?
/home/[^/]+/.cache/mozilla(/.*)?
/home/[^/]+/.icedteaplugin(/.*)?
/home/[^/]+/zimbrauserdata(/.*)?
/home/[^/]+/.juniper_networks(/.*)?
/home/[^/]+/.cache/icedtea-web(/.*)?
/home/[^/]+/abc
/home/[^/]+/mozilla.pdf
/home/[^/]+/.gnashpluginrc
  • nfs_t
  • rpm_var_cache_t
/var/adm/mount(/.*)?
/var/cache/dnf(/.*)?
/var/cache/yum(/.*)?
/var/cache/zypp(/.*)?
/var/spool/up2date(/.*)?
/var/cache/PackageKit(/.*)?
  • tmp_t
/sandbox(/.*)?
/tmp
/usr/tmp
/var/tmp
/var/tmp
/tmp-inst
/var/tmp-inst
/var/tmp/tmp-inst
/var/tmp/vi.recover

(and yes, /var/tmp is listed twice up there β€” that's literally what the policy says, i'm just the messenger 😭)

  • user_home_t
/home/[^/]+/.+
  • user_tmp_type β€” all user tmp files

🌈 FILE CONTEXTS 🌈

SELinux requires files to have an extended attribute to define the file type. it's like a name tag but for security metadata πŸŽ€

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

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

⭐ STANDARD FILE CONTEXT ⭐

SELinux defines the file context types for the gpg. so 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 gpg_exec_t '/srv/gpg/content(/.*)?'
restorecon -R -v /srv/mygpg_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 gpg:

gpg_agent_exec_t

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

gpg_agent_tmp_t

  • Set files with the gpg_agent_tmp_t type, if you want to store gpg agent temporary files in the /tmp directories.

gpg_agent_tmpfs_t

  • Set files with the gpg_agent_tmpfs_t type, if you want to store gpg agent files on a tmpfs file system.

gpg_exec_t

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

Paths:

/usr/bin/gpg(2)?, /usr/lib/gnupg/.*, /usr/bin/gpgsm

gpg_helper_exec_t

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

gpg_pinentry_tmp_t

  • Set files with the gpg_pinentry_tmp_t type, if you want to store gpg pinentry temporary files in the /tmp directories.

gpg_pinentry_tmpfs_t

  • Set files with the gpg_pinentry_tmpfs_t type, if you want to store gpg pinentry files on a tmpfs file system.

gpg_secret_t

  • Set files with the gpg_secret_t type, if you want to treat the files as gpg secret data.

Paths:

/root/.gnupg(/.+)?, /etc/mail/spamassassin/sa-update-keys(/.*)?,
/home/[^/]+/.gnupg(/.+)?

gpg_tmpfs_t

  • Set files with the gpg_tmpfs_t type, if you want to store gpg files on a tmpfs file system.
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 casual fling and semanage fcontext + restorecon is the committed relationship, iykyk πŸ’€

🧚 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. yes bestie, a whole GUI, for when the terminal is doing too much 🌸


πŸ’œ AUTHOR πŸ’œ

This manual page was auto-generated using sepolicy manpage.

(not me being auto-generated and still having this much personality 😭✨)


πŸ”₯ SEE ALSO πŸ”₯

(and yeah, some of those are listed twice β€” the manpage said it twice, so i said it twice. consistency queen πŸ‘‘)


okay that's the whole page, go forth and be secure πŸ¦‹ this was gpg_selinux(8), from the gpg source, dated 26-10-06 β€” mwah, love u, bye πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from