gnu: bind: Update to 9.14.3 [fixes CVE-2019-6471].
[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, 2018, 2019 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, 2017 Efraim Flashner <efraim@flashner.co.il>
7 ;;; Copyright © 2016, 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
9 ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
10 ;;; Copyright © 2018 Meiyo Peng <meiyo.peng@gmail.com>
11 ;;; Copyright © 2019 Leo Famulari <leo@famulari.name>
12 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
13 ;;;
14 ;;; This file is part of GNU Guix.
15 ;;;
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
20 ;;;
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
25 ;;;
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28
29 (define-module (gnu packages vpn)
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix packages)
32 #:use-module (guix download)
33 #:use-module (guix git-download)
34 #:use-module (guix build-system cmake)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system python)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages admin)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages check)
41 #:use-module (gnu packages autotools)
42 #:use-module (gnu packages compression)
43 #:use-module (gnu packages gettext)
44 #:use-module (gnu packages gnupg)
45 #:use-module (gnu packages libevent)
46 #:use-module (gnu packages linux)
47 #:use-module (gnu packages nss)
48 #:use-module (gnu packages perl)
49 #:use-module (gnu packages pkg-config)
50 #:use-module (gnu packages python)
51 #:use-module (gnu packages python-xyz)
52 #:use-module (gnu packages tls)
53 #:use-module (gnu packages xml))
54
55 (define-public gvpe
56 (package
57 (name "gvpe")
58 (version "3.1")
59 (source (origin
60 (method url-fetch)
61 (uri (string-append "mirror://gnu/gvpe/gvpe-"
62 version ".tar.gz"))
63 (sha256
64 (base32
65 "1cz8n75ksl0l908zc5l3rnfm1hv7130s2w8710799fr5sxrdbszi"))))
66 (build-system gnu-build-system)
67 (home-page "http://software.schmorp.de/pkg/gvpe.html")
68 (native-inputs `(("pkg-config" ,pkg-config)))
69 (inputs `(("openssl" ,openssl)
70 ("zlib" ,zlib)))
71 (synopsis "Secure VPN among multiple nodes over an untrusted network")
72 (description
73 "The GNU Virtual Private Ethernet creates a virtual network
74 with multiple nodes using a variety of transport protocols. It works
75 by creating encrypted host-to-host tunnels between multiple
76 endpoints.")
77 (license license:gpl3+)))
78
79 (define-public vpnc
80 (package
81 (name "vpnc")
82 (version "0.5.3")
83 (source (origin
84 (method url-fetch)
85 (uri (string-append "https://www.unix-ag.uni-kl.de/~massar/vpnc/vpnc-"
86 version ".tar.gz"))
87 (sha256 (base32
88 "1128860lis89g1s21hqxvap2nq426c9j4bvgghncc1zj0ays7kj6"))))
89 (build-system gnu-build-system)
90 (inputs `(("libgcrypt" ,libgcrypt)
91 ("perl" ,perl)
92 ("vpnc-scripts" ,vpnc-scripts)))
93 (arguments
94 `(#:tests? #f ; there is no check target
95 #:phases
96 (modify-phases %standard-phases
97 (add-after 'unpack 'use-store-paths
98 (lambda* (#:key inputs outputs #:allow-other-keys)
99 (let ((out (assoc-ref outputs "out"))
100 (vpnc-scripts (assoc-ref inputs "vpnc-scripts")))
101 (substitute* "config.c"
102 (("/etc/vpnc/vpnc-script")
103 (string-append vpnc-scripts "/etc/vpnc/vpnc-script")))
104 (substitute* "Makefile"
105 (("ETCDIR=.*")
106 (string-append "ETCDIR=" out "/etc/vpnc\n"))
107 (("PREFIX=.*")
108 (string-append "PREFIX=" out "\n")))
109 #t)))
110 (delete 'configure)))) ; no configure script
111 (synopsis "Client for Cisco VPN concentrators")
112 (description
113 "vpnc is a VPN client compatible with Cisco's EasyVPN equipment.
114 It supports IPSec (ESP) with Mode Configuration and Xauth. It supports only
115 shared-secret IPSec authentication with Xauth, AES (256, 192, 128), 3DES,
116 1DES, MD5, SHA1, DH1/2/5 and IP tunneling. It runs entirely in userspace.
117 Only \"Universal TUN/TAP device driver support\" is needed in the kernel.")
118 (license license:gpl2+) ; some file are bsd-2, see COPYING
119 (home-page "http://www.unix-ag.uni-kl.de/~massar/vpnc/")))
120
121 (define-public vpnc-scripts
122 (let ((commit "1000e0f6dd7d6bff163169a46359211c1fc3a6d2"))
123 (package
124 (name "vpnc-scripts")
125 (version (string-append "20190116." (string-take commit 7)))
126 (source (origin
127 (method git-fetch)
128 (uri
129 (git-reference
130 (url "git://git.infradead.org/users/dwmw2/vpnc-scripts.git")
131 (commit commit)))
132 (file-name (git-file-name name version))
133 (sha256
134 (base32
135 "1g41yarz2bl0f73kbjqnywr485ghanbp7nmspklfb0n07yp0z6ak"))))
136 (build-system gnu-build-system)
137 (inputs `(("coreutils" ,coreutils)
138 ("grep" ,grep)
139 ("iproute2" ,iproute) ; for ‘ip’
140 ("net-tools" ,net-tools) ; for ‘ifconfig’, ‘route’
141 ("sed" ,sed)
142 ("which" ,which)))
143 (arguments
144 `(#:phases
145 (modify-phases %standard-phases
146 (add-after 'unpack 'use-relative-paths
147 ;; Patch the scripts to work with and use relative paths.
148 (lambda* _
149 (for-each (lambda (script)
150 (substitute* script
151 (("^PATH=.*") "")
152 (("(/usr|)/s?bin/") "")
153 (("\\[ +-x +([^]]+) +\\]" _ command)
154 (string-append "command -v >/dev/null 2>&1 "
155 command))))
156 (find-files "." "^vpnc-script"))
157 #t))
158 (delete 'configure) ; no configure script
159 (replace 'build
160 (lambda _
161 (invoke "gcc" "-o" "netunshare" "netunshare.c")))
162 (replace 'install
163 ;; There is no Makefile; manually install the relevant files.
164 (lambda* (#:key outputs #:allow-other-keys)
165 (let* ((out (assoc-ref outputs "out"))
166 (etc (string-append out "/etc/vpnc")))
167 (for-each (lambda (file)
168 (install-file file etc))
169 (append (find-files "." "^vpnc-script")
170 (list "netunshare"
171 "xinetd.netns.conf")))
172 #t)))
173 (add-after 'install 'wrap-scripts
174 ;; Wrap scripts with paths to their common hard dependencies.
175 ;; Optional dependencies will need to be installed by the user.
176 (lambda* (#:key inputs outputs #:allow-other-keys)
177 (let ((out (assoc-ref outputs "out")))
178 (for-each
179 (lambda (script)
180 (wrap-program script
181 `("PATH" ":" prefix
182 ,(map (lambda (name)
183 (let ((input (assoc-ref inputs name)))
184 (string-append input "/bin:"
185 input "/sbin")))
186 (list "coreutils"
187 "grep"
188 "iproute2"
189 "net-tools"
190 "sed"
191 "which")))))
192 (find-files (string-append out "/etc/vpnc/vpnc-script")
193 "^vpnc-script"))
194 #t))))
195 #:tests? #f)) ; no tests
196 (home-page "http://git.infradead.org/users/dwmw2/vpnc-scripts.git")
197 (synopsis "Network configuration scripts for Cisco VPN clients")
198 (description
199 "This set of scripts configures routing and name services when invoked
200 by the VPNC or OpenConnect Cisco @dfn{Virtual Private Network} (VPN) clients.
201
202 The default @command{vpnc-script} automatically configures most common
203 connections, and provides hooks for performing custom actions at various stages
204 of the connection or disconnection process.
205
206 Alternative scripts are provided for more complicated set-ups, or to serve as an
207 example for writing your own. For example, @command{vpnc-script-sshd} contains
208 the entire VPN in a network namespace accessible only through SSH.")
209 (license license:gpl2+))))
210
211 (define-public ocproxy
212 (package
213 (name "ocproxy")
214 (version "1.60")
215 (source (origin
216 (method url-fetch)
217 (uri (string-append
218 "https://github.com/cernekee/ocproxy/archive/v"
219 version ".tar.gz"))
220 (file-name (string-append name "-" version ".tar.gz"))
221 (sha256
222 (base32
223 "1b4rg3xq5jnrp2l14sw0msan8kqhdxmsd7gpw9lkiwvxy13pcdm7"))))
224 (build-system gnu-build-system)
225 (native-inputs
226 `(("autoconf" ,autoconf)
227 ("automake" ,automake)))
228 (inputs
229 `(("libevent" ,libevent)))
230 (arguments
231 '(#:phases
232 (modify-phases %standard-phases
233 (add-after 'unpack 'autogen
234 (lambda _ (invoke "sh" "autogen.sh"))))))
235 (home-page "https://github.com/cernekee/ocproxy")
236 (synopsis "OpenConnect proxy")
237 (description
238 "User-level @dfn{SOCKS} and port forwarding proxy for OpenConnect based
239 on LwIP. When using ocproxy, OpenConnect only handles network activity that
240 the user specifically asks to proxy, so the @dfn{VPN} interface no longer
241 \"hijacks\" all network traffic on the host.")
242 (license license:bsd-3)))
243
244 (define-public openconnect
245 (package
246 (name "openconnect")
247 (version "8.03")
248 (source (origin
249 (method url-fetch)
250 (uri (string-append "ftp://ftp.infradead.org/pub/openconnect/"
251 "openconnect-" version ".tar.gz"))
252 (sha256 (base32
253 "1wlypi68kqqg2mdck8wvf6aanhrmf9i7z6lngyxvcrp23jdzz34h"))))
254 (build-system gnu-build-system)
255 (inputs
256 `(("libxml2" ,libxml2)
257 ("gnutls" ,gnutls)
258 ("vpnc-scripts" ,vpnc-scripts)
259 ("zlib" ,zlib)))
260 (native-inputs
261 `(("gettext" ,gettext-minimal)
262 ("pkg-config" ,pkg-config)))
263 (arguments
264 `(#:configure-flags
265 `(,(string-append "--with-vpnc-script="
266 (assoc-ref %build-inputs "vpnc-scripts")
267 "/etc/vpnc/vpnc-script"))))
268 (synopsis "Client for Cisco VPN")
269 (description
270 "OpenConnect is a client for Cisco's AnyConnect SSL VPN, which is
271 supported by the ASA5500 Series, by IOS 12.4(9)T or later on Cisco SR500,
272 870, 880, 1800, 2800, 3800, 7200 Series and Cisco 7301 Routers,
273 and probably others.")
274 (license license:lgpl2.1)
275 (home-page "https://www.infradead.org/openconnect/")))
276
277 (define-public openvpn
278 (package
279 (name "openvpn")
280 (version "2.4.7")
281 (source (origin
282 (method url-fetch)
283 (uri (string-append
284 "https://swupdate.openvpn.org/community/releases/openvpn-"
285 version ".tar.xz"))
286 (sha256
287 (base32
288 "0j7na936isk9j8nsdrrbw7wmy09inmjqvsb8mw8az7k61xbm6bx4"))))
289 (build-system gnu-build-system)
290 (arguments
291 '(#:configure-flags '("--enable-iproute2=yes")))
292 (native-inputs
293 `(("iproute2" ,iproute)))
294 (inputs
295 `(("lz4" ,lz4)
296 ("lzo" ,lzo)
297 ("openssl" ,openssl)
298 ("linux-pam" ,linux-pam)))
299 (home-page "https://openvpn.net/")
300 (synopsis "Virtual private network daemon")
301 (description
302 "OpenVPN implements virtual private network (@dfn{VPN}) techniques
303 for creating secure point-to-point or site-to-site connections in routed or
304 bridged configurations and remote access facilities. It uses a custom
305 security protocol that utilizes SSL/TLS for key exchange. It is capable of
306 traversing network address translators (@dfn{NAT}s) and firewalls.")
307 (license license:gpl2)))
308
309 (define-public tinc
310 (package
311 (name "tinc")
312 (version "1.0.35")
313 (source (origin
314 (method url-fetch)
315 (uri (string-append "https://tinc-vpn.org/packages/"
316 name "-" version ".tar.gz"))
317 (sha256
318 (base32
319 "0pl92sdwrkiwgll78x0ww06hfljd07mkwm62g8x17qn3gha3pj0q"))))
320 (build-system gnu-build-system)
321 (arguments
322 '(#:configure-flags
323 '("--sysconfdir=/etc"
324 "--localstatedir=/var")))
325 (inputs `(("zlib" ,zlib)
326 ("lzo" ,lzo)
327 ("openssl" ,openssl)))
328 (home-page "https://tinc-vpn.org")
329 (synopsis "Virtual Private Network (VPN) daemon")
330 (description
331 "Tinc is a VPN that uses tunnelling and encryption to create a secure
332 private network between hosts on the internet.")
333 (license license:gpl2+)))
334
335 (define-public sshuttle
336 (package
337 (name "sshuttle")
338 (version "0.78.5")
339 (source
340 (origin
341 (method url-fetch)
342 (uri (pypi-uri name version))
343 (sha256
344 (base32
345 "0vp13xwrhx4m6zgsyzvai84lkq9mzkaw47j58dk0ll95kaymk2x8"))))
346 (build-system python-build-system)
347 (arguments
348 `(#:phases
349 (modify-phases %standard-phases
350 (add-after 'unpack 'patch-FHS-file-names
351 (lambda _
352 (substitute* "sshuttle/client.py"
353 (("/usr/bin/env") (which "env")))
354 (substitute* "sshuttle/ssh.py"
355 (("/bin/sh") "sh"))
356 #t)))))
357 (native-inputs
358 `(("python-setuptools-scm" ,python-setuptools-scm)
359 ;; For tests only.
360 ("python-flake8", python-flake8)
361 ("python-mock" ,python-mock)
362 ("python-pytest-cov" ,python-pytest-cov)
363 ("python-pytest-runner" ,python-pytest-runner)))
364 (home-page "https://github.com/sshuttle/sshuttle")
365 (synopsis "VPN that transparently forwards connections over SSH")
366 (description "sshuttle creates an encrypted virtual private network (VPN)
367 connection to any remote server to which you have secure shell (SSH) access.
368 The only requirement is a suitable version of Python on the server;
369 administrative privileges are required only on the client. Unlike most VPNs,
370 sshuttle forwards entire sessions, not packets, using kernel transparent
371 proxying. This makes it faster and more reliable than SSH's own tunneling and
372 port forwarding features. It can forward both TCP and UDP traffic, including
373 DNS domain name queries.")
374 (license license:lgpl2.0))) ; incorrectly identified as GPL in ‘setup.py’
375
376 (define-public sshoot
377 (package
378 (name "sshoot")
379 (version "1.2.6")
380 (source
381 (origin
382 (method url-fetch)
383 (uri (pypi-uri name version))
384 (sha256
385 (base32
386 "1ccgh0hjyxrwkgy3hnxz3hgbjbs0lmfs25d5l5jam0xbpcpj63h0"))))
387 (build-system python-build-system)
388 (arguments
389 '(#:phases
390 (modify-phases %standard-phases
391 (add-after 'unpack 'patch-paths
392 (lambda _
393 (substitute* "sshoot/tests/test_manager.py"
394 (("/bin/sh") (which "sh")))
395 #t)))))
396 (inputs
397 `(("python-argcomplete" ,python-argcomplete)
398 ("python-prettytable" ,python-prettytable)
399 ("python-pyyaml" ,python-pyyaml)))
400 ;; For tests only.
401 (native-inputs
402 `(("python-fixtures" ,python-fixtures)
403 ("python-pbr" ,python-pbr)
404 ("python-testtools" ,python-testtools)))
405 (home-page "https://github.com/albertodonato/sshoot")
406 (synopsis "sshuttle VPN session manager")
407 (description "sshoot provides a command-line interface to manage multiple
408 @command{sshuttle} virtual private networks. It supports flexible profiles
409 with configuration options for most of @command{sshuttle}’s features.")
410 (license license:gpl3+)))
411
412 (define-public badvpn
413 (package
414 (name "badvpn")
415 (version "1.999.130")
416 (source
417 (origin
418 (method git-fetch)
419 (uri (git-reference
420 (url "https://github.com/ambrop72/badvpn.git")
421 (commit version)))
422 (file-name (git-file-name name version))
423 (sha256
424 (base32 "0rm67xhi7bh3yph1vh07imv5y1pwyldvw3wa5bz471g8mnkc7d3c"))))
425 (build-system cmake-build-system)
426 (arguments
427 '(#:tests? #f)) ; no tests
428 (inputs
429 `(("nspr" ,nspr)
430 ("nss" ,nss)
431 ("openssl" ,openssl)))
432 (native-inputs
433 `(("pkg-config" ,pkg-config)))
434 (home-page "https://github.com/ambrop72/badvpn")
435 (synopsis "Peer-to-peer virtual private network (VPN)")
436 (description "@code{BadVPN} is a collection of virtual private
437 network (VPN) tools. It includes:
438
439 @enumerate
440 @item NCD programming language.\n
441 NCD (Network Configuration Daemon) is a daemon and programming/scripting
442 language for configuration of network interfaces and other aspects of the
443 operating system.
444 @item Tun2socks network-layer proxifier.\n
445 The tun2socks program socksifes TCP connections at the network layer. It
446 implements a TUN device which accepts all incoming TCP connections (regardless
447 of destination IP), and forwards the connections through a SOCKS server.
448 @item Peer-to-peer VPN.\n
449 The peer-to-peer VPN implements a Layer 2 (Ethernet) network between the peers
450 (VPN nodes).
451 @end enumerate")
452 ;; This project contains a bundled lwIP. lwIP is also released under the
453 ;; 3-clause BSD license.
454 (license license:bsd-3)))
455
456 (define-public wireguard
457 (package
458 (name "wireguard")
459 (version "0.0.20190601")
460 (source (origin
461 (method url-fetch)
462 (uri (string-append "https://git.zx2c4.com/WireGuard/snapshot/"
463 "WireGuard-" version ".tar.xz"))
464 (sha256
465 (base32
466 "0s2mys78whsr0yw045a132iqx6nfy3c6hppiskbln5x04hc4ca3m"))))
467 (build-system gnu-build-system)
468 (outputs '("out" ; The WireGuard userspace tools
469 "kernel-patch")) ; A patch to build Linux with WireGuard support
470 (arguments
471 `(#:tests? #f ; No tests available.
472 #:make-flags
473 (list "CC=gcc"
474 "WITH_BASHCOMPLETION=yes"
475 ;; Build and install the helper script wg-quick(8).
476 "WITH_WGQUICK=yes"
477 (string-append "PREFIX=" (assoc-ref %outputs "out"))
478 (string-append "SYSCONFDIR=" (assoc-ref %outputs "out") "/etc"))
479 #:modules ((guix build gnu-build-system)
480 (guix build utils)
481 (ice-9 popen)
482 (ice-9 textual-ports))
483 #:phases
484 (modify-phases %standard-phases
485 ;; There is no ./configure script.
486 (delete 'configure)
487 ;; Until WireGuard is added to the upstream Linux kernel, it is
488 ;; distributed as a kernel patch generated by this script.
489 (add-after 'patch-source-shebangs 'make-patch
490 (lambda* (#:key outputs #:allow-other-keys)
491 (let* ((output (string-append (assoc-ref outputs "kernel-patch")
492 "/wireguard.patch"))
493 (patch-builder "./contrib/kernel-tree/create-patch.sh")
494 (port (open-input-pipe patch-builder))
495 (str (get-string-all port)))
496 (close-pipe port)
497 (mkdir-p (dirname output))
498 (call-with-output-file output
499 (lambda (port)
500 (format port "~a" str))))
501 #t))
502 (add-after 'make-patch 'chdir
503 (lambda _
504 (chdir "src/tools")
505 #t))
506 ;; Otherwise the 'install-license-file' phase installs nothing.
507 ;; <https://bugs.gnu.org/34703>
508 (add-after 'install 'reset-cwd
509 (lambda _
510 (chdir "../..")
511 #t)))))
512 (inputs
513 `(("libmnl" ,libmnl)))
514 (home-page "https://www.wireguard.com/")
515 (synopsis "Tools for configuring WireGuard")
516 (description "This package provides the userspace tools for setting and
517 retrieving configuration of WireGuard network tunnel interfaces, and a patch
518 that can be applied to a Linux kernel source tree in order to build it with
519 WireGuard support.")
520 (license license:gpl2)))
521
522 (define-public xl2tpd
523 (package
524 (name "xl2tpd")
525 (version "1.3.14")
526 (source (origin
527 (method git-fetch)
528 (uri (git-reference
529 (url "https://github.com/xelerance/xl2tpd")
530 (commit (string-append "v" version))))
531 (file-name (git-file-name name version))
532 (sha256
533 (base32
534 "1c2ahxz2zmmxwmk951d2qhijgz67zhwa1hn0r59fgz0y14w22myi"))))
535 (build-system gnu-build-system)
536 (arguments
537 `(#:make-flags (list (string-append "DESTDIR=" %output)
538 "CC=gcc")
539 #:phases (modify-phases %standard-phases
540 (delete 'configure)) ; no configure script
541 #:tests? #f)) ; no tests provided
542 (inputs `(("libpcap" ,libpcap)))
543 (home-page "https://www.xelerance.com/software/xl2tpd/")
544 (synopsis "Layer 2 Tunnelling Protocol Daemon (RFC 2661)")
545 (description
546 "xl2tpd is an implementation of the Layer 2 Tunnelling Protocol (RFC 2661).
547 L2TP allows you to tunnel PPP over UDP.")
548 (license license:gpl2)))