gpg_selinux(8)
π
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_tgpg_agent_tgpg_helper_tgpg_pinentry_tgpg_web_t
Note:semanage permissive -a gpg_tcan be used to make the process typegpg_tpermissive. 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_tecryptfs_t
/home/[^/]+/.Private(/.*)?
/home/[^/]+/.ecryptfs(/.*)?
etc_mail_t
/etc/mail(/.*)?
fusefs_t
/run/user/[0-9]+/gvfs
gnome_home_typegpg_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_trpm_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_ttype, if you want to transition an executable to thegpg_agent_tdomain.
gpg_agent_tmp_t
- Set files with the
gpg_agent_tmp_ttype, if you want to store gpg agent temporary files in the/tmpdirectories.
gpg_agent_tmpfs_t
- Set files with the
gpg_agent_tmpfs_ttype, if you want to store gpg agent files on a tmpfs file system.
gpg_exec_t
- Set files with the
gpg_exec_ttype, if you want to transition an executable to thegpg_tdomain.
Paths:
/usr/bin/gpg(2)?, /usr/lib/gnupg/.*, /usr/bin/gpgsm
gpg_helper_exec_t
- Set files with the
gpg_helper_exec_ttype, if you want to transition an executable to thegpg_helper_tdomain.
gpg_pinentry_tmp_t
- Set files with the
gpg_pinentry_tmp_ttype, if you want to store gpg pinentry temporary files in the/tmpdirectories.
gpg_pinentry_tmpfs_t
- Set files with the
gpg_pinentry_tmpfs_ttype, if you want to store gpg pinentry files on a tmpfs file system.
gpg_secret_t
- Set files with the
gpg_secret_ttype, 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_ttype, if you want to store gpg files on a tmpfs file system.
Note: File context can be temporarily modified with thechconcommand. If you want to permanently change the file context you need to use thesemanage fcontextcommand. This will modify the SELinux labeling database. You will need to userestoreconto apply the labels. so like,chconis the casual fling andsemanage fcontext+restoreconis 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 π₯
selinux(8)gpg(8)semanage(8)restorecon(8)chcon(1)sepolicy(8)setsebool(8)gpg_agent_selinux(8)gpg_agent_selinux(8)gpg_helper_selinux(8)gpg_helper_selinux(8)gpg_pinentry_selinux(8)gpg_pinentry_selinux(8)gpg_web_selinux(8)gpg_web_selinux(8)
(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
- opensuse-leap 16.0: selinux-policy-doc 20250627+git412.dbf877ab7-160000.1.1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms