Skip to content

Commit 696e000

Browse files
committed
git_client_use_gpg tunable
git calls gpg when signing and validating commits, and needs to communicate with it through temporary files. Add a tunable to allow this domain transition, and for gpg to be able to read these temporary files. Signed-off-by: Antonio Enrico Russo <[email protected]>
1 parent 7551944 commit 696e000

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

policy/modules/services/git.if

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ template(`git_client_role_template',`
143143
# execute shell scripts
144144
corecmd_exec_shell($1_git_t)
145145

146+
optional_policy(`
147+
tunable_policy(`git_client_use_gpg', `
148+
gpg_domtrans($1_git_t)
149+
dev_read_urand($1_git_t)
150+
151+
gpg_read_files($1_git_tmp_t)
152+
')
153+
')
154+
146155
# transition to ssh client domain when performing ssh operations
147156
optional_policy(`
148157
ssh_client_domtrans($1_git_t)

policy/modules/services/git.te

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ gen_tunable(git_client_manage_all_user_home_content, false)
9696
## </desc>
9797
gen_tunable(git_client_exec_user_bin, false)
9898

99+
## <desc>
100+
## <p>
101+
## Determine whether Git client domains
102+
## can access gpg.
103+
## </p>
104+
## </desc>
105+
gen_tunable(git_client_use_gpg, false)
106+
99107
attribute git_daemon;
100108
attribute_role git_session_roles;
101109

0 commit comments

Comments
 (0)