Skip to contentSkip to conversation

policy for gpg-agent

PATCH New Thomas Bleher 1 participant 1 message Jul 2, 2004 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 policy for gpg-agent

The attached patch adds some policy for gpg-agent.
gpg-agent is a program to store gpg keys securely so users have to type their passphrase only once. When gpg-agent is asked to do an encryption or signature for the first time it calls pinentry-{qt,gtk} to get the passphrase from the user.
I do not know of other users of pinentry besides gpg-agent, so for now I have included the policy for pinentry in the gpg-agent policy. If other program use it too, it should probably be split into a macro.

This policy has been working fine on a few computers here for a week now; I have however only tested with pinentry-qt, so pinentry-gtk might need additional permissions.

Thomas

Signature · 2 lines
http://www.cip.ifi.lmu.de/~bleher/selinux/ - my SELinux pages
GPG-Fingerprint: BC4F BB16 30D6 F253 E3EA  D09E C562 2BAE B2F4 ABE7
domains/program/unused/gpg-agent.te +13 -0
diff -urN orig/domains/program/unused/gpg-agent.te mod/domains/program/unused/gpg-agent.te
@@ -0,0 +1,13 @@
+#DESC gpg-agent - agent to securely store gpg-keys
+#
+# Author: Thomas Bleher <[email protected]>
+#
+
+# Type for the gpg-agent executable.
+type gpg_agent_exec_t, file_type, exec_type, sysadmfile;
+
+# type for the pinentry executable
+type pinentry_exec_t, file_type, exec_type, sysadmfile;
+
+# Everything else is in the gpg_agent_domain macro in
+# macros/program/gpg_agent_macros.te.
file_contexts/program/gpg-agent.fc +3 -0
diff -urN orig/file_contexts/program/gpg-agent.fc mod/file_contexts/program/gpg-agent.fc
@@ -0,0 +1,3 @@
+# gpg-agent
+/usr/bin/gpg-agent	--	system_u:object_r:gpg_agent_exec_t
+/usr/bin/pinentry.*	--	system_u:object_r:pinentry_exec_t
macros/program/gpg_agent_macros.te +125 -0

125 lines not on this page · raw message

macros/program/gpg_macros.te +3 -0
diff -urN orig/macros/program/gpg_macros.te mod/macros/program/gpg_macros.te
@@ -94,4 +94,7 @@
 allow $1_t $1_gpg_secret_t:dir rw_dir_perms;
 
 dontaudit $1_gpg_t var_t:dir search;
+
+ifdef(`gpg-agent.te', `gpg_agent_domain($1)')
+
 ')dnl end gpg_domain definition