Skip to content

Commit e4565ac

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 f2f6504 commit e4565ac

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
@@ -147,6 +147,15 @@ template(`git_client_role_template',`
147147
# execute user utilities, e.g., editor
148148
corecmd_bin_domtrans($1_git_t, $2)
149149

150+
optional_policy(`
151+
tunable_policy(`git_client_use_gpg', `
152+
gpg_domtrans($1_git_t)
153+
dev_read_urand($1_git_t)
154+
155+
gpg_read_files($1_git_tmp_t)
156+
')
157+
')
158+
150159
# transition to ssh client domain when performing ssh operations
151160
optional_policy(`
152161
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)