File: installation.md

package info (click to toggle)
fort-validator 1.6.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,064 kB
  • sloc: ansic: 33,015; makefile: 239; sh: 47; javascript: 30; xml: 15
file content (475 lines) | stat: -rw-r--r-- 18,094 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
---
title: Compilation and Installation
description: Guide to compile and install FORT Validator.
---

# {{ page.title }}

## Index

1. [Dependencies](#dependencies)
2. [Option 1: Installing the package](#option-1-installing-the-package)
	1. [Debian package](#debian-package)
	2. [FreeBSD package](#freebsd-package)
	3. [Gentoo package](#gentoo-package)
	4. [RHEL/CentOS package](#rhelcentos-package)
3. [Option 2: Compiling and installing the release tarball](#option-2-compiling-and-installing-the-release-tarball)
	1. [Debian version](#debian-version)
	2. [OpenBSD version](#openbsd-version)
	3. [RHEL/CentOS version](#rhelcentos-version)
	4. [Fedora version](#fedora-version)
	5. [openSUSE Leap version](#opensuse-leap-version)
	6. [FreeBSD version](#freebsd-version)
	7. [Slackware version](#slackware-version)
	8. [Gentoo version](#gentoo-version)
	9. [Alpine version](#alpine-version)
	10. [Rocky Linux 9](#rocky-linux-9)
4. [Option 3: Compiling and installing the git repository](#option-3-compiling-and-installing-the-git-repository)
5. [Option 4: Running from a Docker container](#option-4-running-from-a-docker-container)
6. [Fetching the TALs](#fetching-the-tals)

## Dependencies

> Note: This section is included in case you intend to install Fort in an unlisted OS (and therefore need a little research). For Debians, OpenBSD, RHEL/CentOS, Fedora, openSUSE Leap, FreeBSD, and Slackware just follow the steps in the sections below.

The dependencies are

1. [jansson](http://www.digip.org/jansson/)
2. libcrypto (Either [LibreSSL](http://www.libressl.org/) or [OpenSSL](https://www.openssl.org/) >= 1.1)
3. [rsync](http://rsync.samba.org/)
4. [libcurl](https://curl.haxx.se/libcurl/)
5. [libxml2](http://www.xmlsoft.org/)

Fort currently supports *64-bit* Operating Systems. A 32-bit OS may face the [Year 2038 problem](https://en.wikipedia.org/wiki/Year_2038_problem) when handling certificate dates, and there's no workaround for this at the moment.

## Option 1: Installing the package

### Debian package

Currently, there are 2 alternatives to install a debian package:
- [Latest version](#latest-version): this package is created as part of the latest release (currently {{ site.fort-latest-version }}) and is manually installed.
- [Debian repository version](#debian-repository-version): this package is at Debian repositories, so it can be fetched from there.

#### Latest version

Just download the .deb package and install it. The fort service is automatically started once the installation is done.

{% highlight bash %}
wget https://github.com/NICMx/FORT-validator/releases/download/{{ site.fort-latest-version }}/fort_{{ site.fort-latest-version }}-1_amd64.deb
sudo apt install ./fort_{{ site.fort-latest-version }}-1_amd64.deb
{% endhighlight %}

> If a dependency can't be found at the repositories (i.e. libcurl4), try using a newer repository, such as Debian Buster.
> 
> Add the following line to `/etc/apt/sources.list`, replacing the mirror (_http://ftp.mx.debian.org/debian_) with your [preferred one](https://www.debian.org/mirror/list):
> 
> `deb http://ftp.mx.debian.org/debian buster main`

This version ships with 4 of the 5 TALs, so in order to get the missing one, the [`--init-tals` argument](#--init-tals-argument) can be utilized using also the argument `--tal=/etc/fort/tal`:

{% highlight bash %}
sudo fort --init-tals --tal=/etc/fort/tal
# Don't forget to restart fort service
sudo service fort restart
{% endhighlight %}

Aside from the `fort` binary documented elsewhere in this documentation, the Debian package also ships with a systemd service, which is just the binary ran as a daemon. You can [configure](usage.html#--configuration-file) it at `/etc/fort/config.json`.

{% highlight bash %}
sudo service fort start
service fort status
tail /var/log/syslog
sudo service fort stop
{% endhighlight %}

Or, using systemctl:

{% highlight bash %}
sudo systemctl start fort
systemctl status fort
sudo systemctl stop fort

# In case you don't need to run fort on start
sudo systemctl disable fort
sudo systemctl enable fort
{% endhighlight %}

#### Debian repository version

Special thanks to [Marco d'Itri](https://github.com/rfc1036) for this collaboration.

To know the current status of this package, visit [`fort-validator` debian package tracker](https://tracker.debian.org/pkg/fort-validator).

The main differences between this version (fort-validator package) and the [Latest version](#latest-version) package are:
- [`rpki-trust-anchors`](https://tracker.debian.org/pkg/rpki-trust-anchors) dependency: this package has such dependency, while [Latest version](#latest-version) doesn't.
- Since this package isn't maintained by FORT validator's team, it could be at least one version behind than [Latest version](#latest-version).
- This version reads the TALs from `/etc/tals`, while [Latest version](#latest-version) reads them from `/etc/fort/tal`.

Assuming that the package is still at the `testing` repository, such repository can be added to the APT sources list in order to do a simple `apt install`.

First, check if the file `/etc/apt/apt.conf` exists, otherwise create it. The file should have the following line to keep using the stable repository as the default:

{% highlight bash %}
APT::Default-Release "stable";
{% endhighlight %}

Now add the Debian `testing` repositories, add the following lines to `/etc/apt/sources.list`:

{% highlight bash %}
deb http://deb.debian.org/debian/ testing main
deb-src http://deb.debian.org/debian/ testing main
{% endhighlight %}

Finally, just run:

{% highlight bash %}
sudo apt update
sudo apt -t testing install fort-validator
{% endhighlight %}

FORT validator is now installed as a service, check the status with `sudo service fort start`.

### FreeBSD package

FORT Validator is available in the FreeBSD ports tree since October 2021.  The port maintainer closely follows the development of FORT.  Updates to the FreeBSD port appear shortly after FORT releases.  Binary packages can be installed in the usual way:

{% highlight bash %}
pkg install fort
{% endhighlight %}

If you prefer to build software from ports, this works too:

{% highlight bash %}
cd /usr/ports/net/fort
make install clean
{% endhighlight %}

A default configuration will be installed in `/usr/local/etc/fort/fort-config.json`.  The package is careful not to overwrite an existing configuration.

To use FORT on FreeBSD, you will need the Trust Anchor Locator (TAL) files.  You can download these by running `fort --init-tals` as follows:

{% highlight bash %}
fort --init-tals --tal /usr/local/etc/fort/tal
{% endhighlight %}

When you have downloaded the TAL files, you can start the RTR server and validator with the included service script:

{% highlight bash %}
sysrc fort_enable=YES # or edit /etc/rc.conf manually
service fort start
{% endhighlight %}

The default configuration will bind the RTR server to localhost on port 8323.

### Gentoo package

Thanks to [@alarig](https://github.com/alarig) for [his collaboration](https://github.com/NICMx/FORT-validator/issues/23) creating this package.

> ![img/warn.svg](img/warn.svg) The package is currently at the [GURU repository](https://wiki.gentoo.org/wiki/Project:GURU), it could be at least one version behind the latest version, so please check first which version is the latest at the repository '[net-misc/FORT-validator](https://gitweb.gentoo.org/repo/proj/guru.git/tree/net-misc/FORT-validator)'.

Layman will be utilized, so it must be installed in order to add the GURU repository:

```bash
root# emerge --ask app-portage/layman
root# layman -a guru
```

Now, allow to install the unstable FORT validator package (use according to your architecture). The following lines can be used for **amd64** arch:

```bash
root# nano /etc/portage/package.accept_keywords
## Add the following line and save
net-misc/FORT-validator ~amd64
```

FORT validator can now be installed. Don't forget to update the TALs and restart the validator:

```bash
root# emerge --ask net-misc/FORT-validator
root# su -s /bin/sh -c '/usr/bin/fort --init-tals --tal /usr/share/fort/tal/' fort"
root# rc-service fort restart
```

The configuration file utilized by the service can be found at `/etc/fort/config.json` (see more about [configuration file](usage.html#--configuration-file)).

### RHEL/CentOS package

> **RHEL/CentOS 7** users: the EPEL repository must be enabled to successfully install FORT validator.
>
> The following command will do: `sudo yum install epel-release`

Download the .rpm and install it (currently tested at CentOS 7 and 8):

{% highlight bash %}
wget https://github.com/NICMx/FORT-validator/releases/download/{{ site.fort-latest-version }}/fort-{{ site.fort-latest-version }}-1.el8.x86_64.rpm
sudo yum install fort-{{ site.fort-latest-version }}-1.el8.x86_64.rpm
{% endhighlight %}

This version ships with 4 of the 5 TALs, so in order to get the missing one, the [`--init-tals` argument](#--init-tals-argument) can be utilized using also the argument `--tal=/etc/fort/tal`:

{% highlight bash %}
sudo fort --init-tals --tal=/etc/fort/tal
{% endhighlight %}

By default, FORT validator service isn't initialized once it's installed; so, initialize the service:

{% highlight bash %}
sudo systemctl start fort
systemctl status fort

# In case you want to stop it
sudo systemctl stop fort
{% endhighlight %}

The configuration file utilized by the service can be found at `/etc/fort/config.json` (see more about [configuration file](usage.html#--configuration-file)).

## Option 2: Compiling and installing the release tarball

### Debian version

{% highlight bash %}
sudo apt install autoconf automake build-essential libjansson-dev libssl-dev pkg-config rsync libcurl4-openssl-dev libxml2-dev

wget https://github.com/NICMx/FORT-validator/releases/download/{{ site.fort-latest-version }}/fort-{{ site.fort-latest-version }}.tar.gz
tar xvzf fort-{{ site.fort-latest-version }}.tar.gz
cd fort-{{ site.fort-latest-version }}/
./configure
make
sudo make install
{% endhighlight %}

### OpenBSD version

{% highlight bash %}
su
pkg_add curl jansson libexecinfo rsync libxml # OpenBSD already ships with LibreSSL
exit

ftp https://github.com/NICMx/FORT-validator/releases/download/{{ site.fort-latest-version }}/fort-{{ site.fort-latest-version }}.tar.gz
tar xzf fort-{{ site.fort-latest-version }}.tar.gz
cd fort-{{ site.fort-latest-version }}/
# clang is needed because of gnu11.
env CC=clang CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure
make
su
make install
exit
{% endhighlight %}

Last tested on OpenBSD 7.2.

### RHEL/CentOS version

#### RHEL/CentOS 8

The following steps are for RHEL/CentOS 8.

{% highlight bash %}
sudo dnf install autoconf automake gcc jansson-devel libcurl-devel libxml2-devel make openssl-devel pkgconfig rsync tar wget

wget https://github.com/NICMx/FORT-validator/releases/download/{{ site.fort-latest-version }}/fort-{{ site.fort-latest-version }}.tar.gz
tar xvzf fort-{{ site.fort-latest-version }}.tar.gz
cd fort-{{ site.fort-latest-version }}/
./configure
make
sudo make install
{% endhighlight %}

#### RHEL/CentOS 7

The following steps are for RHEL/CentOS 7.

This OS requires additional steps due to its default GCC version (currently 4.8.5, fort needs >= 4.9) and its default OpenSSL version (currently 1.0.2k, fort needs >= 1.1.0).

**Upgrade OpenSSL from 1.0.2k to 1.1.1c**

There are two options to upgrade OpenSSL:
1. Compile and install a newer version >= 1.1.0 (manual process).
2. Use the [EPEL](https://fedoraproject.org/wiki/EPEL) repository (indicated at the following steps).

**Upgrade GCC**

There are two options to upgrade GCC:
1. Compile and install a newer version >= 4.9 (slow process).
2. Use [Software Collections](https://www.softwarecollections.org) (indicated at the following steps).

{% highlight bash %}
sudo yum install centos-release-scl epel-release
sudo yum install autoconf automake devtoolset-8-gcc jansson-devel libcurl-devel libxml2-devel make openssl11-devel pkgconfig rsync tar wget
# Start a session using the upgraded GCC
scl enable devtoolset-8 bash
cd ~
wget https://github.com/NICMx/FORT-validator/releases/download/{{ site.fort-latest-version }}/fort-{{ site.fort-latest-version }}.tar.gz
tar xvzf fort-{{ site.fort-latest-version }}.tar.gz
cd fort-{{ site.fort-latest-version }}/
# Insert paths from newer OpenSSL version
export CFLAGS+=" $(pkg-config --cflags openssl11)" LDFLAGS+=" $(pkg-config --libs openssl11)"
./configure
make
sudo make install
# Close the 'devtoolset' session
exit
{% endhighlight %}

### Fedora version

The following steps are for Fedora 30 (and later).

{% highlight bash %}
sudo dnf install autoconf automake gcc jansson-devel libcurl-devel libxml2-devel make openssl-devel pkgconfig rsync tar wget
wget https://github.com/NICMx/FORT-validator/releases/download/{{ site.fort-latest-version }}/fort-{{ site.fort-latest-version }}.tar.gz
tar xvzf fort-{{ site.fort-latest-version }}.tar.gz
cd fort-{{ site.fort-latest-version }}/
./configure
make
sudo make install
{% endhighlight %}

### openSUSE Leap version

The following steps are for openSUSE Leap 15.1.

{% highlight bash %}
sudo zypper install autoconf automake gcc libopenssl-devel libjansson-devel libcurl-devel libxml2-devel

wget https://github.com/NICMx/FORT-validator/releases/download/{{ site.fort-latest-version }}/fort-{{ site.fort-latest-version }}.tar.gz
tar xvzf fort-{{ site.fort-latest-version }}.tar.gz
cd fort-{{ site.fort-latest-version }}/
./configure
make
sudo make install
{% endhighlight %}

### FreeBSD version

{% highlight bash %}
sudo pkg install autotools curl jansson pkgconf rsync libxml2
fetch https://github.com/NICMx/FORT-validator/releases/download/{{ site.fort-latest-version }}/fort-{{ site.fort-latest-version }}.tar.gz
tar xzf fort-{{ site.fort-latest-version }}.tar.gz
cd fort-{{ site.fort-latest-version }}/

export CFLAGS=-I/usr/local/include
./configure
make
sudo make install
{% endhighlight %}

Last tested on FreeBSD 13.1.

### Slackware version

The following steps are for Slackware "current" release (as of 2020-07-13).

All dependencies are included in the current release, so there's no need to install any dependency.

{% highlight bash %}
wget https://github.com/NICMx/FORT-validator/releases/download/{{ site.fort-latest-version }}/fort-{{ site.fort-latest-version }}.tar.gz
tar xvzf fort-{{ site.fort-latest-version }}.tar.gz
cd fort-{{ site.fort-latest-version }}/
./configure
make
sudo make install
{% endhighlight %}

### Gentoo version

The following steps are for Gentoo "current" release (as of 2020-07-13).

It's very likely that most of the dependencies are already installed (except `dev-libs/jansson`), still you can execute the following commands.

{% highlight bash %}
su
emerge sys-devel/autoconf sys-devel/automake net-misc/rsync net-misc/curl dev-libs/jansson 
exit

wget https://github.com/NICMx/FORT-validator/releases/download/{{ site.fort-latest-version }}/fort-{{ site.fort-latest-version }}.tar.gz
tar xvzf fort-{{ site.fort-latest-version }}.tar.gz
cd fort-{{ site.fort-latest-version }}/
./configure
make
su
make install
exit
{% endhighlight %}

### Alpine version

The following steps are for Alpine Linux 3.12.0

{% highlight bash %}
su
apk add build-base autoconf automake pkgconfig openssl-dev jansson-dev curl-dev libxml2-dev bsd-compat-headers rsync
exit

wget https://github.com/NICMx/FORT-validator/releases/download/{{ site.fort-latest-version }}/fort-{{ site.fort-latest-version }}.tar.gz
tar xvzf fort-{{ site.fort-latest-version }}.tar.gz
cd fort-{{ site.fort-latest-version }}/
./configure
make
su
make install
exit
{% endhighlight %}

### Rocky Linux 9

```bash
sudo dnf -y install wget tar gcc openssl-devel
sudo dnf -y --enablerepo=devel install jansson-devel libcurl-devel libxml2-devel

wget https://github.com/NICMx/FORT-validator/releases/download/{{ site.fort-latest-version }}/fort-{{ site.fort-latest-version }}.tar.gz
tar xvzf fort-{{ site.fort-latest-version }}.tar.gz
cd fort-{{ site.fort-latest-version }}/
./configure
make
sudo make install
```

## Option 3: Compiling and installing the git repository

In case you wan't a fresh version of Fort validator, there's this third option. The steps are mostly the same as in [Option 2](#option-2-compiling-and-installing-the-release-tarball), just another dependency (as minimum) must be installed: "git"; and a few steps are included in order to get the source code and generate configuration scripts.

The following example is the process to clone, compile and install in Debian OS.

{% highlight bash %}
sudo apt install autoconf automake build-essential git libjansson-dev libssl-dev pkg-config rsync libcurl4-openssl-dev libxml2-dev

git clone https://github.com/NICMx/FORT-validator.git
cd FORT-validator/
./autogen.sh
./configure
make
sudo make install
{% endhighlight %}

## Option 4: Running from a Docker container

There's also the option to run FORT validator from a Docker container. The image can be pulled from [Docker Hub](https://hub.docker.com/r/nicmx/fort-validator) or built from the official Github repository: [FORT-validator/docker](https://github.com/NICMx/FORT-validator/tree/main/docker).

To pull the image from the official repository, run:

{% highlight bash %}
docker pull nicmx/fort-validator:latest
{% endhighlight %}

Or to build from the source Dockerfile, just run (from the same directory where the Dockerfile is):

{% highlight bash %}
docker build -t fort-validator:latest .
{% endhighlight %}

A basic example to run the container using the default values, reading from a local TAL directory (i.e. `host/path/to/tals`), and binding to the local port `8323`:

{% highlight bash %}
docker run --name fort-validator -v host/path/to/tals:/etc/fort/tal:ro -p 8323:323 -d fort-validator
{% endhighlight %}

Read more about the Docker container at the Github repository [FORT-validator/docker](https://github.com/NICMx/FORT-validator/tree/main/docker).

## Fetching the TALs

```bash
fort --init-tals --tal /etc/fort/tal
```

More details [here](usage.html#--init-tals).