gnu: Add sshoot.
[jackhill/guix/guix.git] / gnu / packages / vpn.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013, 2016 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
5 ;;; Copyright © 2015 Jeff Mickey <j@codemac.net>
6 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages vpn)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix build-system python)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages gettext)
33 #:use-module (gnu packages gnupg)
34 #:use-module (gnu packages linux)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages python)
38 #:use-module (gnu packages tls)
39 #:use-module (gnu packages xml))
40
41 (define-public gvpe
42 (package
43 (name "gvpe")
44 (version "3.0")
45 (source (origin
46 (method url-fetch)
47 (uri (string-append "mirror://gnu/gvpe/gvpe-"
48 version ".tar.gz"))
49 (sha256
50 (base32
51 "1v61mj25iyd91z0ir7cmradkkcm1ffbk52c96v293ibsvjs2s2hf"))))
52 (build-system gnu-build-system)
53 (home-page "http://software.schmorp.de/pkg/gvpe.html")
54 (inputs `(("openssl" ,openssl)
55 ("zlib" ,zlib)))
56 (synopsis "Secure VPN among multiple nodes over an untrusted network")
57 (description
58 "The GNU Virtual Private Ethernet creates a virtual network
59 with multiple nodes using a variety of transport protocols. It works
60 by creating encrypted host-to-host tunnels between multiple
61 endpoints.")
62 (license license:gpl3+)))
63
64 (define-public vpnc
65 (package
66 (name "vpnc")
67 (version "0.5.3")
68 (source (origin
69 (method url-fetch)
70 (uri (string-append "https://www.unix-ag.uni-kl.de/~massar/vpnc/vpnc-"
71 version ".tar.gz"))
72 (sha256 (base32
73 "1128860lis89g1s21hqxvap2nq426c9j4bvgghncc1zj0ays7kj6"))
74 (patches (search-patches "vpnc-script.patch"))))
75 (build-system gnu-build-system)
76 (inputs `(("libgcrypt" ,libgcrypt)
77 ("perl" ,perl)
78
79 ;; The following packages provide commands that 'vpnc-script'
80 ;; expects.
81 ("net-tools" ,net-tools) ;ifconfig, route
82 ("iproute2" ,iproute))) ;ip
83 (arguments
84 `(#:tests? #f ; there is no check target
85 #:phases
86 (modify-phases %standard-phases
87 (replace 'configure
88 (lambda* (#:key outputs #:allow-other-keys)
89 (let ((out (assoc-ref outputs "out")))
90 (substitute* "Makefile"
91 (("PREFIX=/usr/local") (string-append "PREFIX=" out)))
92 (substitute* "Makefile"
93 (("ETCDIR=/etc/vpnc") (string-append "ETCDIR=" out
94 "/etc/vpnc"))))))
95 (add-after 'install 'wrap-vpnc-script
96 (lambda* (#:key inputs outputs #:allow-other-keys)
97 ;; Wrap 'etc/vpnc/vpnc-script' so that it finds the commands it
98 ;; needs. Assume coreutils/grep/sed are in $PATH.
99 (let ((out (assoc-ref outputs "out")))
100 (wrap-program (string-append out "/etc/vpnc/vpnc-script")
101 `("PATH" ":" prefix
102 (,(string-append (assoc-ref inputs "net-tools")
103 "/sbin")
104 ,(string-append (assoc-ref inputs "net-tools")
105 "/bin")
106 ,(string-append (assoc-ref inputs "iproute2")
107 "/sbin"))))))))))
108 (synopsis "Client for Cisco VPN concentrators")
109 (description
110 "vpnc is a VPN client compatible with Cisco's EasyVPN equipment.
111 It supports IPSec (ESP) with Mode Configuration and Xauth. It supports only
112 shared-secret IPSec authentication with Xauth, AES (256, 192, 128), 3DES,
113 1DES, MD5, SHA1, DH1/2/5 and IP tunneling. It runs entirely in userspace.
114 Only \"Universal TUN/TAP device driver support\" is needed in the kernel.")
115 (license license:gpl2+) ; some file are bsd-2, see COPYING
116 (home-page "http://www.unix-ag.uni-kl.de/~massar/vpnc/")))
117
118
119 (define-public openconnect
120 (package
121 (name "openconnect")
122 (version "7.07")
123 (source (origin
124 (method url-fetch)
125 (uri (string-append "ftp://ftp.infradead.org/pub/openconnect/"
126 "openconnect-" version ".tar.gz"))
127 (sha256 (base32
128 "0rl33f1g42hxzqfv2a33gls8cb77q4w432xkims1dnfwhzagrv7k"))))
129 (build-system gnu-build-system)
130 (inputs
131 `(("libxml2" ,libxml2)
132 ("gnutls" ,gnutls)
133 ("vpnc" ,vpnc)
134 ("zlib" ,zlib)))
135 (native-inputs
136 `(("gettext" ,gettext-minimal)
137 ("pkg-config" ,pkg-config)))
138 (arguments
139 `(#:configure-flags
140 `(,(string-append "--with-vpnc-script="
141 (assoc-ref %build-inputs "vpnc")
142 "/etc/vpnc/vpnc-script"))))
143 (synopsis "Client for Cisco VPN")
144 (description
145 "OpenConnect is a client for Cisco's AnyConnect SSL VPN, which is
146 supported by the ASA5500 Series, by IOS 12.4(9)T or later on Cisco SR500,
147 870, 880, 1800, 2800, 3800, 7200 Series and Cisco 7301 Routers,
148 and probably others.")
149 (license license:lgpl2.1)
150 (home-page "http://www.infradead.org/openconnect/")))
151
152 (define-public openvpn
153 (package
154 (name "openvpn")
155 (version "2.3.9")
156 (source (origin
157 (method url-fetch)
158 (uri (string-append
159 "https://swupdate.openvpn.org/community/releases/openvpn-"
160 version ".tar.xz"))
161 (sha256
162 (base32
163 "1hfwmdsp7s34qx34qgwrpp89h30744lbsks6y619cdh27bpnpwaj"))))
164 (build-system gnu-build-system)
165 (arguments
166 '(#:configure-flags '("--enable-iproute2=yes")))
167 (native-inputs
168 `(("iproute2" ,iproute)))
169 (inputs
170 `(("lzo" ,lzo)
171 ("openssl" ,openssl)
172 ("linux-pam" ,linux-pam)))
173 (home-page "https://openvpn.net/")
174 (synopsis "Virtual private network daemon")
175 (description "OpenVPN implements virtual private network (VPN) techniques
176 for creating secure point-to-point or site-to-site connections in routed or
177 bridged configurations and remote access facilities. It uses a custom
178 security protocol that utilizes SSL/TLS for key exchange. It is capable of
179 traversing network address translators (NATs) and firewalls.")
180 (license license:gpl2)))
181
182 (define-public tinc
183 (package
184 (name "tinc")
185 (version "1.0.28")
186 (source (origin
187 (method url-fetch)
188 (uri (string-append "http://tinc-vpn.org/packages/"
189 name "-" version ".tar.gz"))
190 (sha256
191 (base32
192 "0i5kx3hza359nclyhb60kxlzqyx0phmg175350hww28g6scjcl0b"))))
193 (build-system gnu-build-system)
194 (arguments
195 '(#:configure-flags
196 '("--sysconfdir=/etc"
197 "--localstatedir=/var")))
198 (inputs `(("zlib" ,zlib)
199 ("lzo" ,lzo)
200 ("openssl" ,openssl)))
201 (home-page "http://tinc-vpn.org")
202 (synopsis "Virtual Private Network (VPN) daemon")
203 (description
204 "Tinc is a VPN that uses tunnelling and encryption to create a secure
205 private network between hosts on the internet.")
206 (license license:gpl2+)))
207
208 (define-public sshuttle
209 (package
210 (name "sshuttle")
211 (version "0.78.1")
212 (source
213 (origin
214 (method url-fetch)
215 (uri (pypi-uri name version))
216 (sha256
217 (base32
218 "0g1dpqigz02vafzh84z5990lnj9d95raknav0xmf0va7rr41d9q3"))))
219 (build-system python-build-system)
220 (native-inputs
221 `(("python-pytest-runner" ,python-pytest-runner)
222 ("python-setuptools-scm" ,python-setuptools-scm)
223 ;; For tests only.
224 ("python-mock" ,python-mock)
225 ("python-pytest" ,python-pytest)))
226 (home-page "https://github.com/sshuttle/sshuttle")
227 (synopsis "VPN that transparently forwards connections over SSH")
228 (description "sshuttle creates an encrypted virtual private network (VPN)
229 connection to any remote server to which you have secure shell (SSH) access.
230 The only requirement is a suitable version of Python on the server;
231 administrative privileges are required only on the client. Unlike most VPNs,
232 sshuttle forwards entire sessions, not packets, using kernel transparent
233 proxying. This makes it faster and more reliable than SSH's own tunneling and
234 port forwarding features. It can forward both TCP and UDP traffic, including
235 DNS domain name queries.")
236 (license license:lgpl2.0))) ; incorrectly identified as GPL in ‘setup.py’
237
238 (define-public sshoot
239 (package
240 (name "sshoot")
241 (version "1.2.5")
242 (source
243 (origin
244 (method url-fetch)
245 (uri (pypi-uri name version))
246 (sha256
247 (base32
248 "0a92lk8790dpp9j64vb6p4sazax0x3nby01lnfll7mxs1hx6n27q"))))
249 (build-system python-build-system)
250 (inputs
251 `(("python-argcomplete" ,python-argcomplete)
252 ("python-prettytable" ,python-prettytable)
253 ("python-pyyaml" ,python-pyyaml)))
254 ;; For tests only.
255 (native-inputs
256 `(("python-fixtures" ,python-fixtures)
257 ("python-pbr" ,python-pbr)
258 ("python-testtools" ,python-testtools)))
259 (home-page "https://bitbucket.org/ack/sshoot")
260 (synopsis "sshuttle VPN session manager")
261 (description "sshoot provides a command-line interface to manage multiple
262 @command{sshuttle} virtual private networks. It supports flexible profiles
263 with configuration options for most of @command{sshuttle}’s features.")
264 (license license:gpl3+)))