1 |
commit: 66bb200d47dcfa85b39c491171b4f3a6a4f341ed |
2 |
Author: Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be> |
3 |
AuthorDate: Wed Mar 4 16:42:33 2015 +0000 |
4 |
Commit: Sven Vermeulen <swift <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 4 16:42:33 2015 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=66bb200d |
7 |
|
8 |
Support SSH agent forwarding |
9 |
|
10 |
When using SSH agent forwarding, the SSH daemon creates the necessary |
11 |
sockets somewhere in a random /tmp/ssh-* location. These sockets get the |
12 |
sshd_tmp_t type associated. |
13 |
|
14 |
Currently, the SSH client (running as ssh_t) does not have any |
15 |
privileges on sshd_tmp_t *socket* files, but it has manage rights on the |
16 |
*regular* files. This means that any attempt to make use of the agent |
17 |
forwarding (i.e. from the logged-in server, attempt to SSH to another |
18 |
server while using the SSH agent running on the users' workstation) will |
19 |
fail. |
20 |
|
21 |
By granting rw_socket_file_perms permissions to ssh_t against the |
22 |
sshd_tmp_t socket files, agent forwarding is working well. |
23 |
|
24 |
X-Gentoo-Bug: 529336 |
25 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=529336 |
26 |
|
27 |
policy/modules/services/ssh.te | 5 +++++ |
28 |
1 file changed, 5 insertions(+) |
29 |
|
30 |
diff --git a/policy/modules/services/ssh.te b/policy/modules/services/ssh.te |
31 |
index 147888c..b63f585 100644 |
32 |
--- a/policy/modules/services/ssh.te |
33 |
+++ b/policy/modules/services/ssh.te |
34 |
@@ -358,3 +358,8 @@ optional_policy(` |
35 |
optional_policy(` |
36 |
udev_read_db(ssh_keygen_t) |
37 |
') |
38 |
+ |
39 |
+ifdef(`distro_gentoo',` |
40 |
+ # Fix bug #529336 - Allow ssh_t to read/write sshd_tmp_t sockets (ssh agent forwarding) |
41 |
+ allow ssh_t sshd_tmp_t:sock_file rw_sock_file_perms; |
42 |
+') |